Perspective correction implemented
This commit is contained in:
@@ -88,9 +88,12 @@ void ParamsEdited::set (bool v) {
|
||||
coarse.rotate = v;
|
||||
coarse.hflip = v;
|
||||
coarse.vflip = v;
|
||||
commonTrans.autofill = v;
|
||||
rotate.degree = v;
|
||||
rotate.fill = v;
|
||||
distortion.uselensfun = v;
|
||||
distortion.amount = v;
|
||||
perspective.horizontal = v;
|
||||
perspective.vertical = v;
|
||||
cacorrection.red = v;
|
||||
cacorrection.blue = v;
|
||||
vignetting.amount = v;
|
||||
@@ -192,9 +195,12 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
coarse.rotate = coarse.rotate && p.coarse.rotate == other.coarse.rotate;
|
||||
coarse.hflip = coarse.hflip && p.coarse.hflip == other.coarse.hflip;
|
||||
coarse.vflip = coarse.vflip && p.coarse.vflip == other.coarse.vflip;
|
||||
commonTrans.autofill = commonTrans.autofill && p.commonTrans.autofill == other.commonTrans.autofill;
|
||||
rotate.degree = rotate.degree && p.rotate.degree == other.rotate.degree;
|
||||
rotate.fill = rotate.fill && p.rotate.fill == other.rotate.fill;
|
||||
distortion.uselensfun = distortion.uselensfun && p.distortion.uselensfun == other.distortion.uselensfun;
|
||||
distortion.amount = distortion.amount && p.distortion.amount == other.distortion.amount;
|
||||
perspective.horizontal = perspective.horizontal && p.perspective.horizontal == other.perspective.horizontal;
|
||||
perspective.vertical = perspective.vertical && p.perspective.vertical == other.perspective.vertical;
|
||||
cacorrection.red = cacorrection.red && p.cacorrection.red == other.cacorrection.red;
|
||||
cacorrection.blue = cacorrection.blue && p.cacorrection.blue == other.cacorrection.blue;
|
||||
vignetting.amount = vignetting.amount && p.vignetting.amount == other.vignetting.amount;
|
||||
@@ -267,33 +273,36 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (lumaDenoise.edgetolerance) toEdit.lumaDenoise.edgetolerance = options.baBehav[ADDSET_LD_EDGETOLERANCE] ? toEdit.lumaDenoise.edgetolerance + mods.lumaDenoise.edgetolerance : mods.lumaDenoise.edgetolerance;
|
||||
if (colorDenoise.enabled) toEdit.colorDenoise.enabled = mods.colorDenoise.enabled;
|
||||
if (colorDenoise.amount) toEdit.colorDenoise.amount = mods.colorDenoise.amount;
|
||||
if (sh.enabled) toEdit.sh.enabled = mods.sh.enabled;
|
||||
if (sh.hq) toEdit.sh.hq = mods.sh.hq;
|
||||
if (sh.highlights) toEdit.sh.highlights = options.baBehav[ADDSET_SH_HIGHLIGHTS] ? toEdit.sh.highlights + mods.sh.highlights : mods.sh.highlights;
|
||||
if (sh.htonalwidth) toEdit.sh.htonalwidth = mods.sh.htonalwidth;
|
||||
if (sh.shadows) toEdit.sh.shadows = options.baBehav[ADDSET_SH_SHADOWS] ? toEdit.sh.shadows + mods.sh.shadows : mods.sh.shadows;
|
||||
if (sh.stonalwidth) toEdit.sh.stonalwidth = mods.sh.stonalwidth;
|
||||
if (sh.localcontrast) toEdit.sh.localcontrast = options.baBehav[ADDSET_SH_LOCALCONTRAST] ? toEdit.sh.localcontrast + mods.sh.localcontrast : mods.sh.localcontrast;
|
||||
if (sh.radius) toEdit.sh.radius = mods.sh.radius;
|
||||
if (crop.enabled) toEdit.crop.enabled = mods.crop.enabled;
|
||||
if (crop.x) toEdit.crop.x = mods.crop.x;
|
||||
if (crop.y) toEdit.crop.y = mods.crop.y;
|
||||
if (crop.w) toEdit.crop.w = mods.crop.w;
|
||||
if (crop.h) toEdit.crop.h = mods.crop.h;
|
||||
if (crop.fixratio) toEdit.crop.fixratio = mods.crop.fixratio;
|
||||
if (crop.ratio) toEdit.crop.ratio = mods.crop.ratio;
|
||||
if (crop.orientation) toEdit.crop.orientation = mods.crop.orientation;
|
||||
if (crop.guide) toEdit.crop.guide = mods.crop.guide;
|
||||
if (coarse.rotate) toEdit.coarse.rotate = (toEdit.coarse.rotate + mods.coarse.rotate) % 360;
|
||||
if (coarse.hflip) toEdit.coarse.hflip = mods.coarse.hflip ? !toEdit.coarse.hflip : toEdit.coarse.hflip;
|
||||
if (coarse.vflip) toEdit.coarse.vflip = mods.coarse.vflip ? !toEdit.coarse.vflip : toEdit.coarse.vflip;
|
||||
if (rotate.degree) toEdit.rotate.degree = options.baBehav[17] ? toEdit.rotate.degree + mods.rotate.degree : mods.rotate.degree;
|
||||
if (rotate.fill) toEdit.rotate.fill = mods.rotate.fill;
|
||||
if (distortion.amount) toEdit.distortion.amount = options.baBehav[ADDSET_DIST_AMOUNT] ? toEdit.distortion.amount + mods.distortion.amount : mods.distortion.amount;
|
||||
if (cacorrection.red) toEdit.cacorrection.red = options.baBehav[ADDSET_CA_RED] ? toEdit.cacorrection.red + mods.cacorrection.red : mods.cacorrection.red;
|
||||
if (cacorrection.blue) toEdit.cacorrection.blue = options.baBehav[ADDSET_CA_BLUE] ? toEdit.cacorrection.blue + mods.cacorrection.blue : mods.cacorrection.blue;
|
||||
if (vignetting.amount) toEdit.vignetting.amount = options.baBehav[ADDSET_VIGN_AMOUNT] ? toEdit.vignetting.amount + mods.vignetting.amount : mods.vignetting.amount;
|
||||
if (vignetting.radius) toEdit.vignetting.radius = mods.vignetting.radius;
|
||||
if (sh.enabled) toEdit.sh.enabled = mods.sh.enabled;
|
||||
if (sh.hq) toEdit.sh.hq = mods.sh.hq;
|
||||
if (sh.highlights) toEdit.sh.highlights = options.baBehav[ADDSET_SH_HIGHLIGHTS] ? toEdit.sh.highlights + mods.sh.highlights : mods.sh.highlights;
|
||||
if (sh.htonalwidth) toEdit.sh.htonalwidth = mods.sh.htonalwidth;
|
||||
if (sh.shadows) toEdit.sh.shadows = options.baBehav[ADDSET_SH_SHADOWS] ? toEdit.sh.shadows + mods.sh.shadows : mods.sh.shadows;
|
||||
if (sh.stonalwidth) toEdit.sh.stonalwidth = mods.sh.stonalwidth;
|
||||
if (sh.localcontrast) toEdit.sh.localcontrast = options.baBehav[ADDSET_SH_LOCALCONTRAST] ? toEdit.sh.localcontrast + mods.sh.localcontrast : mods.sh.localcontrast;
|
||||
if (sh.radius) toEdit.sh.radius = mods.sh.radius;
|
||||
if (crop.enabled) toEdit.crop.enabled = mods.crop.enabled;
|
||||
if (crop.x) toEdit.crop.x = mods.crop.x;
|
||||
if (crop.y) toEdit.crop.y = mods.crop.y;
|
||||
if (crop.w) toEdit.crop.w = mods.crop.w;
|
||||
if (crop.h) toEdit.crop.h = mods.crop.h;
|
||||
if (crop.fixratio) toEdit.crop.fixratio = mods.crop.fixratio;
|
||||
if (crop.ratio) toEdit.crop.ratio = mods.crop.ratio;
|
||||
if (crop.orientation) toEdit.crop.orientation = mods.crop.orientation;
|
||||
if (crop.guide) toEdit.crop.guide = mods.crop.guide;
|
||||
if (coarse.rotate) toEdit.coarse.rotate = (toEdit.coarse.rotate + mods.coarse.rotate) % 360;
|
||||
if (coarse.hflip) toEdit.coarse.hflip = mods.coarse.hflip ? !toEdit.coarse.hflip : toEdit.coarse.hflip;
|
||||
if (coarse.vflip) toEdit.coarse.vflip = mods.coarse.vflip ? !toEdit.coarse.vflip : toEdit.coarse.vflip;
|
||||
if (commonTrans.autofill) toEdit.commonTrans.autofill = mods.commonTrans.autofill;
|
||||
if (rotate.degree) toEdit.rotate.degree = options.baBehav[17] ? toEdit.rotate.degree + mods.rotate.degree : mods.rotate.degree;
|
||||
if (distortion.uselensfun) toEdit.distortion.uselensfun = mods.distortion.uselensfun;
|
||||
if (distortion.amount) toEdit.distortion.amount = options.baBehav[ADDSET_DIST_AMOUNT] ? toEdit.distortion.amount + mods.distortion.amount : mods.distortion.amount;
|
||||
if (perspective.horizontal) toEdit.perspective.horizontal = options.baBehav[ADDSET_PERSPECTIVE] ? toEdit.perspective.horizontal + mods.perspective.horizontal : mods.perspective.horizontal;
|
||||
if (perspective.vertical) toEdit.perspective.vertical = options.baBehav[ADDSET_PERSPECTIVE] ? toEdit.perspective.vertical + mods.perspective.vertical : mods.perspective.vertical;
|
||||
if (cacorrection.red) toEdit.cacorrection.red = options.baBehav[ADDSET_CA] ? toEdit.cacorrection.red + mods.cacorrection.red : mods.cacorrection.red;
|
||||
if (cacorrection.blue) toEdit.cacorrection.blue = options.baBehav[ADDSET_CA] ? toEdit.cacorrection.blue + mods.cacorrection.blue : mods.cacorrection.blue;
|
||||
if (vignetting.amount) toEdit.vignetting.amount = options.baBehav[ADDSET_VIGN_AMOUNT] ? toEdit.vignetting.amount + mods.vignetting.amount : mods.vignetting.amount;
|
||||
if (vignetting.radius) toEdit.vignetting.radius = mods.vignetting.radius;
|
||||
if (chmixer.red[0]) toEdit.chmixer.red[0] = mods.chmixer.red[0];
|
||||
if (chmixer.red[1]) toEdit.chmixer.red[1] = mods.chmixer.red[1];
|
||||
if (chmixer.red[2]) toEdit.chmixer.red[2] = mods.chmixer.red[2];
|
||||
|
Reference in New Issue
Block a user