aboutsummaryrefslogtreecommitdiff
path: root/src/types.h
diff options
context:
space:
mode:
authorKrow Savcik <krow@savcik.xyz>2023-09-26 22:32:35 +0300
committerKrow Savcik <krow@savcik.xyz>2023-09-26 22:32:35 +0300
commit9e660e594f6d3a43ea1427fb872801a2fcedad93 (patch)
tree459cd0c6fc5fef0366f7ef249ae19dd67c363772 /src/types.h
initial commit
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h
new file mode 100644
index 0000000..dc6789e
--- /dev/null
+++ b/src/types.h
@@ -0,0 +1,11 @@
+#define uint unsigned int
+#define uint8 unsigned char
+#define uint16 uint16_t
+#define uint32 unsigned int
+
+#define COLTOINT(R,G,B) (((unsigned int)R)<<16)|(((unsigned int)G)<<8)|(unsigned int)B
+#define INTTOCOL(C) (C>>16), ((C>>8)%256), (C%256)
+#define COLTOINTA(R,G,B,A) (((COLTOINT(R,G,B)) << 8)|(unsigned int)A)
+#define INTTOCOLA(C) (C>>24), ((C>>16)&0xFF), ((C>>8)&0xFF), (C&0xFF)
+
+#define LENGTH(S) ((sizeof S)/(sizeof S[0]))