X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcxfer.C;h=d94fc38945872bdc402d8d4065f9e0f83242c0ea;hp=44258127849b654483f7f52cc719b53735862e42;hb=a19a685a46ddc630010788707d9e5b9d2342af46;hpb=8f0d97d1da0cd4cfcacf76c2c1788204749b6757 diff --git a/cinelerra-5.1/guicast/bcxfer.C b/cinelerra-5.1/guicast/bcxfer.C index 44258127..d94fc389 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); @@ -253,6 +263,8 @@ BC_Xfer::Slicer::~Slicer() done = 1; init->unlock(); join(); + delete complete; + delete init; } void BC_Xfer::Slicer::slice(BC_Xfer *xp, unsigned y0, unsigned y1)