add VFrameJpeg for shapewipe shapes, switch to jpeg for shapes, cam/prjr x,y,z range...
authorGood Guy <[email protected]>
Sat, 4 Apr 2020 01:08:31 +0000 (19:08 -0600)
committerGood Guy <[email protected]>
Sat, 4 Apr 2020 01:08:31 +0000 (19:08 -0600)
122 files changed:
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/cwindowtool.C
cinelerra-5.1/cinelerra/editpanel.C
cinelerra-5.1/cinelerra/localsession.C
cinelerra-5.1/cinelerra/localsession.h
cinelerra-5.1/cinelerra/theme.C
cinelerra-5.1/expanders.es
cinelerra-5.1/expanders.txt
cinelerra-5.1/guicast/vframe.C
cinelerra-5.1/guicast/vframe.h
cinelerra-5.1/plugins/shapes/16-9_boart.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_boxes.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_cat_eyes.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_film_bands.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_multi_circle.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_multi_spiral.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_multi_square.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_rare_spiral.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_rectangles.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_star.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_stars.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/16-9_wood.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Butterfly.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Butterfly.png [deleted file]
cinelerra-5.1/plugins/shapes/Cinelerra16-9-Heavy.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Cinelerra16-9-Light.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/CinelerraGG.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Circle-h_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Circle-h_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Circle-h_02.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Circle-h_02.png [deleted file]
cinelerra-5.1/plugins/shapes/Circle-v_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Circle-v_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Circle-v_02.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Circle-v_02.png [deleted file]
cinelerra-5.1/plugins/shapes/Clouds_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Clouds_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Clouds_02.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Clouds_02.png [deleted file]
cinelerra-5.1/plugins/shapes/Cross-Iris_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Cross-Iris_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Cross_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Cross_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Diagonal-Curve.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Diagonal-Curve.png [deleted file]
cinelerra-5.1/plugins/shapes/Diagonal-Linear.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Diagonal-Linear.png [deleted file]
cinelerra-5.1/plugins/shapes/Diamond-Iris_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Diamond-Iris_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Diamond_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Diamond_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Diamond_02.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Diamond_02.png [deleted file]
cinelerra-5.1/plugins/shapes/Diamond_03.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Diamond_03.png [deleted file]
cinelerra-5.1/plugins/shapes/Double-Door-h.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Double-Door-h.png [deleted file]
cinelerra-5.1/plugins/shapes/Double-Door-v.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Double-Door-v.png [deleted file]
cinelerra-5.1/plugins/shapes/Gravity.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Gravity.png [deleted file]
cinelerra-5.1/plugins/shapes/Linear-h.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Linear-h.png [deleted file]
cinelerra-5.1/plugins/shapes/Linear-v.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Linear-v.png [deleted file]
cinelerra-5.1/plugins/shapes/Plasma_01.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Plasma_01.png [deleted file]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.png [deleted file]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.png [deleted file]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.png [deleted file]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.png [deleted file]
cinelerra-5.1/plugins/shapes/asimetric_clocks.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/asimetric_clocks_2.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/asymmetric_clocks.png [deleted file]
cinelerra-5.1/plugins/shapes/audio.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/audio.png [deleted file]
cinelerra-5.1/plugins/shapes/burst.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/burst.png [deleted file]
cinelerra-5.1/plugins/shapes/circle.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/circle.png [deleted file]
cinelerra-5.1/plugins/shapes/clock.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/clock.png [deleted file]
cinelerra-5.1/plugins/shapes/crazy_clock.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/crazy_clock.png [deleted file]
cinelerra-5.1/plugins/shapes/cream.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/cream.png [deleted file]
cinelerra-5.1/plugins/shapes/film.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/film.png [deleted file]
cinelerra-5.1/plugins/shapes/film2.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/heart.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/heart.png [deleted file]
cinelerra-5.1/plugins/shapes/mosaic.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/mosaic.png [deleted file]
cinelerra-5.1/plugins/shapes/multi_box.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/multi_box.png [deleted file]
cinelerra-5.1/plugins/shapes/rare_spiral.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/rare_spiral.png [deleted file]
cinelerra-5.1/plugins/shapes/specks.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/specks.png [deleted file]
cinelerra-5.1/plugins/shapes/spiral.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/spiral.png [deleted file]
cinelerra-5.1/plugins/shapes/spiral_clock.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/spiral_clock.png [deleted file]
cinelerra-5.1/plugins/shapes/square.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/square.png [deleted file]
cinelerra-5.1/plugins/shapes/squares.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/squares.png [deleted file]
cinelerra-5.1/plugins/shapes/star.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/star.png [deleted file]
cinelerra-5.1/plugins/shapes/tile2x2h.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/tile2x2h.png [deleted file]
cinelerra-5.1/plugins/shapes/tile2x2v.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapes/tile2x2v.png [deleted file]
cinelerra-5.1/plugins/shapes/water.jpg [new file with mode: 0644]
cinelerra-5.1/plugins/shapewipe/shapewipe.C
cinelerra-5.1/plugins/shapewipe/shapewipe.h
cinelerra-5.1/plugins/titler/titlerwindow.C
cinelerra-5.1/thirdparty/downloads.txt

index beac0f8184b22e87b9538b2781b7573a56c03a44..1aff4d6c172fa10c3c27cf3aedd2dd7c2c83c557 100644 (file)
@@ -58,6 +58,7 @@
 #include "tracks.h"
 #include "transportque.h"
 #include "vtrack.h"
+#include "zoombar.h"
 
 
 static double my_zoom_table[] =
@@ -2632,6 +2633,11 @@ void CWindowCanvas::reset_keyframe(int do_camera)
                z_keyframe->set_value(1);
 
                gui->sync_parameters(CHANGE_PARAMS, 1, 1);
+               MWindowGUI *mgui = mwindow->gui;
+               mgui->lock_window("CWindowCanvas::reset_keyframe");
+               gui->mwindow->edl->local_session->reset_view_limits();
+               gui->mwindow->gui->zoombar->update_autozoom();
+               mgui->unlock_window();
        }
 }
 
index 8370ab97167c705e9aef302452c8ac8e3fa31407..f3fd68e330660b86d1d207f78ed20d2244c38a2c 100644 (file)
@@ -436,6 +436,7 @@ CWindowCoordRange::~CWindowCoordRange()
 
 int CWindowCoordRange::update(float scale)
 {
+       CWindowCoordSlider *slider = coord->slider;
        MWindow *mwindow = coord->gui->mwindow;
        LocalSession *local_session = mwindow->edl->local_session;
        int group = Automation::autogrouptype(coord->type, 0);
@@ -448,22 +449,24 @@ int CWindowCoordRange::update(float scale)
                case AUTOGROUPTYPE_Y:    min = -100;   max = 100;  break;
                }
        }
-       float range = max - min;
-       min -= range * scale;
-       max += range * scale;
        switch( group ) {
-       case AUTOGROUPTYPE_ZOOM:
+       case AUTOGROUPTYPE_ZOOM: { // exp
+               float lv = log(slider->get_value());
+               float lmin = log(min), lmax = log(max);
+               float lr = (lmax - lmin) * scale;
+               min = exp(lv - 0.5*lr);
+               max = exp(lv + 0.5*lr);
                if( min < 0.001 ) min = 0.001;
                if( max > 1000. ) max = 1000.;
-               break;
+               break; }
        case AUTOGROUPTYPE_X:
-       case AUTOGROUPTYPE_Y:
-               if( min < -32767 ) min = -32767;
-               if( max >  32767 ) max =  32767;
-               break;
+       case AUTOGROUPTYPE_Y: { // linear
+               float dr = (max - min) * (scale-1);
+               if( (min -= dr) < -32767 ) min = -32767;
+               if( (max += dr) >  32767 ) max =  32767;
+               break; }
        }
-       CWindowCoordSlider *slider = coord->slider;
-       coord->slider->update(slider->get_pointer_motion_range(),
+       slider->update(slider->get_pointer_motion_range(),
                        slider->get_value(), min, max);
        unlock_window();
        MWindowGUI *mgui = mwindow->gui;
@@ -482,11 +485,11 @@ int CWindowCoordRange::update(float scale)
 
 int CWindowCoordRange::handle_up_event()
 {
-       return update(0.5);
+       return update(1.25);
 }
 int CWindowCoordRange::handle_down_event()
 {
-       return update(-0.25);
+       return update(0.8);
 }
 
 CWindowCropApply::CWindowCropApply(MWindow *mwindow, CWindowCropGUI *crop_gui, int x, int y)
index 8523028966ba8ffc41319ac55ddccc24bb9d9f39..33dcded589afab15b4f9c58868f82557976c4fb9 100644 (file)
@@ -259,16 +259,6 @@ void EditPanel::create_buttons()
                x1 += paste->get_w();
        }
 
-       if( use_meters ) {
-               if( meter_panel ) {
-                       meters = new MeterShow(mwindow, meter_panel, x1, y1);
-                       subwindow->add_subwindow(meters);
-                       x1 += meters->get_w();
-               }
-               else
-                       printf("EditPanel::create_objects: meter_panel == 0\n");
-       }
-
        if( use_labels ) {
                labelbutton = new EditLabelbutton(mwindow, this, x1, y1);
                subwindow->add_subwindow(labelbutton);
@@ -328,6 +318,16 @@ void EditPanel::create_buttons()
                scope_dialog = new EditPanelScopeDialog(mwindow, this);
        }
 
+       if( use_meters ) {
+               if( meter_panel ) {
+                       meters = new MeterShow(mwindow, meter_panel, x1, y1);
+                       subwindow->add_subwindow(meters);
+                       x1 += meters->get_w();
+               }
+               else
+                       printf("EditPanel::create_objects: meter_panel == 0\n");
+       }
+
        if( use_commercial ) {
                commercial = new EditCommercial(mwindow, this, x1, y1);
                subwindow->add_subwindow(commercial);
@@ -393,11 +393,6 @@ void EditPanel::reposition_buttons(int x, int y)
                x1 += paste->get_w();
        }
 
-       if( use_meters ) {
-               meters->reposition_window(x1, y1);
-               x1 += meters->get_w();
-       }
-
        if( use_labels ) {
                labelbutton->reposition_window(x1, y1);
                x1 += labelbutton->get_w();
@@ -443,6 +438,11 @@ void EditPanel::reposition_buttons(int x, int y)
                scope->reposition_window(x1, y1-yS(1));
                x1 += scope->get_w();
        }
+
+       if( use_meters ) {
+               meters->reposition_window(x1, y1);
+               x1 += meters->get_w();
+       }
 }
 
 void EditPanel::create_objects()
index 50837a135044536a7949a27a6fa6693880cdba46..e0e8efa87c4f2dfbc7de39d34e6c6061051aacc7 100644 (file)
@@ -80,24 +80,13 @@ LocalSession::LocalSession(EDL *edl)
                track_start[i] = 0;
        }
 
+       reset_view_limits();
        automation_mins[AUTOGROUPTYPE_AUDIO_FADE] = -80;
        automation_maxs[AUTOGROUPTYPE_AUDIO_FADE] = 6;
-
        automation_mins[AUTOGROUPTYPE_VIDEO_FADE] = 0;
        automation_maxs[AUTOGROUPTYPE_VIDEO_FADE] = 100;
-
-       automation_mins[AUTOGROUPTYPE_ZOOM] = 0.005;
-       automation_maxs[AUTOGROUPTYPE_ZOOM] = 5.000;
-
        automation_mins[AUTOGROUPTYPE_SPEED] = 0.005;
        automation_maxs[AUTOGROUPTYPE_SPEED] = 5.000;
-
-       automation_mins[AUTOGROUPTYPE_X] = -100;
-       automation_maxs[AUTOGROUPTYPE_X] = 100;
-
-       automation_mins[AUTOGROUPTYPE_Y] = -100;
-       automation_maxs[AUTOGROUPTYPE_Y] = 100;
-
        automation_mins[AUTOGROUPTYPE_INT255] = 0;
        automation_maxs[AUTOGROUPTYPE_INT255] = 255;
 
@@ -505,3 +494,13 @@ int LocalSession::outpoint_valid()
        return out_point >= 0;
 }
 
+void LocalSession::reset_view_limits()
+{
+       automation_mins[AUTOGROUPTYPE_ZOOM] = 0.005;
+       automation_maxs[AUTOGROUPTYPE_ZOOM] = 5.000;
+       automation_mins[AUTOGROUPTYPE_X] = -100;
+       automation_maxs[AUTOGROUPTYPE_X] = 100;
+       automation_mins[AUTOGROUPTYPE_Y] = -100;
+       automation_maxs[AUTOGROUPTYPE_Y] = 100;
+}
+
index d2b289458fbcba0880f61312b71c57605ff181dc..1fa25f0c16fd502a2819e2e5e4c0f5a1d929eff4 100644 (file)
@@ -67,6 +67,7 @@ public:
        void synchronize_params(LocalSession *that);
 
        void boundaries();
+       void reset_view_limits();
 
        EDL *edl;
 
index 71bb2399ae82e4d8672238f0f0cb1fdf4fb4411d..1700a5b371ea91257d4ae738d381aeb4174ef283 100644 (file)
@@ -735,28 +735,30 @@ SET_TRACE
 
 
                int buttons_h = get_image("rewind")->get_h() + widget_border;
+               int panel_y = mwindow->session->cwindow_h - buttons_h + yS(4);
                ctransport_x = widget_border;
-               ctransport_y = mwindow->session->cwindow_h - buttons_h - widget_border;
                if( ctransport_x + transport_w + widget_border +
                    edit_w + widget_border + zoom_w + widget_border +
                    division_w + status_w > cmeter_x ) {
-                       buttons_h += EditPanel::calculate_h(mwindow) + widget_border;
-                       cedit_x = widget_border;
-                       cedit_y = mwindow->session->cwindow_h - buttons_h;
+                       ctransport_y = panel_y;
                        czoom_x = ctransport_x + transport_w + widget_border;
-                       czoom_y = ctransport_y + widget_border;
+                       czoom_y = panel_y;
                        cstatus_x = xS(440);
-                       cstatus_y = cedit_y + yS(20);
+                       cstatus_y = panel_y - yS(2);
+                       int edit_h = EditPanel::calculate_h(mwindow) + widget_border;
+                       buttons_h += edit_h;  panel_y -= edit_h;
+                       cedit_x = widget_border;
+                       cedit_y = panel_y;
                }
                else {
                        ctransport_x = widget_border;
-                       ctransport_y = mwindow->session->cwindow_h - buttons_h;
+                       ctransport_y = panel_y;
                        cedit_x = ctransport_x + transport_w + widget_border;
-                       cedit_y = ctransport_y;
+                       cedit_y = panel_y;
                        czoom_x = cedit_x + edit_w + widget_border;
-                       czoom_y = cedit_y + widget_border;
+                       czoom_y = panel_y;
                        cstatus_x = czoom_x + zoom_w + division_w;
-                       cstatus_y = ctransport_y;
+                       cstatus_y = panel_y;
                }
                buttons_h += ctimebar_h;
 
@@ -930,27 +932,29 @@ void Theme::get_vwindow_sizes(VWindowGUI *gui)
        vcanvas_w = vmeter_x - vcanvas_x - widget_border;
 
        int buttons_h = get_image("rewind")->get_h() + widget_border;
+       int panel_y = mwindow->session->vwindow_h - buttons_h + yS(4);
        vtransport_x = widget_border;
-       vtransport_y = mwindow->session->vwindow_h - buttons_h - widget_border;
        if( vtransport_x + transport_w + widget_border +
            edit_w + widget_border + vtime_w + xS(40) + widget_border > vmeter_x ) {
-               buttons_h += EditPanel::calculate_h(mwindow) + widget_border;
-               vedit_x = widget_border;
-               vedit_y = mwindow->session->vwindow_h - buttons_h;
+               vtransport_y = panel_y;
                vzoom_x = vtransport_x + transport_w + widget_border;
-               vzoom_y = vtransport_y + widget_border;
-               vdivision_x = xS(280);
+               vzoom_y = panel_y;
+               vdivision_x = xS(320);
                vtime_x = vdivision_x;
-               vtime_y = vtransport_y + widget_border;;
+               vtime_y = panel_y;
+               int edit_h = EditPanel::calculate_h(mwindow) + widget_border;
+               buttons_h += edit_h;  panel_y -= edit_h;
+               vedit_x = widget_border;
+               vedit_y = panel_y;
        }
        else {
                vtransport_x = widget_border;
-               vtransport_y = mwindow->session->vwindow_h - buttons_h;
+               vtransport_y = panel_y;
                vedit_x = vtransport_x + transport_w + widget_border;
-               vedit_y = vtransport_y;
+               vedit_y = panel_y;
                vdivision_x = vedit_x + edit_w + division_w;
                vtime_x = vdivision_x + vtime_border;
-               vtime_y = vtransport_y + widget_border;;
+               vtime_y = panel_y;
        }
        buttons_h += vtimebar_h;
 
index 31c8a28eb9418377d0190022e553d138138f998d..4569ac8d72aa1e977e7111b070b713f982fba596 100644 (file)
@@ -68,6 +68,7 @@ Video Effects
                F_deshake
        - Desenfoque
                Blur
+               BoxBlur
                Edge
                Linear Blur
                Motion Blur
index 425026c7af67bea5f40bd20449db4087d37731b1..0ef0fd232a541b75886a6600c583c6d05ad2d974 100644 (file)
@@ -68,6 +68,7 @@ Video Effects
                F_deshake
        - Blur
                Blur
+               BoxBlur
                Edge
                Linear Blur
                Motion Blur
index 869bba0e9be05e0e7cd93d9baa2f6d3efd56a2a3..c1ff05237bfdc65c743d1330fb538d55fa583c87 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <errno.h>
 #include <png.h>
+#include <jpeglib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
@@ -782,8 +783,7 @@ int VFramePng::read_png(const unsigned char *data, long sz, double xscale, doubl
                if (src_color_model == PNG_COLOR_TYPE_GRAY && png_get_bit_depth(png_ptr, info_ptr) < 8)
                        png_set_expand(png_ptr);
 
-               if (src_color_model == PNG_COLOR_TYPE_GRAY ||
-                   src_color_model == PNG_COLOR_TYPE_GRAY_ALPHA)
+               if (src_color_model == PNG_COLOR_TYPE_GRAY_ALPHA)
                        png_set_gray_to_rgb(png_ptr);
 
                /* expand paletted or RGB images with transparency to full alpha channels
@@ -793,26 +793,22 @@ int VFramePng::read_png(const unsigned char *data, long sz, double xscale, doubl
                        png_set_expand(png_ptr);
                }
 
-               switch(src_color_model)
-               {
-                       case PNG_COLOR_TYPE_GRAY:
-                       case PNG_COLOR_TYPE_RGB:
-                               new_color_model = BC_RGB888;
-                               break;
-
-                       case PNG_COLOR_TYPE_GRAY_ALPHA:
-                       case PNG_COLOR_TYPE_RGB_ALPHA:
-                       default:
-                               new_color_model = BC_RGBA8888;
-                               break;
-
-                       case PNG_COLOR_TYPE_PALETTE:
-                               if(have_alpha)
-                                       new_color_model = BC_RGBA8888;
-                               else
-                                       new_color_model = BC_RGB888;
+               switch(src_color_model) {
+               case PNG_COLOR_TYPE_GRAY:
+                       new_color_model = BC_GREY8;
+                       break;
+               case PNG_COLOR_TYPE_RGB:
+                       new_color_model = BC_RGB888;
+                       break;
+               case PNG_COLOR_TYPE_PALETTE:
+                       new_color_model = have_alpha ? BC_RGBA8888 : BC_RGB888;
+                       break;
+               case PNG_COLOR_TYPE_GRAY_ALPHA:
+               case PNG_COLOR_TYPE_RGB_ALPHA:
+               default:
+                       new_color_model = BC_RGBA8888;
+                       break;
                }
-
                reallocate(NULL, -1, 0, 0, 0, w, h, new_color_model, -1);
 
 //printf("VFrame::read_png %d %d %d %p\n", __LINE__, w, h, get_rows());
@@ -1850,3 +1846,255 @@ void VFrame::draw_t(int x, int y, int sz)
 }
 
 
+// jpeg decompress
+class jpeg_err : public jpeg_error_mgr
+{
+       static void s_error_exit(j_common_ptr cp);
+       static void s_output_message(j_common_ptr cp);
+public:
+       jpeg_err() {
+               jpeg_std_error((jpeg_error_mgr *)this);
+               error_exit = s_error_exit;
+               output_message = s_output_message;
+       }
+       ~jpeg_err() {}
+};
+
+class jpeg_src : public jpeg_source_mgr
+{
+       static void s_init_source(j_decompress_ptr jp);
+       static boolean s_fill_input_buffer(j_decompress_ptr jp);
+       static void s_skip_input_data(j_decompress_ptr jp, long len);
+       static void s_term_source(j_decompress_ptr jp);
+       static boolean s_resync_to_restart(j_decompress_ptr jp, int v);
+public:
+       jpeg_src();
+       ~jpeg_src();
+       int jpeg_file(int fd);
+       int jpeg_mem(const unsigned char *bfr, long len);
+
+       int fd;
+       unsigned char *mbfr;
+       long mlen;
+       enum { buffer_sz=0x10000, file_sz=0x100000, };
+       unsigned char *buffer;
+       boolean fill_buffer();
+       void skip_data(long len);
+};
+
+class JpegVFrame : public jpeg_decompress_struct
+{
+public:
+       JpegVFrame();
+       ~JpegVFrame();
+       int read_jpeg(VFrame *vfrm, double xs, double ys, int jpeg_model);
+
+       jpeg_err jerr;
+       jpeg_src jsrc;
+       int debug, ret;
+};
+
+
+void jpeg_err:: s_error_exit(j_common_ptr cp)
+{
+       JpegVFrame *jpeg = (JpegVFrame *)cp;
+       jpeg->ret = 1;
+       if( !jpeg->debug ) return;
+       printf("s_error_exit()\n");
+}
+
+void jpeg_err::
+s_output_message(j_common_ptr cp)
+{
+       JpegVFrame *jpeg = (JpegVFrame *)cp;
+       if( !jpeg->debug ) return;
+       char msg[JMSG_LENGTH_MAX];
+       (*cp->err->format_message)(cp, msg);
+       printf("s_output_message() = %s\n",&msg[0]);
+}
+
+
+jpeg_src::jpeg_src()
+{
+       init_source = s_init_source;
+       fill_input_buffer = s_fill_input_buffer;
+       skip_input_data = s_skip_input_data;
+       resync_to_restart = s_resync_to_restart;
+       term_source = s_term_source;
+
+       fd = -1;
+       buffer = 0;
+       mbfr = 0;
+       mlen = -1;
+}
+
+jpeg_src::~jpeg_src()
+{
+       if( mbfr ) ::munmap(mbfr, mlen);
+       delete [] buffer;
+}
+
+int jpeg_src::jpeg_file(int fd)
+{
+       this->fd = fd;
+       struct stat st;
+       if( fstat(fd, &st) || !st.st_size ) return 0;
+       if( st.st_size < file_sz ) {
+               mbfr = (unsigned char *)::mmap(0, mlen = st.st_size,
+                               PROT_READ, MAP_SHARED, fd, 0);
+               if( mbfr == MAP_FAILED ) return 0;
+               next_input_byte = mbfr;
+               bytes_in_buffer = mlen;
+       }
+       else {
+               buffer = new unsigned char[buffer_sz];
+               next_input_byte = &buffer[0];
+               bytes_in_buffer = 0;
+       }
+       return 1;
+}
+int jpeg_src::jpeg_mem(const unsigned char *bfr, long len)
+{
+       next_input_byte = bfr;
+       bytes_in_buffer = len;
+       return 1;
+}
+
+void jpeg_src::s_init_source(j_decompress_ptr jp) {}
+void jpeg_src::s_term_source(j_decompress_ptr jp) {}
+
+boolean jpeg_src::s_resync_to_restart(j_decompress_ptr jp, int v)
+{
+       return jpeg_resync_to_restart(jp, v);
+}
+
+boolean jpeg_src::s_fill_input_buffer(j_decompress_ptr jp)
+{
+       JpegVFrame *jpeg = (JpegVFrame *)jp;
+       return jpeg->jsrc.fill_buffer();
+}
+
+boolean jpeg_src::fill_buffer()
+{
+       if( mbfr || fd < 0 ) return 0;
+       long n = ::read(fd, buffer, buffer_sz);
+       if( n < 0 ) perror("jpeg read");
+       if( !n ) return 0;
+       next_input_byte = buffer;
+       bytes_in_buffer = n;
+       return 1;
+}
+
+void jpeg_src::s_skip_input_data(j_decompress_ptr jp, long len)
+{
+       JpegVFrame *jpeg = (JpegVFrame *)jp;
+       jpeg->jsrc.skip_data(len);
+}
+
+void jpeg_src::skip_data(long len)
+{
+       while( len > (long) bytes_in_buffer ) {
+               len -= (long) bytes_in_buffer;
+               if( !fill_buffer() ) return;
+       }
+       next_input_byte += len;
+       bytes_in_buffer -= len;
+}
+
+
+JpegVFrame::JpegVFrame()
+{
+       jpeg_create_decompress(this);
+       debug = 1; ret = 0;
+       err = &jerr;  src = &jsrc;
+}
+JpegVFrame::~JpegVFrame()
+{
+       jpeg_destroy_decompress(this);
+}
+
+int JpegVFrame::read_jpeg(VFrame *vfrm, double xs, double ys, int jpeg_model)
+{
+       VFrame *xfrm = vfrm;
+       int color_model = xfrm->get_color_model();
+       if( color_model == BC_COMPRESSED ) color_model = jpeg_model;
+       jpeg_abort((jpeg_common_struct *)this);
+       if( jpeg_read_header(this, TRUE) != JPEG_HEADER_OK ) return 0;
+       jpeg_calc_output_dimensions(this);
+       quantize_colors = FALSE;
+       out_color_space =
+               jpeg_model == BC_YUV888 ? JCS_YCbCr :
+               jpeg_model == BC_GREY8 ? JCS_GRAYSCALE : JCS_RGB;
+       jpeg_calc_output_dimensions(this);
+       int w = bmax(image_width*xs, 1.);
+       int h = bmax(image_height*ys, 1.);
+       vfrm->reallocate(0, -1, 0, 0, 0, w, h, color_model, -1);
+       if( w != (int)image_width || h != (int)image_height ||
+           color_model != jpeg_model )
+               xfrm = new VFrame(image_width, image_height, jpeg_model);
+       unsigned char *pic = xfrm->get_data();
+       int linesz = xfrm->get_bytes_per_line();
+       jpeg_start_decompress(this);
+       while( !ret && output_scanline < image_height ) {
+               JSAMPROW rowptr = (JSAMPROW) &pic[output_scanline * linesz];
+               jpeg_read_scanlines(this, &rowptr, (JDIMENSION) 1);
+       }
+       jpeg_finish_decompress(this);
+       if( vfrm != xfrm ) {
+               vfrm->transfer_from(xfrm);
+               delete xfrm;
+       }
+       return 1;
+}
+
+int VFrameJpeg::read_jpeg(const unsigned char *data, long sz,
+               double xscale, double yscale, int jpeg_model)
+{
+       JpegVFrame jpeg;
+       jpeg.jsrc.jpeg_mem(data, sz);
+       return jpeg.read_jpeg(this, xscale, yscale, jpeg_model);
+}
+
+VFrameJpeg::VFrameJpeg(const unsigned char *jpeg_data, double s)
+{
+       long image_size =
+               ((long)jpeg_data[0] << 24) | ((long)jpeg_data[1] << 16) |
+               ((long)jpeg_data[2] << 8)  |  (long)jpeg_data[3];
+       if( !s ) s = BC_WindowBase::get_resources()->icon_scale;
+       read_jpeg(jpeg_data+4, image_size, s, s, BC_RGB888);
+}
+
+VFrameJpeg::VFrameJpeg(const unsigned char *jpeg_data, long image_size, double xs, double ys)
+{
+       if( !xs ) xs = BC_WindowBase::get_resources()->icon_scale;
+       if( !ys ) ys = BC_WindowBase::get_resources()->icon_scale;
+       read_jpeg(jpeg_data, image_size, xs, ys, BC_RGB888);
+}
+
+VFrameJpeg::~VFrameJpeg()
+{
+}
+
+
+VFrame *VFrameJpeg::vframe_jpeg(int fd, double xs, double ys, int jpeg_model)
+{
+       JpegVFrame jpeg;
+       jpeg.jsrc.jpeg_file(fd);
+       VFrame *vfrm = new VFrame();
+       if( !jpeg.read_jpeg(vfrm, xs, ys, jpeg_model) ) {
+               delete vfrm;  vfrm = 0;
+       }
+       return vfrm;
+}
+
+VFrame *VFrameJpeg::vframe_jpeg(const char *jpeg_path, double xs, double ys, int jpeg_model)
+{
+       VFrame *vframe = 0;
+       int fd = ::open(jpeg_path, O_RDONLY);
+       if( fd >= 0 ) {
+               vframe = vframe_jpeg(fd, xs, ys, jpeg_model);
+               ::close(fd);
+       }
+       return vframe;
+}
+
index 21b6497af9f6043691eaffa26e28462548444e2b..589fce1c638aad07c22b15a40ac82182d1748d0a 100644 (file)
@@ -56,6 +56,7 @@ public:
 class VFrame
 {
        friend class VFramePng;
+       friend class VFrameJpeg;
        friend class PngReadFunction;
 public:
 // Create new frame with shared data if *data is nonzero.
@@ -486,4 +487,21 @@ public:
        static VFrame *vframe_png(const char *png_path, double xs=1, double ys=1);
 };
 
+// Create a frame with the jpeg image
+//  jpeg_model must be BC_RGB888, BC_YUV888, or BC_GREY8
+class VFrameJpeg : public VFrame
+{
+// Read a JPEG into the frame (no alpha)
+       int read_jpeg(const unsigned char *data, long sz,
+               double xscale, double yscale, int jpeg_model);
+public:
+       VFrameJpeg(const unsigned char *jpeg_data, double s=0);
+       VFrameJpeg(const unsigned char *jpeg_data, long image_size, double xs=0, double ys=0);
+       virtual ~VFrameJpeg();
+       static VFrame *vframe_jpeg(int fd,
+               double xs=1, double ys=1, int jpeg_model=BC_RGB888);
+       static VFrame *vframe_jpeg(const char *jpeg_path,
+               double xs=1, double ys=1, int jpeg_model=BC_RGB888);
+};
+
 #endif
diff --git a/cinelerra-5.1/plugins/shapes/16-9_boart.jpg b/cinelerra-5.1/plugins/shapes/16-9_boart.jpg
new file mode 100644 (file)
index 0000000..f68aab8
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_boart.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_boxes.jpg b/cinelerra-5.1/plugins/shapes/16-9_boxes.jpg
new file mode 100644 (file)
index 0000000..6d6343e
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_boxes.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_cat_eyes.jpg b/cinelerra-5.1/plugins/shapes/16-9_cat_eyes.jpg
new file mode 100644 (file)
index 0000000..46f9d28
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_cat_eyes.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_film_bands.jpg b/cinelerra-5.1/plugins/shapes/16-9_film_bands.jpg
new file mode 100644 (file)
index 0000000..954c634
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_film_bands.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_multi_circle.jpg b/cinelerra-5.1/plugins/shapes/16-9_multi_circle.jpg
new file mode 100644 (file)
index 0000000..cd08b7b
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_multi_circle.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_multi_spiral.jpg b/cinelerra-5.1/plugins/shapes/16-9_multi_spiral.jpg
new file mode 100644 (file)
index 0000000..274bc18
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_multi_spiral.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_multi_square.jpg b/cinelerra-5.1/plugins/shapes/16-9_multi_square.jpg
new file mode 100644 (file)
index 0000000..bf6c7f3
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_multi_square.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_rare_spiral.jpg b/cinelerra-5.1/plugins/shapes/16-9_rare_spiral.jpg
new file mode 100644 (file)
index 0000000..3b4d233
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_rare_spiral.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_rectangles.jpg b/cinelerra-5.1/plugins/shapes/16-9_rectangles.jpg
new file mode 100644 (file)
index 0000000..a4efb4e
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_rectangles.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_star.jpg b/cinelerra-5.1/plugins/shapes/16-9_star.jpg
new file mode 100644 (file)
index 0000000..4485092
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_star.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_stars.jpg b/cinelerra-5.1/plugins/shapes/16-9_stars.jpg
new file mode 100644 (file)
index 0000000..ce0ba98
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_stars.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/16-9_wood.jpg b/cinelerra-5.1/plugins/shapes/16-9_wood.jpg
new file mode 100644 (file)
index 0000000..0a8a868
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/16-9_wood.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Butterfly.jpg b/cinelerra-5.1/plugins/shapes/Butterfly.jpg
new file mode 100644 (file)
index 0000000..c133050
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Butterfly.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Butterfly.png b/cinelerra-5.1/plugins/shapes/Butterfly.png
deleted file mode 100644 (file)
index 3d36cfe..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Butterfly.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Cinelerra16-9-Heavy.jpg b/cinelerra-5.1/plugins/shapes/Cinelerra16-9-Heavy.jpg
new file mode 100644 (file)
index 0000000..33678a8
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Cinelerra16-9-Heavy.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Cinelerra16-9-Light.jpg b/cinelerra-5.1/plugins/shapes/Cinelerra16-9-Light.jpg
new file mode 100644 (file)
index 0000000..ad0e772
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Cinelerra16-9-Light.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/CinelerraGG.jpg b/cinelerra-5.1/plugins/shapes/CinelerraGG.jpg
new file mode 100644 (file)
index 0000000..54e05f8
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/CinelerraGG.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-h_01.jpg b/cinelerra-5.1/plugins/shapes/Circle-h_01.jpg
new file mode 100644 (file)
index 0000000..fa2fa60
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Circle-h_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-h_01.png b/cinelerra-5.1/plugins/shapes/Circle-h_01.png
deleted file mode 100644 (file)
index 8db39c9..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Circle-h_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-h_02.jpg b/cinelerra-5.1/plugins/shapes/Circle-h_02.jpg
new file mode 100644 (file)
index 0000000..e7677cb
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Circle-h_02.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-h_02.png b/cinelerra-5.1/plugins/shapes/Circle-h_02.png
deleted file mode 100644 (file)
index d273de9..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Circle-h_02.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-v_01.jpg b/cinelerra-5.1/plugins/shapes/Circle-v_01.jpg
new file mode 100644 (file)
index 0000000..1b090c5
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Circle-v_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-v_01.png b/cinelerra-5.1/plugins/shapes/Circle-v_01.png
deleted file mode 100644 (file)
index 6b53ef8..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Circle-v_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-v_02.jpg b/cinelerra-5.1/plugins/shapes/Circle-v_02.jpg
new file mode 100644 (file)
index 0000000..362e202
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Circle-v_02.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Circle-v_02.png b/cinelerra-5.1/plugins/shapes/Circle-v_02.png
deleted file mode 100644 (file)
index 1b34eef..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Circle-v_02.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Clouds_01.jpg b/cinelerra-5.1/plugins/shapes/Clouds_01.jpg
new file mode 100644 (file)
index 0000000..6b17ac9
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Clouds_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Clouds_01.png b/cinelerra-5.1/plugins/shapes/Clouds_01.png
deleted file mode 100644 (file)
index 9cb9571..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Clouds_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Clouds_02.jpg b/cinelerra-5.1/plugins/shapes/Clouds_02.jpg
new file mode 100644 (file)
index 0000000..2c9d481
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Clouds_02.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Clouds_02.png b/cinelerra-5.1/plugins/shapes/Clouds_02.png
deleted file mode 100644 (file)
index 5faa096..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Clouds_02.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Cross-Iris_01.jpg b/cinelerra-5.1/plugins/shapes/Cross-Iris_01.jpg
new file mode 100644 (file)
index 0000000..c061c3e
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Cross-Iris_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Cross-Iris_01.png b/cinelerra-5.1/plugins/shapes/Cross-Iris_01.png
deleted file mode 100644 (file)
index f9f8ba2..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Cross-Iris_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Cross_01.jpg b/cinelerra-5.1/plugins/shapes/Cross_01.jpg
new file mode 100644 (file)
index 0000000..ab980e5
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Cross_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Cross_01.png b/cinelerra-5.1/plugins/shapes/Cross_01.png
deleted file mode 100644 (file)
index d2971b3..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Cross_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Diagonal-Curve.jpg b/cinelerra-5.1/plugins/shapes/Diagonal-Curve.jpg
new file mode 100644 (file)
index 0000000..1d2012d
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Diagonal-Curve.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Diagonal-Curve.png b/cinelerra-5.1/plugins/shapes/Diagonal-Curve.png
deleted file mode 100644 (file)
index 64e0248..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Diagonal-Curve.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Diagonal-Linear.jpg b/cinelerra-5.1/plugins/shapes/Diagonal-Linear.jpg
new file mode 100644 (file)
index 0000000..4e0f2f7
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Diagonal-Linear.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Diagonal-Linear.png b/cinelerra-5.1/plugins/shapes/Diagonal-Linear.png
deleted file mode 100644 (file)
index cfa558b..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Diagonal-Linear.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond-Iris_01.jpg b/cinelerra-5.1/plugins/shapes/Diamond-Iris_01.jpg
new file mode 100644 (file)
index 0000000..40c2fe5
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Diamond-Iris_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond-Iris_01.png b/cinelerra-5.1/plugins/shapes/Diamond-Iris_01.png
deleted file mode 100644 (file)
index 62031ec..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Diamond-Iris_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond_01.jpg b/cinelerra-5.1/plugins/shapes/Diamond_01.jpg
new file mode 100644 (file)
index 0000000..ba03007
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Diamond_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond_01.png b/cinelerra-5.1/plugins/shapes/Diamond_01.png
deleted file mode 100644 (file)
index 667c246..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Diamond_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond_02.jpg b/cinelerra-5.1/plugins/shapes/Diamond_02.jpg
new file mode 100644 (file)
index 0000000..31ad312
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Diamond_02.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond_02.png b/cinelerra-5.1/plugins/shapes/Diamond_02.png
deleted file mode 100644 (file)
index eb0e799..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Diamond_02.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond_03.jpg b/cinelerra-5.1/plugins/shapes/Diamond_03.jpg
new file mode 100644 (file)
index 0000000..187a0e5
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Diamond_03.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Diamond_03.png b/cinelerra-5.1/plugins/shapes/Diamond_03.png
deleted file mode 100644 (file)
index ad4e8ef..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Diamond_03.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Double-Door-h.jpg b/cinelerra-5.1/plugins/shapes/Double-Door-h.jpg
new file mode 100644 (file)
index 0000000..e9da2f4
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Double-Door-h.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Double-Door-h.png b/cinelerra-5.1/plugins/shapes/Double-Door-h.png
deleted file mode 100644 (file)
index ac1b902..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Double-Door-h.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Double-Door-v.jpg b/cinelerra-5.1/plugins/shapes/Double-Door-v.jpg
new file mode 100644 (file)
index 0000000..05284d1
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Double-Door-v.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Double-Door-v.png b/cinelerra-5.1/plugins/shapes/Double-Door-v.png
deleted file mode 100644 (file)
index f809050..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Double-Door-v.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Gravity.jpg b/cinelerra-5.1/plugins/shapes/Gravity.jpg
new file mode 100644 (file)
index 0000000..d27ba13
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Gravity.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Gravity.png b/cinelerra-5.1/plugins/shapes/Gravity.png
deleted file mode 100644 (file)
index 2ec38b6..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Gravity.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Linear-h.jpg b/cinelerra-5.1/plugins/shapes/Linear-h.jpg
new file mode 100644 (file)
index 0000000..0f7b318
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Linear-h.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Linear-h.png b/cinelerra-5.1/plugins/shapes/Linear-h.png
deleted file mode 100644 (file)
index fe00042..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Linear-h.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Linear-v.jpg b/cinelerra-5.1/plugins/shapes/Linear-v.jpg
new file mode 100644 (file)
index 0000000..f663ae4
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Linear-v.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Linear-v.png b/cinelerra-5.1/plugins/shapes/Linear-v.png
deleted file mode 100644 (file)
index f456883..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Linear-v.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Plasma_01.jpg b/cinelerra-5.1/plugins/shapes/Plasma_01.jpg
new file mode 100644 (file)
index 0000000..de7756c
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Plasma_01.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Plasma_01.png b/cinelerra-5.1/plugins/shapes/Plasma_01.png
deleted file mode 100644 (file)
index 1725775..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Plasma_01.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.jpg b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.jpg
new file mode 100644 (file)
index 0000000..98ebc39
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.png b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.png
deleted file mode 100644 (file)
index 8f61563..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x05.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.jpg b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.jpg
new file mode 100644 (file)
index 0000000..2a4fe61
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.png b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.png
deleted file mode 100644 (file)
index 58dccf3..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-h-x10.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.jpg b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.jpg
new file mode 100644 (file)
index 0000000..fc4a2e9
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.png b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.png
deleted file mode 100644 (file)
index a9d61bd..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x05.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.jpg b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.jpg
new file mode 100644 (file)
index 0000000..e38f387
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.png b/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.png
deleted file mode 100644 (file)
index 5d4ab07..0000000
Binary files a/cinelerra-5.1/plugins/shapes/Venetian-Blinds-v-x10.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/asimetric_clocks.jpg b/cinelerra-5.1/plugins/shapes/asimetric_clocks.jpg
new file mode 100644 (file)
index 0000000..bee821e
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/asimetric_clocks.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/asimetric_clocks_2.jpg b/cinelerra-5.1/plugins/shapes/asimetric_clocks_2.jpg
new file mode 100644 (file)
index 0000000..4b4ed6b
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/asimetric_clocks_2.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/asymmetric_clocks.png b/cinelerra-5.1/plugins/shapes/asymmetric_clocks.png
deleted file mode 100644 (file)
index a5e4bac..0000000
Binary files a/cinelerra-5.1/plugins/shapes/asymmetric_clocks.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/audio.jpg b/cinelerra-5.1/plugins/shapes/audio.jpg
new file mode 100644 (file)
index 0000000..1879830
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/audio.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/audio.png b/cinelerra-5.1/plugins/shapes/audio.png
deleted file mode 100644 (file)
index 9a5651b..0000000
Binary files a/cinelerra-5.1/plugins/shapes/audio.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/burst.jpg b/cinelerra-5.1/plugins/shapes/burst.jpg
new file mode 100644 (file)
index 0000000..90682e9
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/burst.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/burst.png b/cinelerra-5.1/plugins/shapes/burst.png
deleted file mode 100644 (file)
index b605c6d..0000000
Binary files a/cinelerra-5.1/plugins/shapes/burst.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/circle.jpg b/cinelerra-5.1/plugins/shapes/circle.jpg
new file mode 100644 (file)
index 0000000..0d6c90f
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/circle.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/circle.png b/cinelerra-5.1/plugins/shapes/circle.png
deleted file mode 100644 (file)
index 610fe6c..0000000
Binary files a/cinelerra-5.1/plugins/shapes/circle.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/clock.jpg b/cinelerra-5.1/plugins/shapes/clock.jpg
new file mode 100644 (file)
index 0000000..999738d
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/clock.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/clock.png b/cinelerra-5.1/plugins/shapes/clock.png
deleted file mode 100644 (file)
index 0a3f141..0000000
Binary files a/cinelerra-5.1/plugins/shapes/clock.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/crazy_clock.jpg b/cinelerra-5.1/plugins/shapes/crazy_clock.jpg
new file mode 100644 (file)
index 0000000..be36898
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/crazy_clock.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/crazy_clock.png b/cinelerra-5.1/plugins/shapes/crazy_clock.png
deleted file mode 100644 (file)
index 52b2b85..0000000
Binary files a/cinelerra-5.1/plugins/shapes/crazy_clock.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/cream.jpg b/cinelerra-5.1/plugins/shapes/cream.jpg
new file mode 100644 (file)
index 0000000..0d980ee
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/cream.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/cream.png b/cinelerra-5.1/plugins/shapes/cream.png
deleted file mode 100644 (file)
index 6b4933c..0000000
Binary files a/cinelerra-5.1/plugins/shapes/cream.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/film.jpg b/cinelerra-5.1/plugins/shapes/film.jpg
new file mode 100644 (file)
index 0000000..466ec5b
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/film.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/film.png b/cinelerra-5.1/plugins/shapes/film.png
deleted file mode 100644 (file)
index c1382ec..0000000
Binary files a/cinelerra-5.1/plugins/shapes/film.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/film2.jpg b/cinelerra-5.1/plugins/shapes/film2.jpg
new file mode 100644 (file)
index 0000000..72183d8
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/film2.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/heart.jpg b/cinelerra-5.1/plugins/shapes/heart.jpg
new file mode 100644 (file)
index 0000000..1385c81
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/heart.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/heart.png b/cinelerra-5.1/plugins/shapes/heart.png
deleted file mode 100644 (file)
index 7679323..0000000
Binary files a/cinelerra-5.1/plugins/shapes/heart.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/mosaic.jpg b/cinelerra-5.1/plugins/shapes/mosaic.jpg
new file mode 100644 (file)
index 0000000..ff95e68
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/mosaic.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/mosaic.png b/cinelerra-5.1/plugins/shapes/mosaic.png
deleted file mode 100644 (file)
index eea4177..0000000
Binary files a/cinelerra-5.1/plugins/shapes/mosaic.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/multi_box.jpg b/cinelerra-5.1/plugins/shapes/multi_box.jpg
new file mode 100644 (file)
index 0000000..89185b9
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/multi_box.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/multi_box.png b/cinelerra-5.1/plugins/shapes/multi_box.png
deleted file mode 100644 (file)
index 4d71a8d..0000000
Binary files a/cinelerra-5.1/plugins/shapes/multi_box.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/rare_spiral.jpg b/cinelerra-5.1/plugins/shapes/rare_spiral.jpg
new file mode 100644 (file)
index 0000000..c30bcab
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/rare_spiral.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/rare_spiral.png b/cinelerra-5.1/plugins/shapes/rare_spiral.png
deleted file mode 100644 (file)
index d31a9f0..0000000
Binary files a/cinelerra-5.1/plugins/shapes/rare_spiral.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/specks.jpg b/cinelerra-5.1/plugins/shapes/specks.jpg
new file mode 100644 (file)
index 0000000..c1cd527
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/specks.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/specks.png b/cinelerra-5.1/plugins/shapes/specks.png
deleted file mode 100644 (file)
index 63a75b6..0000000
Binary files a/cinelerra-5.1/plugins/shapes/specks.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/spiral.jpg b/cinelerra-5.1/plugins/shapes/spiral.jpg
new file mode 100644 (file)
index 0000000..b420ab4
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/spiral.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/spiral.png b/cinelerra-5.1/plugins/shapes/spiral.png
deleted file mode 100644 (file)
index e2eaa80..0000000
Binary files a/cinelerra-5.1/plugins/shapes/spiral.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/spiral_clock.jpg b/cinelerra-5.1/plugins/shapes/spiral_clock.jpg
new file mode 100644 (file)
index 0000000..944c170
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/spiral_clock.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/spiral_clock.png b/cinelerra-5.1/plugins/shapes/spiral_clock.png
deleted file mode 100644 (file)
index 0e5e15d..0000000
Binary files a/cinelerra-5.1/plugins/shapes/spiral_clock.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/square.jpg b/cinelerra-5.1/plugins/shapes/square.jpg
new file mode 100644 (file)
index 0000000..7e17cab
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/square.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/square.png b/cinelerra-5.1/plugins/shapes/square.png
deleted file mode 100644 (file)
index 239d632..0000000
Binary files a/cinelerra-5.1/plugins/shapes/square.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/squares.jpg b/cinelerra-5.1/plugins/shapes/squares.jpg
new file mode 100644 (file)
index 0000000..ebc160a
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/squares.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/squares.png b/cinelerra-5.1/plugins/shapes/squares.png
deleted file mode 100644 (file)
index 3a58471..0000000
Binary files a/cinelerra-5.1/plugins/shapes/squares.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/star.jpg b/cinelerra-5.1/plugins/shapes/star.jpg
new file mode 100644 (file)
index 0000000..181a944
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/star.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/star.png b/cinelerra-5.1/plugins/shapes/star.png
deleted file mode 100644 (file)
index ca97e5a..0000000
Binary files a/cinelerra-5.1/plugins/shapes/star.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/tile2x2h.jpg b/cinelerra-5.1/plugins/shapes/tile2x2h.jpg
new file mode 100644 (file)
index 0000000..eed469e
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/tile2x2h.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/tile2x2h.png b/cinelerra-5.1/plugins/shapes/tile2x2h.png
deleted file mode 100644 (file)
index b106671..0000000
Binary files a/cinelerra-5.1/plugins/shapes/tile2x2h.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/tile2x2v.jpg b/cinelerra-5.1/plugins/shapes/tile2x2v.jpg
new file mode 100644 (file)
index 0000000..a45596c
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/tile2x2v.jpg differ
diff --git a/cinelerra-5.1/plugins/shapes/tile2x2v.png b/cinelerra-5.1/plugins/shapes/tile2x2v.png
deleted file mode 100644 (file)
index 7734f59..0000000
Binary files a/cinelerra-5.1/plugins/shapes/tile2x2v.png and /dev/null differ
diff --git a/cinelerra-5.1/plugins/shapes/water.jpg b/cinelerra-5.1/plugins/shapes/water.jpg
new file mode 100644 (file)
index 0000000..02dd81d
Binary files /dev/null and b/cinelerra-5.1/plugins/shapes/water.jpg differ
index b11006d078d48b1371eca3bbe598b597e3d862ee..a0128fea35e538200dc9eeff5a97d31fdef62c3b 100644 (file)
@@ -34,6 +34,7 @@
 #include <png.h>
 #include <math.h>
 #include <stdint.h>
+#include <fcntl.h>
 #include <string.h>
 
 #define SHAPE_SEARCHPATH "/shapes"
@@ -346,8 +347,6 @@ ShapeWipeMain::ShapeWipeMain(PluginServer *server)
        current_filename[0] = '\0';
        current_name[0] = 0;
        pattern_image = 0;
-       min_value = 255;
-       max_value = 0;
        last_preserve_aspect = 0;
        shapes_initialized = 0;
        shape_paths.set_array_delete();
@@ -381,7 +380,7 @@ void ShapeWipeMain::init_shapes()
 {
        if( !shapes_initialized ) {
                FileSystem fs;
-               fs.set_filter("*.png");
+               fs.set_filter("[*.png][*.jpg]");
                char shape_path[BCTEXTLEN];
                sprintf(shape_path, "%s%s", get_plugin_dir(), SHAPE_SEARCHPATH);
                fs.update(shape_path);
@@ -401,7 +400,6 @@ void ShapeWipeMain::init_shapes()
        }
 }
 
-
 int ShapeWipeMain::load_configuration()
 {
        read_data(get_prev_keyframe(get_source_position()));
@@ -409,89 +407,37 @@ int ShapeWipeMain::load_configuration()
 }
 
 int ShapeWipeMain::read_pattern_image(char *shape_name,
-               int new_frame_width, int new_frame_height)
-{
-       png_byte header[8];
-       int is_png;
-       int row, col;
-       int pixel_width;
-       unsigned char value;
-       png_uint_32 width;
-       png_uint_32 height;
-       png_byte color_type;
-       png_byte bit_depth;
-       png_structp png_ptr = 0;
-       png_infop info_ptr = 0;
-       png_infop end_info = 0;
-       png_bytep *image = 0;
-       FILE *fp = 0;
-       frame_width = new_frame_width;
-       frame_height = new_frame_height;
-       int ret = 0;
-
+               int frame_width, int frame_height)
+{
+       VFrame *pattern = 0;
+       int ret = 0, fd = -1;
+       int is_png = 0;
+       unsigned char header[10];
 // Convert name to filename
-       int k = shape_paths.size();
+       int k = shape_paths.size(), hsz = sizeof(header);
        while( --k>=0 && strcmp(shape_titles[k], shape_name) );
        if( k < 0 ) ret = 1;
        if( !ret ) {
                strcpy(current_filename, shape_paths[k]);
-               fp = fopen(current_filename, "rb");
-               if( !fp ) ret = 1;
+               fd = ::open(current_filename, O_RDONLY);
+               if( fd < 0 || read(fd,header,hsz) != hsz ) ret = 1;
        }
        if( !ret ) {
-               fread(header, 1, 8, fp);
-               is_png = !png_sig_cmp(header, 0, 8);
-               if( !is_png ) ret = 1;
+               is_png = !png_sig_cmp(header, 0, hsz);
+               if( !is_png && strncmp("JFIF", (char*)header+6, 4) ) ret = 1;
        }
        if( !ret ) {
-               png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
-               if( !png_ptr ) ret = 1;
+               lseek(fd, 0, SEEK_SET);
+               pattern = is_png ?
+                       VFramePng::vframe_png(fd, 1, 1) :
+                       VFrameJpeg::vframe_jpeg(fd, 1, 1, BC_GREY8);
+               if( !pattern ) ret = 1;
        }
-       if( !ret ) {
-               /* Tell libpng we already checked the first 8 bytes */
-               png_set_sig_bytes(png_ptr, 8);
-               info_ptr = png_create_info_struct(png_ptr);
-               if( !info_ptr ) ret = 1;
-       }
-       if( !ret ) {
-               end_info = png_create_info_struct(png_ptr);
-               if( !end_info ) ret = 1;
+       if( fd >= 0 ) {
+               close(fd);  fd = -1;
        }
        if( !ret ) {
-               png_init_io(png_ptr, fp);
-               png_read_info(png_ptr, info_ptr);
-
-               color_type = png_get_color_type(png_ptr, info_ptr);
-               bit_depth = png_get_bit_depth(png_ptr, info_ptr);
-               width  = png_get_image_width (png_ptr, info_ptr);
-               height = png_get_image_height(png_ptr, info_ptr);
-
-               /* Skip the alpha channel if present
-               * stripping alpha currently doesn't work in conjunction with
-               * converting to grayscale in libpng */
-               pixel_width = color_type & PNG_COLOR_MASK_ALPHA ? 2 : 1;
-               /* Convert 16 bit data to 8 bit */
-               if( bit_depth == 16 ) png_set_strip_16(png_ptr);
-               /* Expand to 1 pixel per byte if necessary */
-               if( bit_depth < 8 ) png_set_packing(png_ptr);
-
-               /* Convert to grayscale */
-               if( color_type == PNG_COLOR_TYPE_RGB ||
-                   color_type == PNG_COLOR_TYPE_RGB_ALPHA )
-                       png_set_rgb_to_gray_fixed(png_ptr, 1, -1, -1);
-
-               /* Allocate memory to hold the original png image */
-               image = (png_bytep*)new png_bytep[height];
-               for( row=0; row<(int)height; ++row )
-                       image[row] = new png_byte[width*pixel_width];
-
-               /* Allocate memory for the pattern image that will actually be
-               * used for the wipe */
-               pattern_image = new  unsigned char*[frame_height];
-
-               png_read_image(png_ptr, image);
-               png_read_end(png_ptr, end_info);
-
+               int width = pattern->get_w(), height = pattern->get_h();
                double row_factor, col_factor;
                double row_offset = 0.5, col_offset = 0.5;      // for rounding
 
@@ -514,39 +460,41 @@ int ShapeWipeMain::read_pattern_image(char *shape_name,
                        row_factor = (double)(height-1)/(double)(frame_height-1);
                        col_factor = (double)(width-1)/(double)(frame_width-1);
                }
+               int out_w = width * col_factor, out_h = height * row_factor;
+               if( out_w != width || out_h != height ) {
+                       VFrame *new_pattern = new VFrame(frame_width, frame_height, BC_GREY8);
+                       new_pattern->transfer_from(pattern, 0, col_offset,row_offset,
+                               frame_width*col_factor, frame_height*row_factor);
+                       delete pattern;  pattern = new_pattern;
+               }
+               unsigned char **rows = pattern->get_rows();
+               unsigned char min = 0xff, max = 0x00;
                // first, determine range min..max
                for( int y=0; y<frame_height; ++y ) {
-                       row = (int)(row_factor*y + row_offset);
+                       unsigned char *row = rows[y];
                        for( int x=0; x<frame_width; ++x ) {
-                               col = (int)(col_factor*x + col_offset)*pixel_width;
-                               value = image[row][col];
-                               if( value < min_value ) min_value = value;
-                               if( value > max_value ) max_value = value;
+                               unsigned char value = row[x];
+                               if( value < min ) min = value;
+                               if( value > max ) max = value;
                        }
                }
-               int range = max_value - min_value;
+               if( min > max ) min = max;
+               int range = max - min;
                if( !range ) range = 1;
+               pattern_image = new  unsigned char*[frame_height];
                // scale to fade normalized pattern_image
                for( int y=0; y<frame_height; ++y ) {
-                       row = (int)(row_factor*y + row_offset);
+                       unsigned char *row = rows[y];
                        pattern_image[y] = new unsigned char[frame_width];
                        for( int x=0; x<frame_width; ++x ) {
-                               col = (int)(col_factor*x + col_offset)*pixel_width;
-                               value = image[row][col];
-                               pattern_image[y][x] = 0xff*(value - min_value) / range;
+                               unsigned char value = row[x];
+                               pattern_image[y][x] = 0xff*(value-min) / range;
                        }
                }
+               this->frame_width = frame_width;
+               this->frame_height = frame_height;
        }
 
-       if( png_ptr || info_ptr || end_info )
-               png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
-       if( fp )
-               fclose(fp);
-       if( image ) {
-               for( row=0; row<(int)height; ++row )
-                       delete [] image[row];
-               delete [] image;
-       }
        return ret;
 }
 
@@ -556,8 +504,6 @@ void ShapeWipeMain::reset_pattern_image()
                for( int y=0; y<frame_height; ++y )
                        delete [] pattern_image[y];
                delete [] pattern_image;  pattern_image = 0;
-               min_value = 255;
-               max_value = 0;  // updated in read_pattern_image
        }
 }
 
index b4fac85cc3074eeddaa8bdee7dabfd8d2b39b167..1f4d449ed336ae14de0ed5c4469217175b87e828 100644 (file)
@@ -199,8 +199,6 @@ public:
        char current_filename[BCTEXTLEN];
        char current_name[BCTEXTLEN];
        unsigned char **pattern_image;
-       unsigned char min_value;
-       unsigned char max_value;
        int frame_width;
        int frame_height;
        int preserve_aspect;
index 644cd67d1220bd3b75570f1f882830b798a7aab2..fc4fc8f87ab5515bcd922baf00d63577699be7ed 100644 (file)
@@ -1549,7 +1549,7 @@ void TitlePngPopup::handle_done_event(int result)
        if( result ) return;
        BrowseButtonWindow *gui = (BrowseButtonWindow *)get_gui();
        const char *path = gui->get_submitted_path();
-       char txt[BCSTRLEN];  sprintf(txt, "<%s %s>", _(KW_PNG), path);
+       char txt[BCTEXTLEN];  sprintf(txt, "<%s %s>", _(KW_PNG), path);
        window->lock_window("TitlePngPopup::handle_done_event");
        window->insert_ibeam(txt);
        window->unlock_window();
index 2c54c32e8c16adf9605c6aedf6bfd06d8d072c32..cb23cf27d6a2d045b04fd6097f2a3ef9cc8589f3 100644 (file)
@@ -2,7 +2,8 @@
 https://www.dechifro.org/dcraw/dcraw.c
 http://download-mirror.savannah.gnu.org/releases//openexr/ilmbase-2.2.1.tar.gz
 http://gnu.mirrors.pair.com/savannah/savannah//openexr/openexr-2.2.1.tar.gz
-https://sourceforge.net/projects/opencvlibrary/files/latest/download?source=directory = 3.2.0
+https://sourceforge.net/projects/opencvlibrary/files/
+https://github.com/opencv/opencv_contrib/archive/
 #https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.2.0.tar.gz/download
 http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz
 https://ieee1394.wiki.kernel.org/index.php/Libraries
@@ -33,7 +34,7 @@ ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20191217-2245-stable.tar
 https://bitbucket.org/multicoreware/x265/downloads/x265_3.2.1.tar.gz
 https://ffmpeg.org/releases/ffmpeg-4.2.tar.bz2
 https://github.com/webmproject/libvpx/archive/v1.8.1.tar.gz
-https://code.videolan.org/videolan/dav1d/-/archive/0.6.0/dav1d-0.6.0.tar.gz
+https://code.videolan.org/videolan/dav1d/-/archive/0.5.1/dav1d-0.5.1.tar.gz
 https://github.com/swh/ladspa/releases/tag/v0.4.17, plugin.org.uk
 https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
 https://github.com/webmproject/libwebp = libwebp-1.1.0