The "dual-spot" exponents calculation feature now honors the master (green) exponent set by the user, and adjusts red and blue based on the ratios between the new, "guessed" exponents.
This way, if the user has chosen a different master exponent than the default, using the feature just alters the color characteristic of the conversion, while keeping the same contrast level.
This commit is contained in:
parent
8c6458daff
commit
2fde6e562a
@ -151,9 +151,9 @@ bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D s
|
||||
// compared to the ratio in the reference channel (green)
|
||||
for (int ch = 0; ch < 3; ++ch) {
|
||||
if (ch == 1) {
|
||||
newExps[ch] = 2.f; // Green is the reference channel
|
||||
newExps[ch] = 1.f; // Green is the reference channel
|
||||
} else {
|
||||
newExps[ch] = CLAMP(2.f * logBase(clearVals[ch] / denseVals[ch], denseGreenRatio), 0.3f, 6.f);
|
||||
newExps[ch] = CLAMP(logBase(clearVals[ch] / denseVals[ch], denseGreenRatio), 0.3f, 6.f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -273,11 +273,12 @@ bool FilmNegative::button1Pressed(int modifierKey)
|
||||
std::array<float, 3> newExps;
|
||||
if (fnp->getFilmNegativeExponents(refSpotCoords[0], refSpotCoords[1], newExps)) {
|
||||
disableListener();
|
||||
redExp->setValue(newExps[0]);
|
||||
greenExp->setValue(newExps[1]);
|
||||
blueExp->setValue(newExps[2]);
|
||||
redRatio = redExp->getValue() / greenExp->getValue();
|
||||
blueRatio = blueExp->getValue() / greenExp->getValue();
|
||||
// Leaving green exponent unchanged, setting red and blue exponents based on
|
||||
// the ratios between newly calculated exponents.
|
||||
redRatio = newExps[0] / newExps[1];
|
||||
blueRatio = newExps[2] / newExps[1];
|
||||
redExp->setValue(greenExp->getValue() * redRatio);
|
||||
blueExp->setValue(greenExp->getValue() * blueRatio);
|
||||
enableListener();
|
||||
|
||||
if (listener && getEnabled()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user