change composer to chroma only - no src alpha blend, resize about pref, new expanders...
[goodguy/history.git] / cinelerra-5.1 / guicast / bcxfer.C
index 44258127849b654483f7f52cc719b53735862e42..95e0c8e52b27a525c1d9e823c8de3ed4bbf06216 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);