make rtengine::processImage return an Imagefloat instead of an Image16

This is for supporting saving to 32-bit float TIFFs
This commit is contained in:
Alberto Griggio
2017-11-20 00:10:51 +01:00
parent d47e7f67b2
commit bc8b8902e6
15 changed files with 157 additions and 96 deletions

View File

@@ -66,7 +66,7 @@ public:
{
}
Image16 *operator()()
Imagefloat *operator()()
{
if (!job->fast) {
return normal_pipeline();
@@ -76,7 +76,7 @@ public:
}
private:
Image16 *normal_pipeline()
Imagefloat *normal_pipeline()
{
if (!stage_init()) {
return nullptr;
@@ -87,7 +87,7 @@ private:
return stage_finish();
}
Image16 *fast_pipeline()
Imagefloat *fast_pipeline()
{
if (!job->pparams.resize.enabled) {
return normal_pipeline();
@@ -831,7 +831,7 @@ private:
}
}
Image16 *stage_finish()
Imagefloat *stage_finish()
{
procparams::ProcParams& params = job->pparams;
//ImProcFunctions ipf (&params, true);
@@ -1227,7 +1227,7 @@ private:
}
}
Image16* readyImg = nullptr;
Imagefloat* readyImg = nullptr;
cmsHPROFILE jprof = nullptr;
bool customGamma = false;
bool useLCMS = false;
@@ -1237,7 +1237,7 @@ private:
GammaValues ga;
// if(params.blackwhite.enabled) params.toneCurve.hrenabled=false;
readyImg = ipf.lab2rgb16 (labView, cx, cy, cw, ch, params.icm, &ga);
readyImg = ipf.lab2rgbOut (labView, cx, cy, cw, ch, params.icm, &ga);
customGamma = true;
//or selected Free gamma
@@ -1251,7 +1251,7 @@ private:
// if Default gamma mode: we use the profile selected in the "Output profile" combobox;
// gamma come from the selected profile, otherwise it comes from "Free gamma" tool
readyImg = ipf.lab2rgb16 (labView, cx, cy, cw, ch, params.icm);
readyImg = ipf.lab2rgbOut (labView, cx, cy, cw, ch, params.icm);
if (settings->verbose) {
printf ("Output profile_: \"%s\"\n", params.icm.output.c_str());
@@ -1281,7 +1281,7 @@ private:
}
if (tmpScale != 1.0 && params.resize.method == "Nearest") { // resize rgb data (gamma applied)
Image16* tempImage = new Image16 (imw, imh);
Imagefloat* tempImage = new Imagefloat (imw, imh);
ipf.resize (readyImg, tempImage, tmpScale);
delete readyImg;
readyImg = tempImage;
@@ -1566,7 +1566,7 @@ private:
} // namespace
IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* pl, bool tunnelMetaData, bool flush)
IImagefloat* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* pl, bool tunnelMetaData, bool flush)
{
ImageProcessor proc (pjob, errorCode, pl, tunnelMetaData, flush);
return proc();
@@ -1579,7 +1579,7 @@ void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl, bo
while (currentJob) {
int errorCode;
IImage16* img = processImage (currentJob, errorCode, bpl, tunnelMetaData, true);
IImagefloat* img = processImage (currentJob, errorCode, bpl, tunnelMetaData, true);
if (errorCode) {
bpl->error (M ("MAIN_MSG_CANNOTLOAD"));