summaryrefslogtreecommitdiffstats
path: root/libvo/vo_x11.c
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-24 04:36:17 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-24 04:36:17 +0000
commite72b62f8cc189053efe7e42078d7fa0f04dd425e (patch)
tree5fa3c0644fde7f0ef4ccf88cfe0f5e7f5a28edd0 /libvo/vo_x11.c
parent96edb007a565f7fc9a50f1ba64ae24e05f903fbc (diff)
downloadmpv-e72b62f8cc189053efe7e42078d7fa0f04dd425e.tar.bz2
mpv-e72b62f8cc189053efe7e42078d7fa0f04dd425e.tar.xz
grey+alpha rendering support (for .sub)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@203 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_x11.c')
-rw-r--r--libvo/vo_x11.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 2d2a19b1bc..bf8b5abe14 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -328,7 +328,30 @@ static void Display_Image( XImage *myximage,uint8_t *ImageData )
#endif
}
+static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+ int dbpp=( bpp+7 )/8;
+ int x,y;
+
+ for(y=0;y<h;y++){
+ uint8_t *dst = ImageData+ dbpp*((y+y0)*image_width+x0);
+ for(x=0;x<w;x++){
+// dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>8;
+ if(srca[x]){
+ dst[0]=(dst[0]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ dst[1]=(dst[1]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ dst[2]=(dst[2]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ }
+ dst+=dbpp;
+ }
+ src+=stride;
+ srca+=stride;
+ }
+
+}
+
+
static void flip_page( void ){
+ vo_draw_text(draw_alpha);
check_events();
Display_Image( myximage,ImageData );
}