Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common Modified Files: evas_convert_main.c evas_convert_rgb_16.c Log Message: patches applied as per emails :) =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_convert_main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- evas_convert_main.c 6 Sep 2006 07:33:39 -0000 1.6 +++ evas_convert_main.c 10 Feb 2007 17:23:06 -0000 1.7 @@ -228,6 +228,38 @@ #endif } #endif +#ifdef BUILD_CONVERT_16_BGR_565 + if ((rmask == 0x0000001f) && (gmask == 0x000007e0) && (bmask == 0x0000f800)) + { +#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 == 0x00007c00) && (gmask == 0x000003e0) && (bmask == 0x0000001f)) { =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_convert_rgb_16.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- evas_convert_rgb_16.c 22 May 2005 02:49:48 -0000 1.4 +++ evas_convert_rgb_16.c 10 Feb 2007 17:23:06 -0000 1.5 @@ -264,6 +264,263 @@ #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; + DATA8 r1, g1, b1; + DATA8 r2, g2, b2; + DATA8 dith, dith2; + + dst_ptr = (DATA16 *)dst; + + CONVERT_LOOP2_START_ROT_0(); + + 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_0(); + + 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_0(); + return; + pal = 0; +} +#endif +#endif + +#ifdef BUILD_CONVERT_16_BGR_565 +#ifdef BUILD_CONVERT_16_RGB_ROT0 +void +evas_common_convert_rgba_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; + DATA8 r, g, b; + DATA8 dith, dith2; + + dst_ptr = (DATA16 *)dst; + + CONVERT_LOOP_START_ROT_0(); + + 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_0(); + 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) +{ + 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_270(); + + 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_270(); + + 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_270(); + return; + pal = 0; +} +#endif +#endif + +#ifdef BUILD_CONVERT_16_BGR_565 +#ifdef BUILD_CONVERT_16_RGB_ROT270 +void +evas_common_convert_rgba_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) +{ + DATA32 *src_ptr; + DATA16 *dst_ptr; + int x, y; + DATA8 r, g, b; + DATA8 dith, dith2; + + dst_ptr = (DATA16 *)dst; + + CONVERT_LOOP_START_ROT_270(); + + 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_270(); + return; + pal = 0; +} +#endif +#endif + +#ifdef BUILD_CONVERT_16_BGR_565 +#ifdef BUILD_CONVERT_16_RGB_ROT90 +void +evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_90 (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_90(); + + 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_90(); + + 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_90(); + return; + pal = 0; +} +#endif +#endif + +#ifdef BUILD_CONVERT_16_BGR_565 +#ifdef BUILD_CONVERT_16_RGB_ROT90 +void +evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_90 (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_90(); + + 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_90(); + return; + pal = 0; +} +#endif +#endif + #ifdef BUILD_CONVERT_16_RGB_444 #ifdef BUILD_CONVERT_16_RGB_ROT0 void ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs