Hi
The attached patch adds 16bpp BGR 565 Converter Support to evas.
Please apply.
-- Lars Munch
Index: configure.in
===
RCS file: /var/cvs/e/e17/libs/evas/configure.in,v
retrieving revision 1.199
diff -p -u -r1.199 configure.in
--- configure.in 4 Dec 2006 20:34:29 - 1.199
+++ configure.in 4 Feb 2007 20:09:29 -
@@ -1444,12 +1444,12 @@ AC_ARG_ENABLE(convert-8-rgb-111,
## Convert to 16bpp RGB 565
conv_16_rgb_565=no
conv_16_rgb_565=yes
-AC_MSG_CHECKING(whether to build 16bpp 565 converter code)
+AC_MSG_CHECKING(whether to build 16bpp 565 rgb converter code)
AC_ARG_ENABLE(convert-16-rgb-565,
- [ --enable-convert-16-rgb-565 enable 16bpp 565 converter code], [
+ [ --enable-convert-16-rgb-565 enable 16bpp rgb 565 converter code], [
if test x$enableval = xyes ; then
AC_MSG_RESULT(yes)
-AC_DEFINE(BUILD_CONVERT_16_RGB_565, 1, [16bpp 565 Converter Support])
+AC_DEFINE(BUILD_CONVERT_16_RGB_565, 1, [16bpp RGB 565 Converter Support])
conv_16_rgb_565=yes
else
AC_MSG_RESULT(no)
@@ -1458,7 +1458,30 @@ AC_ARG_ENABLE(convert-16-rgb-565,
], [
AC_MSG_RESULT($conv_16_rgb_565)
if test x$conv_16_rgb_565 = xyes ; then
-AC_DEFINE(BUILD_CONVERT_16_RGB_565, 1, [16bpp 565 Converter Support])
+AC_DEFINE(BUILD_CONVERT_16_RGB_565, 1, [16bpp RGB 565 Converter Support])
+ fi
+ ]
+)
+
+###
+## Convert to 16bpp BGR 565
+conv_16_bgr_565=no
+conv_16_bgr_565=yes
+AC_MSG_CHECKING(whether to build 16bpp 565 bgr converter code)
+AC_ARG_ENABLE(convert-16-bgr-565,
+ [ --enable-convert-16-bgr-565 enable 16bpp bgr 565 converter code], [
+ if test x$enableval = xyes ; then
+AC_MSG_RESULT(yes)
+AC_DEFINE(BUILD_CONVERT_16_BGR_565, 1, [16bpp BGR 565 Converter Support])
+conv_16_bgr_565=yes
+ else
+AC_MSG_RESULT(no)
+ conv_16_bgr_565=no
+ fi
+ ], [
+ AC_MSG_RESULT($conv_16_bgr_565)
+ if test x$conv_16_bgr_565 = xyes ; then
+AC_DEFINE(BUILD_CONVERT_16_BGR_565, 1, [16bpp BGR 565 Converter Support])
fi
]
)
@@ -2020,6 +2043,7 @@ echo 8bpp RGB 121: $conv_
echo 8bpp RGB 111: $conv_8_rgb_111
# FIXME: add grayscale and BW support
echo 16bpp RGB 565...: $conv_16_rgb_565
+echo 16bpp BGR 565...: $conv_16_bgr_565
echo 16bpp RGB 555...: $conv_16_rgb_555
echo 16bpp RGB 444...: $conv_16_rgb_444
echo 16bpp RGB 565 (444 ipaq): $conv_16_rgb_ipq
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.6
diff -p -u -r1.6 evas_convert_main.c
--- src/lib/engines/common/evas_convert_main.c 6 Sep 2006 07:33:39 - 1.6
+++ src/lib/engines/common/evas_convert_main.c 4 Feb 2007 20:09:31 -
@@ -228,6 +228,38 @@ evas_common_convert_func_get(DATA8 *dest
#endif
}
#endif
+#ifdef BUILD_CONVERT_16_BGR_565
+ if ((rmask == 0x001f) (gmask == 0x07e0) (bmask == 0xf800))
+ {
+#ifdef BUILD_CONVERT_16_RGB_ROT0
+ if (rotation == 0)
+ {
+ if ((!(w 0x1)) (!((int)dest 0x3)))
+ return evas_common_convert_rgba2_to_16bpp_bgr_565_dith;
+ else
+ return evas_common_convert_rgba_to_16bpp_bgr_565_dith;
+ }
+#endif
+#ifdef BUILD_CONVERT_16_RGB_ROT270
+ if (rotation == 270)
+ {
+ if ((!(w 0x1)) (!((int)dest 0x3)))
+ return evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270;
+ else
+ return evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_270;
+ }
+#endif
+#ifdef BUILD_CONVERT_16_RGB_ROT90
+ if (rotation == 90)
+ {
+ if ((!(w 0x1)) (!((int)dest 0x3)))
+ return evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_90;
+ else
+ return evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_90;
+ }
+#endif
+ }
+#endif
#ifdef BUILD_CONVERT_16_RGB_555
if ((rmask == 0x7c00) (gmask == 0x03e0) (bmask == 0x001f))
{
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.4
diff -p -u -r1.4 evas_convert_rgb_16.c
--- src/lib/engines/common/evas_convert_rgb_16.c 22 May 2005 02:49:48 - 1.4
+++ src/lib/engines/common/evas_convert_rgb_16.c 4 Feb 2007 20:09:31 -
@@ -264,6 +264,263 @@ evas_common_convert_rgba_to_16bpp_rgb_56
#endif
#endif
+#ifdef BUILD_CONVERT_16_BGR_565
+#ifdef BUILD_CONVERT_16_RGB_ROT0
+void
+evas_common_convert_rgba2_to_16bpp_bgr_565_dith (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;
+