Hi

The attached patch adds 16bpp and 32bpp Rotation 180 Converter Code to
evas. I did not add the 180 degrees rotation to the software_qtopia
engine as I cannot test it at the moment.

Please apply.

-- Lars Munch


Index: configure.in
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/configure.in,v
retrieving revision 1.200
diff -p -u -r1.200 configure.in
--- configure.in	10 Feb 2007 17:23:05 -0000	1.200
+++ configure.in	17 Feb 2007 20:28:48 -0000
@@ -1602,6 +1602,29 @@ AC_ARG_ENABLE(convert-16-rgb-rot-0, 
 )
 
 #######################################
+## Convert to 16bpp RGB with rotation of 180
+conv_16_rgb_rot_180="no"
+conv_16_rgb_rot_180="yes"
+AC_MSG_CHECKING(whether to build 16bpp rotation 180 converter code)
+AC_ARG_ENABLE(convert-16-rgb-rot-180,
+  [  --enable-convert-16-rgb-rot-180 enable 16bpp rotation 180 converter code], [
+      if test x"$enableval" = x"yes" ; then
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(BUILD_CONVERT_16_RGB_ROT180, 1, [16bpp Rotation 180 Converter Code])
+        conv_16_rgb_rot_180="yes"
+      else
+        AC_MSG_RESULT(no)
+        conv_16_rgb_rot_180="no"
+      fi
+  ], [
+      AC_MSG_RESULT($conv_16_rgb_rot_180)
+      if test x"$conv_16_rgb_rot_180" = x"yes" ; then
+        AC_DEFINE(BUILD_CONVERT_16_RGB_ROT180, 1, [16bpp Rotation 180 Converter Code])
+      fi
+  ]
+)
+
+#######################################
 ## Convert to 16bpp RGB with rotation of 270
 conv_16_rgb_rot_270="no"
 conv_16_rgb_rot_270="yes"
@@ -1809,6 +1832,29 @@ AC_ARG_ENABLE(convert-32-rgb-rot-0, 
 )
 
 #######################################
+## Convert to 32bpp RGB with rotation of 180
+conv_32_rgb_rot_180="no"
+conv_32_rgb_rot_180="yes"
+AC_MSG_CHECKING(whether to build 32bpp rotation 180 converter code)
+AC_ARG_ENABLE(convert-32-rgb-rot-180,
+  [  --enable-convert-32-rgb-rot-180 enable 32bpp rotation 180 converter code], [
+      if test x"$enableval" = x"yes" ; then
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(BUILD_CONVERT_32_RGB_ROT180, 1, [32bpp Rotation 180 Converter Support])
+        conv_32_rgb_rot_180="yes"
+      else
+        AC_MSG_RESULT(no)
+        conv_32_rgb_rot_180="no"
+      fi
+  ], [
+      AC_MSG_RESULT($conv_32_rgb_rot_180)
+      if test x"$conv_32_rgb_rot_180" = x"yes" ; then
+        AC_DEFINE(BUILD_CONVERT_32_RGB_ROT180, 1, [32bpp Rotation 180 Converter Support])
+      fi
+  ]
+)
+
+#######################################
 ## Convert to 32bpp RGB with rotation of 270
 conv_32_rgb_rot_270="no"
 conv_32_rgb_rot_270="yes"
@@ -2078,8 +2124,8 @@ echo "  16bpp RGB 565 (444 ipaq): $conv_
 # FIXME: add 8bpp and below rotation
 echo "  16bpp Rotation 0........: $conv_16_rgb_rot_0"
 echo "  16bpp Rotation 90.......: $conv_16_rgb_rot_90"
+echo "  16bpp Rotation 180......: $conv_16_rgb_rot_180"
 echo "  16bpp Rotation 270......: $conv_16_rgb_rot_270"
-# FIXME: add 180 rotation
 echo "  24bpp RGB 888...........: $conv_24_rgb_888"
 echo "  24bpp BGR 888...........: $conv_24_bgr_888"
 # FIXME: add 24bpp rotation
@@ -2089,8 +2135,8 @@ echo "  32bpp BGR 8888..........: $conv_
 echo "  32bpp BGRX 8888.........: $conv_32_bgrx_8888"
 echo "  32bpp Rotation 0........: $conv_32_rgb_rot_0"
 echo "  32bpp Rotation 90.......: $conv_32_rgb_rot_90"
+echo "  32bpp Rotation 180......: $conv_32_rgb_rot_180"
 echo "  32bpp Rotation 270......: $conv_32_rgb_rot_270"
-# FIXME: add 180 rotation
 echo
 echo "------------------------------------------------------------------------"
 echo
Index: src/lib/engines/common/evas_convert_main.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/engines/common/evas_convert_main.c,v
retrieving revision 1.7
diff -p -u -r1.7 evas_convert_main.c
--- src/lib/engines/common/evas_convert_main.c	10 Feb 2007 17:23:06 -0000	1.7
+++ src/lib/engines/common/evas_convert_main.c	17 Feb 2007 20:28:50 -0000
@@ -208,6 +208,15 @@ evas_common_convert_func_get(DATA8 *dest
 			 return evas_common_convert_rgba_to_16bpp_rgb_565_dith;
 		    }
 #endif
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+		  if (rotation == 180)
+		    {
+		       if ((!(w & 0x1)) && (!((int)dest & 0x3)))
+			 return evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180;
+		       else
+			 return evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180;
+		    }
+#endif
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 		  if (rotation == 270)
 		    {
@@ -240,6 +249,15 @@ evas_common_convert_func_get(DATA8 *dest
 			 return evas_common_convert_rgba_to_16bpp_bgr_565_dith;
 		    }
 #endif
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+		  if (rotation == 180)
+		    {
+		       if ((!(w & 0x1)) && (!((int)dest & 0x3)))
+			 return evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180;
+		       else
+			 return evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180;
+		    }
+#endif
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 		  if (rotation == 270)
 		    {
@@ -272,6 +290,15 @@ evas_common_convert_func_get(DATA8 *dest
  			 return evas_common_convert_rgba_to_16bpp_rgb_555_dith;
 		    }
 #endif
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+		  if (rotation == 180)
+		    {
+		       if ((!(w & 0x1)) && (!((int)dest & 0x3)))
+			 return evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180;
+		       else
+			 return evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180;
+		    }
+#endif
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 		  if (rotation == 270)
 		    {
@@ -304,6 +331,15 @@ evas_common_convert_func_get(DATA8 *dest
 			 return evas_common_convert_rgba_to_16bpp_rgb_444_dith;
 		    }
 #endif
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+		  if (rotation == 180)
+		    {
+		       if ((!(w & 0x1)) && (!((int)dest & 0x3)))
+			 return evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180;
+		       else
+			 return evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180;
+		    }
+#endif
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 		  if (rotation == 270)
 		    {
@@ -337,6 +373,15 @@ evas_common_convert_func_get(DATA8 *dest
 
 		    }
 #endif
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+		  if (rotation == 180)
+		    {
+		       if ((!(w & 0x1)) && (!((int)dest & 0x3)))
+			 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180;
+		       else
+			 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180;
+		    }
+#endif
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 		  if (rotation == 270)
 		    {
@@ -370,6 +415,15 @@ evas_common_convert_func_get(DATA8 *dest
 
 		    }
 #endif
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+		  if (rotation == 180)
+		    {
+		       if ((!(w & 0x1)) && (!((int)dest & 0x3)))
+			 return evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180;
+		       else
+			 return evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180;
+		    }
+#endif
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 		  if (rotation == 270)
 		    {
@@ -400,6 +454,10 @@ evas_common_convert_func_get(DATA8 *dest
 		  if (rotation == 0)
 		    return evas_common_convert_rgba_to_32bpp_rgb_8888;
 #endif
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+		  if (rotation == 180)
+		    return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180;
+#endif
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 		  if (rotation == 270)
 		    return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270;
@@ -417,6 +475,10 @@ evas_common_convert_func_get(DATA8 *dest
 		  if (rotation == 0)
 		    return evas_common_convert_rgba_to_32bpp_rgbx_8888;
 #endif
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+		  if (rotation == 180)
+		    return evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180;
+#endif
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 		  if (rotation == 270)
 		    return evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270;
@@ -434,6 +496,10 @@ evas_common_convert_func_get(DATA8 *dest
 		  if (rotation == 0)
 		    return evas_common_convert_rgba_to_32bpp_bgr_8888;
 #endif
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+		  if (rotation == 180)
+		    return evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180;
+#endif
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 		  if (rotation == 270)
 		    return evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270;
@@ -451,6 +517,10 @@ evas_common_convert_func_get(DATA8 *dest
 		  if (rotation == 0)
 		    return evas_common_convert_rgba_to_32bpp_bgrx_8888;
 #endif
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+		  if (rotation == 180)
+		    return evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180;
+#endif
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 		  if (rotation == 270)
 		    return evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270;
Index: src/lib/engines/common/evas_convert_rgb_16.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/engines/common/evas_convert_rgb_16.c,v
retrieving revision 1.5
diff -p -u -r1.5 evas_convert_rgb_16.c
--- src/lib/engines/common/evas_convert_rgb_16.c	10 Feb 2007 17:23:06 -0000	1.5
+++ src/lib/engines/common/evas_convert_rgb_16.c	17 Feb 2007 20:28:51 -0000
@@ -93,6 +93,92 @@ evas_common_convert_rgba_to_16bpp_rgb_56
 #endif
 
 #ifdef BUILD_CONVERT_16_RGB_565
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r1, g1, b1;
+   DATA8 r2, g2, b2;
+   DATA8 dith, dith2;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP2_START_ROT_180();
+
+   r1 = (R_VAL(src_ptr)) >> 3;
+   g1 = (G_VAL(src_ptr)) >> 2;
+   b1 = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
+   if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
+   if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
+   if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
+
+   CONVERT_LOOP2_INC_ROT_180();
+
+   r2 = (R_VAL(src_ptr)) >> 3;
+   g2 = (G_VAL(src_ptr)) >> 2;
+   b2 = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
+   if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
+   if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
+   if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
+
+#ifndef WORDS_BIGENDIAN
+   *((DATA32 *)dst_ptr) =
+     (r2 << 27) | (g2 << 21) | (b2 << 16) |
+     (r1 << 11) | (g1 << 5 ) | (b1      );
+#else
+   *((DATA32 *)dst_ptr) =
+     (r1 << 27) | (g1 << 21) | (b1 << 16) |
+     (r2 << 11) | (g2 << 5 ) | (b2      );
+#endif
+
+   CONVERT_LOOP2_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_RGB_565
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r, g, b;
+   DATA8 dith, dith2;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+   r = (R_VAL(src_ptr)) >> 3;
+   g = (G_VAL(src_ptr)) >> 2;
+   b = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
+   if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
+   if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
+   if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
+
+   *dst_ptr = (r << 11) | (g << 5) | (b);
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_RGB_565
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 void
 evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
@@ -288,6 +374,7 @@ evas_common_convert_rgba2_to_16bpp_bgr_5
    if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
    if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
    if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
+
    CONVERT_LOOP2_INC_ROT_0();
 
    r2 = (R_VAL(src_ptr)) >> 3;
@@ -350,6 +437,94 @@ evas_common_convert_rgba_to_16bpp_bgr_56
 #endif
 
 #ifdef BUILD_CONVERT_16_BGR_565
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r1, g1, b1;
+   DATA8 r2, g2, b2;
+   DATA8 dith, dith2;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP2_START_ROT_180();
+
+   r1 = (R_VAL(src_ptr)) >> 3;
+   g1 = (G_VAL(src_ptr)) >> 2;
+   b1 = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
+   if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
+   if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
+   if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
+
+   CONVERT_LOOP2_INC_ROT_180();
+
+   r2 = (R_VAL(src_ptr)) >> 3;
+   g2 = (G_VAL(src_ptr)) >> 2;
+   b2 = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
+   if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
+   if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
+   if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
+
+#ifndef WORDS_BIGENDIAN
+   *((DATA32 *)dst_ptr) =
+     (b2 << 27) | (g2 << 21) | (r2 << 16) |
+     (b1 << 11) | (g1 << 5 ) | (r1      );
+#else
+   *((DATA32 *)dst_ptr) =
+     (b1 << 27) | (g1 << 21) | (r1 << 16) |
+     (b2 << 11) | (g2 << 5 ) | (r2      );
+#endif
+
+   CONVERT_LOOP2_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_BGR_565
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r, g, b;
+   DATA8 dith, dith2;
+
+   dst_ptr = (DATA16 *)dst;
+
+   fprintf(stderr, "evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180\n");
+
+   CONVERT_LOOP_START_ROT_180();
+
+   r = (R_VAL(src_ptr)) >> 3;
+   g = (G_VAL(src_ptr)) >> 2;
+   b = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
+   if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
+   if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
+   if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
+
+   *dst_ptr = (b << 11) | (g << 5) | (r);
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_BGR_565
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 void
 evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
@@ -605,6 +780,89 @@ evas_common_convert_rgba_to_16bpp_rgb_44
 #endif
 
 #ifdef BUILD_CONVERT_16_RGB_444
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r1, g1, b1;
+   DATA8 r2, g2, b2;
+   DATA8 dith;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP2_START_ROT_180();
+
+   r1 = (R_VAL(src_ptr)) >> 4;
+   g1 = (G_VAL(src_ptr)) >> 4;
+   b1 = (B_VAL(src_ptr)) >> 4;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
+   if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
+   if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
+   if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
+
+   CONVERT_LOOP2_INC_ROT_180();
+
+   r2 = (R_VAL(src_ptr)) >> 4;
+   g2 = (G_VAL(src_ptr)) >> 4;
+   b2 = (B_VAL(src_ptr)) >> 4;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
+   if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
+   if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
+   if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
+
+#ifndef WORDS_BIGENDIAN
+   *((DATA32 *)dst_ptr) =
+     (r2 << 24) | (g2 << 20) | (b2 << 16) |
+     (r1 << 8 ) | (g1 << 4 ) | (b1      );
+#else
+   *((DATA32 *)dst_ptr) =
+     (r1 << 24) | (g1 << 20) | (b1 << 16) |
+     (r2 << 8 ) | (g2 << 4 ) | (b2      );
+#endif
+
+   CONVERT_LOOP2_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_RGB_444
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r, g, b;
+   DATA8 dith;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+   r = (R_VAL(src_ptr)) >> 4;
+   g = (G_VAL(src_ptr)) >> 4;
+   b = (B_VAL(src_ptr)) >> 4;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
+   if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
+   if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
+   if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
+
+   *dst_ptr = (r << 8) | (g << 4) | (b);
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_RGB_444
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 void
 evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
@@ -854,6 +1112,90 @@ evas_common_convert_rgba_to_16bpp_rgb_45
 #endif
 
 #ifdef BUILD_CONVERT_16_RGB_454645
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r1, g1, b1;
+   DATA8 r2, g2, b2;
+   DATA8 dith;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP2_START_ROT_180();
+
+   r1 = (R_VAL(src_ptr)) >> 4;
+   g1 = (G_VAL(src_ptr)) >> 4;
+   b1 = (B_VAL(src_ptr)) >> 4;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
+   if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
+   if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
+   if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
+
+   CONVERT_LOOP2_INC_ROT_180();
+
+   r2 = (R_VAL(src_ptr)) >> 4;
+   g2 = (G_VAL(src_ptr)) >> 4;
+   b2 = (B_VAL(src_ptr)) >> 4;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
+   if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
+   if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
+   if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
+
+#ifndef WORDS_BIGENDIAN
+   *((DATA32 *)dst_ptr) =
+     (r2 << 28) | (g2 << 23) | (b2 << 17) |
+     (r1 << 12) | (g1 << 7 ) | (b1 << 1 );
+#else
+   *((DATA32 *)dst_ptr) =
+     (r1 << 28) | (g1 << 23) | (b1 << 17) |
+     (r2 << 12) | (g2 << 7 ) | (b2 << 1 );
+#endif
+
+   CONVERT_LOOP2_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_RGB_454645
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r, g, b;
+   DATA8 dith;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+   r = (R_VAL(src_ptr)) >> 4;
+   g = (G_VAL(src_ptr)) >> 4;
+   b = (B_VAL(src_ptr)) >> 4;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
+   if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
+   if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
+   if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
+
+   *dst_ptr = (r << 12) | (g << 7) | (b << 1);
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+
+#ifdef BUILD_CONVERT_16_RGB_454645
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 void
 evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
@@ -1103,6 +1445,89 @@ evas_common_convert_rgba_to_16bpp_rgb_55
 #endif
 
 #ifdef BUILD_CONVERT_16_RGB_555
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r1, g1, b1;
+   DATA8 r2, g2, b2;
+   DATA8 dith;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP2_START_ROT_180();
+
+   r1 = (R_VAL(src_ptr)) >> 3;
+   g1 = (G_VAL(src_ptr)) >> 3;
+   b1 = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
+   if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
+   if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
+
+   CONVERT_LOOP2_INC_ROT_180();
+
+   r2 = (R_VAL(src_ptr)) >> 3;
+   g2 = (G_VAL(src_ptr)) >> 3;
+   b2 = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
+   if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
+   if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
+
+#ifndef WORDS_BIGENDIAN
+   *((DATA32 *)dst_ptr) =
+     (r2 << 26) | (g2 << 21) | (b2 << 16) |
+     (r1 << 10) | (g1 << 5 ) | (b1      );
+#else
+   *((DATA32 *)dst_ptr) =
+     (r1 << 26) | (g1 << 21) | (b1 << 16) |
+     (r2 << 10) | (g2 << 5 ) | (b2      );
+#endif
+
+   CONVERT_LOOP2_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_RGB_555
+#ifdef BUILD_CONVERT_16_RGB_ROT180
+void
+evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA16 *dst_ptr;
+   int x, y;
+   DATA8 r, g, b;
+   DATA8 dith;
+
+   dst_ptr = (DATA16 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+   r = (R_VAL(src_ptr)) >> 3;
+   g = (G_VAL(src_ptr)) >> 3;
+   b = (B_VAL(src_ptr)) >> 3;
+   dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
+   if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
+   if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
+   if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
+
+   *dst_ptr = (r << 10) | (g << 5) | (b);
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_16_RGB_555
 #ifdef BUILD_CONVERT_16_RGB_ROT270
 void
 evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
Index: src/lib/engines/common/evas_convert_rgb_32.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/engines/common/evas_convert_rgb_32.c,v
retrieving revision 1.5
diff -p -u -r1.5 evas_convert_rgb_32.c
--- src/lib/engines/common/evas_convert_rgb_32.c	30 Sep 2006 10:18:32 -0000	1.5
+++ src/lib/engines/common/evas_convert_rgb_32.c	17 Feb 2007 20:28:51 -0000
@@ -30,6 +30,30 @@ evas_common_convert_rgba_to_32bpp_rgb_88
 #endif
 
 #ifdef BUILD_CONVERT_32_RGB_8888
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+void
+evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA32 *dst_ptr;
+   int x, y;
+
+   dst_ptr = (DATA32 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+   *dst_ptr = *src_ptr;
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+   dith_x = 0;
+   dith_y = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_32_RGB_8888
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 void
 evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
@@ -103,6 +127,31 @@ evas_common_convert_rgba_to_32bpp_rgbx_8
 #endif
 
 #ifdef BUILD_CONVERT_32_RGBX_8888
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+void
+evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA32 *dst_ptr;
+   int x, y;
+
+   dst_ptr = (DATA32 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+//   *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
+   *dst_ptr = (*src_ptr << 8);
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+   dith_x = 0;
+   dith_y = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_32_RGBX_8888
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 void
 evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
@@ -177,6 +226,30 @@ evas_common_convert_rgba_to_32bpp_bgr_88
 #endif
 
 #ifdef BUILD_CONVERT_32_BGR_8888
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+void
+evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA32 *dst_ptr;
+   int x, y;
+
+   dst_ptr = (DATA32 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+   *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+   dith_x = 0;
+   dith_y = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_32_BGR_8888
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 void
 evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
@@ -249,6 +322,30 @@ evas_common_convert_rgba_to_32bpp_bgrx_8
 #endif
 
 #ifdef BUILD_CONVERT_32_BGRX_8888
+#ifdef BUILD_CONVERT_32_RGB_ROT180
+void
+evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+   DATA32 *src_ptr;
+   DATA32 *dst_ptr;
+   int x, y;
+
+   dst_ptr = (DATA32 *)dst;
+
+   CONVERT_LOOP_START_ROT_180();
+
+   *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
+
+   CONVERT_LOOP_END_ROT_180();
+   return;
+   pal = 0;
+   dith_x = 0;
+   dith_y = 0;
+}
+#endif
+#endif
+
+#ifdef BUILD_CONVERT_32_BGRX_8888
 #ifdef BUILD_CONVERT_32_RGB_ROT270
 void
 evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
Index: src/lib/include/evas_common.h
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/include/evas_common.h,v
retrieving revision 1.74
diff -p -u -r1.74 evas_common.h
--- src/lib/include/evas_common.h	10 Feb 2007 17:23:06 -0000	1.74
+++ src/lib/include/evas_common.h	17 Feb 2007 20:28:52 -0000
@@ -709,6 +709,17 @@ void evas_common_convert_rgba_to_16bpp_r
 void evas_common_convert_rgba2_to_16bpp_rgb_555_dith            (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_16bpp_rgb_555_dith             (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 
+void evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180    (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180     (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180    (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180     (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180    (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180     (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180  (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180    (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180     (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+
 void evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_270    (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_270     (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270    (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
@@ -735,15 +746,19 @@ void evas_common_convert_rgba_to_24bpp_r
 void evas_common_convert_rgba_to_24bpp_bgr_888                 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 
 void evas_common_convert_rgba_to_32bpp_rgb_8888                (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180        (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270        (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90         (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_rgbx_8888               (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180       (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270       (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_90        (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_bgr_8888                (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180        (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270        (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_bgr_8888_rot_90         (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_bgrx_8888               (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180       (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270       (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90        (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
 
Index: src/lib/include/evas_macros.h
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/include/evas_macros.h,v
retrieving revision 1.2
diff -p -u -r1.2 evas_macros.h
--- src/lib/include/evas_macros.h	2 May 2006 07:28:48 -0000	1.2
+++ src/lib/include/evas_macros.h	17 Feb 2007 20:28:52 -0000
@@ -94,6 +94,21 @@
         dst_ptr += dst_jump; \
      }
 
+#define CONVERT_LOOP_START_ROT_180() \
+   src_ptr = src + (w - 1) + ((h - 1) * (w + src_jump)); \
+   for (y = 0; y < h; y++) \
+     { \
+        for (x = 0; x < w; x++) \
+          {
+
+#define CONVERT_LOOP_END_ROT_180() \
+             dst_ptr++; \
+             src_ptr--; \
+          } \
+        src_ptr = src + (w - 1) + ((h - y - 2) * (w + src_jump)); \
+        dst_ptr += dst_jump; \
+     }
+
 #define CONVERT_LOOP_START_ROT_270() \
    src_ptr = src + ((w - 1) * (h + src_jump)); \
    for (y = 0; y < h; y++) \
@@ -143,6 +158,25 @@ x++;
         dst_ptr += dst_jump; \
      }
 
+#define CONVERT_LOOP2_START_ROT_180() \
+   src_ptr = src + (w - 1) + ((h - 1) * (w + src_jump)); \
+   for (y = 0; y < h; y++) \
+     { \
+        for (x = 0; x < w; x++) \
+          {
+
+#define CONVERT_LOOP2_INC_ROT_180() \
+src_ptr--; \
+x++;
+
+#define CONVERT_LOOP2_END_ROT_180() \
+             dst_ptr+=2; \
+             src_ptr--; \
+          } \
+        src_ptr = src + (w - 1) + ((h - y - 2) * (w + src_jump)); \
+        dst_ptr += dst_jump; \
+     }
+
 #define CONVERT_LOOP2_START_ROT_270() \
    src_ptr = src + ((w - 1) * (h + src_jump)); \
    for (y = 0; y < h; y++) \
Index: src/modules/engines/fb/evas_outbuf.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/fb/evas_outbuf.c,v
retrieving revision 1.1
diff -p -u -r1.1 evas_outbuf.c
--- src/modules/engines/fb/evas_outbuf.c	14 Jan 2006 12:13:37 -0000	1.1
+++ src/modules/engines/fb/evas_outbuf.c	17 Feb 2007 20:28:53 -0000
@@ -40,11 +40,9 @@ evas_fb_outbuf_fb_setup_fb(int w, int h,
      return NULL;
 
    fb_init(vt_no, dev_no);
-   if (rot == 0)
+   if (rot == 0 || rot == 180)
      buf->priv.fb.fb = fb_setmode(w, h, fb_depth, refresh);
-   else if (rot == 270)
-     buf->priv.fb.fb = fb_setmode(h, w, fb_depth, refresh);
-   else if (rot == 90)
+   else if (rot == 90 || rot == 270)
      buf->priv.fb.fb = fb_setmode(h, w, fb_depth, refresh);
    if (!buf->priv.fb.fb) buf->priv.fb.fb = fb_getmode();
    if (!buf->priv.fb.fb)
@@ -54,17 +52,12 @@ evas_fb_outbuf_fb_setup_fb(int w, int h,
      }
    fb_fd = fb_postinit(buf->priv.fb.fb);
 
-   if (rot == 0)
+   if (rot == 0 || rot == 180)
      {
  	buf->w = buf->priv.fb.fb->width;
 	buf->h = buf->priv.fb.fb->height;
      }
-   else if (rot == 270)
-     {
- 	buf->w = buf->priv.fb.fb->height;
-	buf->h = buf->priv.fb.fb->width;
-     }
-   else if (rot == 90)
+   else if (rot == 90 || rot == 270)
      {
  	buf->w = buf->priv.fb.fb->height;
 	buf->h = buf->priv.fb.fb->width;
@@ -88,7 +81,7 @@ evas_fb_outbuf_fb_setup_fb(int w, int h,
 	  buf->priv.mask.b |= (1 << (buf->priv.fb.fb->fb_var.blue.offset + i));
 
 	conv_func = NULL;
-	if (buf->rot == 0)
+	if (buf->rot == 0 || buf->rot == 180)
 	  conv_func = evas_common_convert_func_get(0, buf->w, buf->h,
 				       buf->priv.fb.fb->fb_var.bits_per_pixel,
 				       buf->priv.mask.r,
@@ -96,15 +89,7 @@ evas_fb_outbuf_fb_setup_fb(int w, int h,
 				       buf->priv.mask.b,
 				       PAL_MODE_NONE,
 				       buf->rot);
-	else if (buf->rot == 270)
-	  conv_func = evas_common_convert_func_get(0, buf->h, buf->w,
-				       buf->priv.fb.fb->fb_var.bits_per_pixel,
-				       buf->priv.mask.r,
-				       buf->priv.mask.g,
-				       buf->priv.mask.b,
-				       PAL_MODE_NONE,
-				       buf->rot);
-	else if (buf->rot == 90)
+	else if (buf->rot == 90 || buf->rot == 270)
 	  conv_func = evas_common_convert_func_get(0, buf->h, buf->w,
 				       buf->priv.fb.fb->fb_var.bits_per_pixel,
 				       buf->priv.mask.r,
@@ -163,6 +148,16 @@ evas_fb_outbuf_fb_update(Outbuf *buf, in
 					  buf->priv.mask.b, PAL_MODE_NONE,
 					  buf->rot);
 	  }
+        else if (buf->rot == 180)
+          {
+             data = (DATA8 *)buf->priv.fb.fb->mem + buf->priv.fb.fb->mem_offset +
+               buf->priv.fb.fb->bpp *
+               (buf->w - x - w + ((buf->h - y - h) * buf->priv.fb.fb->width));
+             conv_func = evas_common_convert_func_get(data, w, h, buf->priv.fb.fb->fb_var.bits_per_pixel,
+                                          buf->priv.mask.r, buf->priv.mask.g,
+                                          buf->priv.mask.b, PAL_MODE_NONE,
+                                          buf->rot);
+          }
 	else if (buf->rot == 270)
 	  {
 	     data = (DATA8 *)buf->priv.fb.fb->mem + buf->priv.fb.fb->mem_offset +
@@ -188,7 +183,7 @@ evas_fb_outbuf_fb_update(Outbuf *buf, in
 	     DATA32 *src_data;
 
 	     src_data = buf->priv.back_buf->image->data + (y * buf->w) + x;
-	     if (buf->rot == 0)
+	     if (buf->rot == 0 || buf->rot == 180)
 	       {
 		  conv_func(src_data, data,
 			    buf->w - w,
@@ -196,15 +191,7 @@ evas_fb_outbuf_fb_update(Outbuf *buf, in
 			    w, h,
 			    x, y, NULL);
 	       }
-	     else if (buf->rot == 270)
-	       {
-		  conv_func(src_data, data,
-			    buf->w - w,
-			    buf->priv.fb.fb->width - h,
-			    h, w,
-			    x, y, NULL);
-	       }
-	     else if (buf->rot == 90)
+	     else if (buf->rot == 90 || buf->rot == 270)
 	       {
 		  conv_func(src_data, data,
 			    buf->w - w,
@@ -277,6 +264,18 @@ evas_fb_outbuf_fb_push_updated_region(Ou
 					  buf->priv.mask.b, PAL_MODE_NONE,
 					  buf->rot);
 	  }
+        else if (buf->rot == 180)  
+          {
+             data = (DATA8 *)buf->priv.fb.fb->mem +
+               buf->priv.fb.fb->mem_offset +
+               buf->priv.fb.fb->bpp *  
+               (buf->w - x - w + ((buf->h - y - h) * buf->priv.fb.fb->width));
+             conv_func = evas_common_convert_func_get(data, w, h,
+                                          buf->priv.fb.fb->fb_var.bits_per_pixel,
+                                          buf->priv.mask.r, buf->priv.mask.g,
+                                          buf->priv.mask.b, PAL_MODE_NONE,
+                                          buf->rot);
+          }
 	else if (buf->rot == 270)
 	  {
 	     data = (DATA8 *)buf->priv.fb.fb->mem +
@@ -306,7 +305,7 @@ evas_fb_outbuf_fb_push_updated_region(Ou
 	     DATA32 *src_data;
 
 	     src_data = update->image->data;
-	     if (buf->rot == 0)
+	     if (buf->rot == 0 || buf->rot == 180)
 	       {
 		  conv_func(src_data, data,
 			    0,
@@ -314,15 +313,7 @@ evas_fb_outbuf_fb_push_updated_region(Ou
 			    w, h,
 			    x, y, NULL);
 	       }
-	     else if (buf->rot == 270)
-	       {
-		  conv_func(src_data, data,
-			    0,
-			    buf->priv.fb.fb->width - h,
-			    h, w,
-			    x, y, NULL);
-	       }
-	     else if (buf->rot == 90)
+	     else if (buf->rot == 90 || buf->rot == 270)
 	       {
 		  conv_func(src_data, data,
 			    0,
Index: src/modules/engines/software_qtopia/evas_outbuf.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/software_qtopia/evas_outbuf.c,v
retrieving revision 1.1
diff -p -u -r1.1 evas_outbuf.c
--- src/modules/engines/software_qtopia/evas_outbuf.c	14 Jan 2006 12:13:37 -0000	1.1
+++ src/modules/engines/software_qtopia/evas_outbuf.c	17 Feb 2007 20:28:53 -0000
@@ -125,6 +125,10 @@ evas_qtopia_outbuf_software_qtopia_push_
 					       d->fb.mask.r, d->fb.mask.g, d->fb.mask.b,
 					       PAL_MODE_NONE, buf->rot);
 	       }
+	     else if (buf->rot == 180)
+	       {
+		 // FIXME
+	       }
 	     else if (buf->rot == 270)
 	       {
                   fb_mem = d->fb.data +
@@ -161,6 +165,10 @@ evas_qtopia_outbuf_software_qtopia_push_
 				 w, h,
 				 x, y, NULL);
 		    }
+		  else if (buf->rot == 180)
+		    {
+		      // FIXME
+		    }
 		  else if (buf->rot == 270)
 		    {
 		       src_data = update->image->data +
Index: src/modules/engines/software_x11/evas_outbuf.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/software_x11/evas_outbuf.c,v
retrieving revision 1.8
diff -p -u -r1.8 evas_outbuf.c
--- src/modules/engines/software_x11/evas_outbuf.c	28 Dec 2006 12:45:32 -0000	1.8
+++ src/modules/engines/software_x11/evas_outbuf.c	17 Feb 2007 20:28:53 -0000
@@ -147,7 +147,7 @@ evas_software_x11_outbuf_setup_x(int w, 
 	     }
 	   if (buf->priv.pal)
 	     {
-		if (buf->rot == 0)
+		if (buf->rot == 0 || buf->rot == 180)
 		  conv_func = evas_common_convert_func_get(0, buf->w, buf->h,
 							   evas_software_x11_x_output_buffer_depth
 							   (xob), buf->priv.mask.r,
@@ -155,15 +155,7 @@ evas_software_x11_outbuf_setup_x(int w, 
 							   buf->priv.mask.b,
 							   buf->priv.pal->colors,
 							   buf->rot);
-		else if (buf->rot == 270)
-		  conv_func = evas_common_convert_func_get(0, buf->h, buf->w,
-							   evas_software_x11_x_output_buffer_depth
-							   (xob), buf->priv.mask.r,
-							   buf->priv.mask.g,
-							   buf->priv.mask.b,
-							   buf->priv.pal->colors,
-							   buf->rot);
-		else if (buf->rot == 90)
+		else if (buf->rot == 90 || buf->rot == 270)
 		  conv_func = evas_common_convert_func_get(0, buf->h, buf->w,
 							   evas_software_x11_x_output_buffer_depth
 							   (xob), buf->priv.mask.r,
@@ -174,21 +166,14 @@ evas_software_x11_outbuf_setup_x(int w, 
 	     }
 	   else
 	     {
-		if (buf->rot == 0)
+		if (buf->rot == 0 || buf->rot == 180)
 		  conv_func = evas_common_convert_func_get(0, buf->w, buf->h,
 							   evas_software_x11_x_output_buffer_depth
 							   (xob), buf->priv.mask.r,
 							   buf->priv.mask.g,
 						buf->priv.mask.b, PAL_MODE_NONE,
 							   buf->rot);
-		else if (buf->rot == 270)
-		  conv_func = evas_common_convert_func_get(0, buf->h, buf->w,
-							   evas_software_x11_x_output_buffer_depth
-							   (xob), buf->priv.mask.r,
-							   buf->priv.mask.g,
-							   buf->priv.mask.b, PAL_MODE_NONE,
-							   buf->rot);
-		else if (buf->rot == 90)
+		else if (buf->rot == 90 || buf->rot == 270)
 		  conv_func = evas_common_convert_func_get(0, buf->h, buf->w,
 							   evas_software_x11_x_output_buffer_depth
 							   (xob), buf->priv.mask.r,
Index: src/modules/engines/software_xcb/evas_outbuf.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_outbuf.c,v
retrieving revision 1.12
diff -p -u -r1.12 evas_outbuf.c
--- src/modules/engines/software_xcb/evas_outbuf.c	10 Oct 2006 19:32:36 -0000	1.12
+++ src/modules/engines/software_xcb/evas_outbuf.c	17 Feb 2007 20:28:54 -0000
@@ -167,7 +167,7 @@ evas_software_xcb_outbuf_setup_x(int    
 	     }
 	   if (buf->priv.pal)
 	     {
-		if (buf->rot == 0)
+		if (buf->rot == 0 || buf->rot == 180)
 		   conv_func = evas_common_convert_func_get(0,
 							    buf->w,
 							    buf->h,
@@ -177,7 +177,7 @@ evas_software_xcb_outbuf_setup_x(int    
 							    buf->priv.mask.b,
 							    buf->priv.pal->colors,
 							    buf->rot);
-		else if (buf->rot == 270)
+		else if (buf->rot == 90 || buf->rot == 270)
 		   conv_func = evas_common_convert_func_get(0,
 							    buf->h,
 							    buf->w,
@@ -187,20 +187,10 @@ evas_software_xcb_outbuf_setup_x(int    
 							    buf->priv.mask.b,
 							    buf->priv.pal->colors,
 							    buf->rot);
-		else if (buf->rot == 90)
-		   conv_func = evas_common_convert_func_get(0,
-							    buf->h,
-							    buf->w,
-							    evas_software_xcb_x_output_buffer_depth(xcbob),
-							    buf->priv.mask.r,
-							    buf->priv.mask.g,
-							    buf->priv.mask.b,
-							    buf->priv.pal->colors,
-							    buf->rot);
 	     }
 	   else
 	     {
-		if (buf->rot == 0)
+		if (buf->rot == 0 || buf->rot == 180)
 		   conv_func = evas_common_convert_func_get(0,
 							    buf->w,
 							    buf->h,
@@ -210,17 +200,7 @@ evas_software_xcb_outbuf_setup_x(int    
 							    buf->priv.mask.b,
 							    PAL_MODE_NONE,
 							    buf->rot);
-		else if (buf->rot == 270)
-		   conv_func = evas_common_convert_func_get(0,
-							    buf->h,
-							    buf->w,
-							    evas_software_xcb_x_output_buffer_depth(xcbob),
-							    buf->priv.mask.r,
-							    buf->priv.mask.g,
-							    buf->priv.mask.b,
-							    PAL_MODE_NONE,
-							    buf->rot);
-		else if (buf->rot == 90)
+		else if (buf->rot == 90 || buf->rot == 270)
 		   conv_func = evas_common_convert_func_get(0,
 							    buf->h,
 							    buf->w,
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to