Hi everybody,
I work actually on a set-top-box little endian with a 24-bit depth
framebuffer (evas version 1.2.1). I noticed there are no conversion between
little endian and big endian (my color was inverted). I propose a patch to
handle the endianness for this depth (I test only the
evas_common_convert_rgba_to_24bpp_rgb_888 fonction).
Cordially
Oboeuf David
--- evas-1.2.1.orig/src/lib/engines/common/evas_convert_rgb_24.c 2012-05-12 22:47:08.000000000 +0200
+++ evas-1.2.1/src/lib/engines/common/evas_convert_rgb_24.c 2012-07-24 09:14:19.000000000 +0200
@@ -16,9 +16,15 @@
{
for (x = 0; x < w; x++)
{
+#ifndef WORDS_BIGENDIAN
+ dst_ptr[2] = R_VAL(src_ptr);
+ dst_ptr[1] = G_VAL(src_ptr);
+ dst_ptr[0] = B_VAL(src_ptr);
+#else
dst_ptr[0] = R_VAL(src_ptr);
dst_ptr[1] = G_VAL(src_ptr);
dst_ptr[2] = B_VAL(src_ptr);
+#endif
src_ptr++;
dst_ptr+=3;
}
@@ -45,9 +51,15 @@
{
for (x = 0; x < w; x++)
{
+#ifndef WORDS_BIGENDIAN
+ scratch =
+ (((B_VAL(src_ptr) << 12) | (R_VAL(src_ptr) >> 2)) & 0x03f03f) |
+ ((G_VAL(src_ptr) << 4) & 0x000fc0);
+#else
scratch =
(((R_VAL(src_ptr) << 12) | (B_VAL(src_ptr) >> 2)) & 0x03f03f) |
((G_VAL(src_ptr) << 4) & 0x000fc0);
+#endif
dst_ptr[0] = scratch_ptr[1];
dst_ptr[1] = scratch_ptr[2];
dst_ptr[2] = scratch_ptr[3];
@@ -75,9 +87,15 @@
{
for (x = 0; x < w; x++)
{
+#ifndef WORDS_BIGENDIAN
+ dst_ptr[0] = R_VAL(src_ptr);
+ dst_ptr[1] = G_VAL(src_ptr);
+ dst_ptr[2] = B_VAL(src_ptr);
+#else
dst_ptr[2] = R_VAL(src_ptr);
dst_ptr[1] = G_VAL(src_ptr);
dst_ptr[0] = B_VAL(src_ptr);
+#endif
src_ptr++;
dst_ptr+=3;
}
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel