Raw white point (aka Raw exposure) ported
This commit is contained in:
@@ -480,8 +480,8 @@ PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter
|
|||||||
PARTIALPASTE_RAWCACORR_AUTO;CA auto correction
|
PARTIALPASTE_RAWCACORR_AUTO;CA auto correction
|
||||||
PARTIALPASTE_RAWCACORR_CABLUE;CA Blue
|
PARTIALPASTE_RAWCACORR_CABLUE;CA Blue
|
||||||
PARTIALPASTE_RAWCACORR_CARED;CA Red
|
PARTIALPASTE_RAWCACORR_CARED;CA Red
|
||||||
PARTIALPASTE_RAWEXPOS_LINEAR;Exposure linear corr. factor
|
PARTIALPASTE_RAWEXPOS_LINEAR;Raw white point linear corr. factor
|
||||||
PARTIALPASTE_RAWEXPOS_PRESER;Exposure HL preserving corr. (EV)
|
PARTIALPASTE_RAWEXPOS_PRESER;Raw white point HL preserving corr. (EV)
|
||||||
PARTIALPASTE_RAWGROUP;Raw settings
|
PARTIALPASTE_RAWGROUP;Raw settings
|
||||||
PARTIALPASTE_RAW_DCBENHANCE;Apply DCB enhancement step
|
PARTIALPASTE_RAW_DCBENHANCE;Apply DCB enhancement step
|
||||||
PARTIALPASTE_RAW_DCBITERATIONS;Number of DCB iterations
|
PARTIALPASTE_RAW_DCBITERATIONS;Number of DCB iterations
|
||||||
@@ -734,7 +734,7 @@ TP_EQUALIZER_FINEST;finest
|
|||||||
TP_EQUALIZER_LABEL;Wavelet equalizer
|
TP_EQUALIZER_LABEL;Wavelet equalizer
|
||||||
TP_EQUALIZER_LARGEST;coarsest
|
TP_EQUALIZER_LARGEST;coarsest
|
||||||
TP_EQUALIZER_NEUTRAL;Neutral
|
TP_EQUALIZER_NEUTRAL;Neutral
|
||||||
TP_EXPOSCORR_LABEL;Exposure
|
TP_EXPOSCORR_LABEL;Raw white point
|
||||||
TP_EXPOSURE_AUTOLEVELS;Auto Levels
|
TP_EXPOSURE_AUTOLEVELS;Auto Levels
|
||||||
TP_EXPOSURE_BLACKLEVEL;Black
|
TP_EXPOSURE_BLACKLEVEL;Black
|
||||||
TP_EXPOSURE_BRIGHTNESS;Brightness
|
TP_EXPOSURE_BRIGHTNESS;Brightness
|
||||||
|
|||||||
@@ -155,8 +155,9 @@ enum ProcEvent {
|
|||||||
EvDPDNLumCurve=127,
|
EvDPDNLumCurve=127,
|
||||||
EvDPDNChromCurve=128,
|
EvDPDNChromCurve=128,
|
||||||
EvAutoDIST=129,
|
EvAutoDIST=129,
|
||||||
|
EvPreProcessExpCorrLinear=130,
|
||||||
NUMOFEVENTS=130
|
EvPreProcessExpCorrPH=131,
|
||||||
|
NUMOFEVENTS=132
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,6 +228,10 @@ void ProcParams::setDefaults () {
|
|||||||
raw.dmethod = RAWParams::methodstring[RAWParams::hphd];;
|
raw.dmethod = RAWParams::methodstring[RAWParams::hphd];;
|
||||||
raw.dcb_iterations=2;
|
raw.dcb_iterations=2;
|
||||||
raw.dcb_enhance=false;
|
raw.dcb_enhance=false;
|
||||||
|
// exposure before interpolation
|
||||||
|
raw.expos=1.0;
|
||||||
|
raw.preser=0.0;
|
||||||
|
|
||||||
|
|
||||||
exif.clear ();
|
exif.clear ();
|
||||||
iptc.clear ();
|
iptc.clear ();
|
||||||
@@ -455,6 +459,10 @@ int ProcParams::save (Glib::ustring fname) const {
|
|||||||
keyFile.set_string ("RAW", "Method", raw.dmethod );
|
keyFile.set_string ("RAW", "Method", raw.dmethod );
|
||||||
keyFile.set_integer ("RAW", "DCBIterations", raw.dcb_iterations );
|
keyFile.set_integer ("RAW", "DCBIterations", raw.dcb_iterations );
|
||||||
keyFile.set_boolean ("RAW", "DCBEnhance", raw.dcb_enhance );
|
keyFile.set_boolean ("RAW", "DCBEnhance", raw.dcb_enhance );
|
||||||
|
keyFile.set_double ("RAW", "PreExposure", raw.expos );
|
||||||
|
keyFile.set_double ("RAW", "PrePreserv", raw.preser );
|
||||||
|
|
||||||
|
// exposition
|
||||||
|
|
||||||
// save exif change list
|
// save exif change list
|
||||||
for (int i=0; i<(int)exif.size(); i++)
|
for (int i=0; i<(int)exif.size(); i++)
|
||||||
@@ -770,6 +778,8 @@ if (keyFile.has_group ("RAW")) {
|
|||||||
if (keyFile.has_key ("RAW", "Method")) raw.dmethod = keyFile.get_string ("RAW", "Method");
|
if (keyFile.has_key ("RAW", "Method")) raw.dmethod = keyFile.get_string ("RAW", "Method");
|
||||||
if (keyFile.has_key ("RAW", "DCBIterations")) raw.dcb_iterations = keyFile.get_integer("RAW", "DCBIterations");
|
if (keyFile.has_key ("RAW", "DCBIterations")) raw.dcb_iterations = keyFile.get_integer("RAW", "DCBIterations");
|
||||||
if (keyFile.has_key ("RAW", "DCBEnhance")) raw.dcb_enhance =keyFile.get_boolean("RAW", "DCBEnhance");
|
if (keyFile.has_key ("RAW", "DCBEnhance")) raw.dcb_enhance =keyFile.get_boolean("RAW", "DCBEnhance");
|
||||||
|
if (keyFile.has_key ("RAW", "PreExposure")) raw.expos =keyFile.get_double("RAW", "PreExposure");
|
||||||
|
if (keyFile.has_key ("RAW", "PrePreserv")) raw.preser =keyFile.get_double("RAW", "PrePreserv");
|
||||||
}
|
}
|
||||||
|
|
||||||
// load exif change settings
|
// load exif change settings
|
||||||
@@ -970,7 +980,9 @@ bool ProcParams::operator== (const ProcParams& other) {
|
|||||||
&& hsvequalizer.scurve == other.hsvequalizer.scurve
|
&& hsvequalizer.scurve == other.hsvequalizer.scurve
|
||||||
&& hsvequalizer.vcurve == other.hsvequalizer.vcurve
|
&& hsvequalizer.vcurve == other.hsvequalizer.vcurve
|
||||||
&& exif==other.exif
|
&& exif==other.exif
|
||||||
&& iptc==other.iptc;
|
&& iptc==other.iptc
|
||||||
|
&& raw.expos==other.raw.expos
|
||||||
|
&& raw.preser==other.raw.preser;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProcParams::operator!= (const ProcParams& other) {
|
bool ProcParams::operator!= (const ProcParams& other) {
|
||||||
|
|||||||
@@ -408,6 +408,11 @@ class RAWParams {
|
|||||||
bool ca_autocorrect;
|
bool ca_autocorrect;
|
||||||
double cared;
|
double cared;
|
||||||
double cablue;
|
double cablue;
|
||||||
|
|
||||||
|
// exposure before interpolation
|
||||||
|
double expos;
|
||||||
|
double preser;
|
||||||
|
|
||||||
bool hotdeadpix_filt;
|
bool hotdeadpix_filt;
|
||||||
int hotdeadpix_thresh;
|
int hotdeadpix_thresh;
|
||||||
int linenoise;
|
int linenoise;
|
||||||
|
|||||||
@@ -1091,6 +1091,11 @@ void RawImageSource::preprocess (const RAWParams &raw)
|
|||||||
|
|
||||||
CA_correct_RT(raw.cared, raw.cablue);
|
CA_correct_RT(raw.cared, raw.cablue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( raw.expos !=1 ) { // exposure
|
||||||
|
exp_bef(raw.expos, raw.preser);
|
||||||
|
}
|
||||||
|
|
||||||
t2.set();
|
t2.set();
|
||||||
if( settings->verbose )
|
if( settings->verbose )
|
||||||
printf("Preprocessing: %d usec\n", t2.etime(t1));
|
printf("Preprocessing: %d usec\n", t2.etime(t1));
|
||||||
@@ -2141,6 +2146,7 @@ void RawImageSource::inverse33 (double (*rgb_cam)[3], double (*cam_rgb)[3]) {
|
|||||||
#include "CA_correct_RT.cc"//Emil's CA auto correction
|
#include "CA_correct_RT.cc"//Emil's CA auto correction
|
||||||
#include "cfa_linedn_RT.cc"//Emil's line denoise
|
#include "cfa_linedn_RT.cc"//Emil's line denoise
|
||||||
#include "green_equil_RT.cc"//Emil's green channel equilibration
|
#include "green_equil_RT.cc"//Emil's green channel equilibration
|
||||||
|
#include "expo_before_b.cc"//Jacques's exposure before interpolation
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
#undef PIX_SORT
|
#undef PIX_SORT
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ class RawImageSource : public ImageSource {
|
|||||||
int LinEqSolve( int nDim, float* pfMatr, float* pfVect, float* pfSolution);//Emil's CA auto correction
|
int LinEqSolve( int nDim, float* pfMatr, float* pfVect, float* pfSolution);//Emil's CA auto correction
|
||||||
void CA_correct_RT (double cared, double cablue);
|
void CA_correct_RT (double cared, double cablue);
|
||||||
void ddct8x8s(int isgn, float **a);
|
void ddct8x8s(int isgn, float **a);
|
||||||
|
void exp_bef (float expos, float preser); // exposure before interpolation
|
||||||
|
|
||||||
int cfaCleanFromMap( PixelsMap &bitmapBads );
|
int cfaCleanFromMap( PixelsMap &bitmapBads );
|
||||||
int findHotDeadPixel( PixelsMap &bpMap, float thresh);
|
int findHotDeadPixel( PixelsMap &bpMap, float thresh);
|
||||||
|
|||||||
@@ -149,7 +149,9 @@ DARKFRAME, // EvPreProcessDFFile
|
|||||||
RGBCURVE, // EvHLComprThreshold,
|
RGBCURVE, // EvHLComprThreshold,
|
||||||
DIRPYRDENOISE, // EvDPDNLumCurve,
|
DIRPYRDENOISE, // EvDPDNLumCurve,
|
||||||
DIRPYRDENOISE, // EvDPDNChromCurve,
|
DIRPYRDENOISE, // EvDPDNChromCurve,
|
||||||
TRANSFORM // EvAutoDIST,
|
TRANSFORM, // EvAutoDIST
|
||||||
|
DARKFRAME, // EvPreProcessExpCorrLinear
|
||||||
|
DARKFRAME, // EvPreProcessExpCorrPH
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -713,6 +713,11 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei
|
|||||||
if (params.toneCurve.autoexp && aeHistogram)
|
if (params.toneCurve.autoexp && aeHistogram)
|
||||||
ipf.getAutoExp (aeHistogram, aeHistCompression, logDefGain, params.toneCurve.clip, br, bl);
|
ipf.getAutoExp (aeHistogram, aeHistCompression, logDefGain, params.toneCurve.clip, br, bl);
|
||||||
|
|
||||||
|
// The RAW exposure is not reflected since it's done in preprocessing. If we only have e.g. the chached thumb,
|
||||||
|
// that is already preprocessed. So we simulate the effect here roughly my modifying the exposure accordingly
|
||||||
|
|
||||||
|
if (params.raw.expos!=1) br += (params.raw.expos-1.0);
|
||||||
|
printf("Param raw.exp: %f real %f\n",params.raw.expos,br);
|
||||||
LUTf curve1 (65536);
|
LUTf curve1 (65536);
|
||||||
LUTf curve2 (65536);
|
LUTf curve2 (65536);
|
||||||
LUTf curve (65536);
|
LUTf curve (65536);
|
||||||
|
|||||||
@@ -308,8 +308,8 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
|||||||
raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect;
|
raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect;
|
||||||
raw.caRed = raw.caRed && p.raw.cared == other.raw.cared;
|
raw.caRed = raw.caRed && p.raw.cared == other.raw.cared;
|
||||||
raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue;
|
raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue;
|
||||||
//raw.exPos = raw.exPos && p.raw.expos == other.raw.expos;
|
raw.exPos = raw.exPos && p.raw.expos == other.raw.expos;
|
||||||
//raw.exPreser = raw.exPreser && p.raw.preser == other.raw.preser; //exposi
|
raw.exPreser = raw.exPreser && p.raw.preser == other.raw.preser; //exposi
|
||||||
raw.darkFrame = raw.darkFrame && p.raw.dark_frame == other.raw.dark_frame;
|
raw.darkFrame = raw.darkFrame && p.raw.dark_frame == other.raw.dark_frame;
|
||||||
raw.dfAuto = raw.dfAuto && p.raw.df_autoselect == other.raw.df_autoselect;
|
raw.dfAuto = raw.dfAuto && p.raw.df_autoselect == other.raw.df_autoselect;
|
||||||
raw.ff_file = raw.ff_file && p.raw.ff_file == other.raw.ff_file;
|
raw.ff_file = raw.ff_file && p.raw.ff_file == other.raw.ff_file;
|
||||||
@@ -461,8 +461,8 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
|||||||
if (raw.caCorrection) toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect;
|
if (raw.caCorrection) toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect;
|
||||||
if (raw.caRed) toEdit.raw.cared = mods.raw.cared;
|
if (raw.caRed) toEdit.raw.cared = mods.raw.cared;
|
||||||
if (raw.caBlue) toEdit.raw.cablue = mods.raw.cablue;
|
if (raw.caBlue) toEdit.raw.cablue = mods.raw.cablue;
|
||||||
//if (raw.exPos) toEdit.raw.expos =mods.raw.expos;
|
if (raw.exPos) toEdit.raw.expos =mods.raw.expos;
|
||||||
//if (raw.exPreser) toEdit.raw.preser =mods.raw.preser;
|
if (raw.exPreser) toEdit.raw.preser =mods.raw.preser;
|
||||||
if (raw.greenEq) toEdit.raw.greenthresh = mods.raw.greenthresh;
|
if (raw.greenEq) toEdit.raw.greenthresh = mods.raw.greenthresh;
|
||||||
if (raw.hotDeadPixel) toEdit.raw.hotdeadpix_filt= mods.raw.hotdeadpix_filt;
|
if (raw.hotDeadPixel) toEdit.raw.hotdeadpix_filt= mods.raw.hotdeadpix_filt;
|
||||||
if (raw.linenoise) toEdit.raw.linenoise = mods.raw.linenoise;
|
if (raw.linenoise) toEdit.raw.linenoise = mods.raw.linenoise;
|
||||||
|
|||||||
@@ -552,8 +552,8 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dst, const r
|
|||||||
if (raw_ccSteps->get_active ()) dst->raw.ccSteps =src->raw.ccSteps;
|
if (raw_ccSteps->get_active ()) dst->raw.ccSteps =src->raw.ccSteps;
|
||||||
if (raw_dcb_iterations->get_active ()) dst->raw.dcb_iterations =src->raw.dcb_iterations;
|
if (raw_dcb_iterations->get_active ()) dst->raw.dcb_iterations =src->raw.dcb_iterations;
|
||||||
if (raw_dcb_enhance->get_active ()) dst->raw.dcb_enhance =src->raw.dcb_enhance;
|
if (raw_dcb_enhance->get_active ()) dst->raw.dcb_enhance =src->raw.dcb_enhance;
|
||||||
//if (raw_expos->get_active ()) dst->raw.expos =src->raw.expos;
|
if (raw_expos->get_active ()) dst->raw.expos =src->raw.expos;
|
||||||
//if (raw_preser->get_active ()) dst->raw.preser =src->raw.preser;
|
if (raw_preser->get_active ()) dst->raw.preser =src->raw.preser;
|
||||||
if (raw_ca_autocorrect->get_active ()) dst->raw.ca_autocorrect =src->raw.ca_autocorrect;
|
if (raw_ca_autocorrect->get_active ()) dst->raw.ca_autocorrect =src->raw.ca_autocorrect;
|
||||||
if (raw_cared->get_active ()) dst->raw.cared =src->raw.cared;
|
if (raw_cared->get_active ()) dst->raw.cared =src->raw.cared;
|
||||||
if (raw_cablue->get_active ()) dst->raw.cablue =src->raw.cablue;
|
if (raw_cablue->get_active ()) dst->raw.cablue =src->raw.cablue;
|
||||||
|
|||||||
@@ -48,16 +48,16 @@ void RAWExposure::read(const rtengine::procparams::ProcParams* pp, const ParamsE
|
|||||||
PexPreser->setEditedState( pedited->raw.exPreser ? Edited : UnEdited );
|
PexPreser->setEditedState( pedited->raw.exPreser ? Edited : UnEdited );
|
||||||
}
|
}
|
||||||
|
|
||||||
//PexPos->setValue (pp->raw.expos);
|
PexPos->setValue (pp->raw.expos);
|
||||||
//PexPreser->setValue (pp->raw.preser);//exposi
|
PexPreser->setValue (pp->raw.preser);//exposi
|
||||||
|
|
||||||
enableListener ();
|
enableListener ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RAWExposure::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
void RAWExposure::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
//pp->raw.expos = PexPos->getValue();
|
pp->raw.expos = PexPos->getValue();
|
||||||
//pp->raw.preser = PexPreser->getValue();//exposi
|
pp->raw.preser = PexPreser->getValue();//exposi
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
pedited->raw.exPos = PexPos->getEditedState ();
|
pedited->raw.exPos = PexPos->getEditedState ();
|
||||||
@@ -69,13 +69,11 @@ void RAWExposure::write( rtengine::procparams::ProcParams* pp, ParamsEdited* ped
|
|||||||
void RAWExposure::adjusterChanged (Adjuster* a, double newval)
|
void RAWExposure::adjusterChanged (Adjuster* a, double newval)
|
||||||
{
|
{
|
||||||
if (listener) {
|
if (listener) {
|
||||||
|
|
||||||
Glib::ustring value = a->getTextValue();
|
Glib::ustring value = a->getTextValue();
|
||||||
|
if (a == PexPos)
|
||||||
/*if (a == PexPos)
|
|
||||||
listener->panelChanged (EvPreProcessExpCorrLinear, value );
|
listener->panelChanged (EvPreProcessExpCorrLinear, value );
|
||||||
else if (a == PexPreser)
|
else if (a == PexPreser)
|
||||||
listener->panelChanged (EvPreProcessExpCorrPH, value );*/
|
listener->panelChanged (EvPreProcessExpCorrPH, value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,8 +86,8 @@ void RAWExposure::setBatchMode(bool batchMode)
|
|||||||
|
|
||||||
void RAWExposure::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited)
|
void RAWExposure::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
//PexPos->setDefault( defParams->raw.expos);
|
PexPos->setDefault( defParams->raw.expos);
|
||||||
//PexPreser->setDefault( defParams->raw.preser);
|
PexPreser->setDefault( defParams->raw.preser);
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
PexPos->setDefaultEditedState( pedited->raw.exPos ? Edited : UnEdited);
|
PexPos->setDefaultEditedState( pedited->raw.exPos ? Edited : UnEdited);
|
||||||
|
|||||||
Reference in New Issue
Block a user