add - in theory rgb24+32 666 support (ezx).

SVN revision: 39836
This commit is contained in:
Carsten Haitzler 2009-04-03 01:00:54 +00:00
parent b3e8f31362
commit d5cfffc3c2
6 changed files with 131 additions and 3 deletions

View File

@ -921,6 +921,48 @@ EVAS_CONVERT_COLOR(32, BGR, 8888)
## Convert to 32bpp BGRX 8888
EVAS_CONVERT_COLOR(32, BGRX, 8888)
#######################################
## Convert to 24bpp RGB 666 (666 ezx)
conv_24_rgb_ezx="yes"
AC_MSG_CHECKING(whether to build 24bpp 666 (666 ezx) converter code)
AC_ARG_ENABLE(convert-24-rgb-ezx,
AC_HELP_STRING([--disable-convert-24-rgb-ezx], [disable 24bpp 666 (666 ezx) converter code]),
[
if test "x$enableval" = "xyes" ; then
AC_DEFINE(BUILD_CONVERT_24_RGB_666, 1, [24bpp 666 (666 ezx) Converter Support])
conv_24_rgb_ezx="yes"
else
conv_24_rgb_ezx="no"
fi
], [
if test "x$conv_24_rgb_ezx" = "xyes" ; then
AC_DEFINE(BUILD_CONVERT_24_RGB_666, 1, [24bpp 666 (666 ezx) Converter Support])
fi
]
)
AC_MSG_RESULT($conv_24_rgb_ezx)
#######################################
## Convert to 32bpp RGB 666 (666 ezx)
conv_32_rgb_ezx="yes"
AC_MSG_CHECKING(whether to build 32bpp 666 (666 ezx) converter code)
AC_ARG_ENABLE(convert-32-rgb-ezx,
AC_HELP_STRING([--disable-convert-32-rgb-ezx], [disable 32bpp 666 (666 ezx) converter code]),
[
if test "x$enableval" = "xyes" ; then
AC_DEFINE(BUILD_CONVERT_32_RGB_666, 1, [32bpp 666 (666 ezx) Converter Support])
conv_32_rgb_ezx="yes"
else
conv_32_rgb_ezx="no"
fi
], [
if test "x$conv_32_rgb_ezx" = "xyes" ; then
AC_DEFINE(BUILD_CONVERT_32_RGB_666, 1, [32bpp 666 (666 ezx) Converter Support])
fi
]
)
AC_MSG_RESULT($conv_32_rgb_ezx)
#######################################
## Convert to 32bpp RGB with rotation of 0
EVAS_CONVERT_ROT(32, RGB, 0)
@ -1147,8 +1189,6 @@ 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"
# FIXME: add 555 (444 ipaq) support
# FIXME: add 24bpp 666 support
# FIXME: add 32bpp 666 support
# FIXME: add 30bpp support
# FIXME: add palletted support
# FIXME: add 8bpp and below rotation
@ -1158,11 +1198,13 @@ echo " 16bpp Rotation 180......: $conv_16_rgb_rot_180"
echo " 16bpp Rotation 270......: $conv_16_rgb_rot_270"
echo " 24bpp RGB 888...........: $conv_24_rgb_888"
echo " 24bpp BGR 888...........: $conv_24_bgr_888"
echo " 24bpp RGB 666 (666 ezx).: $conv_24_rgb_ezx"
# FIXME: add 24bpp rotation
echo " 32bpp RGB 8888..........: $conv_32_rgb_8888"
echo " 32bpp RGBX 8888.........: $conv_32_rgbx_8888"
echo " 32bpp BGR 8888..........: $conv_32_bgr_8888"
echo " 32bpp BGRX 8888.........: $conv_32_bgrx_8888"
echo " 32bpp RGB 666 (666 ezx).: $conv_32_rgb_ezx"
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"

View File

@ -537,6 +537,27 @@ evas_common_convert_func_get(DATA8 *dest, int w, int h, int depth, DATA32 rmask,
#ifdef BUILD_CONVERT_32_RGB_ROT90
if (rotation == 90)
return evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90;
#endif
}
#endif
#ifdef BUILD_CONVERT_32_RGB_666
if ((rmask == 0x0003f000) && (gmask == 0x00000fc0) && (bmask == 0x0000003f))
{
#ifdef BUILD_CONVERT_32_RGB_ROT0
if (rotation == 0)
return evas_common_convert_rgba_to_32bpp_rgb_666;
#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;
#endif
#ifdef BUILD_CONVERT_32_RGB_ROT90
// if (rotation == 90)
// return evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90;
#endif
}
#endif
@ -550,6 +571,13 @@ evas_common_convert_func_get(DATA8 *dest, int w, int h, int depth, DATA32 rmask,
return evas_common_convert_rgba_to_24bpp_rgb_888;
}
#endif
#ifdef BUILD_CONVERT_24_RGB_666
if ((rmask == 0x0003f000) && (gmask == 0x00000fc0) && (bmask == 0x0000003f))
{
if (rotation == 0)
return evas_common_convert_rgba_to_24bpp_rgb_666;
}
#endif
#ifdef BUILD_CONVERT_24_BGR_888
if ((rmask == 0x000000ff) && (gmask == 0x0000ff00) && (bmask == 0x00ff0000))
{

View File

@ -32,6 +32,38 @@ evas_common_convert_rgba_to_24bpp_rgb_888(DATA32 *src, DATA8 *dst, int src_jump,
return;
}
#endif
#ifdef BUILD_CONVERT_24_RGB_666
void
evas_common_convert_rgba_to_24bpp_rgb_666(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
{
DATA32 *src_ptr;
DATA8 *dst_ptr, *scratch_ptr;
DATA32 scratch;
int x, y;
dst_ptr = (DATA8 *)dst;
src_ptr = (DATA32 *)src;
scratch_ptr = (DATA8 *)(&scratch);
for (y = 0; y < h; y++)
{
for (x = 0; x < w; x++)
{
scratch =
(((R_VAL(src_ptr) << 12) | (B_VAL(src_ptr) >> 2)) & 0x03f03f) |
((G_VAL(src_ptr) << 4) & 0x000fc0);
dst_ptr[0] = scratch_ptr[1];
dst_ptr[1] = scratch_ptr[2];
dst_ptr[2] = scratch_ptr[3];
src_ptr++;
dst_ptr+=3;
}
src_ptr += src_jump;
dst_ptr += (dst_jump * 3);
}
return;
}
#endif
#ifdef BUILD_CONVERT_24_BGR_888
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 __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)

View File

@ -9,5 +9,6 @@
void evas_common_convert_rgba_to_24bpp_rgb_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_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_24bpp_rgb_666 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
#endif /* _EVAS_CONVERT_RGB_24_H */

View File

@ -349,3 +349,27 @@ evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90 (DATA32 *src, DATA8 *dst, int
}
#endif
#endif
#ifdef BUILD_CONVERT_32_RGB_666
#ifdef BUILD_CONVERT_32_RGB_ROT0
void
evas_common_convert_rgba_to_32bpp_rgb_666(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
{
DATA32 *src_ptr;
DATA32 *dst_ptr;
int x, y;
dst_ptr = (DATA32 *)dst;
CONVERT_LOOP_START_ROT_0();
*dst_ptr =
(((R_VAL(src_ptr) << 12) | (B_VAL(src_ptr) >> 2)) & 0x03f03f) |
((G_VAL(src_ptr) << 4) & 0x000fc0);
CONVERT_LOOP_END_ROT_0();
return;
}
#endif
#endif

View File

@ -23,5 +23,6 @@ void evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180 (DATA32 *src, DAT
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);
void evas_common_convert_rgba_to_32bpp_rgb_666 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
#endif /* _EVAS_CONVERT_RGB_32_H */