some (minor) code cleanup
This commit is contained in:
parent
b5c1293bf3
commit
c2960caab5
@ -699,9 +699,6 @@ 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(),
|
||||
// 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,10 +401,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
|
||||
if (needstransform)
|
||||
ipf.transform (orig_prev, oprevi, 0, 0, 0, 0, pW, pH, fw, fh,
|
||||
imgsrc->getMetaData(),
|
||||
// imgsrc->getMetaData()->getFocalLen(),
|
||||
// imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(),
|
||||
imgsrc->getRotateDegree(), false);
|
||||
imgsrc->getMetaData(), imgsrc->getRotateDegree(), false);
|
||||
else {
|
||||
orig_prev->copyData (oprevi);
|
||||
}
|
||||
@ -1223,9 +1220,7 @@ 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(),
|
||||
// imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(),
|
||||
imgsrc->getRotateDegree(), true);
|
||||
imgsrc->getMetaData(), imgsrc->getRotateDegree(), true);
|
||||
delete im;
|
||||
im = trImg;
|
||||
}
|
||||
|
@ -240,8 +240,6 @@ 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, 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);
|
||||
|
@ -87,20 +87,6 @@ float normn (float a, float b, int n)
|
||||
}
|
||||
|
||||
|
||||
inline void correct_distortion(const rtengine::LensCorrection *lcp, double &x, double &y,
|
||||
int cx, int cy, double scale)
|
||||
{
|
||||
assert (lcp);
|
||||
|
||||
// x += cx;
|
||||
// y += cy;
|
||||
// std::cout << "DIST: x=" << x << ", y=" << y;
|
||||
lcp->correctDistortion(x, y, cx, cy, scale);
|
||||
// std::cout << " --> pos[0]=" << x << ", pos[1]=" << y << std::endl;
|
||||
// x -= (cx * scale);
|
||||
// y -= (cy * scale);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace rtengine
|
||||
@ -160,7 +146,7 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector<Coord2D> &src,
|
||||
double x_d = src[i].x, y_d = src[i].y;
|
||||
|
||||
if (pLCPMap && params->lensProf.useDist) {
|
||||
correct_distortion (pLCPMap, x_d, y_d, 0, 0, ascale);
|
||||
pLCPMap->correctDistortion(x_d, y_d, 0, 0, ascale);
|
||||
} else {
|
||||
x_d *= ascale;
|
||||
y_d *= ascale;
|
||||
@ -311,7 +297,6 @@ 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,
|
||||
const ImageMetaData *metadata,
|
||||
//double focalLen, double focalLen35mm, float focusDist, double fNumber,
|
||||
int rawRotationDeg, bool fullImage)
|
||||
{
|
||||
double focalLen = metadata->getFocalLen();
|
||||
@ -831,7 +816,7 @@ void ImProcFunctions::transformGeneral(ImProcFunctions::TransformMode mode, Imag
|
||||
double x_d = x, y_d = y;
|
||||
|
||||
if (enableLCPDist) {
|
||||
correct_distortion(pLCPMap, x_d, y_d, cx, cy, ascale); // must be first transform
|
||||
pLCPMap->correctDistortion(x_d, y_d, cx, cy, ascale); // must be first transform
|
||||
} else {
|
||||
x_d *= ascale;
|
||||
y_d *= ascale;
|
||||
|
@ -954,8 +954,6 @@ 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, const ImageMetaData *metadata, double& myscale)
|
||||
{
|
||||
std::string camName = metadata->getCamera();
|
||||
@ -1086,7 +1084,6 @@ 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, metadata, 0, true); // Raw rotate degree not detectable here
|
||||
delete baseImg;
|
||||
baseImg = trImg;
|
||||
@ -1286,11 +1283,6 @@ 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;
|
||||
float adap;
|
||||
|
||||
if (fnum < 0.3f || fiso < 5.f || fspeed < 0.00001f)
|
||||
|
@ -71,8 +71,6 @@ 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, 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);
|
||||
|
@ -814,11 +814,7 @@ private:
|
||||
if (ipf.needsTransform()) {
|
||||
Imagefloat* trImg = new Imagefloat (fw, fh);
|
||||
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);
|
||||
imgsrc->getMetaData(), imgsrc->getRotateDegree(), true);
|
||||
delete baseImg;
|
||||
baseImg = trImg;
|
||||
}
|
||||
|
@ -77,11 +77,6 @@ public:
|
||||
int load (const Glib::ustring& fname);
|
||||
int save (const Glib::ustring& fname);
|
||||
|
||||
// Glib::ustring getCamera() const
|
||||
// {
|
||||
// return Glib::ustring(camMake + " " + camModel);
|
||||
// }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// ImageMetaData interface
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -44,8 +44,6 @@ public:
|
||||
return packBox;
|
||||
}
|
||||
|
||||
Gtk::CheckButton *getFill() { return fill; }
|
||||
|
||||
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
|
||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
|
||||
void setBatchMode (bool batchMode);
|
||||
|
Loading…
x
Reference in New Issue
Block a user