diff --git a/rtengine/color.cc b/rtengine/color.cc index b0250ce9c..aa7232db6 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -2248,7 +2248,7 @@ void Color::AllMunsellLch(bool lumaMuns, float Lprov1, float Loldd, float HH, fl correctionHueLum = 0.0; - if(contin1 == true && contin2 == true) { + if(contin1 && contin2) { correctlum = correctlumprov2 - correctlumprov; } diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index c3e8c7780..d3400a8d0 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -570,7 +570,7 @@ std::string ImageMetaData::expcompToString (double expcomp, bool maskZeroexpcomp char buffer[256]; - if (maskZeroexpcomp == true) { + if (maskZeroexpcomp) { if (expcomp != 0.0) { sprintf (buffer, "%0.2f", expcomp); return buffer; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 1f41dd6b4..423a6b341 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -280,7 +280,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } //scene condition for surround - if(params->colorappearance.surrsource == true) { + if(params->colorappearance.surrsource) { f = 0.85; // if user => source image has surround very dark c = 0.55; nc = 0.85; @@ -507,7 +507,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh int gamu = 0; bool highlight = params->toneCurve.hrenabled; //Get the value if "highlight reconstruction" is activated - if(params->colorappearance.gamut == true) { + if(params->colorappearance.gamut) { gamu = 1; //enabled gamut control } @@ -1503,7 +1503,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } //scene condition for surround - if(params->colorappearance.surrsource == true) { + if(params->colorappearance.surrsource) { f = 0.85f; // if user => source image has surround very dark c = 0.55f; nc = 0.85f; @@ -1808,7 +1808,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int const bool highlight = params->toneCurve.hrenabled; //Get the value if "highlight reconstruction" is activated - const int gamu = (params->colorappearance.gamut == true) ? 1 : 0; + const int gamu = (params->colorappearance.gamut) ? 1 : 0; xw = 100.0f * Xw; yw = 100.0f * Yw; zw = 100.0f * Zw; @@ -3817,7 +3817,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float reducac = 0.4f; int preser = 0; - if(params->colorToning.lumamode == true) { + if(params->colorToning.lumamode) { preser = 1; } @@ -3878,7 +3878,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer int preser = 0; //bool execbal = params->colorToning.method=="Splitbal"; - if(params->colorToning.lumamode == true) { + if(params->colorToning.lumamode) { preser = 1; } @@ -3935,14 +3935,14 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float iplow, iphigh; - if(twocol == false) { + if(!twocol) { iplow = (float)ctColorCurve.low; iphigh = (float)ctColorCurve.high; } int twoc = 0; //integer instead of bool to let more possible choice...other than 2 and 500. - if (twocol == false) { + if (!twocol) { twoc = 0; // 2 colours } else { twoc = 1; // 500 colours @@ -4521,7 +4521,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer */ int preser = 0; - if(params->colorToning.lumamode == true) { + if(params->colorToning.lumamode) { preser = 1; } @@ -4570,7 +4570,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float reducac = 0.4f; int preser = 0; - if(params->colorToning.lumamode == true) { + if(params->colorToning.lumamode) { preser = 1; } @@ -4636,7 +4636,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float iplow, iphigh; - if(twocol == false) { + if(!twocol) { iplow = (float)ctColorCurve.low; iphigh = (float)ctColorCurve.high; @@ -4644,7 +4644,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer int twoc = 0; //integer instead of bool to let more possible choice...other than 2 and 500. - if(twocol == false) { + if(!twocol) { twoc = 0; // 2 colours } else { twoc = 1; // 500 colours diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 279b77762..c1a2f479e 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -184,7 +184,7 @@ void ImProcFunctions::sharpening (LabImage* lab, float** b2, SharpeningParams &s #endif { - if (sharpenParam.edgesonly == false) { + if (!sharpenParam.edgesonly) { gaussianBlur (lab->L, b2, W, H, sharpenParam.radius / scale); } else { bilateral (lab->L, (float**)b3, b2, W, H, sharpenParam.edges_radius / scale, sharpenParam.edges_tolerance, multiThread); @@ -327,7 +327,7 @@ void ImProcFunctions::MLsharpen (LabImage* lab) { // JD: this algorithm maximize clarity of images; it does not play on accutance. It can remove (partialy) the effects of the AA filter) // I think we can use this algorithm alone in most cases, or first to clarify image and if you want a very little USM (unsharp mask sharpening) after... - if (params->sharpenEdge.enabled == false) { + if (!params->sharpenEdge.enabled) { return; } @@ -564,7 +564,7 @@ void ImProcFunctions::MLsharpen (LabImage* lab) //! \param luminance : Luminance channel of image void ImProcFunctions::MLmicrocontrast(float** luminance, int W, int H) { - if (params->sharpenMicro.enabled == false) { + if (!params->sharpenMicro.enabled) { return; } @@ -949,7 +949,7 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2) #endif { - if (params->sharpening.edgesonly == false) { + if (!params->sharpening.edgesonly) { gaussianBlur (ncie->sh_p, b2, W, H, params->sharpening.radius / scale); } else { bilateral (ncie->sh_p, (float**)b3, b2, W, H, params->sharpening.edges_radius / scale, params->sharpening.edges_tolerance, multiThread); diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 76dd15e59..1ca5b78ec 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -845,7 +845,7 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int } // printf("LevwavL before: %d\n",levwavL); - if(cp.contrast == 0.f && cp.tonemap == false && cp.conres == 0.f && cp.conresH == 0.f && cp.val == 0 && !ref0 && params->wavelet.CLmethod == "all") { // no processing of residual L or edge=> we probably can reduce the number of levels + if(cp.contrast == 0.f && !cp.tonemap && cp.conres == 0.f && cp.conresH == 0.f && cp.val == 0 && !ref0 && params->wavelet.CLmethod == "all") { // no processing of residual L or edge=> we probably can reduce the number of levels while(levwavL > 0 && cp.mul[levwavL - 1] == 0.f) { // cp.mul[level] == 0.f means no changes to level levwavL--; } @@ -2599,7 +2599,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit float * koe; float maxkoe = 0.f; - if(lipschitz == false) { + if(!lipschitz) { koe = new float [H_L * W_L]; for (int i = 0; i < W_L * H_L; i++) { @@ -2732,7 +2732,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit //take into account local contrast float refin = value * exp (expkoef); - if(cp.link == true && cp.noiseena) { //combi + if(cp.link && cp.noiseena) { //combi { if(level == 0) { refin *= (1.f + cp.lev0s / 50.f); // we can change this sensibility! @@ -2775,7 +2775,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit int k = i * W_L + j; if(cp.detectedge) { - if(lipschitz == false) { + if(!lipschitz) { if(cp.eddet > 10.f) { edge = (aedstr * cp.eddet + bedstr) * (edgePrecalc * (1.f + koe[k])) / (1.f + 0.9f * maxkoe); } else { @@ -2783,7 +2783,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit } } - if(lipschitz == true) { + if(lipschitz) { if(level < 4) { edge = 1.f + (edgePrecalc - 1.f) * (koeLi[level * 3][k]) / (1.f + 0.9f * maxkoeLi[level * 3 + dir - 1]); } else { @@ -2885,7 +2885,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit int k = i * W_L + j; if(cp.detectedge) { - if(lipschitz == false) { + if(!lipschitz) { if(cp.eddet > 10.f) { edge = (aedstr * cp.eddet + bedstr) * (edgePrecalc * (1.f + koe[k])) / (1.f + 0.9f * maxkoe); } else { @@ -2893,7 +2893,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit } } - if(lipschitz == true) { + if(lipschitz) { if(level < 4) { edge = 1.f + (edgePrecalc - 1.f) * (koeLi[level * 3][k]) / (1.f + 0.9f * maxkoeLi[level * 3 + dir - 1]); } else { @@ -2975,13 +2975,13 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit } } - if(lipschitz == false) { + if(!lipschitz) { delete [] koe; } } - if(cp.link == false && cp.noiseena) { //used both with denoise 1 2 3 + if(!cp.link && cp.noiseena) { //used both with denoise 1 2 3 float refine = 0.f; for (int i = 0; i < W_L * H_L; i++) { diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 903bda6c6..b0a7873e9 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -7549,11 +7549,7 @@ bool operator==(const DirPyrEqualizerParams & a, const DirPyrEqualizerParams & b } } - if (a.threshold != b.threshold) { - return false; - } - - return true; + return a.threshold == b.threshold; } /*bool operator==(const ExifPairs& a, const ExifPairs& b) { diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index f631d4894..a36f2e222 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -782,7 +782,7 @@ void RawImage::getRgbCam (float rgbcam[3][4]) bool RawImage::get_thumbSwap() const { - return ((order == 0x4949) == (ntohs(0x1234) == 0x1234)) ? true : false; + return (order == 0x4949) == (ntohs(0x1234) == 0x1234); } } //namespace rtengine diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 9e8522463..ab8a7a8cc 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -1283,7 +1283,7 @@ double Crop::getRatio () double r = -1.0; - if (fixr->get_active() == false) { + if (!fixr->get_active()) { return r; } diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index f1d4d5661..fb3d51297 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1890,18 +1890,10 @@ void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & his bool EditorPanel::CheckSidePanelsVisibility() { if (tbTopPanel_1) { - if(tbTopPanel_1->get_active() == false && tbRightPanel_1->get_active() == false && hidehp->get_active() == false) { - return false; - } - - return true; + return !(!tbTopPanel_1->get_active() && !tbRightPanel_1->get_active() && !hidehp->get_active()); } - if(tbRightPanel_1->get_active() == false && hidehp->get_active() == false) { - return false; - } - - return true; + return !(!tbRightPanel_1->get_active() && !hidehp->get_active()); } void EditorPanel::toggleSidePanels() { @@ -1918,7 +1910,7 @@ void EditorPanel::toggleSidePanels() tbRightPanel_1->set_active (!bAllSidePanelsVisible); hidehp->set_active (!bAllSidePanelsVisible); - if (bAllSidePanelsVisible == false) { + if (!bAllSidePanelsVisible) { tbShowHideSidePanels->set_image (*iShowHideSidePanels); } else { tbShowHideSidePanels->set_image (*iShowHideSidePanels_exit); diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 66594b0e1..88d0a062b 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -582,7 +582,7 @@ void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string pre Gtk::TreeModel::iterator iter; for (iter = root.begin(); iter != root.end(); ++iter) { - if (iter->get_value (exifColumns.edited) == true) { + if (iter->get_value (exifColumns.edited)) { changeList[ prefix + iter->get_value (exifColumns.field_nopango) ] = iter->get_value (exifColumns.value_nopango); } else if (iter->get_value (exifColumns.action) == AC_WRITE && iter->get_value (exifColumns.icon) == delicon) { changeList[ prefix + iter->get_value (exifColumns.field_nopango) ] = "#delete"; diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 9f8b36043..b11361db2 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -1464,8 +1464,8 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) // true -> entry } // return false if basic filter settings are not satisfied - if ((filter.showRanked[entry->thumbnail->getRank()] == false ) || - (filter.showCLabeled[entry->thumbnail->getColorLabel()] == false ) || + if ((!filter.showRanked[entry->thumbnail->getRank()] ) || + (!filter.showCLabeled[entry->thumbnail->getColorLabel()] ) || ((entry->thumbnail->hasProcParams() && filter.showEdited[0]) && !filter.showEdited[1]) || ((!entry->thumbnail->hasProcParams() && filter.showEdited[1]) && !filter.showEdited[0]) || @@ -1515,7 +1515,7 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) // true -> entry } } - if (MatchEqual == true) { + if (MatchEqual) { if (iFilenameMatch == 0) { //none of the vFilterStrings found in FileName return false; } diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 3d2e4f552..82e3a0200 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -2122,11 +2122,7 @@ void FileCatalog::tbRightPanel_1_toggled () bool FileCatalog::CheckSidePanelsVisibility() { - if(tbLeftPanel_1->get_active() == false && tbRightPanel_1->get_active() == false) { - return false; - } else { - return true; - } + return !(!tbLeftPanel_1->get_active() && !tbRightPanel_1->get_active()); } void FileCatalog::toggleSidePanels() { @@ -2539,11 +2535,7 @@ bool FileCatalog::handleShortcutKey (GdkEventKey* event) } } - if (fileBrowser->keyPressed(event)) { - return true; - } - - return false; + return fileBrowser->keyPressed(event); } void FileCatalog::showToolBar() diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 65bbadf52..25e083af3 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -215,7 +215,7 @@ void HistogramPanel::resized (Gtk::Allocation& req) histogramArea->renderHistogram (); histogramArea->queue_draw (); - if (histogramRGBArea->getFreeze() == true) { + if (histogramRGBArea->getFreeze()) { histogramRGBArea->updateFreeze(false); // set histogramRGBArea invalid; histogramRGBArea->renderRGBMarks(-1, -1, -1); @@ -305,9 +305,9 @@ void HistogramPanel::setHistRGBInvalid () // "Freeze" is not a button, but a RMB-click, so this is not in the RGBV-Toggle method void HistogramPanel::toggleFreeze () { - if (histogramRGBArea->getFreeze() == true) { + if (histogramRGBArea->getFreeze()) { histogramRGBArea->updateFreeze(false); - } else if (histogramRGBArea->getShow() == true) { + } else if (histogramRGBArea->getShow()) { histogramRGBArea->updateFreeze(true); } diff --git a/rtgui/history.cc b/rtgui/history.cc index 9c38a705b..4deb7b64a 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -165,7 +165,7 @@ void History::historySelectionChanged () tpc->profileChange (&pp, EvHistoryBrowsed, row[historyColumns.text], ¶msEdited); } - if (blistener && blistenerLock == false) { + if (blistener && !blistenerLock) { Gtk::TreeModel::Path path = historyModel->get_path (iter); path.prev (); iter = historyModel->get_iter (path); @@ -251,9 +251,9 @@ void History::procParamsChanged (ProcParams* params, ProcEvent ev, Glib::ustring selection->select (newrow); } - if (blistener && row && blistenerLock == false) { + if (blistener && row && !blistenerLock) { blistener->historyBeforeLineChanged (row[historyColumns.params]); - } else if (blistener && size == 0 && blistenerLock == false) { + } else if (blistener && size == 0 && !blistenerLock) { blistener->historyBeforeLineChanged (newrow[historyColumns.params]); } } diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index fc81bfa0d..32df9f8f6 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -213,7 +213,7 @@ bool ImageArea::on_expose_event(GdkEventExpose* event) mainCropWindow->expose (cr); } - if (options.showInfo == true && infotext != "") { + if (options.showInfo && infotext != "") { int fnw, fnh; ilayout->get_pixel_size (fnw, fnh); window->draw_pixbuf (get_style()->get_base_gc (Gtk::STATE_NORMAL), ipixbuf, 0, 0, 4, 4, fnw + 8, fnh + 8, Gdk::RGB_DITHER_NONE, 0, 0); diff --git a/rtgui/options.cc b/rtgui/options.cc index 43159cec8..a46ec9f90 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -74,11 +74,7 @@ inline bool Options::checkProfilePath(Glib::ustring &path) p = getGlobalProfilePath(); - if (!p.empty() && Glib::file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS)) { - return true; - } else { - return false; - } + return !p.empty() && Glib::file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS); } bool Options::checkDirPath(Glib::ustring &path, Glib::ustring errString) @@ -2324,7 +2320,7 @@ bool Options::load () void Options::save () { - if (options.multiUser == false) { + if (!options.multiUser) { options.saveToFile (Glib::build_filename(argv0, "options")); } else { options.saveToFile (Glib::build_filename(rtdir, "options")); diff --git a/rtgui/previewmodepanel.cc b/rtgui/previewmodepanel.cc index e5e100ba5..601103fa8 100644 --- a/rtgui/previewmodepanel.cc +++ b/rtgui/previewmodepanel.cc @@ -88,9 +88,9 @@ PreviewModePanel::PreviewModePanel (ImageArea* ia) : imageArea(ia) previewL->set_active (false); previewFocusMask->set_active (false); - backColor0->set_active (options.bgcolor == 0 ? true : false); - backColor1->set_active (options.bgcolor == 1 ? true : false); - backColor2->set_active (options.bgcolor == 2 ? true : false); + backColor0->set_active (options.bgcolor == 0); + backColor1->set_active (options.bgcolor == 1); + backColor2->set_active (options.bgcolor == 2); vbbackColor = Gtk::manage (new Gtk::VBox ()); vbbackColor->set_border_width (0); diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index f51a460b8..ad1cfccc3 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -153,20 +153,12 @@ ProfilePanel::~ProfilePanel () bool ProfilePanel::isCustomSelected() { - if (profiles->getCurrentLabel() == Glib::ustring ("(" + M("PROFILEPANEL_PCUSTOM") + ")")) { - return true; - } - - return false; + return profiles->getCurrentLabel() == Glib::ustring ("(" + M("PROFILEPANEL_PCUSTOM") + ")"); } bool ProfilePanel::isLastSavedSelected() { - if (profiles->getCurrentLabel() == Glib::ustring ("(" + M("PROFILEPANEL_PLASTSAVED") + ")")) { - return true; - } - - return false; + return profiles->getCurrentLabel() == Glib::ustring ("(" + M("PROFILEPANEL_PLASTSAVED") + ")"); } Gtk::TreeIter ProfilePanel::getCustomRow()