Move de-fish to distortion
This commit is contained in:
parent
45b7251073
commit
f9e2e934df
@ -1454,7 +1454,6 @@ HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius
|
||||
HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost
|
||||
HISTORY_MSG_PERSP_CAM_ANGLE;Perspective - Camera
|
||||
HISTORY_MSG_PERSP_CAM_FL;Perspective - Camera
|
||||
HISTORY_MSG_PERSP_CAM_DEFISH;Perspective - De-fish
|
||||
HISTORY_MSG_PERSP_CAM_SCALE;Perspective - Scale
|
||||
HISTORY_MSG_PERSP_CAM_SHIFT;Perspective - Camera
|
||||
HISTORY_MSG_PERSP_CTRL_LINE;Perspective - Control lines
|
||||
@ -2430,6 +2429,8 @@ TP_DIRPYREQUALIZER_THRESHOLD;Threshold
|
||||
TP_DIRPYREQUALIZER_TOOLTIP;Attempts to reduce artifacts in the transitions between skin colors (hue, chroma, luma) and the rest of the image.
|
||||
TP_DISTORTION_AMOUNT;Amount
|
||||
TP_DISTORTION_AUTO_TOOLTIP;Automatically corrects lens distortion in raw files by matching it against the embedded JPEG image if one exists and has had its lens disortion auto-corrected by the camera.
|
||||
TP_DISTORTION_DEFISH;De-fish
|
||||
TP_DISTORTION_FOCAL_LENGTH;Focal length
|
||||
TP_DISTORTION_LABEL;Distortion Correction
|
||||
TP_EPD_EDGESTOPPING;Edge stopping
|
||||
TP_EPD_GAMMA;Gamma
|
||||
|
@ -471,6 +471,10 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector<Coord2D> &src,
|
||||
((params->perspective.camera_focal_length > 0) ? params->perspective.camera_focal_length : PerspectiveParams::DEFAULT_CAMERA_FOCAL_LENGTH)
|
||||
* ((params->perspective.camera_crop_factor > 0) ? params->perspective.camera_crop_factor : PerspectiveParams::DEFAULT_CAMERA_CROP_FACTOR)
|
||||
* (maxRadius / sqrt(18.0*18.0 + 12.0*12.0));
|
||||
const double f_defish =
|
||||
((params->distortion.focal_length > 0) ? params->distortion.focal_length : DistortionParams::DEFAULT_FOCAL_LENGTH)
|
||||
* ((params->perspective.camera_crop_factor > 0) ? params->perspective.camera_crop_factor : PerspectiveParams::DEFAULT_CAMERA_CROP_FACTOR)
|
||||
* (maxRadius / sqrt(18.0*18.0 + 12.0*12.0));
|
||||
const double p_camera_yaw = params->perspective.camera_yaw / 180.0 * rtengine::RT_PI;
|
||||
const double p_camera_pitch = params->perspective.camera_pitch / 180.0 * rtengine::RT_PI;
|
||||
const double p_camera_roll = params->perspective.camera_roll * rtengine::RT_PI_180;
|
||||
@ -517,12 +521,13 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector<Coord2D> &src,
|
||||
|
||||
x_d /= params->perspective.camera_scale;
|
||||
y_d /= params->perspective.camera_scale;
|
||||
if (params->perspective.camera_defish) {
|
||||
x_d /= f;
|
||||
y_d /= f;
|
||||
if (params->distortion.defish) {
|
||||
x_d /= f_defish;
|
||||
y_d /= f_defish;
|
||||
|
||||
const double r = std::sqrt(x_d * x_d + y_d * y_d);
|
||||
const double factor = f * std::atan(r) / r;
|
||||
|
||||
const double factor = f_defish * std::atan(r) / r;
|
||||
|
||||
x_d *= factor;
|
||||
y_d *= factor;
|
||||
@ -1178,6 +1183,10 @@ void ImProcFunctions::transformGeneral(bool highQuality, Imagefloat *original, I
|
||||
((params->perspective.camera_focal_length > 0) ? params->perspective.camera_focal_length : PerspectiveParams::DEFAULT_CAMERA_FOCAL_LENGTH)
|
||||
* ((params->perspective.camera_crop_factor > 0) ? params->perspective.camera_crop_factor : PerspectiveParams::DEFAULT_CAMERA_CROP_FACTOR)
|
||||
* (maxRadius / sqrt(18.0*18.0 + 12.0*12.0));
|
||||
const double f_defish =
|
||||
((params->distortion.focal_length > 0) ? params->distortion.focal_length : DistortionParams::DEFAULT_FOCAL_LENGTH)
|
||||
* ((params->perspective.camera_crop_factor > 0) ? params->perspective.camera_crop_factor : PerspectiveParams::DEFAULT_CAMERA_CROP_FACTOR)
|
||||
* (maxRadius / sqrt(18.0*18.0 + 12.0*12.0));
|
||||
const double p_camera_yaw = params->perspective.camera_yaw / 180.0 * rtengine::RT_PI;
|
||||
const double p_camera_pitch = params->perspective.camera_pitch / 180.0 * rtengine::RT_PI;
|
||||
const double p_camera_roll = params->perspective.camera_roll * rtengine::RT_PI_180;
|
||||
@ -1255,12 +1264,12 @@ void ImProcFunctions::transformGeneral(bool highQuality, Imagefloat *original, I
|
||||
|
||||
x_d /= params->perspective.camera_scale;
|
||||
y_d /= params->perspective.camera_scale;
|
||||
if (params->perspective.camera_defish) {
|
||||
x_d /= f;
|
||||
y_d /= f;
|
||||
if (params->distortion.defish) {
|
||||
x_d /= f_defish;
|
||||
y_d /= f_defish;
|
||||
|
||||
const double r = std::sqrt(x_d * x_d + y_d * y_d);
|
||||
const double factor = f * std::atan(r) / r;
|
||||
const double factor = f_defish * std::atan(r) / r;
|
||||
|
||||
x_d *= factor;
|
||||
y_d *= factor;
|
||||
@ -1485,7 +1494,9 @@ bool ImProcFunctions::needsCA () const
|
||||
|
||||
bool ImProcFunctions::needsDistortion () const
|
||||
{
|
||||
return fabs (params->distortion.amount) > 1e-15;
|
||||
return
|
||||
params->distortion.defish ||
|
||||
fabs (params->distortion.amount) > 1e-15;
|
||||
}
|
||||
|
||||
bool ImProcFunctions::needsRotation () const
|
||||
@ -1509,7 +1520,6 @@ bool ImProcFunctions::needsPerspective () const
|
||||
params->perspective.projection_shift_horiz ||
|
||||
params->perspective.projection_shift_vert ||
|
||||
params->perspective.projection_yaw ||
|
||||
params->perspective.camera_defish ||
|
||||
params->perspective.camera_scale > 1.0 + 1e-6 ||
|
||||
params->perspective.camera_scale < 1.0 - 1e-6 ));
|
||||
}
|
||||
|
@ -304,7 +304,8 @@ PerspectiveCorrection::Params PerspectiveCorrection::autocompute(ImageSource *sr
|
||||
// TODO: Ensure image borders of rotated image do not get detected as lines.
|
||||
neutral.rotate = pparams->rotate;
|
||||
neutral.distortion = pparams->distortion;
|
||||
neutral.perspective.camera_defish = pparams->perspective.camera_defish;
|
||||
neutral.distortion.defish = pparams->distortion.defish;
|
||||
neutral.distortion.focal_length = pparams->distortion.focal_length;
|
||||
neutral.perspective.camera_focal_length = pparams->perspective.camera_focal_length;
|
||||
neutral.perspective.camera_crop_factor = pparams->perspective.camera_crop_factor;
|
||||
neutral.perspective.camera_scale = pparams->perspective.camera_scale;
|
||||
|
@ -1879,14 +1879,11 @@ bool RotateParams::operator !=(const RotateParams& other) const
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
DistortionParams::DistortionParams() :
|
||||
amount(0.0)
|
||||
{
|
||||
}
|
||||
DistortionParams::DistortionParams() {}
|
||||
|
||||
bool DistortionParams::operator ==(const DistortionParams& other) const
|
||||
{
|
||||
return amount == other.amount;
|
||||
return amount == other.amount && defish == other.defish && focal_length == other.focal_length;
|
||||
}
|
||||
|
||||
bool DistortionParams::operator !=(const DistortionParams& other) const
|
||||
@ -1973,7 +1970,6 @@ PerspectiveParams::PerspectiveParams() :
|
||||
horizontal(0.0),
|
||||
vertical(0.0),
|
||||
camera_crop_factor(0.0),
|
||||
camera_defish(false),
|
||||
camera_focal_length(0.0),
|
||||
camera_pitch(0.0),
|
||||
camera_roll(0.0),
|
||||
@ -1996,7 +1992,6 @@ bool PerspectiveParams::operator ==(const PerspectiveParams& other) const
|
||||
&& render == other.render
|
||||
&& horizontal == other.horizontal
|
||||
&& vertical == other.vertical
|
||||
&& camera_defish == other.camera_defish
|
||||
&& camera_focal_length == other.camera_focal_length
|
||||
&& camera_crop_factor == other.camera_crop_factor
|
||||
&& camera_pitch == other.camera_pitch
|
||||
@ -6287,6 +6282,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
||||
|
||||
// Distortion
|
||||
saveToKeyfile(!pedited || pedited->distortion.amount, "Distortion", "Amount", distortion.amount, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->distortion.focal_length, "Distortion", "FocalLength", distortion.focal_length, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->distortion.defish, "Distortion", "Defish", distortion.defish, keyFile);
|
||||
|
||||
// Lens profile
|
||||
saveToKeyfile(!pedited || pedited->lensProf.lcMode, "LensProfile", "LcMode", lensProf.getMethodString(lensProf.lcMode), keyFile);
|
||||
@ -6306,7 +6303,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
||||
saveToKeyfile(!pedited || pedited->perspective.camera_focal_length, "Perspective", "CameraFocalLength", perspective.camera_focal_length, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->perspective.camera_pitch, "Perspective", "CameraPitch", perspective.camera_pitch, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->perspective.camera_scale, "Perspective", "CameraScale", perspective.camera_scale, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->perspective.camera_defish, "Perspective", "CameraDefish", perspective.camera_defish, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->perspective.camera_roll, "Perspective", "CameraRoll", perspective.camera_roll, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->perspective.camera_shift_horiz, "Perspective", "CameraShiftHorizontal", perspective.camera_shift_horiz, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->perspective.camera_shift_vert, "Perspective", "CameraShiftVertical", perspective.camera_shift_vert, keyFile);
|
||||
@ -8331,6 +8327,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
||||
|
||||
if (keyFile.has_group("Distortion")) {
|
||||
assignFromKeyfile(keyFile, "Distortion", "Amount", pedited, distortion.amount, pedited->distortion.amount);
|
||||
assignFromKeyfile(keyFile, "Distortion", "Defish", pedited, distortion.defish, pedited->distortion.defish);
|
||||
assignFromKeyfile(keyFile, "Distortion", "FocalLength", pedited, distortion.focal_length, pedited->distortion.focal_length);
|
||||
}
|
||||
|
||||
if (keyFile.has_group("LensProfile")) {
|
||||
@ -8391,7 +8389,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
||||
assignFromKeyfile(keyFile, "Perspective", "CameraShiftVertical", pedited, perspective.camera_shift_vert, pedited->perspective.camera_shift_vert);
|
||||
assignFromKeyfile(keyFile, "Perspective", "CameraPitch", pedited, perspective.camera_pitch, pedited->perspective.camera_pitch);
|
||||
assignFromKeyfile(keyFile, "Perspective", "CameraScale", pedited, perspective.camera_scale, pedited->perspective.camera_scale);
|
||||
assignFromKeyfile(keyFile, "Perspective", "CameraDefish", pedited, perspective.camera_defish, pedited->perspective.camera_defish);
|
||||
assignFromKeyfile(keyFile, "Perspective", "CameraRoll", pedited, perspective.camera_roll, pedited->perspective.camera_roll);
|
||||
assignFromKeyfile(keyFile, "Perspective", "CameraCropFactor", pedited, perspective.camera_crop_factor, pedited->perspective.camera_crop_factor);
|
||||
assignFromKeyfile(keyFile, "Perspective", "CameraFocalLength", pedited, perspective.camera_focal_length, pedited->perspective.camera_focal_length);
|
||||
|
@ -904,7 +904,10 @@ struct RotateParams {
|
||||
* Parameters of the distortion correction
|
||||
*/
|
||||
struct DistortionParams {
|
||||
double amount;
|
||||
static constexpr double DEFAULT_FOCAL_LENGTH = 12;
|
||||
double amount = 0.0;
|
||||
bool defish = false;
|
||||
double focal_length = DEFAULT_FOCAL_LENGTH;
|
||||
|
||||
DistortionParams();
|
||||
|
||||
@ -960,7 +963,6 @@ struct PerspectiveParams {
|
||||
* be interpreted with {@link #DEFAULT_CAMERA_CROP_FACTOR}.
|
||||
*/
|
||||
double camera_crop_factor;
|
||||
bool camera_defish;
|
||||
/**
|
||||
* Negative and zero values indicate an unspecified focal length and should
|
||||
* be interpreted with {@link #DEFAULT_CAMERA_FOCAL_LENGTH}.
|
||||
|
@ -17,6 +17,7 @@ enum {
|
||||
ADDSET_WB_GREEN,
|
||||
ADDSET_ROTATE_DEGREE,
|
||||
ADDSET_DIST_AMOUNT,
|
||||
ADDSET_DIST_FOCAL_LENGTH,
|
||||
ADDSET_PERSPECTIVE,
|
||||
ADDSET_PERSP_CAM_ANGLE,
|
||||
ADDSET_PERSP_CAM_DEFISH,
|
||||
|
@ -22,13 +22,19 @@
|
||||
|
||||
#include "rtimage.h"
|
||||
|
||||
#include "eventmapper.h"
|
||||
|
||||
#include "../rtengine/procparams.h"
|
||||
#include "../rtengine/refreshmap.h"
|
||||
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
|
||||
Distortion::Distortion (): FoldableToolPanel(this, "distortion", M("TP_DISTORTION_LABEL"))
|
||||
{
|
||||
auto mapper = ProcEventMapper::getInstance();
|
||||
EvDistortionDefish = mapper->newEvent(TRANSFORM, "HISTORY_MSG_DISTORTION_DEFISH");
|
||||
EvDistortionDefishVoid = mapper->newEvent(M_VOID, "HISTORY_MSG_DISTORTION_DEFISH");
|
||||
|
||||
rlistener = nullptr;
|
||||
autoDistor = Gtk::manage (new Gtk::Button (M("GENERAL_AUTO")));
|
||||
@ -45,11 +51,19 @@ Distortion::Distortion (): FoldableToolPanel(this, "distortion", M("TP_DISTORTIO
|
||||
|
||||
distor = Gtk::manage (new Adjuster (M("TP_DISTORTION_AMOUNT"), -0.5, 0.5, 0.001, 0, idistL, idistR));
|
||||
distor->setAdjusterListener (this);
|
||||
|
||||
distor->setLogScale(2, 0);
|
||||
|
||||
distor->show();
|
||||
pack_start (*distor);
|
||||
|
||||
defish = Gtk::manage(new Gtk::CheckButton(M("TP_DISTORTION_DEFISH")));
|
||||
defish->signal_toggled().connect(sigc::mem_fun(*this, &Distortion::defishChanged));
|
||||
defish->show();
|
||||
pack_start (*defish);
|
||||
|
||||
focal_length = Gtk::manage (new Adjuster (M("TP_DISTORTION_FOCAL_LENGTH"), 0.5, 25, 0.01, DistortionParams::DEFAULT_FOCAL_LENGTH));
|
||||
focal_length->setAdjusterListener (this);
|
||||
focal_length->show();
|
||||
pack_start(*focal_length);
|
||||
}
|
||||
|
||||
void Distortion::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
@ -59,9 +73,12 @@ void Distortion::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
|
||||
if (pedited) {
|
||||
distor->setEditedState (pedited->distortion.amount ? Edited : UnEdited);
|
||||
focal_length->setEditedState (pedited->distortion.focal_length != DistortionParams::DEFAULT_FOCAL_LENGTH ? Edited : UnEdited);
|
||||
}
|
||||
|
||||
distor->setValue (pp->distortion.amount);
|
||||
defish->set_active(pp->distortion.defish);
|
||||
focal_length->setValue(pp->distortion.focal_length);
|
||||
|
||||
enableListener ();
|
||||
}
|
||||
@ -70,9 +87,13 @@ void Distortion::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
{
|
||||
|
||||
pp->distortion.amount = distor->getValue ();
|
||||
pp->distortion.defish = defish->get_active ();
|
||||
pp->distortion.focal_length = focal_length->getValue ();
|
||||
|
||||
if (pedited) {
|
||||
pedited->distortion.amount = distor->getEditedState ();
|
||||
pedited->distortion.focal_length = focal_length->getEditedState ();
|
||||
pedited->distortion.defish = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,6 +101,7 @@ void Distortion::setDefaults (const ProcParams* defParams, const ParamsEdited* p
|
||||
{
|
||||
|
||||
distor->setDefault (defParams->distortion.amount);
|
||||
focal_length->setDefault (defParams->distortion.focal_length);
|
||||
|
||||
if (pedited) {
|
||||
distor->setDefaultEditedState (pedited->distortion.amount ? Edited : UnEdited);
|
||||
@ -118,9 +140,19 @@ void Distortion::idPressed ()
|
||||
}
|
||||
}
|
||||
|
||||
void Distortion::defishChanged()
|
||||
{
|
||||
if (listener) {
|
||||
listener->panelChanged(EvDistortionDefish, defish->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
void Distortion::focalLengthChanged(Adjuster *a, const double newval)
|
||||
{
|
||||
}
|
||||
|
||||
void Distortion::setAdjusterBehavior (bool vadd)
|
||||
{
|
||||
|
||||
distor->setAddMode(vadd);
|
||||
}
|
||||
|
||||
@ -128,4 +160,5 @@ void Distortion::trimValues (rtengine::procparams::ProcParams* pp)
|
||||
{
|
||||
|
||||
distor->trimValue(pp->distortion.amount);
|
||||
focal_length->trimValue(pp->distortion.focal_length);
|
||||
}
|
||||
|
@ -33,10 +33,19 @@ class Distortion final :
|
||||
protected:
|
||||
Gtk::Button* autoDistor;
|
||||
Adjuster* distor;
|
||||
Adjuster* focal_length;
|
||||
sigc::connection idConn;
|
||||
LensGeomListener * rlistener;
|
||||
Gtk::CheckButton* defish;
|
||||
|
||||
public:
|
||||
rtengine::ProcEvent EvDistortionDefish;
|
||||
rtengine::ProcEvent EvDistortionDefishVoid;
|
||||
rtengine::ProcEvent* event_distortion_defish;
|
||||
|
||||
rtengine::ProcEvent EvDistortionFocalLength;
|
||||
rtengine::ProcEvent EvDistortionFocalLengthVoid;
|
||||
rtengine::ProcEvent* event_distortion_focal_length;
|
||||
|
||||
Distortion ();
|
||||
|
||||
@ -53,4 +62,6 @@ public:
|
||||
{
|
||||
rlistener = l;
|
||||
}
|
||||
void defishChanged (void);
|
||||
void focalLengthChanged(Adjuster* a, double const newval);
|
||||
};
|
||||
|
@ -332,6 +332,8 @@ void ParamsEdited::set(bool v)
|
||||
commonTrans.autofill = v;
|
||||
rotate.degree = v;
|
||||
distortion.amount = v;
|
||||
distortion.defish = v;
|
||||
distortion.focal_length = v;
|
||||
lensProf.lcMode = v;
|
||||
lensProf.lcpFile = v;
|
||||
lensProf.useDist = v;
|
||||
@ -346,7 +348,6 @@ void ParamsEdited::set(bool v)
|
||||
perspective.horizontal = v;
|
||||
perspective.vertical = v;
|
||||
perspective.camera_crop_factor = v;
|
||||
perspective.camera_defish = v;
|
||||
perspective.camera_focal_length = v;
|
||||
perspective.camera_pitch = v;
|
||||
perspective.camera_scale = v;
|
||||
@ -1039,6 +1040,8 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
||||
commonTrans.autofill = commonTrans.autofill && p.commonTrans.autofill == other.commonTrans.autofill;
|
||||
rotate.degree = rotate.degree && p.rotate.degree == other.rotate.degree;
|
||||
distortion.amount = distortion.amount && p.distortion.amount == other.distortion.amount;
|
||||
distortion.defish = distortion.defish && p.distortion.defish == other.distortion.defish;
|
||||
distortion.focal_length = distortion.focal_length && p.distortion.focal_length == other.distortion.focal_length;
|
||||
lensProf.lcMode = lensProf.lcMode && p.lensProf.lcMode == other.lensProf.lcMode;
|
||||
lensProf.lcpFile = lensProf.lcpFile && p.lensProf.lcpFile == other.lensProf.lcpFile;
|
||||
lensProf.useDist = lensProf.useDist && p.lensProf.useDist == other.lensProf.useDist;
|
||||
@ -1053,7 +1056,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
||||
perspective.horizontal = perspective.horizontal && p.perspective.horizontal == other.perspective.horizontal;
|
||||
perspective.vertical = perspective.vertical && p.perspective.vertical == other.perspective.vertical;
|
||||
perspective.camera_crop_factor = perspective.camera_crop_factor && p.perspective.camera_crop_factor == other.perspective.camera_crop_factor;
|
||||
perspective.camera_defish = perspective.camera_defish && p.perspective.camera_defish == other.perspective.camera_defish;
|
||||
perspective.camera_focal_length = perspective.camera_focal_length && p.perspective.camera_focal_length == other.perspective.camera_focal_length;
|
||||
perspective.camera_pitch = perspective.camera_pitch && p.perspective.camera_pitch == other.perspective.camera_pitch;
|
||||
perspective.camera_scale = perspective.camera_scale && p.perspective.camera_scale == other.perspective.camera_scale;
|
||||
@ -3259,6 +3261,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
||||
toEdit.distortion.amount = dontforceSet && options.baBehav[ADDSET_DIST_AMOUNT] ? toEdit.distortion.amount + mods.distortion.amount : mods.distortion.amount;
|
||||
}
|
||||
|
||||
if (distortion.defish) {
|
||||
toEdit.distortion.defish = mods.distortion.defish;
|
||||
}
|
||||
|
||||
if (distortion.focal_length != DistortionParams::DEFAULT_FOCAL_LENGTH) {
|
||||
toEdit.distortion.focal_length = dontforceSet && options.baBehav[ADDSET_DIST_FOCAL_LENGTH] ? toEdit.distortion.focal_length + mods.distortion.focal_length : mods.distortion.focal_length;
|
||||
}
|
||||
|
||||
if (lensProf.lcMode) {
|
||||
toEdit.lensProf.lcMode = mods.lensProf.lcMode;
|
||||
}
|
||||
@ -3307,10 +3317,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
||||
toEdit.perspective.camera_crop_factor = dontforceSet && options.baBehav[ADDSET_PERSP_CAM_FOCAL_LENGTH] ? toEdit.perspective.camera_crop_factor + mods.perspective.camera_crop_factor : mods.perspective.camera_crop_factor;
|
||||
}
|
||||
|
||||
if (perspective.camera_defish) {
|
||||
toEdit.perspective.camera_defish = mods.perspective.camera_defish;
|
||||
}
|
||||
|
||||
if (perspective.camera_scale) {
|
||||
toEdit.perspective.camera_scale =
|
||||
dontforceSet && options.baBehav[ADDSET_PERSP_CAM_FOCAL_LENGTH]
|
||||
|
@ -386,6 +386,8 @@ struct RotateParamsEdited {
|
||||
|
||||
struct DistortionParamsEdited {
|
||||
bool amount;
|
||||
bool defish;
|
||||
bool focal_length;
|
||||
};
|
||||
class LocallabParamsEdited
|
||||
{
|
||||
@ -1110,7 +1112,6 @@ struct PerspectiveParamsEdited {
|
||||
bool horizontal;
|
||||
bool vertical;
|
||||
bool camera_crop_factor;
|
||||
bool camera_defish;
|
||||
bool camera_focal_length;
|
||||
bool camera_pitch;
|
||||
bool camera_scale;
|
||||
|
@ -89,7 +89,6 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M("
|
||||
|
||||
auto mapper = ProcEventMapper::getInstance();
|
||||
// Normal events.
|
||||
EvPerspCamDefish = mapper->newEvent(TRANSFORM, "HISTORY_MSG_PERSP_CAM_DEFISH");
|
||||
EvPerspCamAngle = mapper->newEvent(TRANSFORM, "HISTORY_MSG_PERSP_CAM_ANGLE");
|
||||
EvPerspCamFocalLength = mapper->newEvent(TRANSFORM, "HISTORY_MSG_PERSP_CAM_FL");
|
||||
EvPerspCamShift = mapper->newEvent(TRANSFORM, "HISTORY_MSG_PERSP_CAM_SHIFT");
|
||||
@ -100,7 +99,6 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M("
|
||||
EvPerspProjShift = mapper->newEvent(TRANSFORM, "HISTORY_MSG_PERSP_PROJ_SHIFT");
|
||||
EvPerspRender = mapper->newEvent(TRANSFORM, "GENERAL_NA");
|
||||
// Void events.
|
||||
EvPerspCamDefishVoid = mapper->newEvent(M_VOID, "HISTORY_MSG_PERSP_CAM_DEFISH");
|
||||
EvPerspCamAngleVoid = mapper->newEvent(M_VOID, "HISTORY_MSG_PERSP_CAM_ANGLE");
|
||||
EvPerspCamFocalLengthVoid = mapper->newEvent(M_VOID, "HISTORY_MSG_PERSP_CAM_FL");
|
||||
EvPerspCamShiftVoid = mapper->newEvent(M_VOID, "HISTORY_MSG_PERSP_CAM_SHIFT");
|
||||
@ -254,10 +252,6 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M("
|
||||
camera_scale= Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_CAMERA_SCALE"), 0.1, 10, 0.01, 0));
|
||||
camera_scale->setAdjusterListener (this);
|
||||
|
||||
camera_defish = Gtk::manage(new Gtk::CheckButton(M("TP_PERSPECTIVE_CAMERA_DEFISH")));
|
||||
camera_defish->signal_toggled().connect(sigc::mem_fun(*this, &PerspCorrection::defishChanged));
|
||||
|
||||
|
||||
Gtk::Frame* recovery_frame = Gtk::manage (new Gtk::Frame
|
||||
(M("TP_PERSPECTIVE_RECOVERY_FRAME")));
|
||||
recovery_frame->set_label_align(0.025, 0.5);
|
||||
@ -277,7 +271,6 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M("
|
||||
auto_hbox->pack_start (*auto_yaw);
|
||||
auto_hbox->pack_start (*auto_pitch_yaw);
|
||||
|
||||
camera_vbox->pack_start (*camera_defish);
|
||||
camera_vbox->pack_start (*camera_focal_length);
|
||||
camera_vbox->pack_start (*camera_crop_factor);
|
||||
camera_vbox->pack_start (*camera_shift_horiz);
|
||||
@ -346,7 +339,6 @@ void PerspCorrection::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
vert->setValue (pp->perspective.vertical);
|
||||
setFocalLengthValue (pp, metadata);
|
||||
camera_pitch->setValue (pp->perspective.camera_pitch);
|
||||
camera_defish->set_active(pp->perspective.camera_defish);
|
||||
camera_scale->setValue (pp->perspective.camera_scale);
|
||||
camera_roll->setValue (pp->perspective.camera_roll);
|
||||
camera_shift_horiz->setValue (pp->perspective.camera_shift_horiz);
|
||||
@ -400,7 +392,6 @@ void PerspCorrection::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->perspective.camera_focal_length = camera_focal_length->getValue ();
|
||||
}
|
||||
pp->perspective.camera_pitch = camera_pitch->getValue ();
|
||||
pp->perspective.camera_defish = camera_defish->get_active ();
|
||||
pp->perspective.camera_scale = camera_scale->getValue ();
|
||||
pp->perspective.camera_roll = camera_roll->getValue ();
|
||||
pp->perspective.camera_shift_horiz = camera_shift_horiz->getValue ();
|
||||
@ -424,7 +415,6 @@ void PerspCorrection::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
}
|
||||
|
||||
if (pedited) {
|
||||
pedited->perspective.camera_defish = true;
|
||||
pedited->perspective.method = method->get_active_row_number() != 2;
|
||||
pedited->perspective.horizontal = horiz->getEditedState ();
|
||||
pedited->perspective.vertical = vert->getEditedState ();
|
||||
@ -644,13 +634,6 @@ void PerspCorrection::methodChanged (void)
|
||||
|
||||
}
|
||||
|
||||
void PerspCorrection::defishChanged()
|
||||
{
|
||||
if (listener) {
|
||||
listener->panelChanged(EvPerspCamDefish, camera_defish->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
void PerspCorrection::setAdjusterBehavior (
|
||||
bool badd,
|
||||
bool camera_focal_length_add,
|
||||
@ -906,7 +889,6 @@ void PerspCorrection::requestApplyControlLines(void)
|
||||
void PerspCorrection::setCamBasedEventsActive(bool active)
|
||||
{
|
||||
if (active) {
|
||||
event_persp_cam_defish = &EvPerspCamDefish;
|
||||
event_persp_cam_focal_length = &EvPerspCamFocalLength;
|
||||
event_persp_cam_shift = &EvPerspCamShift;
|
||||
event_persp_cam_angle = &EvPerspCamAngle;
|
||||
@ -915,7 +897,6 @@ void PerspCorrection::setCamBasedEventsActive(bool active)
|
||||
event_persp_proj_rotate = &EvPerspProjRotate;
|
||||
event_persp_proj_angle = &EvPerspProjAngle;
|
||||
} else {
|
||||
event_persp_cam_defish = &EvPerspCamDefishVoid;
|
||||
event_persp_cam_focal_length = &EvPerspCamFocalLengthVoid;
|
||||
event_persp_cam_shift = &EvPerspCamShiftVoid;
|
||||
event_persp_cam_angle = &EvPerspCamAngleVoid;
|
||||
|
@ -65,11 +65,9 @@ protected:
|
||||
Adjuster* projection_pitch;
|
||||
Adjuster* projection_rotate;
|
||||
Adjuster* camera_scale;
|
||||
Gtk::CheckButton* camera_defish;
|
||||
Adjuster* projection_shift_horiz;
|
||||
Adjuster* projection_shift_vert;
|
||||
Adjuster* projection_yaw;
|
||||
rtengine::ProcEvent EvPerspCamDefish;
|
||||
rtengine::ProcEvent EvPerspCamFocalLength;
|
||||
rtengine::ProcEvent EvPerspCamShift;
|
||||
rtengine::ProcEvent EvPerspCamAngle;
|
||||
@ -80,7 +78,6 @@ protected:
|
||||
rtengine::ProcEvent EvPerspCamScale;
|
||||
rtengine::ProcEvent EvPerspProjAngle;
|
||||
rtengine::ProcEvent EvPerspRender;
|
||||
rtengine::ProcEvent EvPerspCamDefishVoid;
|
||||
rtengine::ProcEvent EvPerspCamFocalLengthVoid;
|
||||
rtengine::ProcEvent EvPerspCamShiftVoid;
|
||||
rtengine::ProcEvent EvPerspCamAngleVoid;
|
||||
@ -88,7 +85,6 @@ protected:
|
||||
rtengine::ProcEvent EvPerspProjRotateVoid;
|
||||
rtengine::ProcEvent EvPerspCamScaleVoid;
|
||||
rtengine::ProcEvent EvPerspProjAngleVoid;
|
||||
rtengine::ProcEvent* event_persp_cam_defish;
|
||||
rtengine::ProcEvent* event_persp_cam_focal_length;
|
||||
rtengine::ProcEvent* event_persp_cam_shift;
|
||||
rtengine::ProcEvent* event_persp_cam_angle;
|
||||
@ -127,7 +123,6 @@ public:
|
||||
void linesEditButtonPressed (void);
|
||||
void linesEraseButtonPressed (void);
|
||||
void methodChanged (void);
|
||||
void defishChanged (void);
|
||||
void requestApplyControlLines(void);
|
||||
void setAdjusterBehavior (
|
||||
bool badd,
|
||||
|
Loading…
x
Reference in New Issue
Block a user