comparison libvo/vo_xv.c @ 326:f6b5c2dbc88e

OSD alpha renderers moved to osd.c
author arpi_esp
date Tue, 10 Apr 2001 02:29:38 +0000
parents 720c640332c8
children 601822cc8c52
comparison
equal deleted inserted replaced
325:b2fd5c172f80 326:f6b5c2dbc88e
254 } 254 }
255 } 255 }
256 } 256 }
257 257
258 258
259 //void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride);
260 //void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride);
261
259 static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ 262 static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
260 int x,y; 263 int x,y;
261 264
262 if (xv_format==IMGFMT_YV12){ 265 if (xv_format==IMGFMT_YV12)
263 266 vo_draw_alpha_yv12(w,h,src,srca,stride,xvimage[0]->data+image_width*y0+x0,image_width);
264 for(y=0;y<h;y++){ 267 else
265 uint8_t *dst = xvimage[0]->data + image_width * (y+y0) + x0; 268 vo_draw_alpha_yuy2(w,h,src,srca,stride,xvimage[0]->data+2*(image_width*y0+x0),2*image_width);
266 for(x=0;x<w;x++){
267 // dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>8;
268 if(srca[x])
269 // dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8;
270 dst[x]=((dst[x]*srca[x])>>8)+src[x];
271 }
272 src+=stride;
273 srca+=stride;
274 }
275
276 } else {
277
278 for(y=0;y<h;y++){
279 uint8_t *dst = xvimage[0]->data + 2*(image_width * (y+y0) + x0);
280 for(x=0;x<w;x++){
281 // dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>8;
282 if(srca[x])
283 // dst[2*x]=(dst[2*x]*(srca[x]^255)+src[x]*(srca[x]))>>8;
284 dst[2*x]=((dst[2*x]*srca[x])>>8)+src[x];
285 }
286 src+=stride;
287 srca+=stride;
288 }
289
290 }
291 269
292 } 270 }
293 271
294 static void flip_page(void) 272 static void flip_page(void)
295 { 273 {