forked from enlightenment/efl
buffer engine seems to be wroking for an rgb buffer with color keying...
SVN revision: 6811
This commit is contained in:
parent
afa5ce1ab0
commit
a2e0c127b0
|
@ -24,7 +24,7 @@ main(int argc, char **argv)
|
|||
einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(evas);
|
||||
|
||||
/* the following is specific to the engine */
|
||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB24;
|
||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_BGR24;
|
||||
img_buf = malloc(win_w * win_h * 3);
|
||||
einfo->info.dest_buffer = img_buf;
|
||||
einfo->info.dest_buffer_row_bytes = win_w * 3;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#ifndef _EVAS_ENGINE_BUFFER_H
|
||||
#define _EVAS_ENGINE_BUFFER_H
|
||||
|
||||
#define EVAS_ENGINE_BUFFER_DEPTH_RGBA32 0
|
||||
#define EVAS_ENGINE_BUFFER_DEPTH_RGB24 1
|
||||
#define EVAS_ENGINE_BUFFER_DEPTH_ARGB32 0
|
||||
#define EVAS_ENGINE_BUFFER_DEPTH_BGRA32 1
|
||||
#define EVAS_ENGINE_BUFFER_DEPTH_RGB24 2
|
||||
#define EVAS_ENGINE_BUFFER_DEPTH_BGR24 3
|
||||
|
||||
typedef struct _Evas_Engine_Info_Buffer Evas_Engine_Info_Buffer;
|
||||
|
||||
|
|
|
@ -251,11 +251,15 @@ evas_engine_buffer_output_setup(int w,
|
|||
Outbuf_Depth dep;
|
||||
DATA32 color_key;
|
||||
|
||||
dep = OUTBUF_DEPTH_RGB_24BPP_888_888;
|
||||
if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_RGBA32)
|
||||
dep = OUTBUF_DEPTH_BGR_24BPP_888_888;
|
||||
if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_ARGB32)
|
||||
dep = OUTBUF_DEPTH_RGB_32BPP_888_8888;
|
||||
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_BGRA32)
|
||||
dep = OUTBUF_DEPTH_BGR_32BPP_888_8888;
|
||||
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_RGB24)
|
||||
dep = OUTBUF_DEPTH_RGB_24BPP_888_888;
|
||||
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_BGR24)
|
||||
dep = OUTBUF_DEPTH_BGR_24BPP_888_888;
|
||||
R_VAL(&color_key) = color_key_r;
|
||||
G_VAL(&color_key) = color_key_g;
|
||||
B_VAL(&color_key) = color_key_b;
|
||||
|
|
|
@ -8,8 +8,10 @@ typedef enum _Outbuf_Depth Outbuf_Depth;
|
|||
enum _Outbuf_Depth
|
||||
{
|
||||
OUTBUF_DEPTH_NONE,
|
||||
OUTBUF_DEPTH_RGB_24BPP_888_888,
|
||||
OUTBUF_DEPTH_RGB_32BPP_888_8888,
|
||||
OUTBUF_DEPTH_BGR_32BPP_888_8888,
|
||||
OUTBUF_DEPTH_RGB_24BPP_888_888,
|
||||
OUTBUF_DEPTH_BGR_24BPP_888_888,
|
||||
OUTBUF_DEPTH_LAST
|
||||
};
|
||||
|
||||
|
|
|
@ -115,10 +115,66 @@ evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int
|
|||
}
|
||||
}
|
||||
break;
|
||||
case OUTBUF_DEPTH_BGR_24BPP_888_888:
|
||||
/* copy & pack into 24bpp - if colorkey is enabled... etc. */
|
||||
{
|
||||
DATA8 thresh;
|
||||
int xx, yy;
|
||||
DATA32 colorkey;
|
||||
DATA32 *src;
|
||||
DATA8 *dst;
|
||||
|
||||
colorkey = buf->color_key;
|
||||
thresh = buf->alpha_level;
|
||||
if (buf->use_color_key)
|
||||
{
|
||||
for (yy = 0; yy < h; yy++)
|
||||
{
|
||||
dst = buf->dest + ((y + yy) * buf->dest_row_bytes);
|
||||
src = update->image->data + (yy * update->image->w);
|
||||
for (xx = 0; xx < w; xx++)
|
||||
{
|
||||
if (A_VAL(src) > thresh)
|
||||
{
|
||||
*dst++ = B_VAL(src);
|
||||
*dst++ = G_VAL(src);
|
||||
*dst++ = R_VAL(src);
|
||||
}
|
||||
else
|
||||
{
|
||||
*dst++ = B_VAL(&colorkey);
|
||||
*dst++ = G_VAL(&colorkey);
|
||||
*dst++ = R_VAL(&colorkey);
|
||||
}
|
||||
src++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (yy = 0; yy < h; yy++)
|
||||
{
|
||||
dst = buf->dest + ((y + yy) * buf->dest_row_bytes);
|
||||
src = update->image->data + (yy * update->image->w);
|
||||
for (xx = 0; xx < w; xx++)
|
||||
{
|
||||
*dst++ = B_VAL(src);
|
||||
*dst++ = G_VAL(src);
|
||||
*dst++ = R_VAL(src);
|
||||
src++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OUTBUF_DEPTH_RGB_32BPP_888_8888:
|
||||
/* simple memcpy */
|
||||
/* FIXME: write this */
|
||||
break;
|
||||
case OUTBUF_DEPTH_BGR_32BPP_888_8888:
|
||||
/* simple memcpy */
|
||||
/* FIXME: write this */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue