further speedup for histogram matching
This commit is contained in:
@@ -395,7 +395,7 @@ RawMetaDataLocation Thumbnail::loadMetaDataFromRaw (const Glib::ustring& fname)
|
||||
return rml;
|
||||
}
|
||||
|
||||
Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, eSensorType &sensorType, int &w, int &h, int fixwh, double wbEq, bool rotate, bool multiThread)
|
||||
Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, eSensorType &sensorType, int &w, int &h, int fixwh, double wbEq, bool rotate, bool forHistogramMatching)
|
||||
{
|
||||
RawImage *ri = new RawImage (fname);
|
||||
unsigned int tempImageNum = 0;
|
||||
@@ -427,10 +427,9 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
|
||||
tpp->greenMultiplier = ri->get_pre_mul (1);
|
||||
tpp->blueMultiplier = ri->get_pre_mul (2);
|
||||
|
||||
//ri->scale_colors();
|
||||
float pre_mul[4], scale_mul[4], cblack[4];
|
||||
ri->get_colorsCoeff (pre_mul, scale_mul, cblack, false);
|
||||
scale_colors (ri, scale_mul, cblack, multiThread);
|
||||
scale_colors (ri, scale_mul, cblack, forHistogramMatching); // enable multithreading when forHistogramMatching is true
|
||||
|
||||
ri->pre_interpolate();
|
||||
|
||||
@@ -672,6 +671,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
|
||||
} else {
|
||||
tpp->scale = (double) height / (rotate_90 ? w : h);
|
||||
}
|
||||
if(!forHistogramMatching) { // we don't need this for histogram matching
|
||||
|
||||
// generate histogram for auto exposure, also calculate autoWB
|
||||
tpp->aeHistCompression = 3;
|
||||
@@ -798,7 +798,6 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ri->get_colors() == 1) {
|
||||
pixSum[0] = pixSum[1] = pixSum[2] = 1.;
|
||||
n[0] = n[1] = n[2] = 1;
|
||||
@@ -819,6 +818,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
|
||||
|
||||
ColorTemp cTemp;
|
||||
cTemp.mul2temp (tpp->redAWBMul, tpp->greenAWBMul, tpp->blueAWBMul, tpp->wbEqual, tpp->autoWBTemp, tpp->autoWBGreen);
|
||||
}
|
||||
|
||||
if (rotate && ri->get_rotateDegree() > 0) {
|
||||
tpp->thumbImg->rotate (ri->get_rotateDegree());
|
||||
@@ -930,7 +930,7 @@ IImage8* Thumbnail::quickProcessImage (const procparams::ProcParams& params, int
|
||||
}
|
||||
|
||||
// Full thumbnail processing, second stage if complete profile exists
|
||||
IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& myscale, bool forMonitor, bool multiThread)
|
||||
IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& myscale, bool forMonitor, bool forHistogramMatching)
|
||||
{
|
||||
unsigned int imgNum = 0;
|
||||
if (isRaw) {
|
||||
@@ -1062,7 +1062,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
|
||||
int fh = baseImg->getHeight();
|
||||
//ColorTemp::CAT02 (baseImg, ¶ms) ;//perhaps not good!
|
||||
|
||||
ImProcFunctions ipf (¶ms, multiThread);
|
||||
ImProcFunctions ipf (¶ms, forHistogramMatching); // enable multithreading when forHistogramMatching is true
|
||||
ipf.setScale (sqrt (double (fw * fw + fh * fh)) / sqrt (double (thumbImg->getWidth() * thumbImg->getWidth() + thumbImg->getHeight() * thumbImg->getHeight()))*scale);
|
||||
ipf.updateColorProfiles (ICCStore::getInstance()->getDefaultMonitorProfileName(), options.rtSettings.monitorIntent, false, false);
|
||||
|
||||
|
@@ -71,13 +71,13 @@ public:
|
||||
|
||||
void init ();
|
||||
|
||||
IImage8* processImage (const procparams::ProcParams& pparams, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& scale, bool forMonitor=true, bool multiThread = false);
|
||||
IImage8* processImage (const procparams::ProcParams& pparams, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& scale, bool forMonitor=true, bool forHistogramMatching = false);
|
||||
IImage8* quickProcessImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp);
|
||||
int getImageWidth (const procparams::ProcParams& pparams, int rheight, float &ratio);
|
||||
void getDimensions (int& w, int& h, double& scaleFac);
|
||||
|
||||
static Thumbnail* loadQuickFromRaw (const Glib::ustring& fname, rtengine::RawMetaDataLocation& rml, eSensorType &sensorType, int &w, int &h, int fixwh, bool rotate, bool inspectorMode = false);
|
||||
static Thumbnail* loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, eSensorType &sensorType, int &w, int &h, int fixwh, double wbEq, bool rotate, bool multiThread = false);
|
||||
static Thumbnail* loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, eSensorType &sensorType, int &w, int &h, int fixwh, double wbEq, bool rotate, bool forHistogramMatching = false);
|
||||
static Thumbnail* loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh, double wbEq, bool inspectorMode = false);
|
||||
static RawMetaDataLocation loadMetaDataFromRaw (const Glib::ustring& fname);
|
||||
|
||||
|
Reference in New Issue
Block a user