2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
2008-07-10 15:53:33 -07:00
|
|
|
#include "evas_convert_rgb_24.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
|
|
|
|
#ifdef BUILD_CONVERT_24_RGB_888
|
2005-04-11 08:45:12 -07:00
|
|
|
void
|
2009-02-24 00:31:31 -08:00
|
|
|
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 __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
|
2005-04-11 08:45:12 -07:00
|
|
|
{
|
|
|
|
DATA32 *src_ptr;
|
|
|
|
DATA8 *dst_ptr;
|
|
|
|
int x, y;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2005-04-11 08:45:12 -07:00
|
|
|
dst_ptr = (DATA8 *)dst;
|
2005-10-08 03:16:17 -07:00
|
|
|
src_ptr = (DATA32 *)src;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2005-04-11 08:45:12 -07:00
|
|
|
for (y = 0; y < h; y++)
|
|
|
|
{
|
|
|
|
for (x = 0; x < w; x++)
|
|
|
|
{
|
|
|
|
dst_ptr[0] = R_VAL(src_ptr);
|
|
|
|
dst_ptr[1] = G_VAL(src_ptr);
|
|
|
|
dst_ptr[2] = B_VAL(src_ptr);
|
|
|
|
src_ptr++;
|
|
|
|
dst_ptr+=3;
|
|
|
|
}
|
|
|
|
src_ptr += src_jump;
|
|
|
|
dst_ptr += (dst_jump * 3);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
#endif
|
2009-04-02 18:00:54 -07:00
|
|
|
#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
|
2002-11-08 00:02:15 -08:00
|
|
|
#ifdef BUILD_CONVERT_24_BGR_888
|
2005-04-11 08:45:12 -07:00
|
|
|
void
|
2009-02-24 00:31:31 -08:00
|
|
|
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__)
|
2005-04-11 08:45:12 -07:00
|
|
|
{
|
2006-09-30 03:18:37 -07:00
|
|
|
DATA32 *src_ptr;
|
|
|
|
DATA8 *dst_ptr;
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
dst_ptr = (DATA8 *)dst;
|
|
|
|
src_ptr = (DATA32 *)src;
|
|
|
|
|
|
|
|
for (y = 0; y < h; y++)
|
|
|
|
{
|
|
|
|
for (x = 0; x < w; x++)
|
|
|
|
{
|
|
|
|
dst_ptr[2] = R_VAL(src_ptr);
|
|
|
|
dst_ptr[1] = G_VAL(src_ptr);
|
|
|
|
dst_ptr[0] = B_VAL(src_ptr);
|
|
|
|
src_ptr++;
|
|
|
|
dst_ptr+=3;
|
|
|
|
}
|
|
|
|
src_ptr += src_jump;
|
|
|
|
dst_ptr += (dst_jump * 3);
|
|
|
|
}
|
|
|
|
return;
|
2005-04-11 08:45:12 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
#endif
|