/* * This file is part of RawTherapee. * * Copyright (c) 2004-2010 Gabor Horvath * * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * RawTherapee is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ #include "paramsedited.h" #include #include "options.h" #include "addsetids.h" ParamsEdited::ParamsEdited (bool value) { set (value); } void ParamsEdited::set (bool v) { general.rank = v; general.colorlabel = v; general.intrash = v; toneCurve.curve = v; toneCurve.curve2 = v; toneCurve.curveMode = v; toneCurve.curveMode2 = v; toneCurve.brightness = v; toneCurve.black = v; toneCurve.contrast = v; toneCurve.saturation = v; toneCurve.shcompr = v; toneCurve.hlcompr = v; toneCurve.hlcomprthresh = v; toneCurve.autoexp = v; toneCurve.clip = v; toneCurve.expcomp = v; toneCurve.hrenabled = v; toneCurve.method = v; labCurve.lcurve = v; labCurve.acurve = v; labCurve.bcurve = v; labCurve.cccurve = v; labCurve.chcurve = v; labCurve.lhcurve = v; labCurve.hhcurve = v; labCurve.lccurve = v; labCurve.clcurve = v; labCurve.brightness = v; labCurve.contrast = v; labCurve.chromaticity = v; labCurve.avoidcolorshift = v; labCurve.rstprotection = v; labCurve.lcredsk = v; rgbCurves.lumamode = v; rgbCurves.rcurve = v; rgbCurves.gcurve = v; rgbCurves.bcurve = v; colorToning.enabled = v; colorToning.autosat = v; colorToning.opacityCurve = v; colorToning.colorCurve = v; colorToning.satprotectionthreshold = v; colorToning.saturatedopacity = v; colorToning.strength = v; colorToning.shadowsColSat = v; colorToning.hlColSat = v; colorToning.balance = v; colorToning.clcurve = v; colorToning.method = v; colorToning.twocolor = v; colorToning.cl2curve = v; colorToning.redlow = v; colorToning.greenlow = v; colorToning.bluelow = v; colorToning.satlow = v; colorToning.sathigh = v; colorToning.redmed = v; colorToning.greenmed = v; colorToning.bluemed = v; colorToning.redhigh = v; colorToning.greenhigh = v; colorToning.bluehigh = v; colorToning.lumamode = v; sharpening.enabled = v; sharpening.radius = v; sharpening.amount = v; sharpening.threshold = v; sharpening.edgesonly = v; sharpening.edges_radius = v; sharpening.edges_tolerance = v; sharpening.halocontrol = v; sharpening.halocontrol_amount = v; sharpening.method = v; sharpening.deconvamount = v; sharpening.deconvradius = v; sharpening.deconviter = v; sharpening.deconvdamping = v; prsharpening.enabled = v; prsharpening.radius = v; prsharpening.amount = v; prsharpening.threshold = v; prsharpening.edgesonly = v; prsharpening.edges_radius = v; prsharpening.edges_tolerance = v; prsharpening.halocontrol = v; prsharpening.halocontrol_amount = v; prsharpening.method = v; prsharpening.deconvamount = v; prsharpening.deconvradius = v; prsharpening.deconviter = v; prsharpening.deconvdamping = v; sharpenEdge.enabled = v; sharpenEdge.passes = v; sharpenEdge.amount = v; sharpenEdge.threechannels = v; sharpenMicro.enabled = v; sharpenMicro.matrix = v; sharpenMicro.amount = v; sharpenMicro.uniformity = v; vibrance.enabled = v; vibrance.pastels = v; vibrance.saturated = v; vibrance.psthreshold = v; vibrance.protectskins = v; vibrance.avoidcolorshift = v; vibrance.pastsattog = v; vibrance.skintonescurve = v; colorappearance.enabled = v; colorappearance.degree = v; colorappearance.autodegree = v; colorappearance.surround = v; colorappearance.adapscen = v; colorappearance.autoadapscen = v; colorappearance.adaplum = v; colorappearance.badpixsl = v; colorappearance.wbmodel = v; colorappearance.algo = v; colorappearance.jlight = v; colorappearance.qbright = v; colorappearance.chroma = v; colorappearance.schroma = v; colorappearance.mchroma = v; colorappearance.contrast = v; colorappearance.qcontrast = v; colorappearance.colorh = v; colorappearance.rstprotection = v; colorappearance.surrsource = v; colorappearance.gamut = v; // colorappearance.badpix = v; colorappearance.datacie = v; colorappearance.tonecie = v; // colorappearance.sharpcie = v; colorappearance.curve = v; colorappearance.curve2 = v; colorappearance.curve3 = v; colorappearance.curveMode = v; colorappearance.curveMode2 = v; colorappearance.curveMode3 = v; //colorBoost.amount = v; //colorBoost.avoidclip = v; //colorBoost.enable_saturationlimiter = v; //colorBoost.saturationlimit = v; wb.method = v; wb.green = v; wb.temperature = v; wb.equal = v; //colorShift.a = v; //colorShift.b = v; //lumaDenoise.enabled = v; //lumaDenoise.radius = v; //lumaDenoise.edgetolerance = v; //colorDenoise.enabled = v; //colorDenoise.amount = v; defringe.enabled = v; defringe.radius = v; defringe.threshold = v; defringe.huecurve = v; impulseDenoise.enabled = v; impulseDenoise.thresh = v; dirpyrDenoise.enabled = v; dirpyrDenoise.enhance = v; // dirpyrDenoise.perform = v; dirpyrDenoise.lcurve = v; dirpyrDenoise.cccurve = v; dirpyrDenoise.median = v; dirpyrDenoise.autochroma = v; dirpyrDenoise.luma = v; dirpyrDenoise.Ldetail = v; dirpyrDenoise.chroma = v; dirpyrDenoise.redchro = v; dirpyrDenoise.bluechro = v; dirpyrDenoise.gamma = v; dirpyrDenoise.passes = v; dirpyrDenoise.dmethod = v; dirpyrDenoise.Lmethod = v; dirpyrDenoise.Cmethod = v; dirpyrDenoise.C2method = v; dirpyrDenoise.smethod = v; dirpyrDenoise.medmethod = v; dirpyrDenoise.methodmed = v; dirpyrDenoise.rgbmethod = v; epd.enabled = v; epd.strength = v; epd.gamma = v; epd.edgeStopping = v; epd.scale = v; epd.reweightingIterates = v; sh.enabled = v; sh.hq = v; sh.highlights = v; sh.htonalwidth = v; sh.shadows = v; sh.stonalwidth = v; sh.localcontrast = v; sh.radius = v; crop.enabled = v; crop.x = v; crop.y = v; crop.w = v; crop.h = v; crop.fixratio = v; crop.ratio = v; crop.orientation = v; crop.guide = v; coarse.rotate = v; coarse.hflip = v; coarse.vflip = v; commonTrans.autofill = v; rotate.degree = v; distortion.amount = v; lensProf.lcpFile = v; lensProf.useDist = v; lensProf.useVign = v; lensProf.useCA = v; perspective.horizontal = v; perspective.vertical = v; gradient.enabled = v; gradient.degree = v; gradient.feather = v; gradient.strength = v; gradient.centerX = v; gradient.centerY = v; pcvignette.enabled = v; pcvignette.strength = v; pcvignette.feather = v; pcvignette.roundness = v; cacorrection.red = v; cacorrection.blue = v; vignetting.amount = v; vignetting.radius = v; vignetting.strength = v; vignetting.centerX = v; vignetting.centerY = v; chmixer.red[0] = v; chmixer.red[1] = v; chmixer.red[2] = v; chmixer.green[0] = v; chmixer.green[1] = v; chmixer.green[2] = v; chmixer.blue[0] = v; chmixer.blue[1] = v; chmixer.blue[2] = v; blackwhite.enabled = v; blackwhite.enabledcc = v; blackwhite.mixerRed = v; blackwhite.mixerOrange = v; blackwhite.mixerYellow = v; blackwhite.mixerGreen = v; blackwhite.mixerCyan = v; blackwhite.mixerBlue = v; blackwhite.mixerMagenta = v; blackwhite.mixerPurple = v; blackwhite.gammaRed = v; blackwhite.gammaGreen = v; blackwhite.gammaBlue = v; blackwhite.filter = v; blackwhite.setting = v; blackwhite.method = v; blackwhite.luminanceCurve = v; blackwhite.beforeCurve = v; blackwhite.beforeCurveMode = v; blackwhite.afterCurve = v; blackwhite.afterCurveMode = v; blackwhite.autoc = v; blackwhite.algo = v; resize.scale = v; resize.appliesTo = v; resize.method = v; resize.dataspec = v; resize.width = v; resize.height = v; resize.enabled = v; icm.input = v; icm.toneCurve = v; icm.applyLookTable = v; icm.applyBaselineExposureOffset = v; icm.applyHueSatMap = v; icm.blendCMSMatrix = v; icm.dcpIlluminant = v; icm.working = v; icm.output = v; icm.gamma = v; icm.freegamma = v; icm.gampos = v; icm.slpos = v; raw.bayersensor.method = v; raw.bayersensor.ccSteps = v; raw.bayersensor.exBlack0 = v; raw.bayersensor.exBlack1 = v; raw.bayersensor.exBlack2 = v; raw.bayersensor.exBlack3 = v; raw.bayersensor.exTwoGreen=v; raw.bayersensor.dcbIterations = v; raw.bayersensor.dcbEnhance = v; //raw.bayersensor.allEnhance = v; raw.bayersensor.lmmseIterations = v; raw.bayersensor.greenEq = v; raw.bayersensor.linenoise = v; raw.xtranssensor.method = v; raw.xtranssensor.ccSteps = v; raw.xtranssensor.exBlackRed= v; raw.xtranssensor.exBlackGreen = v; raw.xtranssensor.exBlackBlue = v; raw.caCorrection = v; raw.caBlue = v; raw.caRed = v; raw.hotPixelFilter = v; raw.deadPixelFilter = v; raw.hotDeadPixelThresh = v; raw.darkFrame = v; raw.dfAuto = v; raw.ff_file = v; raw.ff_AutoSelect = v; raw.ff_BlurRadius = v; raw.ff_BlurType = v; raw.ff_AutoClipControl = v; raw.ff_clipControl = v; raw.exPos = v; raw.exPreser = v; wavelet.enabled = v; wavelet.strength = v; wavelet.balance = v; wavelet.iter = v; wavelet.median = v; wavelet.medianlev = v; wavelet.linkedg = v; wavelet.cbenab = v; wavelet.greenhigh = v; wavelet.greenmed = v; wavelet.greenlow = v; wavelet.bluehigh = v; wavelet.bluemed = v; wavelet.bluelow = v; wavelet.lipst = v; wavelet.Medgreinf = v; wavelet.avoid = v; wavelet.tmr = v; wavelet.Lmethod = v; wavelet.CLmethod = v; wavelet.Backmethod = v; wavelet.Tilesmethod = v; wavelet.daubcoeffmethod = v; wavelet.CHmethod = v; wavelet.CHSLmethod = v; wavelet.EDmethod = v; wavelet.BAmethod = v; wavelet.TMmethod = v; wavelet.HSmethod = v; wavelet.Dirmethod = v; wavelet.rescon = v; wavelet.resconH = v; wavelet.reschro = v; wavelet.tmrs = v; wavelet.gamma = v; wavelet.sup = v; wavelet.sky = v; wavelet.thres = v; wavelet.threshold = v; wavelet.threshold2 = v; wavelet.edgedetect = v; wavelet.edgedetectthr = v; wavelet.edgedetectthr2 = v; wavelet.chroma = v; wavelet.chro = v; wavelet.contrast = v; wavelet.edgrad = v; wavelet.edgval = v; wavelet.edgthresh = v; wavelet.thr = v; wavelet.thrH = v; wavelet.skinprotect = v; wavelet.hueskin = v; wavelet.hueskin2 = v; wavelet.hllev = v; wavelet.bllev = v; wavelet.edgcont = v; wavelet.level0noise = v; wavelet.level1noise = v; wavelet.level2noise = v; wavelet.ccwcurve = v; wavelet.opacityCurveRG = v; wavelet.opacityCurveBY = v; wavelet.opacityCurveW = v; wavelet.opacityCurveWL = v; wavelet.hhcurve = v; wavelet.Chcurve = v; wavelet.wavclCurve = v; wavelet.pastlev = v; wavelet.satlev = v; // wavelet.enacont = v; // wavelet.enachrom = v; // wavelet.enaedge = v; // wavelet.enares = v; wavelet.expfinal = v; wavelet.expcontrast = v; wavelet.expchroma = v; wavelet.expedge = v; wavelet.expresid = v; wavelet.exptoning = v; wavelet.expnoise = v; for(int i = 0; i < 9; i++) { wavelet.c[i] = v; } for(int i = 0; i < 9; i++) { wavelet.ch[i] = v; } dirpyrequalizer.enabled = v; dirpyrequalizer.gamutlab = v; for(int i = 0; i < 6; i++) { dirpyrequalizer.mult[i] = v; } dirpyrequalizer.threshold = v; dirpyrequalizer.skinprotect = v; dirpyrequalizer.hueskin = v; //dirpyrequalizer.algo = v; hsvequalizer.hcurve = v; hsvequalizer.scurve = v; hsvequalizer.vcurve = v; filmSimulation.enabled = v; filmSimulation.clutFilename = v; filmSimulation.strength = v; exif = v; iptc = v; } using namespace rtengine; using namespace rtengine::procparams; void ParamsEdited::initFrom (const std::vector& src) { set (true); if (src.empty()) return; const ProcParams& p = src[0]; for (size_t i=1; ifirst] = i->second; } // IPTC changes are added to the existing ones if (iptc) for (procparams::IPTCPairs::const_iterator i=mods.iptc.begin(); i!=mods.iptc.end(); i++) { toEdit.iptc[i->first] = i->second; } } bool RAWParamsEdited::BayerSensor::isUnchanged() const { return method && ccSteps && dcbIterations && dcbEnhance && lmmseIterations/*&& allEnhance*/ && greenEq && linenoise && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen; } bool RAWParamsEdited::XTransSensor::isUnchanged() const { return method && ccSteps && exBlackRed && exBlackGreen && exBlackBlue; } bool RAWParamsEdited::isUnchanged() const { return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && caCorrection && caRed && caBlue && hotPixelFilter && deadPixelFilter && hotDeadPixelThresh && darkFrame && dfAuto && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl; } bool LensProfParamsEdited::isUnchanged() const { return lcpFile; }