"Fossies" - the Fresh Open Source Software Archive

Member "rawtherapee-5.7/rtgui/resize.h" (10 Sep 2019, 3004 Bytes) of package /linux/misc/rawtherapee-5.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "resize.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.6_vs_5.7.

    1 /*
    2  *  This file is part of RawTherapee.
    3  *
    4  *  Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
    5  *
    6  *  RawTherapee is free software: you can redistribute it and/or modify
    7  *  it under the terms of the GNU General Public License as published by
    8  *  the Free Software Foundation, either version 3 of the License, or
    9  *  (at your option) any later version.
   10  *
   11  *  RawTherapee is distributed in the hope that it will be useful,
   12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  *  GNU General Public License for more details.
   15  *
   16  *  You should have received a copy of the GNU General Public License
   17  *  along with RawTherapee.  If not, see <https://www.gnu.org/licenses/>.
   18  */
   19 #ifndef _RESIZE_H_
   20 #define _RESIZE_H_
   21 
   22 #include <gtkmm.h>
   23 #include "adjuster.h"
   24 #include "guiutils.h"
   25 #include "toolpanel.h"
   26 #include "guiutils.h"
   27 
   28 class Resize final :
   29     public ToolParamBlock,
   30     public AdjusterListener,
   31     public FoldableToolPanel,
   32     public rtengine::SizeListener
   33 {
   34 public:
   35     Resize ();
   36     ~Resize () override;
   37 
   38     Gtk::Box* getPackBox ()
   39     {
   40         return packBox;
   41     }
   42 
   43     void read           (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override;
   44     void write          (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override;
   45     void setDefaults    (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
   46     void setBatchMode   (bool batchMode) override;
   47 
   48     void adjusterChanged  (Adjuster* a, double newval) override;
   49     void entryWChanged    ();
   50     void entryHChanged    ();
   51     void appliesToChanged ();
   52     void methodChanged    ();
   53     void specChanged      ();
   54     void update           (bool isCropped, int cw, int ch, int ow = 0, int oh = 0);
   55     void setGUIFromCrop   (bool isCropped, int cw, int ch);
   56     void sizeChanged      (int w, int h, int ow, int oh) override;
   57     void setDimensions    ();
   58     void enabledChanged   () override;
   59 
   60     void setAdjusterBehavior (bool scaleadd);
   61     void trimValues          (rtengine::procparams::ProcParams* pp) override;
   62 
   63 private:
   64     void fitBoxScale ();
   65     int getComputedWidth ();
   66     int getComputedHeight ();
   67     void notifyBBox ();
   68     void updateGUI ();
   69     void allowUpscalingChanged();
   70 
   71     rtengine::ProcEvent EvResizeAllowUpscaling;
   72     Adjuster*          scale;
   73     Gtk::VBox*         sizeBox;
   74     MyComboBoxText*    appliesTo;
   75     MyComboBoxText*    method;
   76     MyComboBoxText*    spec;
   77     MySpinButton*      w;
   78     MySpinButton*      h;
   79     Gtk::CheckButton *allowUpscaling;
   80     int                maxw, maxh;
   81     int                cropw, croph;
   82     sigc::connection   sconn, aconn, wconn, hconn;
   83     bool               wDirty, hDirty;
   84     ToolParamBlock*    packBox;
   85     IdleRegister       idle_register;
   86 
   87     static constexpr int MAX_SCALE = 16; // 16 to match the main preview max scale of 1600%
   88 };
   89 
   90 #endif