summaryrefslogtreecommitdiff
path: root/src/modules/pixbounce/draw.h
diff options
context:
space:
mode:
authorPhilip J Freeman <elektron@halo.nu>2018-04-03 17:41:31 -0700
committerVito Caputo <vcaputo@pengaru.com>2019-11-10 19:22:07 -0800
commit76248e7443fa9d967cc6d63d953e70a00fe4791e (patch)
tree6f05a80a69152dc40b38ebf7295b8892789bab73 /src/modules/pixbounce/draw.h
parent3653ac23907c051d2a29d8917f1bd1cded655558 (diff)
pixbounce: add pixbounce module
Diffstat (limited to 'src/modules/pixbounce/draw.h')
-rw-r--r--src/modules/pixbounce/draw.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules/pixbounce/draw.h b/src/modules/pixbounce/draw.h
new file mode 100644
index 0000000..0b68c00
--- /dev/null
+++ b/src/modules/pixbounce/draw.h
@@ -0,0 +1,16 @@
+#ifndef _DRAW_H
+#define _DRAW_H
+
+#include <stdint.h>
+
+/* helper for scaling rgb colors and packing them into an pixel */
+static inline uint32_t makergb(uint32_t r, uint32_t g, uint32_t b, float intensity)
+{
+ r = (((float)intensity) * r);
+ g = (((float)intensity) * g);
+ b = (((float)intensity) * b);
+
+ return (((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff));
+}
+
+#endif
© All Rights Reserved