X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fresourcepixmap.C;h=b0bc49b7ffbf5020ce8764ac5024ff1ddccbe763;hp=9ed12d9357dc71fdef5f83de4f277ec43e408f33;hb=052becff04e4f4a4240a87c6b2f2f4023b65d247;hpb=b8edca23c6b2a5109676001cd04759507e354364 diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.C b/cinelerra-5.1/cinelerra/resourcepixmap.C index 9ed12d93..b0bc49b7 100644 --- a/cinelerra-5.1/cinelerra/resourcepixmap.C +++ b/cinelerra-5.1/cinelerra/resourcepixmap.C @@ -238,6 +238,8 @@ VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color) VFrame *title_bar = new VFrame(tw, th, colormodel); uint8_t **bar_rows = title_bar->get_rows(); const uint8_t gap_grey = 0x4a; + union { unsigned rgba; struct { uint8_t r,g,b,a; }; } c; + c.r = color>>16; c.g = color>>8; c.b = color>>0; c.a = 0xff; if( BC_CModels::has_alpha(colormodel) && // fast path BC_CModels::calculate_pixelsize(colormodel) == sizeof(unsigned) ) { const unsigned gap_rgba = (0xff<<24) | @@ -246,16 +248,14 @@ VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color) unsigned *bp = (unsigned *)bar_rows[0]; for( int i=tw; --i>=0; ) *bp++ = gap_rgba; } - unsigned rgba = (0xff<<24) | (color & 0xffffff); for( int y=1; y 0 ) *bp++ = gap_rgba; - for( int i=tw1; --i>0; ++bp ) *bp = rgba; + for( int i=tw1; --i>0; ++bp ) *bp = c.rgba; if( tw > 1 ) *bp = gap_rgba; } } else { - uint8_t cr = (color>>16), cg = (color>>8), cb = (color>>0); if( th > 0 ) { uint8_t *cp = bar_rows[0]; for( int x=0; x 3 ) cp[3] = 0xff; cp += bpp; }