Alpha overlay is almost completely working now!
By doing (in the render thread in the xmms plugin):
VisVideo *bitmapje = visual_bitmap_load_new_video
("/alphachantest.bmp");
VisVideo *bitmapje32 = visual_video_new ();
visual_video_set_depth (bitmapje32, VISUAL_VIDEO_DEPTH_32BIT);
visual_video_set_dimension (bitmapje32, bitmapje->width,
bitmapje->height);
visual_video_allocate_buffer (bitmapje32);
visual_video_depth_transform (bitmapje32, bitmapje);
/* This is the color to alpha chan function (the first 3 numbers
* are the r g b values for the color that is going to be
* the alpha channel and the last number is
* the density of the other colors */
visual_video_alpha_color (bitmapje32, 255, 0, 234, 128);
Now after visual_bin_run:
visual_video_blit_overlay (video, bitmapje32, 10, 10, TRUE);
10, 10 is placement, the TRUE flag tells the overlay function
to look for an alpha channel.
Result:
http://libvisual.sourceforge.net/libvisual-overlay.png
First image is with density at 128 second image at 255.
The picture has some rough edges, but that is in the pic
not libvisual :)
Cheers,
Dennis
|