Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/include/true24.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/true24.h')
-rw-r--r--src/include/true24.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/true24.h b/src/include/true24.h
new file mode 100644
index 0000000..de626a3
--- /dev/null
+++ b/src/include/true24.h
@@ -0,0 +1,31 @@
+#ifdef cpixel_t
+#undef cpixel_t
+#undef cpixeldata_t
+#undef cppixel_t
+#undef cpixeldata_t
+#undef bpp
+#undef bpp1
+#undef p_add
+#undef p_inc
+#undef p_set
+#undef p_get
+#undef p_setp
+#undef UNSUPPORTED
+#undef p_getp
+#undef p_copy
+#endif
+#ifndef STRUECOLOR24
+#define UNSUPPORTED
+#endif
+#define cpixel_t pixel8_t
+#define cppixel_t ppixel8_t
+#define cpixeldata_t pixel32_t
+#define bpp 3
+/*FIXME this should make problems at small edian machines? */
+#define p_set(ptr,val) ((*(pixel16_t *)(ptr))=(pixel16_t)(val),((ptr)[2])=(pixel8_t)((val)>>16))
+#define p_get(ptr) (((pixel32_t)*(pixel16_t *)(ptr)+(pixel32_t)(*((ptr)+2)<<16)))
+#define p_copy(ptr1,pos1,ptr2,pos2) (*((pixel16_t *)((ptr1)+(pos1)*3))=*(pixel16_t *)((ptr2)+(pos2)*3),(ptr1)[(pos1)*3+2]=(ptr2)[(pos2)*3+2])
+#define p_setp(ptr,pos,val) p_set((ptr)+(pos)*3,val)
+#define p_getp(ptr,pos) p_get((ptr)+(pos)*3)
+#define p_add(ptr,pos) ((ptr)+(pos)*3)
+#define p_inc(ptr,pos) ((ptr)+=(pos)*3)