From: Good Guy Date: Fri, 8 Dec 2017 02:09:01 +0000 (-0700) Subject: opengl dot() fix, add file dates, sort file name/time, fix icon image lookup, sync... X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=a6369311556cc1e1877142181d8606e4f68aa803;p=goodguy%2Fhistory.git opengl dot() fix, add file dates, sort file name/time, fix icon image lookup, sync icon pngs, diffkey tweaks --- diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index 47cc7f2a..677b8bab 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -64,7 +64,10 @@ void AssetPopup::create_objects() BC_SubMenu *submenu; add_item(info = new AssetPopupInfo(mwindow, this)); add_item(format = new AWindowListFormat(mwindow, gui)); - add_item(new AssetPopupSort(mwindow, this)); + add_item(menu_item = new BC_MenuItem(_("Sort..."))); + menu_item->add_submenu(submenu = new BC_SubMenu()); + submenu->add_submenuitem(new AssetPopupSortNames(mwindow, this)); + submenu->add_submenuitem(new AssetPopupSortTimes(mwindow, this)); add_item(index = new AssetPopupBuildIndex(mwindow, this)); add_item(view = new AssetPopupView(mwindow, this)); add_item(view_window = new AssetPopupViewWindow(mwindow, this)); @@ -180,20 +183,37 @@ int AssetPopupBuildIndex::handle_event() } -AssetPopupSort::AssetPopupSort(MWindow *mwindow, AssetPopup *popup) - : BC_MenuItem(_("Sort items")) +AssetPopupSortNames::AssetPopupSortNames(MWindow *mwindow, AssetPopup *popup) + : BC_MenuItem(_("Sort names")) +{ + this->mwindow = mwindow; + this->popup = popup; +} + +AssetPopupSortNames::~AssetPopupSortNames() +{ +} + +int AssetPopupSortNames::handle_event() +{ + mwindow->awindow->gui->sort_assets(0); + return 1; +} + +AssetPopupSortTimes::AssetPopupSortTimes(MWindow *mwindow, AssetPopup *popup) + : BC_MenuItem(_("Sort times")) { this->mwindow = mwindow; this->popup = popup; } -AssetPopupSort::~AssetPopupSort() +AssetPopupSortTimes::~AssetPopupSortTimes() { } -int AssetPopupSort::handle_event() +int AssetPopupSortTimes::handle_event() { - mwindow->awindow->gui->sort_assets(); + mwindow->awindow->gui->sort_assets(1); return 1; } diff --git a/cinelerra-5.1/cinelerra/assetpopup.h b/cinelerra-5.1/cinelerra/assetpopup.h index ee1a3d1f..b9191a77 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.h +++ b/cinelerra-5.1/cinelerra/assetpopup.h @@ -71,11 +71,23 @@ public: AssetPopup *popup; }; -class AssetPopupSort : public BC_MenuItem +class AssetPopupSortNames : public BC_MenuItem { public: - AssetPopupSort(MWindow *mwindow, AssetPopup *popup); - ~AssetPopupSort(); + AssetPopupSortNames(MWindow *mwindow, AssetPopup *popup); + ~AssetPopupSortNames(); + + int handle_event(); + + MWindow *mwindow; + AssetPopup *popup; +}; + +class AssetPopupSortTimes : public BC_MenuItem +{ +public: + AssetPopupSortTimes(MWindow *mwindow, AssetPopup *popup); + ~AssetPopupSortTimes(); int handle_event(); diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index d2777c93..7195d4e7 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -222,6 +222,7 @@ void AssetPicon::reset() icon_vframe = 0; vicon = 0; in_use = 1; + mtime = 0; id = 0; persistent = 0; } @@ -311,7 +312,8 @@ void AssetPicon::create_objects() icon = gui->audio_icon; icon_vframe = gui->audio_vframe; } - + struct stat st; + mtime = !stat(asset->path, &st) ? st.st_mtime : 0; } else if( indexable && !indexable->is_asset ) { @@ -1135,7 +1137,7 @@ void AWindowGUI::update_picon(Indexable *indexable) } } -void AWindowGUI::sort_assets() +void AWindowGUI::sort_assets(int use_mtime) { switch( mwindow->edl->session->awindow_folder ) { case AW_AEFFECT_FOLDER: @@ -1154,7 +1156,7 @@ void AWindowGUI::sort_assets() sort_picons(&labellist); break; default: - sort_picons(&assets); + sort_picons(&assets, use_mtime); } // reset xyposition asset_list->update_format(asset_list->get_format(), 0); @@ -1207,6 +1209,14 @@ void AWindowGUI::copy_picons(ArrayList *dst, else if( picon->label && picon->label->textstr ) dst[1].append(item2 = new BC_ListBoxItem(picon->label->textstr)); + else if( picon->mtime ) { + char date_time[BCSTRLEN]; + struct tm stm; localtime_r(&picon->mtime, &stm); + sprintf(date_time,"%04d.%02d.%02d %02d:%02d:%02d", + stm.tm_year+1900, stm.tm_mon+1, stm.tm_mday, + stm.tm_hour, stm.tm_min, stm.tm_sec); + dst[1].append(item2 = new BC_ListBoxItem(date_time)); + } else dst[1].append(item2 = new BC_ListBoxItem("")); item1->set_autoplace_text(1); item1->set_autoplace_icon(1); @@ -1215,26 +1225,29 @@ void AWindowGUI::copy_picons(ArrayList *dst, } } -void AWindowGUI::sort_picons(ArrayList *src) +void AWindowGUI::sort_picons(ArrayList *src, int use_mtime) { - int done = 0; - while(!done) - { + int done = 0, changed = 0; + while( !done ) { done = 1; - for( int i = 0; i < src->total - 1; i++ ) { - BC_ListBoxItem *item1 = src->values[i]; - BC_ListBoxItem *item2 = src->values[i + 1]; - item1->set_autoplace_icon(1); - item2->set_autoplace_icon(1); - item1->set_autoplace_text(1); - item2->set_autoplace_text(1); - if( strcmp(item1->get_text(), item2->get_text()) > 0 ) { + for( int i=0; itotal-1; ++i ) { + AssetPicon *item1 = (AssetPicon *)src->values[i]; + AssetPicon *item2 = (AssetPicon *)src->values[i + 1]; + if( use_mtime ? item1->mtime > item2->mtime : + strcmp(item1->get_text(), item2->get_text()) > 0 ) { src->values[i + 1] = item1; src->values[i] = item2; - done = 0; + done = 0; changed = 1; } } } + if( changed ) { + for( int i=0; itotal; ++i ) { + AssetPicon *item = (AssetPicon *)src->values[i]; + item->set_autoplace_icon(1); + item->set_autoplace_text(1); + } + } } @@ -2122,7 +2135,7 @@ AWindowListSort::AWindowListSort(MWindow *mwindow, AWindowGUI *gui) int AWindowListSort::handle_event() { - gui->sort_assets(); + gui->sort_assets(0); return 1; } diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index 2e922869..3068ac99 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -71,7 +71,7 @@ public: EDL *edl; int in_use; - + time_t mtime; int persistent; PluginServer *plugin; @@ -138,7 +138,7 @@ public: int keypress_event(); void async_update_assets(); // Sends update asset event void update_effects(); - void sort_assets(); + void sort_assets(int use_mtime); void sort_folders(); void reposition_objects(); static int folder_number(const char *name); @@ -155,7 +155,7 @@ public: void create_label_folder(); void copy_picons(ArrayList *dst, ArrayList *src, int folder); - void sort_picons(ArrayList *src); + void sort_picons(ArrayList *src, int use_mtime=0); // Return the selected asset in asset_list Indexable* selected_asset(); PluginServer* selected_plugin(); diff --git a/cinelerra-5.1/cinelerra/clippopup.C b/cinelerra-5.1/cinelerra/clippopup.C index 0eeee34e..f6ca8231 100644 --- a/cinelerra-5.1/cinelerra/clippopup.C +++ b/cinelerra-5.1/cinelerra/clippopup.C @@ -167,7 +167,7 @@ ClipPopupSort::~ClipPopupSort() int ClipPopupSort::handle_event() { - mwindow->awindow->gui->sort_assets(); + mwindow->awindow->gui->sort_assets(0); return 1; } diff --git a/cinelerra-5.1/cinelerra/playback3d.h b/cinelerra-5.1/cinelerra/playback3d.h index 314f392a..452b367c 100644 --- a/cinelerra-5.1/cinelerra/playback3d.h +++ b/cinelerra-5.1/cinelerra/playback3d.h @@ -43,29 +43,37 @@ // use static presets YUV in bccolors.h #define BC_GL_MATRIX(shader, mat) \ glUniformMatrix3fv(glGetUniformLocation(shader, #mat), 1, 0, YUV::mat) +#define BC_GL_VECTOR(shader, vec) \ + glUniform3fv(glGetUniformLocation(shader, #vec), 1, YUV::vec) -#define BC_GL_YMINF(shader,mat) \ - glUniform1f(glGetUniformLocation(shader, "yminf"), YUV::mat[9]) +#define BC_GL_YMINF(shader) \ + glUniform1f(glGetUniformLocation(shader, "yminf"), YUV::yuv.get_yminf()) #define BC_GL_RGB_TO_YUV(shader) do { \ BC_GL_MATRIX(shader, rgb_to_yuv_matrix); \ - BC_GL_YMINF(shader, rgb_to_yuv_matrix); \ + BC_GL_YMINF(shader); \ +} while(0) + +#define BC_GL_RGB_TO_Y(shader) do { \ + BC_GL_VECTOR(shader, rgb_to_y_vector); \ + BC_GL_YMINF(shader); \ } while(0) #define BC_GL_YUV_TO_RGB(shader) do { \ BC_GL_MATRIX(shader, yuv_to_rgb_matrix); \ - BC_GL_YMINF(shader, yuv_to_rgb_matrix); \ + BC_GL_YMINF(shader); \ } while(0) #define BC_GL_COLORS(shader) do { \ BC_GL_MATRIX(shader, yuv_to_rgb_matrix); \ BC_GL_MATRIX(shader, rgb_to_yuv_matrix); \ - BC_GL_YMINF(shader, rgb_to_yuv_matrix); \ + BC_GL_YMINF(shader); \ } while(0) #define bc_gl_yuv_to_rgb "uniform mat3 yuv_to_rgb_matrix;\n" #define bc_gl_rgb_to_yuv "uniform mat3 rgb_to_yuv_matrix;\n" +#define bc_gl_rgb_to_y "uniform vec3 rgb_to_y_vector;\n" #define bc_gl_yminf "uniform float yminf;\n" #define bc_gl_colors bc_gl_yuv_to_rgb bc_gl_rgb_to_yuv bc_gl_yminf diff --git a/cinelerra-5.1/cinelerra/vattachmentpoint.C b/cinelerra-5.1/cinelerra/vattachmentpoint.C index 9ee8fe35..c9b491bb 100644 --- a/cinelerra-5.1/cinelerra/vattachmentpoint.C +++ b/cinelerra-5.1/cinelerra/vattachmentpoint.C @@ -126,11 +126,13 @@ void VAttachmentPoint::render(VFrame *output, } //printf("VAttachmentPoint::render 3\n"); // Need to copy PBuffer if OpenGL, regardless of use_opengl - if( buffer_vector[buffer_number]->get_opengl_state() == VFrame::RAM ) { + int opengl_state = buffer_vector[buffer_number]->get_opengl_state(); + if( opengl_state == VFrame::RAM ) { output->copy_from(buffer_vector[buffer_number]); output->set_opengl_state(VFrame::RAM); } - else if(renderengine && renderengine->video) { + else if( opengl_state != VFrame::UNKNOWN && + renderengine && renderengine->video) { // Need to copy PBuffer to texture // printf("VAttachmentPoint::render temp=%p output=%p\n", // buffer_vector[buffer_number], diff --git a/cinelerra-5.1/guicast/bccolors.C b/cinelerra-5.1/guicast/bccolors.C index 78aaf64f..5d181696 100644 --- a/cinelerra-5.1/guicast/bccolors.C +++ b/cinelerra-5.1/guicast/bccolors.C @@ -126,8 +126,9 @@ int HSV::hsv_to_yuv(int &y, int &u, int &v, float h, float s, float va, int max) YUV YUV::yuv; -float YUV::rgb_to_yuv_matrix[10]; -float YUV::yuv_to_rgb_matrix[10]; +float YUV::yuv_to_rgb_matrix[9]; +float YUV::rgb_to_yuv_matrix[9]; +float YUV::rgb_to_y_vector[3]; YUV::YUV() { @@ -232,7 +233,10 @@ void YUV::init(double Kr, double Kb, int mpeg) rgb_to_yuv_matrix[6] = b_to_y; rgb_to_yuv_matrix[7] = b_to_u; rgb_to_yuv_matrix[8] = b_to_v; - rgb_to_yuv_matrix[9] = yminf; + + rgb_to_y_vector[0] = r_to_y; + rgb_to_y_vector[1] = g_to_y; + rgb_to_y_vector[2] = b_to_y; float yscale = 1.f / yrangef; yuv_to_rgb_matrix[0] = yscale; @@ -244,7 +248,6 @@ void YUV::init(double Kr, double Kb, int mpeg) yuv_to_rgb_matrix[6] = v_to_r; yuv_to_rgb_matrix[7] = v_to_g; yuv_to_rgb_matrix[8] = 0; - yuv_to_rgb_matrix[9] = yminf; } void YUV::init_tables(int len, diff --git a/cinelerra-5.1/guicast/bccolors.h b/cinelerra-5.1/guicast/bccolors.h index 720735ce..86877352 100644 --- a/cinelerra-5.1/guicast/bccolors.h +++ b/cinelerra-5.1/guicast/bccolors.h @@ -186,8 +186,10 @@ public: inline int is_mpeg() { return mpeg; } static YUV yuv; - static float rgb_to_yuv_matrix[10]; - static float yuv_to_rgb_matrix[10]; + static float yuv_to_rgb_matrix[9]; + static float rgb_to_yuv_matrix[9]; + static float rgb_to_y_vector[3]; + inline float get_yminf() { return yminf; } #define YUV_rgb_to_yuv_8(r,g,b, y,u,v) \ y = iclip((rtoy8[r] + gtoy8[g] + btoy8[b] + yzero) >> 16, ymin8, ymax8); \ diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 7ca7e4ab..6c1ceb31 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -835,15 +835,11 @@ int BC_FileBox::create_tables() // Date entry if(!is_dir || 1) { - static const char *month_text[13] = { "Nul", - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; - sprintf(string, - "%s %d, %d", - month_text[file_item->month], - file_item->day, - file_item->year); + struct tm mod_time; + localtime_r(&file_item->mtime, &mod_time); + sprintf(string, "%04d.%02d.%02d %02d:%02d:%02d", + mod_time.tm_year+1900, mod_time.tm_mon+1, mod_time.tm_mday, + mod_time.tm_hour, mod_time.tm_min, mod_time.tm_sec); new_item = new BC_ListBoxItem(string, get_resources()->file_color); } else diff --git a/cinelerra-5.1/guicast/bctheme.C b/cinelerra-5.1/guicast/bctheme.C index b79988c0..c587ed25 100644 --- a/cinelerra-5.1/guicast/bctheme.C +++ b/cinelerra-5.1/guicast/bctheme.C @@ -471,7 +471,7 @@ int BC_Theme::images_cmpr(const void *ap, const void *bp) unsigned char* BC_Theme::get_image_data(const char *name, int log_errs) { // Image is the same as the last one - if( last_image_data && !strcasecmp(last_image_data->name, name) ) + if( last_image_data && !strcmp(last_image_data->name, name) ) return last_image_data->data; // look forwards thru data sets for name @@ -484,7 +484,7 @@ unsigned char* BC_Theme::get_image_data(const char *name, int log_errs) while( r-l > 1 ) { m = (l + r) / 2; BC_ImageData *image_data = images[m]; - if( !(v=strcasecmp(name, image_data->name)) ) { + if( !(v=strcmp(name, image_data->name)) ) { image_data->used = 1; last_image_data = image_data; return image_data->data; diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C index c5829696..1d0aee88 100644 --- a/cinelerra-5.1/guicast/filesystem.C +++ b/cinelerra-5.1/guicast/filesystem.C @@ -44,8 +44,7 @@ FileItem::FileItem() } FileItem::FileItem(char *path, char *name, int is_dir, - int64_t size, int month, int day, int year, - int64_t calendar_time, int item_no) + int64_t size, time_t mtime, int item_no) { this->path = new char[strlen(path)]; this->name = new char[strlen(name)]; @@ -53,10 +52,7 @@ FileItem::FileItem(char *path, char *name, int is_dir, if(this->name) strcpy(this->name, name); this->is_dir = is_dir; this->size = size; - this->month = month; - this->day = day; - this->year = year; - this->calendar_time = calendar_time; + this->mtime = mtime; this->item_no = item_no; } @@ -73,10 +69,7 @@ int FileItem::reset() name = 0; is_dir = 0; size = 0; - month = 0; - day = 0; - year = 0; - calendar_time = 0; + mtime = 0; item_no = -1; return 0; } @@ -206,18 +199,18 @@ int FileSystem::date_ascending(const void *ptr1, const void *ptr2) { FileItem *item1 = *(FileItem**)ptr1; FileItem *item2 = *(FileItem**)ptr2; - return item1->calendar_time == item2->calendar_time ? + return item1->mtime == item2->mtime ? item1->item_no - item2->item_no : - item1->calendar_time > item2->calendar_time; + item1->mtime > item2->mtime; } int FileSystem::date_descending(const void *ptr1, const void *ptr2) { FileItem *item1 = *(FileItem**)ptr1; FileItem *item2 = *(FileItem**)ptr2; - return item2->calendar_time == item1->calendar_time ? + return item2->mtime == item1->mtime ? item2->item_no - item1->item_no : - item2->calendar_time > item1->calendar_time; + item2->mtime > item1->mtime; } int FileSystem::ext_ascending(const void *ptr1, const void *ptr2) @@ -449,11 +442,7 @@ int FileSystem::scan_directory(const char *new_dir) if(!stat(full_path, &ostat)) { new_file->size = ostat.st_size; - struct tm *mod_time = localtime(&(ostat.st_mtime)); - new_file->month = mod_time->tm_mon + 1; - new_file->day = mod_time->tm_mday; - new_file->year = mod_time->tm_year + 1900; - new_file->calendar_time = ostat.st_mtime; + new_file->mtime = ostat.st_mtime; if(S_ISDIR(ostat.st_mode)) { diff --git a/cinelerra-5.1/guicast/filesystem.h b/cinelerra-5.1/guicast/filesystem.h index 7226c11e..75110c6a 100644 --- a/cinelerra-5.1/guicast/filesystem.h +++ b/cinelerra-5.1/guicast/filesystem.h @@ -31,8 +31,7 @@ class FileItem public: FileItem(); FileItem(char *path, char *name, int is_dir, - int64_t size, int month, int day, int year, - int64_t calendar_time, int item_no=-1); + int64_t size, time_t mtime, int item_no=-1); ~FileItem(); int set_path(char *path); @@ -47,10 +46,7 @@ public: char *name; int is_dir; int64_t size; - int month; - int day; - int year; - int64_t calendar_time; + time_t mtime; int item_no; }; diff --git a/cinelerra-5.1/plugins/chromakey/chromakey.C b/cinelerra-5.1/plugins/chromakey/chromakey.C index 73140371..fe52fec6 100644 --- a/cinelerra-5.1/plugins/chromakey/chromakey.C +++ b/cinelerra-5.1/plugins/chromakey/chromakey.C @@ -687,11 +687,11 @@ int ChromaKey::handle_opengl() "}\n"; static const char *get_rgbvalue_frag = - "uniform mat3 rgb_to_yuv_matrix;\n" + "uniform vec3 rgb_to_y_vector;\n" "uniform float yminf;\n" "float get_value(vec4 color)\n" "{\n" - " return dot(color.rgb, rgb_to_yuv_matrix[0]) + yminf;\n" + " return dot(color.rgb, rgb_to_y_vector) + yminf;\n" "}\n"; static const char *value_frag = @@ -784,7 +784,7 @@ SET_TRACE glUniform3f(glGetUniformLocation(shader, "key"), (float)y_key / 0xff, (float)u_key / 0xff, (float)v_key / 0xff); if(config.use_value) - BC_GL_RGB_TO_YUV(shader); + BC_GL_RGB_TO_Y(shader); } SET_TRACE diff --git a/cinelerra-5.1/plugins/diffkey/diffkey.C b/cinelerra-5.1/plugins/diffkey/diffkey.C index 9ce891ea..2f24a587 100644 --- a/cinelerra-5.1/plugins/diffkey/diffkey.C +++ b/cinelerra-5.1/plugins/diffkey/diffkey.C @@ -452,8 +452,8 @@ int DiffKey::handle_opengl() static const char *rgb_value = " float difference = abs(" - " dot(foreground.rgb, rgb_to_yuv_matrix[0]) - " - " dot(background.rgb, rgb_to_yuv_matrix[0]));\n"; + " dot(foreground.rgb, rgb_to_y_vector) - " + " dot(background.rgb, rgb_to_y_vector));\n"; static const char *diffkey_tail = " vec4 result;\n" @@ -468,22 +468,28 @@ int DiffKey::handle_opengl() " gl_FragColor = result;\n" "}\n"; - top_frame->enable_opengl(); - top_frame->init_screen(); - top_frame->to_texture(); bottom_frame->to_texture(); top_frame->enable_opengl(); top_frame->init_screen(); - int need_color_matrix = 0; + const char *shader_stack[16]; + memset(shader_stack,0, sizeof(shader_stack)); + int current_shader = 0; + + int need_rgb_to_y = 0; const char *shader_frag = !config.do_value ? colorcube : BC_CModels::is_yuv(top_frame->get_color_model()) ? - yuv_value : (need_color_matrix = 1, rgb_value); - - unsigned int shader = VFrame::make_shader(0, - diffkey_head, shader_frag, diffkey_tail, 0); + yuv_value : (need_rgb_to_y = 1, rgb_value); + if( need_rgb_to_y ) + shader_stack[current_shader++] = bc_gl_rgb_to_y; + shader_stack[current_shader++] = diffkey_head; + shader_stack[current_shader++] = shader_frag; + shader_stack[current_shader++] = diffkey_tail; + + shader_stack[current_shader] = 0; + unsigned int shader = VFrame::make_shader(shader_stack); DIFFKEY_VARS(this) bottom_frame->bind_texture(1); @@ -496,8 +502,8 @@ int DiffKey::handle_opengl() glUniform1f(glGetUniformLocation(shader, "threshold"), threshold); glUniform1f(glGetUniformLocation(shader, "pad"), pad); glUniform1f(glGetUniformLocation(shader, "threshold_pad"), threshold_pad); - if( need_color_matrix ) - BC_GL_MATRIX(shader, rgb_to_yuv_matrix); + if( need_rgb_to_y ) + BC_GL_MATRIX(shader, rgb_to_y_vector); } if(BC_CModels::components(get_output()->get_color_model()) == 3) @@ -511,10 +517,8 @@ int DiffKey::handle_opengl() glUseProgram(0); top_frame->set_opengl_state(VFrame::SCREEN); glDisable(GL_BLEND); - -// does not work, fails in playback3d // Fastest way to discard output -// bottom_frame->set_opengl_state(VFrame::TEXTURE); + bottom_frame->set_opengl_state(VFrame::UNKNOWN); // kludge ahead top_frame->screen_to_ram(); diff --git a/cinelerra-5.1/plugins/theme_blond/blondtheme.C b/cinelerra-5.1/plugins/theme_blond/blondtheme.C index 31d29f89..de0343ba 100644 --- a/cinelerra-5.1/plugins/theme_blond/blondtheme.C +++ b/cinelerra-5.1/plugins/theme_blond/blondtheme.C @@ -661,7 +661,7 @@ void BlondTheme::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - new_toggle("histogram.png", + new_toggle("histogram_toggle.png", editpanel_up, editpanel_hi, editpanel_checked, diff --git a/cinelerra-5.1/plugins/theme_blond/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_blond/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blond/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C index 52951ba5..6c7a0732 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C @@ -672,6 +672,44 @@ void BlondCVTheme::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); + new_toggle("histogram_toggle.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "histogram_toggle"); + new_toggle("histogram_rgb.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "histogram_rgb_toggle"); + new_toggle("waveform.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "waveform_toggle"); + new_toggle("waveform_rgb.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "waveform_rgb_toggle"); + new_toggle("scope.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "scope_toggle"); + + new_button("picture.png", editpanel_up, editpanel_hi, editpanel_dn, "picture"); + new_button("histogram_img.png", editpanel_up, editpanel_hi, editpanel_dn, "histogram_img"); //bottom_justify = new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn); //center_justify = new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn); diff --git a/cinelerra-5.1/plugins/theme_blond_cv/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_blond_cv/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blond_cv/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_blue/bluetheme.C b/cinelerra-5.1/plugins/theme_blue/bluetheme.C index 33a3fb87..c66ff351 100644 --- a/cinelerra-5.1/plugins/theme_blue/bluetheme.C +++ b/cinelerra-5.1/plugins/theme_blue/bluetheme.C @@ -661,7 +661,7 @@ void BlueDotTheme::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - new_toggle("histogram.png", + new_toggle("histogram_toggle.png", editpanel_up, editpanel_hi, editpanel_checked, @@ -700,7 +700,6 @@ void BlueDotTheme::initialize() new_button("picture.png", editpanel_up, editpanel_hi, editpanel_dn, "picture"); new_button("histogram_img.png", editpanel_up, editpanel_hi, editpanel_dn, "histogram_img"); - new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy"); new_button("commercial.png", editpanel_up, editpanel_hi, editpanel_dn, "commercial"); new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut"); diff --git a/cinelerra-5.1/plugins/theme_blue/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_blue/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C index 260afb7e..b2cb0e7b 100644 --- a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C +++ b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C @@ -698,6 +698,44 @@ void BlueDotTheme::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); + new_toggle("histogram_toggle.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "histogram_toggle"); + new_toggle("histogram_rgb.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "histogram_rgb_toggle"); + new_toggle("waveform.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "waveform_toggle"); + new_toggle("waveform_rgb.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "waveform_rgb_toggle"); + new_toggle("scope.png", + editpanel_up, + editpanel_hi, + editpanel_checked, + editpanel_dn, + editpanel_checkedhi, + "scope_toggle"); + + new_button("picture.png", editpanel_up, editpanel_hi, editpanel_dn, "picture"); + new_button("histogram_img.png", editpanel_up, editpanel_hi, editpanel_dn, "histogram_img"); new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy"); new_button("commercial.png", editpanel_up, editpanel_hi, editpanel_dn, "commercial"); diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checked.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checked.png new file mode 100644 index 00000000..8e5840a9 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checked.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checkedhi.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checkedhi.png new file mode 100644 index 00000000..1fcfff69 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checkedhi.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_dn.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_dn.png new file mode 100644 index 00000000..0fb61fb1 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_dn.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_hi.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_hi.png new file mode 100644 index 00000000..81d78997 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_hi.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_up.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_up.png new file mode 100644 index 00000000..cfd43b2f Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_up.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_img.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_img.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_img.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_rgb.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_rgb.png new file mode 100644 index 00000000..a68050a1 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_rgb.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/picture.png b/cinelerra-5.1/plugins/theme_blue_dot/data/picture.png new file mode 100644 index 00000000..c634d408 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/picture.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/scope.png b/cinelerra-5.1/plugins/theme_blue_dot/data/scope.png new file mode 100644 index 00000000..bef250d8 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/scope.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/waveform.png b/cinelerra-5.1/plugins/theme_blue_dot/data/waveform.png new file mode 100644 index 00000000..fb81e31a Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/waveform.png differ diff --git a/cinelerra-5.1/plugins/theme_blue_dot/data/waveform_rgb.png b/cinelerra-5.1/plugins/theme_blue_dot/data/waveform_rgb.png new file mode 100644 index 00000000..c529ce15 Binary files /dev/null and b/cinelerra-5.1/plugins/theme_blue_dot/data/waveform_rgb.png differ diff --git a/cinelerra-5.1/plugins/theme_bright/brighttheme.C b/cinelerra-5.1/plugins/theme_bright/brighttheme.C index 1bfb1666..9e02df4a 100644 --- a/cinelerra-5.1/plugins/theme_bright/brighttheme.C +++ b/cinelerra-5.1/plugins/theme_bright/brighttheme.C @@ -667,7 +667,7 @@ void BrightTheme::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - new_toggle("histogram.png", + new_toggle("histogram_toggle.png", editpanel_up, editpanel_hi, editpanel_checked, diff --git a/cinelerra-5.1/plugins/theme_bright/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_bright/data/histogram_toggle.png new file mode 100644 index 00000000..c07d97dd Binary files /dev/null and b/cinelerra-5.1/plugins/theme_bright/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_hulk/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_hulk/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_hulk/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C index 518a2ccc..f05a9829 100644 --- a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C +++ b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C @@ -662,7 +662,7 @@ void HULKTHEME::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - new_toggle("histogram.png", + new_toggle("histogram_toggle.png", editpanel_up, editpanel_hi, editpanel_checked, diff --git a/cinelerra-5.1/plugins/theme_pinklady/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_pinklady/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_pinklady/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C index 321ec319..094796ad 100644 --- a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C +++ b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C @@ -647,7 +647,7 @@ void PINKLADY::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - new_toggle("histogram.png", + new_toggle("histogram_toggle.png", editpanel_up, editpanel_hi, editpanel_checked, diff --git a/cinelerra-5.1/plugins/theme_suv/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_suv/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_suv/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_suv/suv.C b/cinelerra-5.1/plugins/theme_suv/suv.C index e294c888..5f66b154 100644 --- a/cinelerra-5.1/plugins/theme_suv/suv.C +++ b/cinelerra-5.1/plugins/theme_suv/suv.C @@ -649,7 +649,7 @@ void SUV::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - new_toggle("histogram.png", + new_toggle("histogram_toggle.png", editpanel_up, editpanel_hi, editpanel_checked, diff --git a/cinelerra-5.1/plugins/theme_unflat/data/histogram_toggle.png b/cinelerra-5.1/plugins/theme_unflat/data/histogram_toggle.png new file mode 100644 index 00000000..0f7da6eb Binary files /dev/null and b/cinelerra-5.1/plugins/theme_unflat/data/histogram_toggle.png differ diff --git a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C index 26859167..3273ed89 100644 --- a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C +++ b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C @@ -656,7 +656,7 @@ void UNFLATTHEME::initialize() new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify"); new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel"); - new_toggle("histogram.png", + new_toggle("histogram_toggle.png", editpanel_up, editpanel_hi, editpanel_checked, diff --git a/cinelerra-5.1/plugins/threshold/threshold.C b/cinelerra-5.1/plugins/threshold/threshold.C index 09a3680b..13231b6e 100644 --- a/cinelerra-5.1/plugins/threshold/threshold.C +++ b/cinelerra-5.1/plugins/threshold/threshold.C @@ -259,12 +259,12 @@ int ThresholdMain::handle_opengl() "uniform vec4 low_color;\n" "uniform vec4 mid_color;\n" "uniform vec4 high_color;\n" - "uniform mat3 rgb_to_yuv_matrix;\n" + "uniform vec3 rgb_to_y_vector;\n" "uniform float yminf;\n" "void main()\n" "{\n" " vec4 pixel = texture2D(tex, gl_TexCoord[0].st);\n" - " float v = dot(pixel.rgb, rgb_to_yuv_matrix[0]) + yminf;\n" + " float v = dot(pixel.rgb, rgb_to_y_vector) + yminf;\n" " if(v < min)\n" " pixel = low_color;\n" " else if(v < max)\n" @@ -356,7 +356,7 @@ int ThresholdMain::handle_opengl() (float)config.high_color.g / 0xff, (float)config.high_color.b / 0xff, has_alpha ? (float)config.high_color.a / 0xff : 1.0); - BC_GL_RGB_TO_YUV(shader); + BC_GL_RGB_TO_Y(shader); } }