From a6369311556cc1e1877142181d8606e4f68aa803 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Thu, 7 Dec 2017 19:09:01 -0700 Subject: [PATCH] opengl dot() fix, add file dates, sort file name/time, fix icon image lookup, sync icon pngs, diffkey tweaks --- cinelerra-5.1/cinelerra/assetpopup.C | 32 +++++++++--- cinelerra-5.1/cinelerra/assetpopup.h | 18 +++++-- cinelerra-5.1/cinelerra/awindowgui.C | 47 +++++++++++------- cinelerra-5.1/cinelerra/awindowgui.h | 6 +-- cinelerra-5.1/cinelerra/clippopup.C | 2 +- cinelerra-5.1/cinelerra/playback3d.h | 18 +++++-- cinelerra-5.1/cinelerra/vattachmentpoint.C | 6 ++- cinelerra-5.1/guicast/bccolors.C | 11 ++-- cinelerra-5.1/guicast/bccolors.h | 6 ++- cinelerra-5.1/guicast/bcfilebox.C | 14 ++---- cinelerra-5.1/guicast/bctheme.C | 4 +- cinelerra-5.1/guicast/filesystem.C | 27 +++------- cinelerra-5.1/guicast/filesystem.h | 8 +-- cinelerra-5.1/plugins/chromakey/chromakey.C | 6 +-- cinelerra-5.1/plugins/diffkey/diffkey.C | 34 +++++++------ .../plugins/theme_blond/blondtheme.C | 2 +- .../theme_blond/data/histogram_toggle.png | Bin 0 -> 259 bytes .../plugins/theme_blond_cv/blondcvtheme.C | 38 ++++++++++++++ .../theme_blond_cv/data/histogram_toggle.png | Bin 0 -> 259 bytes cinelerra-5.1/plugins/theme_blue/bluetheme.C | 3 +- .../theme_blue/data/histogram_toggle.png | Bin 0 -> 259 bytes .../plugins/theme_blue_dot/bluedottheme.C | 38 ++++++++++++++ .../data/histogram_carrot_checked.png | Bin 0 -> 218 bytes .../data/histogram_carrot_checkedhi.png | Bin 0 -> 218 bytes .../data/histogram_carrot_dn.png | Bin 0 -> 217 bytes .../data/histogram_carrot_hi.png | Bin 0 -> 218 bytes .../data/histogram_carrot_up.png | Bin 0 -> 218 bytes .../theme_blue_dot/data/histogram_img.png | Bin 0 -> 259 bytes .../theme_blue_dot/data/histogram_rgb.png | Bin 0 -> 286 bytes .../theme_blue_dot/data/histogram_toggle.png | Bin 0 -> 259 bytes .../plugins/theme_blue_dot/data/picture.png | Bin 0 -> 378 bytes .../plugins/theme_blue_dot/data/scope.png | Bin 0 -> 377 bytes .../plugins/theme_blue_dot/data/waveform.png | Bin 0 -> 278 bytes .../theme_blue_dot/data/waveform_rgb.png | Bin 0 -> 321 bytes .../plugins/theme_bright/brighttheme.C | 2 +- .../theme_bright/data/histogram_toggle.png | Bin 0 -> 229 bytes .../theme_hulk/data/histogram_toggle.png | Bin 0 -> 259 bytes cinelerra-5.1/plugins/theme_hulk/hulktheme.C | 2 +- .../theme_pinklady/data/histogram_toggle.png | Bin 0 -> 259 bytes .../plugins/theme_pinklady/pinkladytheme.C | 2 +- .../theme_suv/data/histogram_toggle.png | Bin 0 -> 259 bytes cinelerra-5.1/plugins/theme_suv/suv.C | 2 +- .../theme_unflat/data/histogram_toggle.png | Bin 0 -> 259 bytes .../plugins/theme_unflat/unflattheme.C | 2 +- cinelerra-5.1/plugins/threshold/threshold.C | 6 +-- 45 files changed, 228 insertions(+), 108 deletions(-) create mode 100644 cinelerra-5.1/plugins/theme_blond/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_blond_cv/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_blue/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checked.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_checkedhi.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_dn.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_hi.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_carrot_up.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_img.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_rgb.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/picture.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/scope.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/waveform.png create mode 100644 cinelerra-5.1/plugins/theme_blue_dot/data/waveform_rgb.png create mode 100644 cinelerra-5.1/plugins/theme_bright/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_hulk/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_pinklady/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_suv/data/histogram_toggle.png create mode 100644 cinelerra-5.1/plugins/theme_unflat/data/histogram_toggle.png 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 0000000000000000000000000000000000000000..0f7da6ebc00ab64144063ac8f0a69326fb6cb356 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hQL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hQL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hQK$!8;-MT+OLG}_)Usv|qoE#i-;;J0ai-1B=o-U3d8t0P} z4ltL!`}0M9zKyV5uT8nJoyUv!K%2m4-R&rZ&bLI1M{{O{wvyvBBGcahVo41RsTJr{I3xlVtpUXO@ GgeCxuzDYI! literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1fcfff697f81ce7b383f5671c6e9fae4cc60e74f GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^{2QK$!8;-MT+OLG}_)Usv|qoE#i-dR4snRY0LAPZ!4!jq}L~ z2blBj|NJOF-$vN3H|M&yWZ1e}-{+^CJ;LBtv+dA<&i9Qx4-@@*wrrKW8&&PW$}U+Wy~s>++t)cMJ^koGl+eXun+!w1vUb)z4*} HQ$iB}n7U60 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..0fb61fb135ddb5e57da04c93d962543345e4bd2c GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^{2QK$!8;-MT+OLG}_)Usv|qoE#jI%HDrlfg%i%o-U3d8t0P} z4ltK|&H49ua{8g=fdK(?9UW6&*H1DPW|sJPlZ&~39-E=fj>l&`qGw;sJ(_O)HRo8W zw%+ZP$;OJ&8*lpUJbUC;SDtmM+3Qy~|NQ^6c2eUz28PL3)vLa>^>%@5@pScbS?83{ F1OVm`O|$?2 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..81d789971a55760f6ea3464e595757e2e219e3d3 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^{2QK$!8;-MT+OLG}_)Usv|qoE#id5*KgVKL-j$dAc};Xq-<@ zIKZ5D|K~^f`8L9Kz3b!bk|K6y-LIcyD$FeL@g^6u|2(@y4*ue#C2P;V*!F1i+$yuj zn?$F-y|QuUgta$vmfuNB%5~j7*JyS=(2W0gb|&+burtWqcXbo_wBS0>76wmOKbLh* G2~7ZNy-nx< literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..cfd43b2ff7fada4d7146a8718cb53bbc8a4b2a67 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^{2QK$!8;-MT+OLG}_)Usv|qoE#i7JaeOcWPn0Zo-U3d8t0P} z4ltL!`}0M9zKyV5?{t0n)Q-M&Km0ePB{3-5MJGP^^Rt=9dwQ9{rE6&=(I0R6+0HJ! z*>$??)eWB$VL97^^NcrcTXfrR=2`3Vx?lS<0;QSnGBWgkbXpLqC;km+3xlVtpUXO@ GgeCyy;Y*QL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hwc z6hbmm72G|21Ky{o<^dJ9d%8G=cpQH_)tc*o0gv<23%}zdWxb{c1phQXmffTBgq`tR zid(}R+4T2wO=TD4Z0O#dwtDg%!<}k*ObjePzMjiF-l(zI!syqet>Ftbl;@b=IBMz< zsIg4V^_%a!)Bl1)URoUJ2$VVO@adbDh-wQr+wL7~np{V(EIF}{li|XG6&DH{1kZoZ bJQL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hQL70(Y)*O%l>?NMQuI#rtqDxO@5ryiZZh11h}e>EamTas2I6TR&z)fmVBKzb%h7 zj5{w~cp_4uFl)-34&{r59C{9p8^7_nnr(3G7GMo{kZ$|)`OP~2GQ$fWWG#NU+r>WI z{Py9oNc;1$A79S>xZK&iIqd?^zgEXj{w)Cu|69e+^2`pqhMcy2N!u6<+XkaSZV|{x;N+ui1cSvvS{@%4qq+ zh5a{gTNHoiyR4?+>#V&j^HPzM#ztZD(#CjxH_k~RtO_^J$~DeE`%>$Qtkq<1{y8cO zKSrLIDrdo9(D;6qjt&d^hTrFu8JSo%S#-8O5Y3#>$3AZ|PwGRnNqbJ1WPP`PTT*6z z@{wztsX23U<*He|* zzbrHSzUax_bEVhk99R?^ak4H}D4mP{kCF7h8L9KDChYsQ=r1#aT*&8{MHxz-7lD3b N@O1TaS?83{1ONa^hsXc` literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..fb81e31af3fea825d5225ef6aeecc6a9768ff22b GIT binary patch literal 278 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*O%l>?NMQuI#rtd0EBe@9?x~0)=EtTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0Tt$Yx;Tb-9Df_^$aO%0$2e8~^y%Lw zkcT?B$c)`gq~0*wEeOa@r3kDtE>*Z|qwCQL70(Y)*O%l>?NMQuI#rtd08d+H0--WfkLt+t`Q~9`MJ5N zc_j?aMX8A;sVNHOnI#ztAsML(?w-B@?^9IsfC^`Lx;Tb-9Dh66oA0mzhfC$&|8rk1 znmS3T&F4L2z!o@8`^NCRt*FWBihXWe8Z*e+{8a~O2yW4ME5F&Jt z#ZEY7qxbqB8DCBD!6<42E0#E%>yd*^K@|x@i_iA*pZJxfg|YO|MV({_GKrFyw~M1HKjExMC=vF zI{KDF!dCf8q+=|@3hD3u-7{>1x!L#3v@ds1Wz?=a)GfMuR>Ey<{>p+QOqVM7MHD|q REd`p);OXk;vd$@?2>^uAMB)Gd literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..0f7da6ebc00ab64144063ac8f0a69326fb6cb356 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hQL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hQL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;hQL70(Y)*O%l>?NMQuI#rtWY}d4bxPKG0EJ{rTq8=H^K)}k z^GX<;i&7IyQd1PlGfOfQLNZbn+&z5*-lwSM0To7hx;Tb-9Df_)$j6|-p;h