Make ImProcFunctions::transCoord() const

This commit is contained in:
Flössie 2019-10-08 14:12:42 +02:00
parent 1a3d4504d1
commit f7c57eeeda
2 changed files with 26 additions and 26 deletions

View File

@ -67,14 +67,14 @@ class ImProcFunctions
void transformGeneral(bool highQuality, Imagefloat *original, Imagefloat *transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const LensCorrection *pLCPMap);
void transformLCPCAOnly(Imagefloat *original, Imagefloat *transformed, int cx, int cy, const LensCorrection *pLCPMap);
bool needsCA();
bool needsDistortion();
bool needsRotation();
bool needsPerspective();
bool needsGradient();
bool needsVignetting();
bool needsLCP();
bool needsLensfun();
bool needsCA() const;
bool needsDistortion() const;
bool needsRotation() const;
bool needsPerspective() const;
bool needsGradient() const;
bool needsVignetting() const;
bool needsLCP() const;
bool needsLensfun() const;
// static cmsUInt8Number* Mempro = NULL;
@ -99,8 +99,8 @@ public:
}
void setScale(double iscale);
bool needsTransform();
bool needsPCVignetting();
bool needsTransform() const;
bool needsPCVignetting() const;
void firstAnalysis(const Imagefloat* const working, const procparams::ProcParams &params, LUTu & vhist16);
void updateColorProfiles(const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck);
@ -247,11 +247,11 @@ public:
// CieImage *ciec;
void workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, int ch, int mul, const Glib::ustring &profile, double gampos, double slpos, cmsHTRANSFORM &transform, bool normalizeIn = true, bool normalizeOut = true, bool keepTransForm = false) const;
bool transCoord(int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr);
bool transCoord(int W, int H, const std::vector<Coord2D> &src, std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr);
bool transCoord(int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr) const;
bool transCoord(int W, int H, const std::vector<Coord2D> &src, std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr) const;
static void getAutoExp(const LUTu & histogram, int histcompr, double clip, double& expcomp, int& bright, int& contr, int& black, int& hlcompr, int& hlcomprthresh);
static double getAutoDistor(const Glib::ustring& fname, int thumb_size);
double getTransformAutoFill(int oW, int oH, const LensCorrection *pLCPMap = nullptr);
double getTransformAutoFill(int oW, int oH, const LensCorrection *pLCPMap = nullptr) const;
void rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace);
void lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace);
};

View File

@ -208,7 +208,7 @@ namespace rtengine
#define CLIPTOC(a,b,c,d) ((a)>=(b)?((a)<=(c)?(a):(d=true,(c))):(d=true,(b)))
bool ImProcFunctions::transCoord (int W, int H, const std::vector<Coord2D> &src, std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, double ascaleDef,
const LensCorrection *pLCPMap)
const LensCorrection *pLCPMap) const
{
bool clipped = false;
@ -310,7 +310,7 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector<Coord2D> &src,
}
// Transform all corners and critical sidelines of an image
bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef, const LensCorrection *pLCPMap)
bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef, const LensCorrection *pLCPMap) const
{
const int DivisionsPerBorder = 32;
@ -1113,7 +1113,7 @@ void ImProcFunctions::transformLCPCAOnly(Imagefloat *original, Imagefloat *trans
}
double ImProcFunctions::getTransformAutoFill (int oW, int oH, const LensCorrection *pLCPMap)
double ImProcFunctions::getTransformAutoFill (int oW, int oH, const LensCorrection *pLCPMap) const
{
if (!needsCA() && !needsDistortion() && !needsRotation() && !needsPerspective() && (!params->lensProf.useDist || pLCPMap == nullptr)) {
return 1;
@ -1137,52 +1137,52 @@ double ImProcFunctions::getTransformAutoFill (int oW, int oH, const LensCorrecti
return scaleL;
}
bool ImProcFunctions::needsCA ()
bool ImProcFunctions::needsCA () const
{
return fabs (params->cacorrection.red) > 1e-15 || fabs (params->cacorrection.blue) > 1e-15;
}
bool ImProcFunctions::needsDistortion ()
bool ImProcFunctions::needsDistortion () const
{
return fabs (params->distortion.amount) > 1e-15;
}
bool ImProcFunctions::needsRotation ()
bool ImProcFunctions::needsRotation () const
{
return fabs (params->rotate.degree) > 1e-15;
}
bool ImProcFunctions::needsPerspective ()
bool ImProcFunctions::needsPerspective () const
{
return params->perspective.horizontal || params->perspective.vertical;
}
bool ImProcFunctions::needsGradient ()
bool ImProcFunctions::needsGradient () const
{
return params->gradient.enabled && fabs (params->gradient.strength) > 1e-15;
}
bool ImProcFunctions::needsPCVignetting ()
bool ImProcFunctions::needsPCVignetting () const
{
return params->pcvignette.enabled && fabs (params->pcvignette.strength) > 1e-15;
}
bool ImProcFunctions::needsVignetting ()
bool ImProcFunctions::needsVignetting () const
{
return params->vignetting.amount;
}
bool ImProcFunctions::needsLCP ()
bool ImProcFunctions::needsLCP () const
{
return params->lensProf.useLcp();
}
bool ImProcFunctions::needsLensfun()
bool ImProcFunctions::needsLensfun() const
{
return params->lensProf.useLensfun();
}
bool ImProcFunctions::needsTransform ()
bool ImProcFunctions::needsTransform () const
{
return needsCA () || needsDistortion () || needsRotation () || needsPerspective () || needsGradient () || needsPCVignetting () || needsVignetting () || needsLCP() || needsLensfun();
}