Fix wrong *Sensor::Method::NONE for MONO substitution

This commit is contained in:
Flössie 2017-11-17 17:19:40 +01:00
parent e0f7c1358b
commit 0a9d81bc7f
3 changed files with 8 additions and 25 deletions

View File

@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#include <map>
#include <locale.h>
@ -437,7 +438,6 @@ void RetinexParams::getCurves (RetinextransmissionCurve &transmissionCurveLUT, R
}
void RetinexParams::getDefaultgaintransmissionCurve (std::vector<double> &curve)
{
double v[16] = { 0.00, 0.1, 0.35, 0.00,
@ -446,7 +446,6 @@ void RetinexParams::getDefaultgaintransmissionCurve (std::vector<double> &curve)
1.00, 0.1, 0.00, 0.00
};
curve.resize (17);
curve.at (0 ) = double (FCT_MinMaxCPoints);
@ -455,7 +454,6 @@ void RetinexParams::getDefaultgaintransmissionCurve (std::vector<double> &curve)
}
}
void RetinexParams::getDefaulttransmissionCurve (std::vector<double> &curve)
{
double v[12] = { 0.00, 0.50, 0.35, 0.35,
@ -463,7 +461,6 @@ void RetinexParams::getDefaulttransmissionCurve (std::vector<double> &curve)
1.00, 0.50, 0.35, 0.35,
};
curve.resize (13);
curve.at (0 ) = double (FCT_MinMaxCPoints);
@ -655,15 +652,10 @@ void ColorToningParams::mixerToCurve (std::vector<double> &colorCurve, std::vect
high[0] = high[1] = high[2] = 1.f;
}
const double xPosLow = 0.1;
const double xPosMed = 0.4;
const double xPosHigh = 0.7;
colorCurve.resize ( medSat != 0.f ? 13 : 9 );
colorCurve.at (0) = FCT_MinMaxCPoints;
opacityCurve.resize (13);
@ -808,7 +800,6 @@ void ColorToningParams::getDefaultColorCurve (std::vector<double> &curve)
}
}
void ColorToningParams::getDefaultOpacityCurve (std::vector<double> &curve)
{
double v[16] = { 0.00, 0.3, 0.35, 0.00,
@ -882,7 +873,6 @@ VibranceParams::VibranceParams() :
{
}
const std::vector<WBEntry>& WBParams::getWbEntries()
{
static const std::vector<WBEntry> wb_entries = {
@ -1291,7 +1281,6 @@ void WaveletParams::getDefaultOpacityCurveBY (std::vector<double> &curve)
};
}
void WaveletParams::getDefaultOpacityCurveW (std::vector<double> &curve)
{
curve = {
@ -1330,7 +1319,6 @@ void WaveletParams::getDefaultOpacityCurveWL (std::vector<double> &curve)
};
}
DirPyrEqualizerParams::DirPyrEqualizerParams() :
hueskin (20, 80, 2000, 1200, false)
{
@ -1721,7 +1709,6 @@ void ProcParams::setDefaults ()
cacorrection.red = 0;
cacorrection.blue = 0;
vignetting.amount = 0;
vignetting.radius = 50;
vignetting.strength = 1;
@ -1781,7 +1768,6 @@ void ProcParams::setDefaults ()
dirpyrequalizer.gamutlab = false;
dirpyrequalizer.cbdlMethod = "bef";
for (int i = 0; i < 6; i ++) {
dirpyrequalizer.mult[i] = 1.0;
}
@ -1873,7 +1859,6 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b
saveToKeyfile(!pedited || pedited->retinex.slope, "Retinex", "Slope", retinex.slope, keyFile);
saveToKeyfile(!pedited || pedited->retinex.medianmap, "Retinex", "Median", retinex.medianmap, keyFile);
saveToKeyfile(!pedited || pedited->retinex.neigh, "Retinex", "Neigh", retinex.neigh, keyFile);
saveToKeyfile(!pedited || pedited->retinex.offs, "Retinex", "Offs", retinex.offs, keyFile);
saveToKeyfile(!pedited || pedited->retinex.vart, "Retinex", "Vart", retinex.vart, keyFile);
@ -2766,11 +2751,9 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Retinex", "TransmissionCurve", pedited, retinex.transmissionCurve, pedited->retinex.transmissionCurve);
assignFromKeyfile(keyFile, "Retinex", "GainTransmissionCurve", pedited, retinex.gaintransmissionCurve, pedited->retinex.gaintransmissionCurve);
}
if (keyFile.has_group ("Luminance Curve")) {
assignFromKeyfile(keyFile, "Luminance Curve", "Brightness", pedited, labCurve.brightness, pedited->labCurve.brightness);
assignFromKeyfile(keyFile, "Luminance Curve", "Contrast", pedited, labCurve.contrast, pedited->labCurve.contrast);

View File

@ -650,8 +650,8 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima
const float new_pre_mul[4] = { ri->get_pre_mul(0) / rm, ri->get_pre_mul(1) / gm, ri->get_pre_mul(2) / bm, ri->get_pre_mul(3) / gm };
float new_scale_mul[4];
bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE))
|| (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE));
bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO))
|| (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO));
float gain = calculate_scale_mul(new_scale_mul, new_pre_mul, c_white, cblacksom, isMono, ri->get_colors());
rm = new_scale_mul[0] / scale_mul[0] * gain;
gm = new_scale_mul[1] / scale_mul[1] * gain;
@ -2047,7 +2047,7 @@ void RawImageSource::demosaic(const RAWParams &raw)
lmmse_interpolate_omp(W, H, rawData, red, green, blue, raw.bayersensor.lmmse_iterations);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST) ) {
fast_demosaic (0, 0, W, H);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) ) {
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO) ) {
nodemosaic(true);
} else {
nodemosaic(false);
@ -2062,7 +2062,7 @@ void RawImageSource::demosaic(const RAWParams &raw)
xtrans_interpolate(1, false);
} else if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::THREE_PASS) ) {
xtrans_interpolate(3, true);
} else if(raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE) ) {
} else if(raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO) ) {
nodemosaic(true);
} else {
nodemosaic(false);
@ -3429,7 +3429,7 @@ void RawImageSource::scaleColors(int winx, int winy, int winw, int winh, const R
black_lev[2] = raw.bayersensor.black2; //B
black_lev[3] = raw.bayersensor.black3; //G2
isMono = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) == raw.bayersensor.method;
isMono = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO) == raw.bayersensor.method;
} else if (getSensorType() == ST_FUJI_XTRANS) {
black_lev[0] = raw.xtranssensor.blackred; //R
@ -3437,7 +3437,7 @@ void RawImageSource::scaleColors(int winx, int winy, int winw, int winh, const R
black_lev[2] = raw.xtranssensor.blackblue; //B
black_lev[3] = raw.xtranssensor.blackgreen; //G2 (set, only used with a Bayer filter)
isMono = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE) == raw.xtranssensor.method;
isMono = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO) == raw.xtranssensor.method;
}
for(int i = 0; i < 4 ; i++) {

View File

@ -162,7 +162,7 @@ void XTransProcess::methodChanged ()
if (curSelection >= 0 && curSelection < std::numeric_limits<int>::max()) {
methodName = RAWParams::XTransSensor::getMethodStrings()[curSelection];
if (method == RAWParams::XTransSensor::Method::NONE || RAWParams::XTransSensor::Method(oldSelection) == RAWParams::XTransSensor::Method::NONE) {
if (method == RAWParams::XTransSensor::Method::MONO || RAWParams::XTransSensor::Method(oldSelection) == RAWParams::XTransSensor::Method::MONO) {
ppreq = true;
}
}