X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fresourcepixmap.C;fp=cinelerra-5.1%2Fcinelerra%2Fresourcepixmap.C;h=e70c5fcd5b0676c6848e25f87709ee2ded5dbc9c;hb=258d9cb69d560f40961acdd20866e12e940c2f93;hp=2ffd86ca58287ecc74747ca45926331e82f4f38f;hpb=0b9b147db71b52ac26c6916569a1e407bb2651bc;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.C b/cinelerra-5.1/cinelerra/resourcepixmap.C index 2ffd86ca..e70c5fcd 100644 --- a/cinelerra-5.1/cinelerra/resourcepixmap.C +++ b/cinelerra-5.1/cinelerra/resourcepixmap.C @@ -46,6 +46,7 @@ #include "localsession.h" #include "mwindow.h" #include "mwindowgui.h" +#include "preferences.h" #include "renderengine.h" #include "resourcethread.h" #include "resourcepixmap.h" @@ -241,6 +242,32 @@ void ResourcePixmap::draw_data(TrackCanvas *canvas, SET_TRACE } + +VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color, int bg_color) +{ + if( color < 0 || color == bg_color ) return title_bg; + int colormodel = title_bg->get_color_model(); + int bpp = BC_CModels::calculate_pixelsize(colormodel); + int tw = title_bg->get_w(), th = title_bg->get_h(); + VFrame *title_bar = new VFrame(tw, th, colormodel); + uint8_t br = (bg_color>>16), cr = (color>>16); + uint8_t bg = (bg_color>>8), cg = (color>>8); + uint8_t bb = (bg_color>>0), cb = (color>>0); + int dr = cr-br, dg = cg-bg, db = cb-bb; + uint8_t **bar_rows = title_bar->get_rows(); + uint8_t **rows = title_bg->get_rows(); + for( int y=0; y