From 15ad679b0d55c4b472f7d5b367a2c5713432caf9 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 14 Feb 2017 14:37:49 +0100 Subject: [PATCH] clean code --- rtengine/dcrop.cc | 7 ++----- rtengine/improccoordinator.cc | 12 ++---------- rtengine/iplocallab.cc | 16 +++------------- rtengine/simpleprocess.cc | 11 ++--------- 4 files changed, 9 insertions(+), 37 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 819a673cc..e960380ab 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -837,15 +837,12 @@ void Crop::update (int todo) if (needslocal ) { // if (tyty ) { - //Glib::ustring datalab2 = parent->imgsrc->getFileName() + ".mip"; - // Glib::ustring pop = options.getUserProfilePath() + "/"; - CacheManager* cachemgr; // parent + CacheManager* cachemgr; - CacheImageData cfs; // cache entry corresponding to the thumbnai + CacheImageData cfs; cfs.md5 = cachemgr->getMD5 (parent->imgsrc->getFileName()); std::string mdfive = cfs.md5; - // printf("md5=%s \n", mdfive.c_str()); Glib::ustring pop = options.cacheBaseDir + "/mip/"; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index f8925d9e3..8eb9cc2a0 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -720,12 +720,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) */ bool isascii = true; - CacheManager* cachemgr; // parent + CacheManager* cachemgr; - CacheImageData cfs; // cache entry corresponding to the thumbnai + CacheImageData cfs; cfs.md5 = cachemgr->getMD5 (imgsrc->getFileName()); std::string mdfive = cfs.md5; -// printf("md5=%s \n", mdfive.c_str()); Glib::ustring datainterm = imgsrc->getFileName() + ".ii";//extansion ii arbitrary to test if mip file is possible @@ -749,8 +748,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) } } - // printf("mip file=%s \n", datalab.c_str()); - // Glib::ustring pop = options.getUserProfilePath() + "/"; Glib::ustring pop = options.cacheBaseDir + "/mip/"; Glib::ustring datal; @@ -817,7 +814,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) ifstream fic (datal, ios::in); bool reinit = false; - //printf("versionmip=%i nbspot=%i\n", versionmip, params.locallab.nbspot) ; if (fic.fail() || versionmip == 0 || params.locallab.nbspot == 0) { //initialize mip with default values if no file or old file to prevent crash @@ -1346,7 +1342,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) retistr[ns] = str3; sizecu = longe; - // printf("lecture str=%s ns=%i si=%i\n", retistr[ns].c_str(), ns, sizecu); } if (excurvll && spotline.substr (0, pos) == "curveLL") { @@ -1364,7 +1359,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) llstr[ns] = str3; sizell = longel; - // printf("lecture strLL=%s ns=%i si=%i\n", llstr[ns].c_str(), ns, sizell); } @@ -1383,7 +1377,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) lhstr[ns] = str3; sizelh = longeh; - //printf("lecture strLH=%s ns=%i si=%i\n", lhstr[ns].c_str(), ns, sizelh); } if (excurvcc && spotline.substr (0, pos) == "curveCC") { @@ -1401,7 +1394,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) ccstr[ns] = str3; sizecc = longec; - // printf("lecture strCC=%s ns=%i si=%i\n", ccstr[ns].c_str(), ns, sizecc); } diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index db00b0114..5aad9659d 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -98,9 +98,6 @@ struct local_params { bool sharpena; bool cbdlena; bool denoiena; - - - }; static void calcLocalParams (int oW, int oH, const LocallabParams& locallab, struct local_params& lp) @@ -323,7 +320,6 @@ void ImProcFunctions::strcurv_data (std::string retistr, int *s_datc, int &siz) std::size_t posend = retistr.find ("@"); std::string strend = retistr.substr (posend - 1, 1); - // printf("stren=%s posz=%i\n", strend.c_str(), posz); int longe; for (int sl = 0; sl < 69; sl++) { @@ -334,7 +330,6 @@ void ImProcFunctions::strcurv_data (std::string retistr, int *s_datc, int &siz) s_size = longe; - // printf("sp=%i stren=%s reti=%s long=%i\n", sp, strend.c_str(), retistr[sp].c_str(), longe); int s_cur[s_size + 1]; int s_datcu[s_size + 1]; @@ -1894,7 +1889,6 @@ struct local_contra { float bb; float aaa, bbb; float ccc; -// float DY; float dx, dy; float ah, bh; float al, bl; @@ -2912,7 +2906,7 @@ void ImProcFunctions::ColorLight_Local (int call, LabImage * bufcolorig, LabImag constexpr float lumdelta = 11.f; //11 float modlum = lumdelta * multlum; - // constant and varaibles to prepare shape detection + // constant and variables to prepare shape detection if (lumaref + modlum >= 100.f) { modlum = (100.f - lumaref) / 2.f; } @@ -2930,7 +2924,6 @@ void ImProcFunctions::ColorLight_Local (int call, LabImage * bufcolorig, LabImag float vi = (lumaref - modlum) / 100.f; ImProcFunctions::secondeg_begin (reducac, vi, aa, bb);//parabolic ImProcFunctions::secondeg_end (reducac, vinf, aaa, bbb, ccc);//parabolic -// printf("vi=%f aa=%f bb=%f vinf=%f aaa=%f bbb=%f ccc=%f\n", vi,aa,bb, vinf, aaa, bbb, ccc); float vinf2 = (lumaref + modlum) / 100.f; float vi2 = (lumaref - modlum) / 100.f; float aaaa, bbbb, cccc, aO, bO; @@ -3557,7 +3550,6 @@ void ImProcFunctions::InverseColorLight_Local (const struct local_params & lp, L calclight (original->L[y][x], lp.ligh , lumnew, false); } - // float lightcont = localcurve[original->L[y][x]]; //apply lightness float lightcont = lumnew ; //original->L[y][x] + (lp.ligh /100.f)*original->L[y][x] ; //apply lightness @@ -3577,10 +3569,8 @@ void ImProcFunctions::InverseColorLight_Local (const struct local_params & lp, L calclight (original->L[y][x], lp.ligh , lumnew, false); } - // float lightcont = localcurve[original->L[y][x]]; //apply lightness - float lightcont = lumnew ; //original->L[y][x] + (lp.ligh /100.f)*original->L[y][x] ; //apply lightness + float lightcont = lumnew ; //apply lightness - //float lightcont = localcurve[original->L[y][x]]; //apply lightness float diflc = lightcont - original->L[y][x]; diflc *= factorx; transformed->L[y][x] = original->L[y][x] + diflc; @@ -3771,7 +3761,7 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * LabImage *bufgb; int GW = transformed->W; int GH = transformed->H; - printf ("rad=%f gaus=%f call=%i skip=%i\n", radius, GAUSS_SKIP, call, sk); + // printf ("rad=%f gaus=%f call=%i skip=%i\n", radius, GAUSS_SKIP, call, sk); if (call == 2 && !lp.invrad) { //simpleprocess int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 59ebf9824..c60c71a83 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -948,15 +948,12 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p if (params.locallab.enabled) { MyTime t1, t2; t1.set(); - CacheManager* cachemgr; // parent + CacheManager* cachemgr; - CacheImageData cfs; // cache entry corresponding to the thumbnai + CacheImageData cfs; cfs.md5 = cachemgr->getMD5 (imgsrc->getFileName()); std::string mdfive = cfs.md5; - //Glib::ustring datalab = imgsrc->getFileName() + ".mip"; - - // Glib::ustring pop = options.getUserProfilePath() + "/"; Glib::ustring pop = options.cacheBaseDir + "/mip/"; Glib::ustring datalab; @@ -1331,7 +1328,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p retistrs[ns] = str3; sizecu = longe; - // printf("lec simpl str=%s ns=%i si=%i\n", retistrs[ns].c_str(), ns, sizecu); } if (spotline.substr (0, pos) == "curveLL") { @@ -1349,7 +1345,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p llstrs[ns] = str3; sizell = longel; - // printf("lecture strLL=%s ns=%i si=%i\n", llstr[ns].c_str(), ns, sizell); } @@ -1368,7 +1363,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p lhstrs[ns] = str3; sizelh = longeh; - //printf("lecture strLH=%s ns=%i si=%i\n", lhstr[ns].c_str(), ns, sizelh); } if (spotline.substr (0, pos) == "curveCC") { @@ -1386,7 +1380,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p ccstrs[ns] = str3; sizecc = longec; - //printf("lecture strCC=%s ns=%i si=%i\n", ccstr[ns].c_str(), ns, sizecc); } }