olaf neophyte and de.po updates, valgrind tweaks, delete green lady, inkscape dpi=96
[goodguy/history.git] / cinelerra-5.1 / guicast / bcxfer.C
index 44258127849b654483f7f52cc719b53735862e42..d94fc38945872bdc402d8d4065f9e0f83242c0ea 100644 (file)
@@ -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)