changed signature of ImProcFunctions::transform to take as input an ImageMetaData pointer
This commit is contained in:
@@ -698,9 +698,10 @@ void Crop::update (int todo)
|
||||
|
||||
if (needstransform)
|
||||
parent->ipf.transform (baseCrop, transCrop, cropx / skip, cropy / skip, trafx / skip, trafy / skip, skips (parent->fw, skip), skips (parent->fh, skip), parent->getFullWidth(), parent->getFullHeight(),
|
||||
parent->imgsrc->getMetaData()->getFocalLen(), parent->imgsrc->getMetaData()->getFocalLen35mm(),
|
||||
parent->imgsrc->getMetaData()->getFocusDist(),
|
||||
parent->imgsrc->getMetaData()->getFNumber(),
|
||||
parent->imgsrc->getMetaData(),
|
||||
// parent->imgsrc->getMetaData()->getFocalLen(), parent->imgsrc->getMetaData()->getFocalLen35mm(),
|
||||
// parent->imgsrc->getMetaData()->getFocusDist(),
|
||||
// parent->imgsrc->getMetaData()->getFNumber(),
|
||||
parent->imgsrc->getRotateDegree(), false);
|
||||
else {
|
||||
baseCrop->copyData (transCrop);
|
||||
|
||||
@@ -401,7 +401,9 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
|
||||
if (needstransform)
|
||||
ipf.transform (orig_prev, oprevi, 0, 0, 0, 0, pW, pH, fw, fh, imgsrc->getMetaData()->getFocalLen(),
|
||||
imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(), imgsrc->getRotateDegree(), false);
|
||||
imgsrc->getMetaData(),
|
||||
// imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(),
|
||||
imgsrc->getRotateDegree(), false);
|
||||
else {
|
||||
orig_prev->copyData (oprevi);
|
||||
}
|
||||
@@ -1219,8 +1221,10 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
|
||||
|
||||
if (ipf.needsTransform()) {
|
||||
Imagefloat* trImg = new Imagefloat (fW, fH);
|
||||
ipf.transform (im, trImg, 0, 0, 0, 0, fW, fH, fW, fH, imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(),
|
||||
imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(), imgsrc->getRotateDegree(), true);
|
||||
ipf.transform (im, trImg, 0, 0, 0, 0, fW, fH, fW, fH,
|
||||
imgsrc->getMetaData(),
|
||||
// imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(),
|
||||
imgsrc->getRotateDegree(), true);
|
||||
delete im;
|
||||
im = trImg;
|
||||
}
|
||||
|
||||
@@ -239,8 +239,9 @@ public:
|
||||
void colorCurve (LabImage* lold, LabImage* lnew);
|
||||
void sharpening (LabImage* lab, float** buffer, SharpeningParams &sharpenParam);
|
||||
void sharpeningcam (CieImage* ncie, float** buffer);
|
||||
void transform (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH,
|
||||
double focalLen, double focalLen35mm, float focusDist, double fNumber, int rawRotationDeg, bool fullImage);
|
||||
/* void transform (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, */
|
||||
/* double focalLen, double focalLen35mm, float focusDist, double fNumber, int rawRotationDeg, bool fullImage); */
|
||||
void transform (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const ImageMetaData *metadata, int rawRotationDeg, bool fullImage);
|
||||
float resizeScale (const ProcParams* params, int fw, int fh, int &imw, int &imh);
|
||||
void lab2monitorRgb (LabImage* lab, Image8* image);
|
||||
void resize (Image16* src, Image16* dst, float dScale);
|
||||
|
||||
@@ -307,8 +307,14 @@ bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int&
|
||||
}
|
||||
|
||||
void ImProcFunctions::transform (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH,
|
||||
double focalLen, double focalLen35mm, float focusDist, double fNumber, int rawRotationDeg, bool fullImage)
|
||||
const ImageMetaData *metadata,
|
||||
//double focalLen, double focalLen35mm, float focusDist, double fNumber,
|
||||
int rawRotationDeg, bool fullImage)
|
||||
{
|
||||
double focalLen = metadata->getFocalLen();
|
||||
double focalLen35mm = metadata->getFocalLen35mm();
|
||||
float focusDist = metadata->getFocusDist();
|
||||
double fNumber = metadata->getFNumber();
|
||||
|
||||
LCPMapper *pLCPMap = nullptr;
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ class IImage8;
|
||||
class IImage16;
|
||||
class IImagefloat;
|
||||
|
||||
|
||||
/**
|
||||
* This class represents provides functions to obtain exif and IPTC metadata information
|
||||
* from the image file
|
||||
|
||||
@@ -954,9 +954,19 @@ IImage8* Thumbnail::quickProcessImage (const procparams::ProcParams& params, int
|
||||
}
|
||||
|
||||
// Full thumbnail processing, second stage if complete profile exists
|
||||
IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rheight, TypeInterpolation interp, std::string camName,
|
||||
double focalLen, double focalLen35mm, float focusDist, float shutter, float fnumber, float iso, std::string expcomp_, double& myscale)
|
||||
// IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rheight, TypeInterpolation interp, std::string camName,
|
||||
// double focalLen, double focalLen35mm, float focusDist, float shutter, float fnumber, float iso, std::string expcomp_, double& myscale)
|
||||
IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rheight, TypeInterpolation interp, const ImageMetaData *metadata, double& myscale)
|
||||
{
|
||||
std::string camName = metadata->getCamera();
|
||||
double focalLen = metadata->getFocalLen();
|
||||
double focalLen35mm = metadata->getFocalLen35mm();
|
||||
float focusDist = metadata->getFocusDist();
|
||||
float shutter = metadata->getShutterSpeed();
|
||||
float fnumber = metadata->getFNumber();
|
||||
float iso = metadata->getISOSpeed();
|
||||
float fcomp = metadata->getExpComp();
|
||||
|
||||
// check if the WB's equalizer value has changed
|
||||
if (wbEqual < (params.wb.equal - 5e-4) || wbEqual > (params.wb.equal + 5e-4) || wbTempBias < (params.wb.tempBias - 5e-4) || wbTempBias > (params.wb.tempBias + 5e-4)) {
|
||||
wbEqual = params.wb.equal;
|
||||
@@ -1079,7 +1089,8 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei
|
||||
int origFH;
|
||||
double tscale = 0.0;
|
||||
getDimensions (origFW, origFH, tscale);
|
||||
ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, origFW * tscale + 0.5, origFH * tscale + 0.5, focalLen, focalLen35mm, focusDist, fnumber, 0, true); // Raw rotate degree not detectable here
|
||||
// ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, origFW * tscale + 0.5, origFH * tscale + 0.5, focalLen, focalLen35mm, focusDist, fnumber, 0, true); // Raw rotate degree not detectable here
|
||||
ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, origFW * tscale + 0.5, origFH * tscale + 0.5, metadata, 0, true); // Raw rotate degree not detectable here
|
||||
delete baseImg;
|
||||
baseImg = trImg;
|
||||
}
|
||||
@@ -1278,11 +1289,11 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei
|
||||
float fnum = fnumber;// F number
|
||||
float fiso = iso;// ISO
|
||||
float fspeed = shutter;//speed
|
||||
char * writ = new char[expcomp_.size() + 1];//convert expcomp_ to char
|
||||
std::copy (expcomp_.begin(), expcomp_.end(), writ);
|
||||
writ[expcomp_.size()] = '\0';
|
||||
float fcomp = atof (writ); //compensation + -
|
||||
delete[] writ;
|
||||
// char * writ = new char[expcomp_.size() + 1];//convert expcomp_ to char
|
||||
// std::copy (expcomp_.begin(), expcomp_.end(), writ);
|
||||
// writ[expcomp_.size()] = '\0';
|
||||
// float fcomp = atof (writ); //compensation + -
|
||||
// delete[] writ;
|
||||
float adap;
|
||||
|
||||
if (fnum < 0.3f || fiso < 5.f || fspeed < 0.00001f)
|
||||
|
||||
@@ -71,8 +71,9 @@ public:
|
||||
|
||||
void init ();
|
||||
|
||||
IImage8* processImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, std::string camName,
|
||||
double focalLen, double focalLen35mm, float focusDist, float shutter, float fnumber, float iso, std::string expcomp_, double& scale);
|
||||
// IImage8* processImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, std::string camName,
|
||||
// double focalLen, double focalLen35mm, float focusDist, float shutter, float fnumber, float iso, std::string expcomp_, double& scale);
|
||||
IImage8* processImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, const ImageMetaData *metadata, double& scale);
|
||||
IImage8* quickProcessImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, double& scale);
|
||||
int getImageWidth (const procparams::ProcParams& pparams, int rheight, float &ratio);
|
||||
void getDimensions (int& w, int& h, double& scaleFac);
|
||||
|
||||
@@ -813,9 +813,11 @@ private:
|
||||
// perform transform (excepted resizing)
|
||||
if (ipf.needsTransform()) {
|
||||
Imagefloat* trImg = new Imagefloat (fw, fh);
|
||||
ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, fw, fh, imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(),
|
||||
imgsrc->getMetaData()->getFocusDist(),
|
||||
imgsrc->getMetaData()->getFNumber(),
|
||||
ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, fw, fh,
|
||||
imgsrc->getMetaData(),
|
||||
// imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(),
|
||||
// imgsrc->getMetaData()->getFocusDist(),
|
||||
// imgsrc->getMetaData()->getFNumber(),
|
||||
imgsrc->getRotateDegree(), true);
|
||||
delete baseImg;
|
||||
baseImg = trImg;
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
|
||||
#include <glibmm.h>
|
||||
#include "options.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
class CacheImageData
|
||||
class CacheImageData: public rtengine::ImageMetaData
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -76,9 +77,31 @@ public:
|
||||
int load (const Glib::ustring& fname);
|
||||
int save (const Glib::ustring& fname);
|
||||
|
||||
Glib::ustring getCamera() const
|
||||
{
|
||||
return Glib::ustring(camMake + " " + camModel);
|
||||
}
|
||||
// Glib::ustring getCamera() const
|
||||
// {
|
||||
// return Glib::ustring(camMake + " " + camModel);
|
||||
// }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// ImageMetaData interface
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
bool hasExif() const { return false; }
|
||||
const rtexif::TagDirectory *getExifData() const { return NULL; }
|
||||
bool hasIPTC() const { return false; }
|
||||
const procparams::IPTCPairs getIPTCData () const { return procparams::IPTCPairs(); }
|
||||
struct tm getDateTime () const { struct tm ret; return ret; }
|
||||
time_t getDateTimeAsTS() const { time_t ret; return ret; }
|
||||
int getISOSpeed() const { return iso; }
|
||||
double getFNumber() const { return fnumber; }
|
||||
double getFocalLen() const { return focalLen; }
|
||||
double getFocalLen35mm() const { return focalLen35mm; }
|
||||
float getFocusDist() const { return focusDist; }
|
||||
double getShutterSpeed() const { return shutter; }
|
||||
double getExpComp() const { return atof(expcomp.c_str()); }
|
||||
std::string getMake() const { return camMake; }
|
||||
std::string getModel() const { return camModel; }
|
||||
std::string getLens() const { return lens; }
|
||||
std::string getOrientation() const { return ""; } // TODO
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -602,7 +602,8 @@ rtengine::IImage8* Thumbnail::processThumbImage (const rtengine::procparams::Pro
|
||||
image = tpp->quickProcessImage (pparams, h, rtengine::TI_Nearest, scale);
|
||||
} else {
|
||||
// Full thumbnail: apply profile
|
||||
image = tpp->processImage (pparams, h, rtengine::TI_Bilinear, cfs.getCamera(), cfs.focalLen, cfs.focalLen35mm, cfs.focusDist, cfs.shutter, cfs.fnumber, cfs.iso, cfs.expcomp, scale );
|
||||
// image = tpp->processImage (pparams, h, rtengine::TI_Bilinear, cfs.getCamera(), cfs.focalLen, cfs.focalLen35mm, cfs.focusDist, cfs.shutter, cfs.fnumber, cfs.iso, cfs.expcomp, scale );
|
||||
image = tpp->processImage (pparams, h, rtengine::TI_Bilinear, &cfs, scale );
|
||||
}
|
||||
|
||||
tpp->getDimensions(lastW, lastH, lastScale);
|
||||
@@ -627,7 +628,8 @@ rtengine::IImage8* Thumbnail::upgradeThumbImage (const rtengine::procparams::Pro
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
rtengine::IImage8* image = tpp->processImage (pparams, h, rtengine::TI_Bilinear, cfs.getCamera(), cfs.focalLen, cfs.focalLen35mm, cfs.focusDist, cfs.shutter, cfs.fnumber, cfs.iso, cfs.expcomp, scale );
|
||||
// rtengine::IImage8* image = tpp->processImage (pparams, h, rtengine::TI_Bilinear, cfs.getCamera(), cfs.focalLen, cfs.focalLen35mm, cfs.focusDist, cfs.shutter, cfs.fnumber, cfs.iso, cfs.expcomp, scale );
|
||||
rtengine::IImage8* image = tpp->processImage (pparams, h, rtengine::TI_Bilinear, &cfs, scale );
|
||||
tpp->getDimensions(lastW, lastH, lastScale);
|
||||
|
||||
delete tpp;
|
||||
|
||||
Reference in New Issue
Block a user