Merge pull request #4999 from Beep6581/lensprofcombo

Improvements to Profiled Lens Correction
This commit is contained in:
Beep6581
2018-11-20 21:42:56 +01:00
committed by GitHub
32 changed files with 517 additions and 564 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -16,87 +16,26 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LENSPROFILE_H_
#define _LENSPROFILE_H_
#pragma once
#include <gtkmm.h>
#include "toolpanel.h"
#include "guiutils.h"
#include "lensgeom.h"
#include "toolpanel.h"
class LensProfilePanel : public ToolParamBlock, public FoldableToolPanel
class LensProfilePanel final :
public ToolParamBlock,
public FoldableToolPanel
{
protected:
MyFileChooserButton *fcbLCPFile;
Gtk::CheckButton *ckbUseDist, *ckbUseVign, *ckbUseCA;
Gtk::HBox *hbLCPFile;
Gtk::Label *lLCPFileHead;
bool lcModeChanged, lcpFileChanged, useDistChanged, useVignChanged, useCAChanged;
sigc::connection conLCPFile, conUseDist, conUseVign, conUseCA;
void updateDisabled(bool enable);
bool allowFocusDep;
bool isRaw;
const rtengine::FramesMetaData* metadata;
Gtk::RadioButton::Group corrGroup;
Gtk::RadioButton *corrOff;
Gtk::RadioButton *corrLensfunAuto;
Gtk::RadioButton *corrLensfunManual;
Gtk::RadioButton *corrLcpFile;
Gtk::RadioButton *corrUnchanged;
MyComboBox *lensfunCameras;
MyComboBox *lensfunLenses;
Gtk::Image *warning;
class LFDbHelper {
public:
class LFModelCam: public Gtk::TreeModel::ColumnRecord {
public:
LFModelCam() { add(make); add(model); }
Gtk::TreeModelColumn<Glib::ustring> make;
Gtk::TreeModelColumn<Glib::ustring> model;
};
class LFModelLens: public Gtk::TreeModel::ColumnRecord {
public:
LFModelLens() { add(lens); add(prettylens); }
Gtk::TreeModelColumn<Glib::ustring> lens;
Gtk::TreeModelColumn<Glib::ustring> prettylens;
};
LFModelCam lensfunModelCam;
LFModelLens lensfunModelLens;
Glib::RefPtr<Gtk::TreeStore> lensfunCameraModel;
Glib::RefPtr<Gtk::TreeStore> lensfunLensModel;
LFDbHelper();
void fillLensfunCameras();
void fillLensfunLenses();
};
static LFDbHelper *lf;
bool useLensfunChanged;
bool lensfunAutoChanged;
bool lensfunCameraChanged;
bool lensfunLensChanged;
bool setLensfunCamera(const Glib::ustring &make, const Glib::ustring &model);
bool setLensfunLens(const Glib::ustring &lens);
bool checkLensfunCanCorrect(bool automatch);
void updateLensfunWarning();
public:
LensProfilePanel();
LensProfilePanel ();
void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
void setRawMeta(bool raw, const rtengine::FramesMetaData* pMeta);
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
void setRawMeta (bool raw, const rtengine::FramesMetaData* pMeta);
void onLCPFileChanged ();
void onLCPFileChanged();
void onUseDistChanged();
void onUseVignChanged();
void onUseCAChanged();
@@ -105,7 +44,92 @@ public:
void onLensfunCameraChanged();
void onLensfunLensChanged();
void onCorrModeChanged(const Gtk::RadioButton *rbChanged);
};
void onCorrModeChanged(const Gtk::RadioButton* rbChanged);
#endif
private:
class LFDbHelper final
{
public:
class LFModelCam final :
public Gtk::TreeModel::ColumnRecord
{
public:
LFModelCam()
{
add(make);
add(model);
}
Gtk::TreeModelColumn<Glib::ustring> make;
Gtk::TreeModelColumn<Glib::ustring> model;
};
class LFModelLens final :
public Gtk::TreeModel::ColumnRecord
{
public:
LFModelLens()
{
add(lens);
add(prettylens);
}
Gtk::TreeModelColumn<Glib::ustring> lens;
Gtk::TreeModelColumn<Glib::ustring> prettylens;
};
LFModelCam lensfunModelCam;
LFModelLens lensfunModelLens;
Glib::RefPtr<Gtk::TreeStore> lensfunCameraModel;
Glib::RefPtr<Gtk::TreeStore> lensfunLensModel;
LFDbHelper();
void fillLensfunCameras();
void fillLensfunLenses();
};
void updateDisabled(bool enable);
bool setLensfunCamera(const Glib::ustring& make, const Glib::ustring& model);
bool setLensfunLens(const Glib::ustring& lens);
bool checkLensfunCanCorrect(bool automatch);
void setManualParamsVisibility(bool setVisible);
void updateLensfunWarning();
bool lcModeChanged;
bool lcpFileChanged;
bool useDistChanged;
bool useVignChanged;
bool useCAChanged;
bool useLensfunChanged;
bool lensfunAutoChanged;
bool lensfunCameraChanged;
bool lensfunLensChanged;
sigc::connection conLCPFile;
sigc::connection conUseDist;
sigc::connection conUseVign;
sigc::connection conUseCA;
bool allowFocusDep;
bool isRaw;
const rtengine::FramesMetaData* metadata;
Gtk::Grid* const modesGrid;
Gtk::Grid* const distGrid;
Gtk::RadioButton* const corrUnchangedRB;
Gtk::RadioButton::Group corrGroup;
Gtk::RadioButton* const corrOffRB;
Gtk::RadioButton* const corrLensfunAutoRB;
Gtk::RadioButton* const corrLensfunManualRB;
Gtk::RadioButton* const corrLcpFileRB;
MyFileChooserButton* const corrLcpFileChooser;
Gtk::Label* const lensfunCamerasLbl;
MyComboBox* const lensfunCameras;
Gtk::Label* const lensfunLensesLbl;
MyComboBox* const lensfunLenses;
Gtk::Image* const warning;
Gtk::CheckButton* const ckbUseDist;
Gtk::CheckButton* const ckbUseVign;
Gtk::CheckButton* const ckbUseCA;
static LFDbHelper* lf;
};