X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcxfer.C;fp=cinelerra-5.1%2Fguicast%2Fbcxfer.C;h=95e0c8e52b27a525c1d9e823c8de3ed4bbf06216;hp=44258127849b654483f7f52cc719b53735862e42;hb=26f3c4335351a3938db78303c57a2ba6551a2a10;hpb=ae44cc4a24c9e04ee5e3b38baf6ce529832cfb39 diff --git a/cinelerra-5.1/guicast/bcxfer.C b/cinelerra-5.1/guicast/bcxfer.C index 44258127..95e0c8e5 100644 --- a/cinelerra-5.1/guicast/bcxfer.C +++ b/cinelerra-5.1/guicast/bcxfer.C @@ -6,6 +6,21 @@ void BC_Xfer::init( uint8_t *in_yp, uint8_t *in_up, uint8_t *in_vp, uint8_t *in_ap, int in_rowspan, int bg_color) { + this->bg_color = bg_color; + if( bg_color >= 0 ) { + this->bg_r = (bg_color>>16) & 0xff; + this->bg_g = (bg_color>>8) & 0xff; + this->bg_b = (bg_color>>0) & 0xff; + } + else { // bg_color < 0, no src blending + switch( in_colormodel ) { + case BC_RGBA8888: in_colormodel = BC_RGBX8888; break; + case BC_RGBA16161616: in_colormodel = BC_RGBX16161616; break; + case BC_YUVA8888: in_colormodel = BC_YUVX8888; break; + case BC_YUVA16161616: in_colormodel = BC_YUVX16161616; break; + case BC_RGBA_FLOAT: in_colormodel = BC_RGBX_FLOAT; break; + } + } // prevent bounds errors on poorly dimensioned macro pixel formats switch( in_colormodel ) { case BC_UVY422: @@ -67,11 +82,6 @@ void BC_Xfer::init( break; } this->total_out_w = out_rowspan; - this->bg_color = bg_color; - this->bg_r = (bg_color>>16) & 0xff; - this->bg_g = (bg_color>>8) & 0xff; - this->bg_b = (bg_color>>0) & 0xff; - this->in_pixelsize = BC_CModels::calculate_pixelsize(in_colormodel); this->out_pixelsize = BC_CModels::calculate_pixelsize(out_colormodel); this->scale = (out_w != in_w) || (in_x != 0);