summaryrefslogtreecommitdiff
path: root/src/modules/spiro/draw.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/spiro/draw.h')
-rw-r--r--src/modules/spiro/draw.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules/spiro/draw.h b/src/modules/spiro/draw.h
new file mode 100644
index 0000000..0b68c00
--- /dev/null
+++ b/src/modules/spiro/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