From f59e7c31e4cce25c0d26c913dba64cdd85b1420d Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 2 Sep 2018 13:39:55 +0200 Subject: [PATCH 01/53] Modifications to store histogram settings across sessions --- rtgui/editorpanel.cc | 2 +- rtgui/histogrampanel.cc | 85 ++++++++++++++++++++--------------------- rtgui/histogrampanel.h | 21 +++++----- rtgui/options.cc | 33 ++++++++++++++++ rtgui/options.h | 3 +- 5 files changed, 89 insertions(+), 55 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index cb4a58317..3b717abe7 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -2241,7 +2241,7 @@ void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & his { if (histogramPanel) { - histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); + histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); } tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 1d8ce89db..5293c6c00 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -129,14 +129,14 @@ HistogramPanel::HistogramPanel () buttonGrid = Gtk::manage (new Gtk::Grid ()); buttonGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); - showRed->set_active (true); - showGreen->set_active (true); - showBlue->set_active (true); - showValue->set_active (false);//unactive by default - showChro->set_active (false);//unactive by default - showRAW->set_active (false); + showRed->set_active (options.histogramRed); + showGreen->set_active (options.histogramGreen); + showBlue->set_active (options.histogramBlue); + showValue->set_active (options.histogramLuma); + showChro->set_active (options.histogramChroma); + showRAW->set_active (options.histogramRAW); // no showMode->set_active(), as it's not a ToggleButton - showBAR->set_active (options.histogramBar); + showBAR->set_active (options.histogramBar); showRed->set_image (showRed->get_active() ? *redImage : *redImage_g); showGreen->set_image (showGreen->get_active() ? *greenImage : *greenImage_g); @@ -297,12 +297,12 @@ void HistogramPanel::bar_toggled () void HistogramPanel::rgbv_toggled () { // Update Display - histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showChro->get_active(), options.histogramDrawMode); + histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showChro->get_active(), showRAW->get_active(), options.histogramDrawMode); histogramArea->queue_draw (); - histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showBAR->get_active(), showChro->get_active()); + histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showChro->get_active(), showRAW->get_active(), showBAR->get_active()); histogramRGBArea->updateBackBuffer (0, 0, 0); - histogramArea->queue_draw (); + histogramRGBArea->queue_draw (); } void HistogramPanel::setHistRGBInvalid () @@ -369,8 +369,11 @@ double HistogramScaling::log(double vsize, double val) // // // HistogramRGBArea -HistogramRGBArea::HistogramRGBArea () ://needChroma unactive by default, luma too - val(0), r(0), g(0), b(0), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(false), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false), parent(nullptr) +HistogramRGBArea::HistogramRGBArea () : + val(0), r(0), g(0), b(0), valid(false), + needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue), + needLuma(options.histogramLuma), needChroma(options.histogramChroma), rawMode(options.histogramRAW), + showMode(options.histogramBar), barDisplayed(options.histogramBar), parent(nullptr) { get_style_context()->add_class("drawingarea"); @@ -583,28 +586,23 @@ void HistogramRGBArea::update (int valh, int rh, int gh, int bh) idle_register.add(func, harih); } -void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool bar, bool c) +void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool bar) { - needRed = r; - needGreen = g; - needBlue = b; - needLuma = l; - rawMode = raw; - showMode = bar; - needChroma = c; - - // Histogram RGB BAR button logic goes here + options.histogramRed = needRed = r; + options.histogramGreen = needGreen = g; + options.histogramBlue = needBlue = b; + options.histogramLuma = needLuma = l; + options.histogramChroma = needChroma = c; + options.histogramRAW = rawMode = raw; + options.histogramBar = showMode = bar; + // Show/hide the RGB bar widget if (bar && !barDisplayed) { - // Toggled on, add (show) the widget parent->add(*this); - options.histogramBar = true; barDisplayed = true; } else if (!bar && barDisplayed) { - // Toggled off, remove (hide) the widget removeIfThere(parent, this, false); - options.histogramBar = false; barDisplayed = false; } @@ -661,16 +659,18 @@ void HistogramRGBArea::factorChanged (double newFactor) // // // HistogramArea -HistogramArea::HistogramArea (DrawModeListener *fml) : //needChroma unactive by default, luma too +HistogramArea::HistogramArea (DrawModeListener *fml) : valid(false), drawMode(options.histogramDrawMode), myDrawModeListener(fml), - oldwidth(-1), oldheight(-1), needLuma(false), needRed(true), needGreen(true), needBlue(true), - rawMode(false), needChroma(false), isPressed(false), movingPosition(0.0) + oldwidth(-1), oldheight(-1), + needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue), + needLuma(options.histogramLuma), needChroma(options.histogramChroma), rawMode(options.histogramRAW), + isPressed(false), movingPosition(0.0) { - lhist(256); rhist(256); ghist(256); bhist(256); + lhist(256); chist(256); get_style_context()->add_class("drawingarea"); @@ -724,32 +724,31 @@ void HistogramArea::get_preferred_width_for_height_vfunc (int height, int &minim get_preferred_width_vfunc (minimum_width, natural_width); } -void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool c, int mode) +void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode) { - - needRed = r; - needGreen = g; - needBlue = b; - needLuma = l; - rawMode = raw; - needChroma = c; - drawMode = mode; + + options.histogramRed = needRed = r; + options.histogramGreen = needGreen = g; + options.histogramBlue = needBlue = b; + options.histogramLuma = needLuma = l; + options.histogramChroma = needChroma = c; + options.histogramRAW = rawMode = raw; + options.histogramDrawMode = drawMode = mode; updateBackBuffer (); } -void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) +void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) { if (histRed) { - lhist = histLuma; - chist = histChroma; rhist = histRed; ghist = histGreen; bhist = histBlue; + lhist = histLuma; + chist = histChroma; rhistRaw = histRedRaw; ghistRaw = histGreenRaw; bhistRaw = histBlueRaw; - valid = true; } else { valid = false; diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index d3788d057..7c2e11162 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -70,10 +70,10 @@ protected: bool needGreen; bool needBlue; bool needLuma; + bool needChroma; bool rawMode; bool showMode; bool barDisplayed; - bool needChroma; Gtk::Grid* parent; @@ -91,7 +91,7 @@ public: }; void update (int val, int rh, int gh, int bh); - void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool show, bool c); + void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool show); void on_realize(); bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); @@ -104,7 +104,7 @@ private: void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const; void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const; void get_preferred_width_for_height_vfunc (int h, int &minimum_width, int &natural_width) const; - // Some ... + }; class DrawModeListener @@ -124,15 +124,16 @@ private: type_signal_factor_changed sigFactorChanged; protected: - LUTu lhist, rhist, ghist, bhist, chist; - LUTu lhistRaw, rhistRaw, ghistRaw, bhistRaw; + LUTu rhist, ghist, bhist, lhist, chist; + LUTu rhistRaw, ghistRaw, bhistRaw, lhistRaw; //lhistRaw is unused? bool valid; int drawMode; DrawModeListener *myDrawModeListener; int oldwidth, oldheight; - bool needLuma, needRed, needGreen, needBlue, rawMode, needChroma; + bool needRed, needGreen, needBlue, needLuma, needChroma; + bool rawMode; bool isPressed; double movingPosition; @@ -143,8 +144,8 @@ public: ~HistogramArea(); void updateBackBuffer (); - void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma); - void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool c, int mode); + void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw); + void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode); void on_realize(); bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); bool on_button_press_event (GdkEventButton* event); @@ -208,9 +209,9 @@ public: HistogramPanel (); ~HistogramPanel (); - void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) + void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) { - histogramArea->update (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); + histogramArea->update (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); } // pointermotionlistener interface void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false); diff --git a/rtgui/options.cc b/rtgui/options.cc index eb920a7d6..9c7e0baf9 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -417,6 +417,9 @@ void Options::setDefaults() mainNBVertical = true; multiDisplayMode = 0; histogramPosition = 1; + histogramRed = true; + histogramGreen = true; + histogramBlue = true; histogramBar = true; histogramHeight = 200; histogramDrawMode = 0; @@ -1305,6 +1308,30 @@ void Options::readFromFile(Glib::ustring fname) if (keyFile.has_key("GUI", "HistogramPosition")) { histogramPosition = keyFile.get_integer("GUI", "HistogramPosition"); } + + if (keyFile.has_key("GUI", "HistogramRed")) { + histogramRed = keyFile.get_boolean("GUI", "HistogramRed"); + } + + if (keyFile.has_key("GUI", "HistogramGreen")) { + histogramGreen = keyFile.get_boolean("GUI", "HistogramGreen"); + } + + if (keyFile.has_key("GUI", "HistogramBlue")) { + histogramBlue = keyFile.get_boolean("GUI", "HistogramBlue"); + } + + if (keyFile.has_key("GUI", "HistogramLuma")) { + histogramLuma = keyFile.get_boolean("GUI", "HistogramLuma"); + } + + if (keyFile.has_key("GUI", "HistogramChroma")) { + histogramChroma = keyFile.get_boolean("GUI", "HistogramChroma"); + } + + if (keyFile.has_key("GUI", "HistogramRAW")) { + histogramRAW = keyFile.get_boolean("GUI", "HistogramRAW"); + } if (keyFile.has_key("GUI", "HistogramBar")) { histogramBar = keyFile.get_boolean("GUI", "HistogramBar"); @@ -2035,6 +2062,12 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_double_list ("GUI", "CutOverlayBrush", cutOverlayBrush); keyFile.set_double_list ("GUI", "NavGuideBrush", navGuideBrush); keyFile.set_integer ("GUI", "HistogramPosition", histogramPosition); + keyFile.set_boolean ("GUI", "HistogramRed", histogramRed); + keyFile.set_boolean ("GUI", "HistogramGreen", histogramGreen); + keyFile.set_boolean ("GUI", "HistogramBlue", histogramBlue); + keyFile.set_boolean ("GUI", "HistogramLuma", histogramLuma); + keyFile.set_boolean ("GUI", "HistogramChroma", histogramChroma); + keyFile.set_boolean ("GUI", "HistogramRAW", histogramRAW); keyFile.set_boolean ("GUI", "HistogramBar", histogramBar); keyFile.set_integer ("GUI", "HistogramHeight", histogramHeight); keyFile.set_integer ("GUI", "HistogramDrawMode", histogramDrawMode); diff --git a/rtgui/options.h b/rtgui/options.h index 93f29b7ac..149fa2135 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -254,7 +254,8 @@ public: bool sndEnable; int histogramPosition; // 0=disabled, 1=left pane, 2=right pane - //int histogramWorking; // 0=disabled, 1=left pane, 2=right pane + bool histogramRed, histogramGreen, histogramBlue; + bool histogramLuma, histogramChroma, histogramRAW; bool histogramBar; int histogramHeight; int histogramDrawMode; From 59ca037fd75ab97a6127b7d528004661e915d970 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 2 Sep 2018 16:58:20 +0200 Subject: [PATCH 02/53] Disable highlight recovery threshold when highlight recovery = 0 and set threshold default to 0 --- rtengine/improcfun.cc | 2 +- rtengine/procparams.cc | 2 +- rtgui/tonecurve.cc | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 945eaf29f..7d9d080e2 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -5466,7 +5466,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double //now tune hlcompr to bring back rawmax to 65535 - hlcomprthresh = 33; + hlcomprthresh = 0; //this is a series approximation of the actual formula for comp, //which is a transcendental equation float comp = (gain * ((float)whiteclip) / scale - 1.f) * 2.3f; // 2.3 instead of 2 to increase slightly comp diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e7225e993..90c472290 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -330,7 +330,7 @@ ToneCurveParams::ToneCurveParams() : saturation(0), shcompr(50), hlcompr(0), - hlcomprthresh(33), + hlcomprthresh(0), histmatching(false), fromHistMatching(false), clampOOG(true) diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 30c9dadee..1354dd81b 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -111,7 +111,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA //----------- Highlight recovery & threshold ------------- hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0)); pack_start (*hlcompr); - hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33)); + hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0)); pack_start (*hlcomprthresh); //----------- Black Level & Compression ------------------- @@ -232,6 +232,10 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) if (!black->getAddMode()) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode()) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } brightness->setValue (pp->toneCurve.brightness); contrast->setValue (pp->toneCurve.contrast); @@ -620,6 +624,10 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) listener->panelChanged (EvSaturation, costr); } else if (a == hlcompr) { listener->panelChanged (EvHLCompr, costr); + + if (!hlcompr->getAddMode()) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } } else if (a == hlcomprthresh) { listener->panelChanged (EvHLComprThreshold, costr); } else if (a == shcompr) { @@ -663,6 +671,10 @@ void ToneCurve::neutral_pressed () if (!black->getAddMode()) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode()) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } contrast->setValue(0); //saturation->setValue(0); From 30b36e63712f651c0f3ada6e233f8fed8352602f Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 2 Sep 2018 17:04:17 +0200 Subject: [PATCH 03/53] Revert "Modifications to store histogram settings across sessions" This reverts commit f59e7c31e4cce25c0d26c913dba64cdd85b1420d. --- rtgui/editorpanel.cc | 2 +- rtgui/histogrampanel.cc | 85 +++++++++++++++++++++-------------------- rtgui/histogrampanel.h | 21 +++++----- rtgui/options.cc | 33 ---------------- rtgui/options.h | 3 +- 5 files changed, 55 insertions(+), 89 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 3f0909d88..c99ed2dbd 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -2242,7 +2242,7 @@ void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & his { if (histogramPanel) { - histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); + histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); } tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 5293c6c00..1d8ce89db 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -129,14 +129,14 @@ HistogramPanel::HistogramPanel () buttonGrid = Gtk::manage (new Gtk::Grid ()); buttonGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); - showRed->set_active (options.histogramRed); - showGreen->set_active (options.histogramGreen); - showBlue->set_active (options.histogramBlue); - showValue->set_active (options.histogramLuma); - showChro->set_active (options.histogramChroma); - showRAW->set_active (options.histogramRAW); + showRed->set_active (true); + showGreen->set_active (true); + showBlue->set_active (true); + showValue->set_active (false);//unactive by default + showChro->set_active (false);//unactive by default + showRAW->set_active (false); // no showMode->set_active(), as it's not a ToggleButton - showBAR->set_active (options.histogramBar); + showBAR->set_active (options.histogramBar); showRed->set_image (showRed->get_active() ? *redImage : *redImage_g); showGreen->set_image (showGreen->get_active() ? *greenImage : *greenImage_g); @@ -297,12 +297,12 @@ void HistogramPanel::bar_toggled () void HistogramPanel::rgbv_toggled () { // Update Display - histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showChro->get_active(), showRAW->get_active(), options.histogramDrawMode); + histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showChro->get_active(), options.histogramDrawMode); histogramArea->queue_draw (); - histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showChro->get_active(), showRAW->get_active(), showBAR->get_active()); + histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showBAR->get_active(), showChro->get_active()); histogramRGBArea->updateBackBuffer (0, 0, 0); - histogramRGBArea->queue_draw (); + histogramArea->queue_draw (); } void HistogramPanel::setHistRGBInvalid () @@ -369,11 +369,8 @@ double HistogramScaling::log(double vsize, double val) // // // HistogramRGBArea -HistogramRGBArea::HistogramRGBArea () : - val(0), r(0), g(0), b(0), valid(false), - needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue), - needLuma(options.histogramLuma), needChroma(options.histogramChroma), rawMode(options.histogramRAW), - showMode(options.histogramBar), barDisplayed(options.histogramBar), parent(nullptr) +HistogramRGBArea::HistogramRGBArea () ://needChroma unactive by default, luma too + val(0), r(0), g(0), b(0), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(false), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false), parent(nullptr) { get_style_context()->add_class("drawingarea"); @@ -586,23 +583,28 @@ void HistogramRGBArea::update (int valh, int rh, int gh, int bh) idle_register.add(func, harih); } -void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool bar) +void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool bar, bool c) { - options.histogramRed = needRed = r; - options.histogramGreen = needGreen = g; - options.histogramBlue = needBlue = b; - options.histogramLuma = needLuma = l; - options.histogramChroma = needChroma = c; - options.histogramRAW = rawMode = raw; - options.histogramBar = showMode = bar; + needRed = r; + needGreen = g; + needBlue = b; + needLuma = l; + rawMode = raw; + showMode = bar; + needChroma = c; + + // Histogram RGB BAR button logic goes here - // Show/hide the RGB bar widget if (bar && !barDisplayed) { + // Toggled on, add (show) the widget parent->add(*this); + options.histogramBar = true; barDisplayed = true; } else if (!bar && barDisplayed) { + // Toggled off, remove (hide) the widget removeIfThere(parent, this, false); + options.histogramBar = false; barDisplayed = false; } @@ -659,18 +661,16 @@ void HistogramRGBArea::factorChanged (double newFactor) // // // HistogramArea -HistogramArea::HistogramArea (DrawModeListener *fml) : +HistogramArea::HistogramArea (DrawModeListener *fml) : //needChroma unactive by default, luma too valid(false), drawMode(options.histogramDrawMode), myDrawModeListener(fml), - oldwidth(-1), oldheight(-1), - needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue), - needLuma(options.histogramLuma), needChroma(options.histogramChroma), rawMode(options.histogramRAW), - isPressed(false), movingPosition(0.0) + oldwidth(-1), oldheight(-1), needLuma(false), needRed(true), needGreen(true), needBlue(true), + rawMode(false), needChroma(false), isPressed(false), movingPosition(0.0) { + lhist(256); rhist(256); ghist(256); bhist(256); - lhist(256); chist(256); get_style_context()->add_class("drawingarea"); @@ -724,31 +724,32 @@ void HistogramArea::get_preferred_width_for_height_vfunc (int height, int &minim get_preferred_width_vfunc (minimum_width, natural_width); } -void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode) +void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool c, int mode) { - - options.histogramRed = needRed = r; - options.histogramGreen = needGreen = g; - options.histogramBlue = needBlue = b; - options.histogramLuma = needLuma = l; - options.histogramChroma = needChroma = c; - options.histogramRAW = rawMode = raw; - options.histogramDrawMode = drawMode = mode; + + needRed = r; + needGreen = g; + needBlue = b; + needLuma = l; + rawMode = raw; + needChroma = c; + drawMode = mode; updateBackBuffer (); } -void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) +void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) { if (histRed) { + lhist = histLuma; + chist = histChroma; rhist = histRed; ghist = histGreen; bhist = histBlue; - lhist = histLuma; - chist = histChroma; rhistRaw = histRedRaw; ghistRaw = histGreenRaw; bhistRaw = histBlueRaw; + valid = true; } else { valid = false; diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 7c2e11162..d3788d057 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -70,10 +70,10 @@ protected: bool needGreen; bool needBlue; bool needLuma; - bool needChroma; bool rawMode; bool showMode; bool barDisplayed; + bool needChroma; Gtk::Grid* parent; @@ -91,7 +91,7 @@ public: }; void update (int val, int rh, int gh, int bh); - void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool show); + void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool show, bool c); void on_realize(); bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); @@ -104,7 +104,7 @@ private: void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const; void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const; void get_preferred_width_for_height_vfunc (int h, int &minimum_width, int &natural_width) const; - + // Some ... }; class DrawModeListener @@ -124,16 +124,15 @@ private: type_signal_factor_changed sigFactorChanged; protected: - LUTu rhist, ghist, bhist, lhist, chist; - LUTu rhistRaw, ghistRaw, bhistRaw, lhistRaw; //lhistRaw is unused? + LUTu lhist, rhist, ghist, bhist, chist; + LUTu lhistRaw, rhistRaw, ghistRaw, bhistRaw; bool valid; int drawMode; DrawModeListener *myDrawModeListener; int oldwidth, oldheight; - bool needRed, needGreen, needBlue, needLuma, needChroma; - bool rawMode; + bool needLuma, needRed, needGreen, needBlue, rawMode, needChroma; bool isPressed; double movingPosition; @@ -144,8 +143,8 @@ public: ~HistogramArea(); void updateBackBuffer (); - void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw); - void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode); + void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma); + void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool c, int mode); void on_realize(); bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); bool on_button_press_event (GdkEventButton* event); @@ -209,9 +208,9 @@ public: HistogramPanel (); ~HistogramPanel (); - void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) + void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) { - histogramArea->update (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); + histogramArea->update (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); } // pointermotionlistener interface void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false); diff --git a/rtgui/options.cc b/rtgui/options.cc index 8107b43f0..0190b7d40 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -419,9 +419,6 @@ void Options::setDefaults() mainNBVertical = true; multiDisplayMode = 0; histogramPosition = 1; - histogramRed = true; - histogramGreen = true; - histogramBlue = true; histogramBar = true; histogramHeight = 200; histogramDrawMode = 0; @@ -1318,30 +1315,6 @@ void Options::readFromFile(Glib::ustring fname) if (keyFile.has_key("GUI", "HistogramPosition")) { histogramPosition = keyFile.get_integer("GUI", "HistogramPosition"); } - - if (keyFile.has_key("GUI", "HistogramRed")) { - histogramRed = keyFile.get_boolean("GUI", "HistogramRed"); - } - - if (keyFile.has_key("GUI", "HistogramGreen")) { - histogramGreen = keyFile.get_boolean("GUI", "HistogramGreen"); - } - - if (keyFile.has_key("GUI", "HistogramBlue")) { - histogramBlue = keyFile.get_boolean("GUI", "HistogramBlue"); - } - - if (keyFile.has_key("GUI", "HistogramLuma")) { - histogramLuma = keyFile.get_boolean("GUI", "HistogramLuma"); - } - - if (keyFile.has_key("GUI", "HistogramChroma")) { - histogramChroma = keyFile.get_boolean("GUI", "HistogramChroma"); - } - - if (keyFile.has_key("GUI", "HistogramRAW")) { - histogramRAW = keyFile.get_boolean("GUI", "HistogramRAW"); - } if (keyFile.has_key("GUI", "HistogramBar")) { histogramBar = keyFile.get_boolean("GUI", "HistogramBar"); @@ -2074,12 +2047,6 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_double_list ("GUI", "CutOverlayBrush", cutOverlayBrush); keyFile.set_double_list ("GUI", "NavGuideBrush", navGuideBrush); keyFile.set_integer ("GUI", "HistogramPosition", histogramPosition); - keyFile.set_boolean ("GUI", "HistogramRed", histogramRed); - keyFile.set_boolean ("GUI", "HistogramGreen", histogramGreen); - keyFile.set_boolean ("GUI", "HistogramBlue", histogramBlue); - keyFile.set_boolean ("GUI", "HistogramLuma", histogramLuma); - keyFile.set_boolean ("GUI", "HistogramChroma", histogramChroma); - keyFile.set_boolean ("GUI", "HistogramRAW", histogramRAW); keyFile.set_boolean ("GUI", "HistogramBar", histogramBar); keyFile.set_integer ("GUI", "HistogramHeight", histogramHeight); keyFile.set_integer ("GUI", "HistogramDrawMode", histogramDrawMode); diff --git a/rtgui/options.h b/rtgui/options.h index 6c473949b..ee95d5cb3 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -256,8 +256,7 @@ public: bool sndEnable; int histogramPosition; // 0=disabled, 1=left pane, 2=right pane - bool histogramRed, histogramGreen, histogramBlue; - bool histogramLuma, histogramChroma, histogramRAW; + //int histogramWorking; // 0=disabled, 1=left pane, 2=right pane bool histogramBar; int histogramHeight; int histogramDrawMode; From 7b0a9c01c5832d74a1e7d2b4bf1bd44ca7ddb36f Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 2 Sep 2018 20:40:11 +0200 Subject: [PATCH 04/53] Fix for usability of highlight threshold slider and shadow compression in batch mode --- rtgui/tonecurve.cc | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 1354dd81b..5205d6f18 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -229,11 +229,11 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) hlcomprthresh->setValue (pp->toneCurve.hlcomprthresh); shcompr->setValue (pp->toneCurve.shcompr); - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } - if (!hlcompr->getAddMode()) { + if (!hlcompr->getAddMode() && !batchMode) { hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect } @@ -615,7 +615,7 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) } else if (a == black) { listener->panelChanged (EvBlack, costr); - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } } else if (a == contrast) { @@ -625,7 +625,7 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) } else if (a == hlcompr) { listener->panelChanged (EvHLCompr, costr); - if (!hlcompr->getAddMode()) { + if (!hlcompr->getAddMode() && !batchMode) { hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect } } else if (a == hlcomprthresh) { @@ -668,11 +668,11 @@ void ToneCurve::neutral_pressed () hlrbox->hide(); } - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } - if (!hlcompr->getAddMode()) { + if (!hlcompr->getAddMode() && !batchMode) { hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect } @@ -745,6 +745,11 @@ void ToneCurve::autolevels_toggled () if (!black->getAddMode()) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } + } else { listener->panelChanged (EvFixedExp, M("GENERAL_DISABLED")); } @@ -859,9 +864,13 @@ bool ToneCurve::autoExpComputed_ () hlrbox->hide(); } - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } enableListener (); @@ -983,9 +992,13 @@ bool ToneCurve::histmatchingComputed() contrast->setValue(0); black->setValue(0); - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue() == 0)); } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } if (autolevels->get_active() ) { expcomp->setValue(0); From 9ecc7e687659b86941c817a1f46c09b39dfbffa0 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 5 Sep 2018 13:30:15 +0200 Subject: [PATCH 05/53] iterative raw auto ca correction, #4774 --- rtdata/languages/default | 2 + rtengine/CA_correct_RT.cc | 1903 ++++++++++++++++++------------------ rtengine/procparams.cc | 4 + rtengine/procparams.h | 1 + rtengine/rawimagesource.cc | 8 +- rtengine/rawimagesource.h | 2 +- rtgui/paramsedited.cc | 8 +- rtgui/paramsedited.h | 1 + rtgui/partialpastedlg.cc | 1 + rtgui/rawcacorrection.cc | 27 +- rtgui/rawcacorrection.h | 3 + 11 files changed, 1002 insertions(+), 958 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index b1fafc48e..05498985f 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -748,6 +748,7 @@ HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold HISTORY_MSG_RAW_BORDER;Raw border +HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1780,6 +1781,7 @@ TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by o TP_PRSHARPENING_LABEL;Post-Resize Sharpening TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. TP_RAWCACORR_AUTO;Auto-correction +TP_RAWCACORR_AUTOIT;Iterations TP_RAWCACORR_CABLUE;Blue TP_RAWCACORR_CARED;Red TP_RAWCACORR_CASTR;Strength diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index a2f34584f..35e36ce05 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -111,7 +111,7 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) using namespace std; using namespace rtengine; -float* RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const double cablue, const double caautostrength, array2D &rawData, double *fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, float *buffer, bool freeBuffer) +float* RawImageSource::CA_correct_RT(const bool autoCA, const size_t autoIterations, const double cared, const double cablue, const double caautostrength, array2D &rawData, double *fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, float *buffer, bool freeBuffer) { // multithreaded and vectorized by Ingo Weyrich constexpr int ts = 128; @@ -155,1038 +155,1039 @@ float* RawImageSource::CA_correct_RT(const bool autoCA, const double cared, cons memset(blockwt, 0, vblsz * hblsz * (2 * 2 + 1) * sizeof(float)); float (*blockshifts)[2][2] = (float (*)[2][2])(blockwt + vblsz * hblsz); - float blockave[2][2] = {{0, 0}, {0, 0}}, blocksqave[2][2] = {{0, 0}, {0, 0}}, blockdenom[2][2] = {{0, 0}, {0, 0}}, blockvar[2][2]; - // Because we can't break parallel processing, we need a switch do handle the errors bool processpasstwo = true; - double fitparams[2][2][16]; - const bool fitParamsSet = fitParamsTransfer && fitParamsIn; - if(autoCA && fitParamsSet) { - // use stored parameters - int index = 0; - for(int c = 0; c < 2; ++c) { - for(int d = 0; d < 2; ++d) { - for(int e = 0; e < 16; ++e) { - fitparams[c][d][e] = fitParamsTransfer[index++]; + + const size_t iterations = autoCA ? std::max(autoIterations, static_cast(1)) : 1; + for (size_t it = 0; it < iterations && processpasstwo; ++it) { + float blockave[2][2] = {{0, 0}, {0, 0}}, blocksqave[2][2] = {{0, 0}, {0, 0}}, blockdenom[2][2] = {{0, 0}, {0, 0}}, blockvar[2][2]; + const bool fitParamsSet = fitParamsTransfer && fitParamsIn; + if(autoCA && fitParamsSet && iterations < 2) { + // use stored parameters + int index = 0; + for(int c = 0; c < 2; ++c) { + for(int d = 0; d < 2; ++d) { + for(int e = 0; e < 16; ++e) { + fitparams[c][d][e] = fitParamsTransfer[index++]; + } } } } - } - //order of 2d polynomial fit (polyord), and numpar=polyord^2 - int polyord = 4, numpar = 16; + //order of 2d polynomial fit (polyord), and numpar=polyord^2 + int polyord = 4, numpar = 16; - constexpr float eps = 1e-5f, eps2 = 1e-10f; //tolerance to avoid dividing by zero + constexpr float eps = 1e-5f, eps2 = 1e-10f; //tolerance to avoid dividing by zero - #pragma omp parallel - { - int progresscounter = 0; + #pragma omp parallel + { + int progresscounter = 0; - //direction of the CA shift in a tile - int GRBdir[2][3]; + //direction of the CA shift in a tile + int GRBdir[2][3]; - int shifthfloor[3], shiftvfloor[3], shifthceil[3], shiftvceil[3]; + int shifthfloor[3], shiftvfloor[3], shifthceil[3], shiftvceil[3]; - //polynomial fit coefficients - //residual CA shift amount within a plaquette - float shifthfrac[3], shiftvfrac[3]; + //polynomial fit coefficients + //residual CA shift amount within a plaquette + float shifthfrac[3], shiftvfrac[3]; - // assign working space - constexpr int buffersize = sizeof(float) * ts * ts + 8 * sizeof(float) * ts * tsh + 8 * 64 + 63; - constexpr int buffersizePassTwo = sizeof(float) * ts * ts + 4 * sizeof(float) * ts * tsh + 4 * 64 + 63; - char * const bufferThr = (char *) malloc((autoCA && !fitParamsSet) ? buffersize : buffersizePassTwo); + // assign working space + constexpr int buffersize = sizeof(float) * ts * ts + 8 * sizeof(float) * ts * tsh + 8 * 64 + 63; + constexpr int buffersizePassTwo = sizeof(float) * ts * ts + 4 * sizeof(float) * ts * tsh + 4 * 64 + 63; + char * const bufferThr = (char *) malloc((autoCA && !fitParamsSet) ? buffersize : buffersizePassTwo); - char * const data = (char*)( ( uintptr_t(bufferThr) + uintptr_t(63)) / 64 * 64); + char * const data = (char*)( ( uintptr_t(bufferThr) + uintptr_t(63)) / 64 * 64); - // shift the beginning of all arrays but the first by 64 bytes to avoid cache miss conflicts on CPUs which have <= 4-way associative L1-Cache + // shift the beginning of all arrays but the first by 64 bytes to avoid cache miss conflicts on CPUs which have <= 4-way associative L1-Cache - //rgb data in a tile - float* rgb[3]; - rgb[0] = (float (*)) data; - rgb[1] = (float (*)) (data + sizeof(float) * ts * tsh + 1 * 64); - rgb[2] = (float (*)) (data + sizeof(float) * (ts * ts + ts * tsh) + 2 * 64); + //rgb data in a tile + float* rgb[3]; + rgb[0] = (float (*)) data; + rgb[1] = (float (*)) (data + sizeof(float) * ts * tsh + 1 * 64); + rgb[2] = (float (*)) (data + sizeof(float) * (ts * ts + ts * tsh) + 2 * 64); - if (autoCA && !fitParamsSet) { - //high pass filter for R/B in vertical direction - float *rbhpfh = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); - //high pass filter for R/B in horizontal direction - float *rbhpfv = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); - //low pass filter for R/B in horizontal direction - float *rblpfh = (float (*)) (data + 3 * sizeof(float) * ts * ts + 5 * 64); - //low pass filter for R/B in vertical direction - float *rblpfv = (float (*)) (data + 3 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 6 * 64); - //low pass filter for colour differences in horizontal direction - float *grblpfh = (float (*)) (data + 4 * sizeof(float) * ts * ts + 7 * 64); - //low pass filter for colour differences in vertical direction - float *grblpfv = (float (*)) (data + 4 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 8 * 64); - // Main algorithm: Tile loop calculating correction parameters per tile + if (autoCA && !fitParamsSet) { + //high pass filter for R/B in vertical direction + float *rbhpfh = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); + //high pass filter for R/B in horizontal direction + float *rbhpfv = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); + //low pass filter for R/B in horizontal direction + float *rblpfh = (float (*)) (data + 3 * sizeof(float) * ts * ts + 5 * 64); + //low pass filter for R/B in vertical direction + float *rblpfv = (float (*)) (data + 3 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 6 * 64); + //low pass filter for colour differences in horizontal direction + float *grblpfh = (float (*)) (data + 4 * sizeof(float) * ts * ts + 7 * 64); + //low pass filter for colour differences in vertical direction + float *grblpfv = (float (*)) (data + 4 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 8 * 64); + // Main algorithm: Tile loop calculating correction parameters per tile - //local quadratic fit to shift data within a tile - float coeff[2][3][2]; - //measured CA shift parameters for a tile - float CAshift[2][2]; + //local quadratic fit to shift data within a tile + float coeff[2][3][2]; + //measured CA shift parameters for a tile + float CAshift[2][2]; - //per thread data for evaluation of block CA shift variance - float blockavethr[2][2] = {{0, 0}, {0, 0}}, blocksqavethr[2][2] = {{0, 0}, {0, 0}}, blockdenomthr[2][2] = {{0, 0}, {0, 0}}; + //per thread data for evaluation of block CA shift variance + float blockavethr[2][2] = {{0, 0}, {0, 0}}, blocksqavethr[2][2] = {{0, 0}, {0, 0}}, blockdenomthr[2][2] = {{0, 0}, {0, 0}}; - #pragma omp for collapse(2) schedule(dynamic) nowait - for (int top = -border ; top < height; top += ts - border2) - for (int left = -border; left < width - (W & 1); left += ts - border2) { - memset(bufferThr, 0, buffersize); - const int vblock = ((top + border) / (ts - border2)) + 1; - const int hblock = ((left + border) / (ts - border2)) + 1; - const int bottom = min(top + ts, height + border); - const int right = min(left + ts, width - (W & 1) + border); - const int rr1 = bottom - top; - const int cc1 = right - left; - const int rrmin = top < 0 ? border : 0; - const int rrmax = bottom > height ? height - top : rr1; - const int ccmin = left < 0 ? border : 0; - const int ccmax = (right > width - (W & 1)) ? width - (W & 1) - left : cc1; + #pragma omp for collapse(2) schedule(dynamic) nowait + for (int top = -border ; top < height; top += ts - border2) + for (int left = -border; left < width - (W & 1); left += ts - border2) { + memset(bufferThr, 0, buffersize); + const int vblock = ((top + border) / (ts - border2)) + 1; + const int hblock = ((left + border) / (ts - border2)) + 1; + const int bottom = min(top + ts, height + border); + const int right = min(left + ts, width - (W & 1) + border); + const int rr1 = bottom - top; + const int cc1 = right - left; + const int rrmin = top < 0 ? border : 0; + const int rrmax = bottom > height ? height - top : rr1; + const int ccmin = left < 0 ? border : 0; + const int ccmax = (right > width - (W & 1)) ? width - (W & 1) - left : cc1; - // rgb from input CFA data - // rgb values should be floating point numbers between 0 and 1 - // after white balance multipliers are applied + // rgb from input CFA data + // rgb values should be floating point numbers between 0 and 1 + // after white balance multipliers are applied -#ifdef __SSE2__ - vfloat c65535v = F2V(65535.f); -#endif + #ifdef __SSE2__ + vfloat c65535v = F2V(65535.f); + #endif - for (int rr = rrmin; rr < rrmax; rr++) { - int row = rr + top; - int cc = ccmin; - int col = cc + left; -#ifdef __SSE2__ - int c0 = FC(rr, cc); - if(c0 == 1) { - rgb[c0][rr * ts + cc] = rawData[row][col] / 65535.f; - cc++; - col++; - c0 = FC(rr, cc); - } - int indx1 = rr * ts + cc; - for (; cc < ccmax - 7; cc+=8, col+=8, indx1 += 8) { - vfloat val1 = LVFU(rawData[row][col]) / c65535v; - vfloat val2 = LVFU(rawData[row][col + 4]) / c65535v; - vfloat nonGreenv = _mm_shuffle_ps(val1,val2,_MM_SHUFFLE( 2,0,2,0 )); - STVFU(rgb[c0][indx1 >> 1], nonGreenv); - STVFU(rgb[1][indx1], val1); - STVFU(rgb[1][indx1 + 4], val2); - } -#endif - for (; cc < ccmax; cc++, col++) { - int c = FC(rr, cc); + for (int rr = rrmin; rr < rrmax; rr++) { + int row = rr + top; + int cc = ccmin; + int col = cc + left; + #ifdef __SSE2__ + int c0 = FC(rr, cc); + if(c0 == 1) { + rgb[c0][rr * ts + cc] = rawData[row][col] / 65535.f; + cc++; + col++; + c0 = FC(rr, cc); + } int indx1 = rr * ts + cc; - rgb[c][indx1 >> ((c & 1) ^ 1)] = rawData[row][col] / 65535.f; - } - } - - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //fill borders - if (rrmin > 0) { - for (int rr = 0; rr < border; rr++) - for (int cc = ccmin; cc < ccmax; cc++) { + for (; cc < ccmax - 7; cc+=8, col+=8, indx1 += 8) { + vfloat val1 = LVFU(rawData[row][col]) / c65535v; + vfloat val2 = LVFU(rawData[row][col + 4]) / c65535v; + vfloat nonGreenv = _mm_shuffle_ps(val1,val2,_MM_SHUFFLE( 2,0,2,0 )); + STVFU(rgb[c0][indx1 >> 1], nonGreenv); + STVFU(rgb[1][indx1], val1); + STVFU(rgb[1][indx1 + 4], val2); + } + #endif + for (; cc < ccmax; cc++, col++) { int c = FC(rr, cc); - rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)]; - } - } - - if (rrmax < rr1) { - for (int rr = 0; rr < border; rr++) - for (int cc = ccmin; cc < ccmax; cc++) { - int c = FC(rr, cc); - rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][left + cc] / 65535.f; - } - } - - if (ccmin > 0) { - for (int rr = rrmin; rr < rrmax; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)]; - } - } - - if (ccmax < cc1) { - for (int rr = rrmin; rr < rrmax; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(top + rr)][(width - cc - 2)] / 65535.f; - } - } - - //also, fill the image corners - if (rrmin > 0 && ccmin > 0) { - for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rawData[border2 - rr][border2 - cc] / 65535.f; - } - } - - if (rrmax < rr1 && ccmax < cc1) { - for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(width - cc - 2)] / 65535.f; - } - } - - if (rrmin > 0 && ccmax < cc1) { - for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(border2 - rr)][(width - cc - 2)] / 65535.f; - } - } - - if (rrmax < rr1 && ccmin > 0) { - for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(border2 - cc)] / 65535.f; - } - } - - //end of border fill - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //end of initialization - - -#ifdef __SSE2__ - vfloat onev = F2V(1.f); - vfloat epsv = F2V(eps); -#endif - for (int rr = 3; rr < rr1 - 3; rr++) { - int row = rr + top; - int cc = 3 + (FC(rr,3) & 1); - int indx = rr * ts + cc; - int c = FC(rr,cc); -#ifdef __SSE2__ - for (; cc < cc1 - 9; cc+=8, indx+=8) { - //compute directional weights using image gradients - vfloat rgb1mv1v = LC2VFU(rgb[1][indx - v1]); - vfloat rgb1pv1v = LC2VFU(rgb[1][indx + v1]); - vfloat rgbcv = LVFU(rgb[c][indx >> 1]); - vfloat temp1v = epsv + vabsf(rgb1mv1v - rgb1pv1v); - vfloat wtuv = onev / SQRV(temp1v + vabsf(rgbcv - LVFU(rgb[c][(indx - v2) >> 1])) + vabsf(rgb1mv1v - LC2VFU(rgb[1][indx - v3]))); - vfloat wtdv = onev / SQRV(temp1v + vabsf(rgbcv - LVFU(rgb[c][(indx + v2) >> 1])) + vabsf(rgb1pv1v - LC2VFU(rgb[1][indx + v3]))); - vfloat rgb1m1v = LC2VFU(rgb[1][indx - 1]); - vfloat rgb1p1v = LC2VFU(rgb[1][indx + 1]); - vfloat temp2v = epsv + vabsf(rgb1m1v - rgb1p1v); - vfloat wtlv = onev / SQRV(temp2v + vabsf(rgbcv - LVFU(rgb[c][(indx - 2) >> 1])) + vabsf(rgb1m1v - LC2VFU(rgb[1][indx - 3]))); - vfloat wtrv = onev / SQRV(temp2v + vabsf(rgbcv - LVFU(rgb[c][(indx + 2) >> 1])) + vabsf(rgb1p1v - LC2VFU(rgb[1][indx + 3]))); - - //store in rgb array the interpolated G value at R/B grid points using directional weighted average - STC2VFU(rgb[1][indx], (wtuv * rgb1mv1v + wtdv * rgb1pv1v + wtlv * rgb1m1v + wtrv * rgb1p1v) / (wtuv + wtdv + wtlv + wtrv)); - } - -#endif - for (; cc < cc1 - 3; cc+=2, indx+=2) { - //compute directional weights using image gradients - float wtu = 1.f / SQR(eps + fabsf(rgb[1][indx + v1] - rgb[1][indx - v1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx - v2) >> 1]) + fabsf(rgb[1][indx - v1] - rgb[1][indx - v3])); - float wtd = 1.f / SQR(eps + fabsf(rgb[1][indx - v1] - rgb[1][indx + v1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx + v2) >> 1]) + fabsf(rgb[1][indx + v1] - rgb[1][indx + v3])); - float wtl = 1.f / SQR(eps + fabsf(rgb[1][indx + 1] - rgb[1][indx - 1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx - 2) >> 1]) + fabsf(rgb[1][indx - 1] - rgb[1][indx - 3])); - float wtr = 1.f / SQR(eps + fabsf(rgb[1][indx - 1] - rgb[1][indx + 1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx + 2) >> 1]) + fabsf(rgb[1][indx + 1] - rgb[1][indx + 3])); - - //store in rgb array the interpolated G value at R/B grid points using directional weighted average - rgb[1][indx] = (wtu * rgb[1][indx - v1] + wtd * rgb[1][indx + v1] + wtl * rgb[1][indx - 1] + wtr * rgb[1][indx + 1]) / (wtu + wtd + wtl + wtr); - } - - if (row > -1 && row < height) { - int offset = (FC(row,max(left + 3, 0)) & 1); - int col = max(left + 3, 0) + offset; - int indx = rr * ts + 3 - (left < 0 ? (left+3) : 0) + offset; -#ifdef __SSE2__ - for(; col < min(cc1 + left - 3, width) - 7; col+=8, indx+=8) { - STVFU(Gtmp[(row * width + col) >> 1], LC2VFU(rgb[1][indx])); - } -#endif - for(; col < min(cc1 + left - 3, width); col+=2, indx+=2) { - Gtmp[(row * width + col) >> 1] = rgb[1][indx]; + int indx1 = rr * ts + cc; + rgb[c][indx1 >> ((c & 1) ^ 1)] = rawData[row][col] / 65535.f; } } - } - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -#ifdef __SSE2__ - vfloat zd25v = F2V(0.25f); -#endif - for (int rr = 4; rr < rr1 - 4; rr++) { - int cc = 4 + (FC(rr, 2) & 1); - int indx = rr * ts + cc; - int c = FC(rr, cc); -#ifdef __SSE2__ - for (; cc < cc1 - 10; cc += 8, indx += 8) { - vfloat rgb1v = LC2VFU(rgb[1][indx]); - vfloat rgbcv = LVFU(rgb[c][indx >> 1]); - vfloat rgb1mv4 = LC2VFU(rgb[1][indx - v4]); - vfloat rgb1pv4 = LC2VFU(rgb[1][indx + v4]); - vfloat temp1v = vabsf(vabsf((rgb1v - rgbcv) - (rgb1pv4 - LVFU(rgb[c][(indx + v4) >> 1]))) + - vabsf(rgb1mv4 - LVFU(rgb[c][(indx - v4) >> 1]) - rgb1v + rgbcv) - - vabsf(rgb1mv4 - LVFU(rgb[c][(indx - v4) >> 1]) - rgb1pv4 + LVFU(rgb[c][(indx + v4) >> 1]))); - STVFU(rbhpfv[indx >> 1], temp1v); - vfloat rgb1m4 = LC2VFU(rgb[1][indx - 4]); - vfloat rgb1p4 = LC2VFU(rgb[1][indx + 4]); - vfloat temp2v = vabsf(vabsf((rgb1v - rgbcv) - (rgb1p4 - LVFU(rgb[c][(indx + 4) >> 1]))) + - vabsf(rgb1m4 - LVFU(rgb[c][(indx - 4) >> 1]) - rgb1v + rgbcv) - - vabsf(rgb1m4 - LVFU(rgb[c][(indx - 4) >> 1]) - rgb1p4 + LVFU(rgb[c][(indx + 4) >> 1]))); - STVFU(rbhpfh[indx >> 1], temp2v); - - //low and high pass 1D filters of G in vertical/horizontal directions - rgb1v = vmul2f(rgb1v); - vfloat glpfvv = (rgb1v + LC2VFU(rgb[1][indx + v2]) + LC2VFU(rgb[1][indx - v2])); - vfloat glpfhv = (rgb1v + LC2VFU(rgb[1][indx + 2]) + LC2VFU(rgb[1][indx - 2])); - rgbcv = vmul2f(rgbcv); - STVFU(rblpfv[indx >> 1], zd25v * vabsf(glpfvv - (rgbcv + LVFU(rgb[c][(indx + v2) >> 1]) + LVFU(rgb[c][(indx - v2) >> 1])))); - STVFU(rblpfh[indx >> 1], zd25v * vabsf(glpfhv - (rgbcv + LVFU(rgb[c][(indx + 2) >> 1]) + LVFU(rgb[c][(indx - 2) >> 1])))); - STVFU(grblpfv[indx >> 1], zd25v * (glpfvv + (rgbcv + LVFU(rgb[c][(indx + v2) >> 1]) + LVFU(rgb[c][(indx - v2) >> 1])))); - STVFU(grblpfh[indx >> 1], zd25v * (glpfhv + (rgbcv + LVFU(rgb[c][(indx + 2) >> 1]) + LVFU(rgb[c][(indx - 2) >> 1])))); - } - -#endif - for (; cc < cc1 - 4; cc += 2, indx += 2) { - rbhpfv[indx >> 1] = fabsf(fabsf((rgb[1][indx] - rgb[c][indx >> 1]) - (rgb[1][indx + v4] - rgb[c][(indx + v4) >> 1])) + - fabsf((rgb[1][indx - v4] - rgb[c][(indx - v4) >> 1]) - (rgb[1][indx] - rgb[c][indx >> 1])) - - fabsf((rgb[1][indx - v4] - rgb[c][(indx - v4) >> 1]) - (rgb[1][indx + v4] - rgb[c][(indx + v4) >> 1]))); - rbhpfh[indx >> 1] = fabsf(fabsf((rgb[1][indx] - rgb[c][indx >> 1]) - (rgb[1][indx + 4] - rgb[c][(indx + 4) >> 1])) + - fabsf((rgb[1][indx - 4] - rgb[c][(indx - 4) >> 1]) - (rgb[1][indx] - rgb[c][indx >> 1])) - - fabsf((rgb[1][indx - 4] - rgb[c][(indx - 4) >> 1]) - (rgb[1][indx + 4] - rgb[c][(indx + 4) >> 1]))); - - //low and high pass 1D filters of G in vertical/horizontal directions - float glpfv = (2.f * rgb[1][indx] + rgb[1][indx + v2] + rgb[1][indx - v2]); - float glpfh = (2.f * rgb[1][indx] + rgb[1][indx + 2] + rgb[1][indx - 2]); - rblpfv[indx >> 1] = 0.25f * fabsf(glpfv - (2.f * rgb[c][indx >> 1] + rgb[c][(indx + v2) >> 1] + rgb[c][(indx - v2) >> 1])); - rblpfh[indx >> 1] = 0.25f * fabsf(glpfh - (2.f * rgb[c][indx >> 1] + rgb[c][(indx + 2) >> 1] + rgb[c][(indx - 2) >> 1])); - grblpfv[indx >> 1] = 0.25f * (glpfv + (2.f * rgb[c][indx >> 1] + rgb[c][(indx + v2) >> 1] + rgb[c][(indx - v2) >> 1])); - grblpfh[indx >> 1] = 0.25f * (glpfh + (2.f * rgb[c][indx >> 1] + rgb[c][(indx + 2) >> 1] + rgb[c][(indx - 2) >> 1])); - } - } - - for (int dir = 0; dir < 2; dir++) { - for (int k = 0; k < 3; k++) { - for (int c = 0; c < 2; c++) { - coeff[dir][k][c] = 0; - } - } - } - -#ifdef __SSE2__ - vfloat zd3v = F2V(0.3f); - vfloat zd1v = F2V(0.1f); - vfloat zd5v = F2V(0.5f); -#endif - - // along line segments, find the point along each segment that minimizes the colour variance - // averaged over the tile; evaluate for up/down and left/right away from R/B grid point - for (int rr = 8; rr < rr1 - 8; rr++) { - int cc = 8 + (FC(rr, 2) & 1); - int indx = rr * ts + cc; - int c = FC(rr, cc); -#ifdef __SSE2__ - vfloat coeff00v = ZEROV; - vfloat coeff01v = ZEROV; - vfloat coeff02v = ZEROV; - vfloat coeff10v = ZEROV; - vfloat coeff11v = ZEROV; - vfloat coeff12v = ZEROV; - for (; cc < cc1 - 14; cc += 8, indx += 8) { - - //in linear interpolation, colour differences are a quadratic function of interpolation position; - //solve for the interpolation position that minimizes colour difference variance over the tile - - //vertical - vfloat temp1 = zd3v * (LC2VFU(rgb[1][indx + ts + 1]) - LC2VFU(rgb[1][indx - ts - 1])); - vfloat temp2 = zd3v * (LC2VFU(rgb[1][indx - ts + 1]) - LC2VFU(rgb[1][indx + ts - 1])); - vfloat gdiffvv = (LC2VFU(rgb[1][indx + ts]) - LC2VFU(rgb[1][indx - ts])) + (temp1 - temp2); - vfloat deltgrbv = LVFU(rgb[c][indx >> 1]) - LC2VFU(rgb[1][indx]); - - vfloat gradwtvv = (LVFU(rbhpfv[indx >> 1]) + zd5v * (LVFU(rbhpfv[(indx >> 1) + 1]) + LVFU(rbhpfv[(indx >> 1) - 1]))) * (LVFU(grblpfv[(indx >> 1) - v1]) + LVFU(grblpfv[(indx >> 1) + v1])) / (epsv + zd1v * (LVFU(grblpfv[(indx >> 1) - v1]) + LVFU(grblpfv[(indx >> 1) + v1])) + LVFU(rblpfv[(indx >> 1) - v1]) + LVFU(rblpfv[(indx >> 1) + v1])); - - coeff00v += gradwtvv * deltgrbv * deltgrbv; - coeff01v += gradwtvv * gdiffvv * deltgrbv; - coeff02v += gradwtvv * gdiffvv * gdiffvv; - - //horizontal - vfloat gdiffhv = (LC2VFU(rgb[1][indx + 1]) - LC2VFU(rgb[1][indx - 1])) + (temp1 + temp2); - - vfloat gradwthv = (LVFU(rbhpfh[indx >> 1]) + zd5v * (LVFU(rbhpfh[(indx >> 1) + v1]) + LVFU(rbhpfh[(indx >> 1) - v1]))) * (LVFU(grblpfh[(indx >> 1) - 1]) + LVFU(grblpfh[(indx >> 1) + 1])) / (epsv + zd1v * (LVFU(grblpfh[(indx >> 1) - 1]) + LVFU(grblpfh[(indx >> 1) + 1])) + LVFU(rblpfh[(indx >> 1) - 1]) + LVFU(rblpfh[(indx >> 1) + 1])); - - coeff10v += gradwthv * deltgrbv * deltgrbv; - coeff11v += gradwthv * gdiffhv * deltgrbv; - coeff12v += gradwthv * gdiffhv * gdiffhv; - } - - coeff[0][0][c>>1] += vhadd(coeff00v); - coeff[0][1][c>>1] += vhadd(coeff01v); - coeff[0][2][c>>1] += vhadd(coeff02v); - coeff[1][0][c>>1] += vhadd(coeff10v); - coeff[1][1][c>>1] += vhadd(coeff11v); - coeff[1][2][c>>1] += vhadd(coeff12v); - -#endif - for (; cc < cc1 - 8; cc += 2, indx += 2) { - - //in linear interpolation, colour differences are a quadratic function of interpolation position; - //solve for the interpolation position that minimizes colour difference variance over the tile - - //vertical - float gdiff = (rgb[1][indx + ts] - rgb[1][indx - ts]) + 0.3f * (rgb[1][indx + ts + 1] - rgb[1][indx - ts + 1] + rgb[1][indx + ts - 1] - rgb[1][indx - ts - 1]); - float deltgrb = (rgb[c][indx >> 1] - rgb[1][indx]); - - float gradwt = (rbhpfv[indx >> 1] + 0.5f * (rbhpfv[(indx >> 1) + 1] + rbhpfv[(indx >> 1) - 1]) ) * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) / (eps + 0.1f * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) + rblpfv[(indx >> 1) - v1] + rblpfv[(indx >> 1) + v1]); - - coeff[0][0][c>>1] += gradwt * deltgrb * deltgrb; - coeff[0][1][c>>1] += gradwt * gdiff * deltgrb; - coeff[0][2][c>>1] += gradwt * gdiff * gdiff; - - //horizontal - gdiff = (rgb[1][indx + 1] - rgb[1][indx - 1]) + 0.3f * (rgb[1][indx + 1 + ts] - rgb[1][indx - 1 + ts] + rgb[1][indx + 1 - ts] - rgb[1][indx - 1 - ts]); - - gradwt = (rbhpfh[indx >> 1] + 0.5f * (rbhpfh[(indx >> 1) + v1] + rbhpfh[(indx >> 1) - v1]) ) * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) / (eps + 0.1f * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) + rblpfh[(indx >> 1) - 1] + rblpfh[(indx >> 1) + 1]); - - coeff[1][0][c>>1] += gradwt * deltgrb * deltgrb; - coeff[1][1][c>>1] += gradwt * gdiff * deltgrb; - coeff[1][2][c>>1] += gradwt * gdiff * gdiff; - - // In Mathematica, - // f[x_]=Expand[Total[Flatten[ - // ((1-x) RotateLeft[Gint,shift1]+x RotateLeft[Gint,shift2]-cfapad)^2[[dv;;-1;;2,dh;;-1;;2]]]]]; - // extremum = -.5Coefficient[f[x],x]/Coefficient[f[x],x^2] - } - } - - for (int dir = 0; dir < 2; dir++) { - for (int k = 0; k < 3; k++) { - for (int c = 0; c < 2; c++) { - coeff[dir][k][c] *= 0.25f; - if(k == 1) { - coeff[dir][k][c] *= 0.3125f; - } else if(k == 2) { - coeff[dir][k][c] *= SQR(0.3125f); + // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //fill borders + if (rrmin > 0) { + for (int rr = 0; rr < border; rr++) + for (int cc = ccmin; cc < ccmax; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)]; } - } } - } - for (int c = 0; c < 2; c++) { - for (int dir = 0; dir < 2; dir++) { // vert/hor - - // CAshift[dir][c] are the locations - // that minimize colour difference variances; - // This is the approximate _optical_ location of the R/B pixels - if (coeff[dir][2][c] > eps2) { - CAshift[dir][c] = coeff[dir][1][c] / coeff[dir][2][c]; - blockwt[vblock * hblsz + hblock] = coeff[dir][2][c] / (eps + coeff[dir][0][c]) ; - } else { - CAshift[dir][c] = 17.0; - blockwt[vblock * hblsz + hblock] = 0; - } - - //data structure = CAshift[vert/hor][colour] - //dir : 0=vert, 1=hor - - //offset gives NW corner of square containing the min; dir : 0=vert, 1=hor - if (fabsf(CAshift[dir][c]) < 2.0f) { - blockavethr[dir][c] += CAshift[dir][c]; - blocksqavethr[dir][c] += SQR(CAshift[dir][c]); - blockdenomthr[dir][c] += 1; - } - //evaluate the shifts to the location that minimizes CA within the tile - blockshifts[vblock * hblsz + hblock][c][dir] = CAshift[dir][c]; //vert/hor CA shift for R/B - - }//vert/hor - }//colour - - if(plistener) { - progresscounter++; - - if(progresscounter % 8 == 0) - #pragma omp critical (cadetectpass1) - { - progress += (double)(8.0 * (ts - border2) * (ts - border2)) / (2 * height * width); - - if (progress > 1.0) { - progress = 1.0; - } - - plistener->setProgress(progress); + if (rrmax < rr1) { + for (int rr = 0; rr < border; rr++) + for (int cc = ccmin; cc < ccmax; cc++) { + int c = FC(rr, cc); + rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][left + cc] / 65535.f; + } } - } - } - - //end of diagnostic pass - #pragma omp critical (cadetectpass2) - { - for (int dir = 0; dir < 2; dir++) - for (int c = 0; c < 2; c++) { - blockdenom[dir][c] += blockdenomthr[dir][c]; - blocksqave[dir][c] += blocksqavethr[dir][c]; - blockave[dir][c] += blockavethr[dir][c]; - } - } - #pragma omp barrier - - #pragma omp single - { - for (int dir = 0; dir < 2; dir++) - for (int c = 0; c < 2; c++) { - if (blockdenom[dir][c]) { - blockvar[dir][c] = blocksqave[dir][c] / blockdenom[dir][c] - SQR(blockave[dir][c] / blockdenom[dir][c]); - } else { - processpasstwo = false; - printf ("blockdenom vanishes \n"); - break; + if (ccmin > 0) { + for (int rr = rrmin; rr < rrmax; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)]; + } } - } - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - //now prepare for CA correction pass - //first, fill border blocks of blockshift array - if(processpasstwo) { - for (int vblock = 1; vblock < vblsz - 1; vblock++) { //left and right sides - for (int c = 0; c < 2; c++) { - for (int i = 0; i < 2; i++) { - blockshifts[vblock * hblsz][c][i] = blockshifts[(vblock) * hblsz + 2][c][i]; - blockshifts[vblock * hblsz + hblsz - 1][c][i] = blockshifts[(vblock) * hblsz + hblsz - 3][c][i]; - } + if (ccmax < cc1) { + for (int rr = rrmin; rr < rrmax; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(top + rr)][(width - cc - 2)] / 65535.f; + } } - } - for (int hblock = 0; hblock < hblsz; hblock++) { //top and bottom sides - for (int c = 0; c < 2; c++) { - for (int i = 0; i < 2; i++) { - blockshifts[hblock][c][i] = blockshifts[2 * hblsz + hblock][c][i]; - blockshifts[(vblsz - 1)*hblsz + hblock][c][i] = blockshifts[(vblsz - 3) * hblsz + hblock][c][i]; - } + //also, fill the image corners + if (rrmin > 0 && ccmin > 0) { + for (int rr = 0; rr < border; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rawData[border2 - rr][border2 - cc] / 65535.f; + } } - } - //end of filling border pixels of blockshift array - - //initialize fit arrays - double polymat[2][2][256], shiftmat[2][2][16]; - - for (int i = 0; i < 256; i++) { - polymat[0][0][i] = polymat[0][1][i] = polymat[1][0][i] = polymat[1][1][i] = 0; - } - - for (int i = 0; i < 16; i++) { - shiftmat[0][0][i] = shiftmat[0][1][i] = shiftmat[1][0][i] = shiftmat[1][1][i] = 0; - } - - int numblox[2] = {0, 0}; - - for (int vblock = 1; vblock < vblsz - 1; vblock++) - for (int hblock = 1; hblock < hblsz - 1; hblock++) { - // block 3x3 median of blockshifts for robustness - for (int c = 0; c < 2; c ++) { - float bstemp[2]; - for (int dir = 0; dir < 2; dir++) { - //temporary storage for median filter - const std::array p = { - blockshifts[(vblock - 1) * hblsz + hblock - 1][c][dir], - blockshifts[(vblock - 1) * hblsz + hblock][c][dir], - blockshifts[(vblock - 1) * hblsz + hblock + 1][c][dir], - blockshifts[(vblock) * hblsz + hblock - 1][c][dir], - blockshifts[(vblock) * hblsz + hblock][c][dir], - blockshifts[(vblock) * hblsz + hblock + 1][c][dir], - blockshifts[(vblock + 1) * hblsz + hblock - 1][c][dir], - blockshifts[(vblock + 1) * hblsz + hblock][c][dir], - blockshifts[(vblock + 1) * hblsz + hblock + 1][c][dir] - }; - bstemp[dir] = median(p); + if (rrmax < rr1 && ccmax < cc1) { + for (int rr = 0; rr < border; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(width - cc - 2)] / 65535.f; } - - //now prepare coefficient matrix; use only data points within caautostrength/2 std devs of zero - if (SQR(bstemp[0]) > caautostrength * blockvar[0][c] || SQR(bstemp[1]) > caautostrength * blockvar[1][c]) { - continue; - } - - numblox[c]++; - - for (int dir = 0; dir < 2; dir++) { - double powVblockInit = 1.0; - for (int i = 0; i < polyord; i++) { - double powHblockInit = 1.0; - for (int j = 0; j < polyord; j++) { - double powVblock = powVblockInit; - for (int m = 0; m < polyord; m++) { - double powHblock = powHblockInit; - for (int n = 0; n < polyord; n++) { - polymat[c][dir][numpar * (polyord * i + j) + (polyord * m + n)] += powVblock * powHblock * blockwt[vblock * hblsz + hblock]; - powHblock *= hblock; - } - powVblock *= vblock; - } - shiftmat[c][dir][(polyord * i + j)] += powVblockInit * powHblockInit * bstemp[dir] * blockwt[vblock * hblsz + hblock]; - powHblockInit *= hblock; - } - powVblockInit *= vblock; - }//monomials - }//dir - }//c - }//blocks - - numblox[1] = min(numblox[0], numblox[1]); - - //if too few data points, restrict the order of the fit to linear - if (numblox[1] < 32) { - polyord = 2; - numpar = 4; - - if (numblox[1] < 10) { - - printf ("numblox = %d \n", numblox[1]); - processpasstwo = false; } - } - if(processpasstwo) - - //fit parameters to blockshifts - for (int c = 0; c < 2; c++) - for (int dir = 0; dir < 2; dir++) { - if (!LinEqSolve(numpar, polymat[c][dir], shiftmat[c][dir], fitparams[c][dir])) { - printf("CA correction pass failed -- can't solve linear equations for colour %d direction %d...\n", c, dir); - processpasstwo = false; + if (rrmin > 0 && ccmax < cc1) { + for (int rr = 0; rr < border; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(border2 - rr)][(width - cc - 2)] / 65535.f; } - } - } - - //fitparams[polyord*i+j] gives the coefficients of (vblock^i hblock^j) in a polynomial fit for i,j<=4 - } - //end of initialization for CA correction pass - //only executed if autoCA is true - } - - // Main algorithm: Tile loop - if(processpasstwo) { - float *grbdiff = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); // there is no overlap in buffer usage => share - //green interpolated to optical sample points for R/B - float *gshift = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); // there is no overlap in buffer usage => share - #pragma omp for schedule(dynamic) collapse(2) nowait - - for (int top = -border; top < height; top += ts - border2) - for (int left = -border; left < width - (W & 1); left += ts - border2) { - memset(bufferThr, 0, buffersizePassTwo); - float lblockshifts[2][2]; - const int vblock = ((top + border) / (ts - border2)) + 1; - const int hblock = ((left + border) / (ts - border2)) + 1; - const int bottom = min(top + ts, height + border); - const int right = min(left + ts, width - (W & 1) + border); - const int rr1 = bottom - top; - const int cc1 = right - left; - - const int rrmin = top < 0 ? border : 0; - const int rrmax = bottom > height ? height - top : rr1; - const int ccmin = left < 0 ? border : 0; - const int ccmax = (right > width - (W & 1)) ? width - (W & 1) - left : cc1; - - // rgb from input CFA data - // rgb values should be floating point number between 0 and 1 - // after white balance multipliers are applied - -#ifdef __SSE2__ - vfloat c65535v = F2V(65535.f); - vmask gmask = _mm_set_epi32(0, 0xffffffff, 0, 0xffffffff); -#endif - for (int rr = rrmin; rr < rrmax; rr++) { - int row = rr + top; - int cc = ccmin; - int col = cc + left; - int indx = row * width + col; - int indx1 = rr * ts + cc; -#ifdef __SSE2__ - int c = FC(rr, cc); - if(c & 1) { - rgb[1][indx1] = rawData[row][col] / 65535.f; - indx++; - indx1++; - cc++; - col++; - c = FC(rr, cc); } - for (; cc < ccmax - 7; cc += 8, col += 8, indx += 8, indx1 += 8) { - vfloat val1v = LVFU(rawData[row][col]) / c65535v; - vfloat val2v = LVFU(rawData[row][col + 4]) / c65535v; - STVFU(rgb[c][indx1 >> 1], _mm_shuffle_ps(val1v, val2v, _MM_SHUFFLE(2, 0, 2, 0))); - vfloat gtmpv = LVFU(Gtmp[indx >> 1]); - STVFU(rgb[1][indx1], vself(gmask, PERMUTEPS(gtmpv, _MM_SHUFFLE(1, 1, 0, 0)), val1v)); - STVFU(rgb[1][indx1 + 4], vself(gmask, PERMUTEPS(gtmpv, _MM_SHUFFLE(3, 3, 2, 2)), val2v)); + + if (rrmax < rr1 && ccmin > 0) { + for (int rr = 0; rr < border; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(border2 - cc)] / 65535.f; + } } -#endif - for (; cc < ccmax; cc++, col++, indx++, indx1++) { - int c = FC(rr, cc); - rgb[c][indx1 >> ((c & 1) ^ 1)] = rawData[row][col] / 65535.f; - if ((c & 1) == 0) { - rgb[1][indx1] = Gtmp[indx >> 1]; - } - } - } - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //fill borders - if (rrmin > 0) { - for (int rr = 0; rr < border; rr++) - for (int cc = ccmin; cc < ccmax; cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)]; - rgb[1][rr * ts + cc] = rgb[1][(border2 - rr) * ts + cc]; - } - } + //end of border fill + // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //end of initialization - if (rrmax < rr1) { - for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) - for (int cc = ccmin; cc < ccmax; cc++) { - int c = FC(rr, cc); - rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][left + cc]) / 65535.f; - if ((c & 1) == 0) { - rgb[1][(rrmax + rr)*ts + cc] = Gtmp[((height - rr - 2) * width + left + cc) >> 1]; - } - } - } - if (ccmin > 0) { - for (int rr = rrmin; rr < rrmax; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)]; - rgb[1][rr * ts + cc] = rgb[1][rr * ts + border2 - cc]; - } - } - - if (ccmax < cc1) { - for (int rr = rrmin; rr < rrmax; rr++) - for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(top + rr)][(width - cc - 2)]) / 65535.f; - if ((c & 1) == 0) { - rgb[1][rr * ts + ccmax + cc] = Gtmp[((top + rr) * width + (width - cc - 2)) >> 1]; - } - } - } - - //also, fill the image corners - if (rrmin > 0 && ccmin > 0) { - for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = (rawData[border2 - rr][border2 - cc]) / 65535.f; - if ((c & 1) == 0) { - rgb[1][rr * ts + cc] = Gtmp[((border2 - rr) * width + border2 - cc) >> 1]; - } - } - } - - if (rrmax < rr1 && ccmax < cc1) { - for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) - for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { - int c = FC(rr, cc); - rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(width - cc - 2)]) / 65535.f; - if ((c & 1) == 0) { - rgb[1][(rrmax + rr)*ts + ccmax + cc] = Gtmp[((height - rr - 2) * width + (width - cc - 2)) >> 1]; - } - } - } - - if (rrmin > 0 && ccmax < cc1) { - for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { - int c = FC(rr, cc); - rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(border2 - rr)][(width - cc - 2)]) / 65535.f; - if ((c & 1) == 0) { - rgb[1][rr * ts + ccmax + cc] = Gtmp[((border2 - rr) * width + (width - cc - 2)) >> 1]; - } - } - } - - if (rrmax < rr1 && ccmin > 0) { - for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) - for (int cc = 0; cc < border; cc++) { - int c = FC(rr, cc); - rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(border2 - cc)]) / 65535.f; - if ((c & 1) == 0) { - rgb[1][(rrmax + rr)*ts + cc] = Gtmp[((height - rr - 2) * width + (border2 - cc)) >> 1]; - } - } - } - - //end of border fill - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - if (!autoCA || fitParamsIn) { -#ifdef __SSE2__ - const vfloat onev = F2V(1.f); - const vfloat epsv = F2V(eps); -#endif - - //manual CA correction; use red/blue slider values to set CA shift parameters + #ifdef __SSE2__ + vfloat onev = F2V(1.f); + vfloat epsv = F2V(eps); + #endif for (int rr = 3; rr < rr1 - 3; rr++) { - int cc = 3 + FC(rr, 1), c = FC(rr,cc), indx = rr * ts + cc; -#ifdef __SSE2__ - for (; cc < cc1 - 10; cc += 8, indx += 8) { + int row = rr + top; + int cc = 3 + (FC(rr,3) & 1); + int indx = rr * ts + cc; + int c = FC(rr,cc); + #ifdef __SSE2__ + for (; cc < cc1 - 9; cc+=8, indx+=8) { //compute directional weights using image gradients - vfloat val1v = epsv + vabsf(LC2VFU(rgb[1][(rr + 1) * ts + cc]) - LC2VFU(rgb[1][(rr - 1) * ts + cc])); - vfloat val2v = epsv + vabsf(LC2VFU(rgb[1][indx + 1]) - LC2VFU(rgb[1][indx - 1])); - vfloat wtuv = onev / SQRV(val1v + vabsf(LVFU(rgb[c][(rr * ts + cc) >> 1]) - LVFU(rgb[c][((rr - 2) * ts + cc) >> 1])) + vabsf(LC2VFU(rgb[1][(rr - 1) * ts + cc]) - LC2VFU(rgb[1][(rr - 3) * ts + cc]))); - vfloat wtdv = onev / SQRV(val1v + vabsf(LVFU(rgb[c][(rr * ts + cc) >> 1]) - LVFU(rgb[c][((rr + 2) * ts + cc) >> 1])) + vabsf(LC2VFU(rgb[1][(rr + 1) * ts + cc]) - LC2VFU(rgb[1][(rr + 3) * ts + cc]))); - vfloat wtlv = onev / SQRV(val2v + vabsf(LVFU(rgb[c][indx >> 1]) - LVFU(rgb[c][(indx - 2) >> 1])) + vabsf(LC2VFU(rgb[1][indx - 1]) - LC2VFU(rgb[1][indx - 3]))); - vfloat wtrv = onev / SQRV(val2v + vabsf(LVFU(rgb[c][indx >> 1]) - LVFU(rgb[c][(indx + 2) >> 1])) + vabsf(LC2VFU(rgb[1][indx + 1]) - LC2VFU(rgb[1][indx + 3]))); + vfloat rgb1mv1v = LC2VFU(rgb[1][indx - v1]); + vfloat rgb1pv1v = LC2VFU(rgb[1][indx + v1]); + vfloat rgbcv = LVFU(rgb[c][indx >> 1]); + vfloat temp1v = epsv + vabsf(rgb1mv1v - rgb1pv1v); + vfloat wtuv = onev / SQRV(temp1v + vabsf(rgbcv - LVFU(rgb[c][(indx - v2) >> 1])) + vabsf(rgb1mv1v - LC2VFU(rgb[1][indx - v3]))); + vfloat wtdv = onev / SQRV(temp1v + vabsf(rgbcv - LVFU(rgb[c][(indx + v2) >> 1])) + vabsf(rgb1pv1v - LC2VFU(rgb[1][indx + v3]))); + vfloat rgb1m1v = LC2VFU(rgb[1][indx - 1]); + vfloat rgb1p1v = LC2VFU(rgb[1][indx + 1]); + vfloat temp2v = epsv + vabsf(rgb1m1v - rgb1p1v); + vfloat wtlv = onev / SQRV(temp2v + vabsf(rgbcv - LVFU(rgb[c][(indx - 2) >> 1])) + vabsf(rgb1m1v - LC2VFU(rgb[1][indx - 3]))); + vfloat wtrv = onev / SQRV(temp2v + vabsf(rgbcv - LVFU(rgb[c][(indx + 2) >> 1])) + vabsf(rgb1p1v - LC2VFU(rgb[1][indx + 3]))); //store in rgb array the interpolated G value at R/B grid points using directional weighted average - STC2VFU(rgb[1][indx], (wtuv * LC2VFU(rgb[1][indx - v1]) + wtdv * LC2VFU(rgb[1][indx + v1]) + wtlv * LC2VFU(rgb[1][indx - 1]) + wtrv * LC2VFU(rgb[1][indx + 1])) / (wtuv + wtdv + wtlv + wtrv)); + STC2VFU(rgb[1][indx], (wtuv * rgb1mv1v + wtdv * rgb1pv1v + wtlv * rgb1m1v + wtrv * rgb1p1v) / (wtuv + wtdv + wtlv + wtrv)); } -#endif - for (; cc < cc1 - 3; cc += 2, indx += 2) { + + #endif + for (; cc < cc1 - 3; cc+=2, indx+=2) { //compute directional weights using image gradients - float wtu = 1.f / SQR(eps + fabsf(rgb[1][(rr + 1) * ts + cc] - rgb[1][(rr - 1) * ts + cc]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][((rr - 2) * ts + cc) >> 1]) + fabsf(rgb[1][(rr - 1) * ts + cc] - rgb[1][(rr - 3) * ts + cc])); - float wtd = 1.f / SQR(eps + fabsf(rgb[1][(rr + 1) * ts + cc] - rgb[1][(rr - 1) * ts + cc]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][((rr + 2) * ts + cc) >> 1]) + fabsf(rgb[1][(rr + 1) * ts + cc] - rgb[1][(rr + 3) * ts + cc])); - float wtl = 1.f / SQR(eps + fabsf(rgb[1][rr * ts + cc + 1] - rgb[1][rr * ts + cc - 1]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][(rr * ts + cc - 2) >> 1]) + fabsf(rgb[1][rr * ts + cc - 1] - rgb[1][rr * ts + cc - 3])); - float wtr = 1.f / SQR(eps + fabsf(rgb[1][rr * ts + cc + 1] - rgb[1][rr * ts + cc - 1]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][(rr * ts + cc + 2) >> 1]) + fabsf(rgb[1][rr * ts + cc + 1] - rgb[1][rr * ts + cc + 3])); + float wtu = 1.f / SQR(eps + fabsf(rgb[1][indx + v1] - rgb[1][indx - v1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx - v2) >> 1]) + fabsf(rgb[1][indx - v1] - rgb[1][indx - v3])); + float wtd = 1.f / SQR(eps + fabsf(rgb[1][indx - v1] - rgb[1][indx + v1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx + v2) >> 1]) + fabsf(rgb[1][indx + v1] - rgb[1][indx + v3])); + float wtl = 1.f / SQR(eps + fabsf(rgb[1][indx + 1] - rgb[1][indx - 1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx - 2) >> 1]) + fabsf(rgb[1][indx - 1] - rgb[1][indx - 3])); + float wtr = 1.f / SQR(eps + fabsf(rgb[1][indx - 1] - rgb[1][indx + 1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx + 2) >> 1]) + fabsf(rgb[1][indx + 1] - rgb[1][indx + 3])); //store in rgb array the interpolated G value at R/B grid points using directional weighted average rgb[1][indx] = (wtu * rgb[1][indx - v1] + wtd * rgb[1][indx + v1] + wtl * rgb[1][indx - 1] + wtr * rgb[1][indx + 1]) / (wtu + wtd + wtl + wtr); } - } - } - if (!autoCA) { - float hfrac = -((float)(hblock - 0.5) / (hblsz - 2) - 0.5); - float vfrac = -((float)(vblock - 0.5) / (vblsz - 2) - 0.5) * height / width; - lblockshifts[0][0] = 2 * vfrac * cared; - lblockshifts[0][1] = 2 * hfrac * cared; - lblockshifts[1][0] = 2 * vfrac * cablue; - lblockshifts[1][1] = 2 * hfrac * cablue; - } else { - //CA auto correction; use CA diagnostic pass to set shift parameters - lblockshifts[0][0] = lblockshifts[0][1] = 0; - lblockshifts[1][0] = lblockshifts[1][1] = 0; - double powVblock = 1.0; - for (int i = 0; i < polyord; i++) { - double powHblock = powVblock; - for (int j = 0; j < polyord; j++) { - lblockshifts[0][0] += powHblock * fitparams[0][0][polyord * i + j]; - lblockshifts[0][1] += powHblock * fitparams[0][1][polyord * i + j]; - lblockshifts[1][0] += powHblock * fitparams[1][0][polyord * i + j]; - lblockshifts[1][1] += powHblock * fitparams[1][1][polyord * i + j]; - powHblock *= hblock; - } - powVblock *= vblock; - } - constexpr float bslim = 3.99; //max allowed CA shift - lblockshifts[0][0] = LIM(lblockshifts[0][0], -bslim, bslim); - lblockshifts[0][1] = LIM(lblockshifts[0][1], -bslim, bslim); - lblockshifts[1][0] = LIM(lblockshifts[1][0], -bslim, bslim); - lblockshifts[1][1] = LIM(lblockshifts[1][1], -bslim, bslim); - }//end of setting CA shift parameters - - for (int c = 0; c < 3; c += 2) { - - //some parameters for the bilinear interpolation - shiftvfloor[c] = floor((float)lblockshifts[c>>1][0]); - shiftvceil[c] = ceil((float)lblockshifts[c>>1][0]); - shiftvfrac[c] = lblockshifts[c>>1][0] - shiftvfloor[c]; - - shifthfloor[c] = floor((float)lblockshifts[c>>1][1]); - shifthceil[c] = ceil((float)lblockshifts[c>>1][1]); - shifthfrac[c] = lblockshifts[c>>1][1] - shifthfloor[c]; - - GRBdir[0][c] = lblockshifts[c>>1][0] > 0 ? 2 : -2; - GRBdir[1][c] = lblockshifts[c>>1][1] > 0 ? 2 : -2; - - } - - - for (int rr = 4; rr < rr1 - 4; rr++) { - int cc = 4 + (FC(rr, 2) & 1); - int c = FC(rr, cc); - int indx = (rr * ts + cc) >> 1; - int indxfc = (rr + shiftvfloor[c]) * ts + cc + shifthceil[c]; - int indxff = (rr + shiftvfloor[c]) * ts + cc + shifthfloor[c]; - int indxcc = (rr + shiftvceil[c]) * ts + cc + shifthceil[c]; - int indxcf = (rr + shiftvceil[c]) * ts + cc + shifthfloor[c]; -#ifdef __SSE2__ - vfloat shifthfracv = F2V(shifthfrac[c]); - vfloat shiftvfracv = F2V(shiftvfrac[c]); - for (; cc < cc1 - 10; cc += 8, indxfc += 8, indxff += 8, indxcc += 8, indxcf += 8, indx += 4) { - //perform CA correction using colour ratios or colour differences - vfloat Ginthfloorv = vintpf(shifthfracv, LC2VFU(rgb[1][indxfc]), LC2VFU(rgb[1][indxff])); - vfloat Ginthceilv = vintpf(shifthfracv, LC2VFU(rgb[1][indxcc]), LC2VFU(rgb[1][indxcf])); - //Gint is bilinear interpolation of G at CA shift point - vfloat Gintv = vintpf(shiftvfracv, Ginthceilv, Ginthfloorv); - - //determine R/B at grid points using colour differences at shift point plus interpolated G value at grid point - //but first we need to interpolate G-R/G-B to grid points... - STVFU(grbdiff[indx], Gintv - LVFU(rgb[c][indx])); - STVFU(gshift[indx], Gintv); - } - -#endif - for (; cc < cc1 - 4; cc += 2, indxfc += 2, indxff += 2, indxcc += 2, indxcf += 2, ++indx) { - //perform CA correction using colour ratios or colour differences - float Ginthfloor = intp(shifthfrac[c], rgb[1][indxfc], rgb[1][indxff]); - float Ginthceil = intp(shifthfrac[c], rgb[1][indxcc], rgb[1][indxcf]); - //Gint is bilinear interpolation of G at CA shift point - float Gint = intp(shiftvfrac[c], Ginthceil, Ginthfloor); - - //determine R/B at grid points using colour differences at shift point plus interpolated G value at grid point - //but first we need to interpolate G-R/G-B to grid points... - grbdiff[indx] = Gint - rgb[c][indx]; - gshift[indx] = Gint; - } - } - - shifthfrac[0] /= 2.f; - shifthfrac[2] /= 2.f; - shiftvfrac[0] /= 2.f; - shiftvfrac[2] /= 2.f; - -#ifdef __SSE2__ - vfloat zd25v = F2V(0.25f); - vfloat onev = F2V(1.f); - vfloat zd5v = F2V(0.5f); - vfloat epsv = F2V(eps); -#endif - for (int rr = 8; rr < rr1 - 8; rr++) { - int cc = 8 + (FC(rr, 2) & 1); - int c = FC(rr, cc); - int GRBdir0 = GRBdir[0][c]; - int GRBdir1 = GRBdir[1][c]; -#ifdef __SSE2__ - vfloat shifthfracc = F2V(shifthfrac[c]); - vfloat shiftvfracc = F2V(shiftvfrac[c]); - for (int indx = rr * ts + cc; cc < cc1 - 14; cc += 8, indx += 8) { - //interpolate colour difference from optical R/B locations to grid locations - vfloat grbdiffinthfloor = vintpf(shifthfracc, LVFU(grbdiff[(indx - GRBdir1) >> 1]), LVFU(grbdiff[indx >> 1])); - vfloat grbdiffinthceil = vintpf(shifthfracc, LVFU(grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1]), LVFU(grbdiff[((rr - GRBdir0) * ts + cc) >> 1])); - //grbdiffint is bilinear interpolation of G-R/G-B at grid point - vfloat grbdiffint = vintpf(shiftvfracc, grbdiffinthceil, grbdiffinthfloor); - - //now determine R/B at grid points using interpolated colour differences and interpolated G value at grid point - vfloat cinv = LVFU(rgb[c][indx >> 1]); - vfloat rinv = LC2VFU(rgb[1][indx]); - vfloat RBint = rinv - grbdiffint; - vmask cmask = vmaskf_ge(vabsf(RBint - cinv), zd25v * (RBint + cinv)); - if(_mm_movemask_ps((vfloat)cmask)) { - // if for any of the 4 pixels the condition is true, do the math for all 4 pixels and mask the unused out at the end - //gradient weights using difference from G at CA shift points and G at grid points - vfloat p0 = onev / (epsv + vabsf(rinv - LVFU(gshift[indx >> 1]))); - vfloat p1 = onev / (epsv + vabsf(rinv - LVFU(gshift[(indx - GRBdir1) >> 1]))); - vfloat p2 = onev / (epsv + vabsf(rinv - LVFU(gshift[((rr - GRBdir0) * ts + cc) >> 1]))); - vfloat p3 = onev / (epsv + vabsf(rinv - LVFU(gshift[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1]))); - - grbdiffint = vself(cmask, (p0 * LVFU(grbdiff[indx >> 1]) + p1 * LVFU(grbdiff[(indx - GRBdir1) >> 1]) + - p2 * LVFU(grbdiff[((rr - GRBdir0) * ts + cc) >> 1]) + p3 * LVFU(grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1])) / (p0 + p1 + p2 + p3), grbdiffint); - - } - vfloat grbdiffold = rinv - cinv; - RBint = rinv - grbdiffint; - RBint = vself(vmaskf_gt(vabsf(grbdiffold), vabsf(grbdiffint)), RBint, cinv); - RBint = vself(vmaskf_lt(grbdiffold * grbdiffint, ZEROV), rinv - zd5v * (grbdiffold + grbdiffint), RBint); - STVFU(rgb[c][indx >> 1], RBint); - } -#endif - for (int c = FC(rr, cc), indx = rr * ts + cc; cc < cc1 - 8; cc += 2, indx += 2) { - float grbdiffold = rgb[1][indx] - rgb[c][indx >> 1]; - - //interpolate colour difference from optical R/B locations to grid locations - float grbdiffinthfloor = intp(shifthfrac[c], grbdiff[(indx - GRBdir1) >> 1], grbdiff[indx >> 1]); - float grbdiffinthceil = intp(shifthfrac[c], grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1], grbdiff[((rr - GRBdir0) * ts + cc) >> 1]); - //grbdiffint is bilinear interpolation of G-R/G-B at grid point - float grbdiffint = intp(shiftvfrac[c], grbdiffinthceil, grbdiffinthfloor); - - //now determine R/B at grid points using interpolated colour differences and interpolated G value at grid point - float RBint = rgb[1][indx] - grbdiffint; - - if (fabsf(RBint - rgb[c][indx >> 1]) < 0.25f * (RBint + rgb[c][indx >> 1])) { - if (fabsf(grbdiffold) > fabsf(grbdiffint) ) { - rgb[c][indx >> 1] = RBint; + if (row > -1 && row < height) { + int offset = (FC(row,max(left + 3, 0)) & 1); + int col = max(left + 3, 0) + offset; + int indx = rr * ts + 3 - (left < 0 ? (left+3) : 0) + offset; + #ifdef __SSE2__ + for(; col < min(cc1 + left - 3, width) - 7; col+=8, indx+=8) { + STVFU(Gtmp[(row * width + col) >> 1], LC2VFU(rgb[1][indx])); } + #endif + for(; col < min(cc1 + left - 3, width); col+=2, indx+=2) { + Gtmp[(row * width + col) >> 1] = rgb[1][indx]; + } + } + + } + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + #ifdef __SSE2__ + vfloat zd25v = F2V(0.25f); + #endif + for (int rr = 4; rr < rr1 - 4; rr++) { + int cc = 4 + (FC(rr, 2) & 1); + int indx = rr * ts + cc; + int c = FC(rr, cc); + #ifdef __SSE2__ + for (; cc < cc1 - 10; cc += 8, indx += 8) { + vfloat rgb1v = LC2VFU(rgb[1][indx]); + vfloat rgbcv = LVFU(rgb[c][indx >> 1]); + vfloat rgb1mv4 = LC2VFU(rgb[1][indx - v4]); + vfloat rgb1pv4 = LC2VFU(rgb[1][indx + v4]); + vfloat temp1v = vabsf(vabsf((rgb1v - rgbcv) - (rgb1pv4 - LVFU(rgb[c][(indx + v4) >> 1]))) + + vabsf(rgb1mv4 - LVFU(rgb[c][(indx - v4) >> 1]) - rgb1v + rgbcv) - + vabsf(rgb1mv4 - LVFU(rgb[c][(indx - v4) >> 1]) - rgb1pv4 + LVFU(rgb[c][(indx + v4) >> 1]))); + STVFU(rbhpfv[indx >> 1], temp1v); + vfloat rgb1m4 = LC2VFU(rgb[1][indx - 4]); + vfloat rgb1p4 = LC2VFU(rgb[1][indx + 4]); + vfloat temp2v = vabsf(vabsf((rgb1v - rgbcv) - (rgb1p4 - LVFU(rgb[c][(indx + 4) >> 1]))) + + vabsf(rgb1m4 - LVFU(rgb[c][(indx - 4) >> 1]) - rgb1v + rgbcv) - + vabsf(rgb1m4 - LVFU(rgb[c][(indx - 4) >> 1]) - rgb1p4 + LVFU(rgb[c][(indx + 4) >> 1]))); + STVFU(rbhpfh[indx >> 1], temp2v); + + //low and high pass 1D filters of G in vertical/horizontal directions + rgb1v = vmul2f(rgb1v); + vfloat glpfvv = (rgb1v + LC2VFU(rgb[1][indx + v2]) + LC2VFU(rgb[1][indx - v2])); + vfloat glpfhv = (rgb1v + LC2VFU(rgb[1][indx + 2]) + LC2VFU(rgb[1][indx - 2])); + rgbcv = vmul2f(rgbcv); + STVFU(rblpfv[indx >> 1], zd25v * vabsf(glpfvv - (rgbcv + LVFU(rgb[c][(indx + v2) >> 1]) + LVFU(rgb[c][(indx - v2) >> 1])))); + STVFU(rblpfh[indx >> 1], zd25v * vabsf(glpfhv - (rgbcv + LVFU(rgb[c][(indx + 2) >> 1]) + LVFU(rgb[c][(indx - 2) >> 1])))); + STVFU(grblpfv[indx >> 1], zd25v * (glpfvv + (rgbcv + LVFU(rgb[c][(indx + v2) >> 1]) + LVFU(rgb[c][(indx - v2) >> 1])))); + STVFU(grblpfh[indx >> 1], zd25v * (glpfhv + (rgbcv + LVFU(rgb[c][(indx + 2) >> 1]) + LVFU(rgb[c][(indx - 2) >> 1])))); + } + + #endif + for (; cc < cc1 - 4; cc += 2, indx += 2) { + rbhpfv[indx >> 1] = fabsf(fabsf((rgb[1][indx] - rgb[c][indx >> 1]) - (rgb[1][indx + v4] - rgb[c][(indx + v4) >> 1])) + + fabsf((rgb[1][indx - v4] - rgb[c][(indx - v4) >> 1]) - (rgb[1][indx] - rgb[c][indx >> 1])) - + fabsf((rgb[1][indx - v4] - rgb[c][(indx - v4) >> 1]) - (rgb[1][indx + v4] - rgb[c][(indx + v4) >> 1]))); + rbhpfh[indx >> 1] = fabsf(fabsf((rgb[1][indx] - rgb[c][indx >> 1]) - (rgb[1][indx + 4] - rgb[c][(indx + 4) >> 1])) + + fabsf((rgb[1][indx - 4] - rgb[c][(indx - 4) >> 1]) - (rgb[1][indx] - rgb[c][indx >> 1])) - + fabsf((rgb[1][indx - 4] - rgb[c][(indx - 4) >> 1]) - (rgb[1][indx + 4] - rgb[c][(indx + 4) >> 1]))); + + //low and high pass 1D filters of G in vertical/horizontal directions + float glpfv = (2.f * rgb[1][indx] + rgb[1][indx + v2] + rgb[1][indx - v2]); + float glpfh = (2.f * rgb[1][indx] + rgb[1][indx + 2] + rgb[1][indx - 2]); + rblpfv[indx >> 1] = 0.25f * fabsf(glpfv - (2.f * rgb[c][indx >> 1] + rgb[c][(indx + v2) >> 1] + rgb[c][(indx - v2) >> 1])); + rblpfh[indx >> 1] = 0.25f * fabsf(glpfh - (2.f * rgb[c][indx >> 1] + rgb[c][(indx + 2) >> 1] + rgb[c][(indx - 2) >> 1])); + grblpfv[indx >> 1] = 0.25f * (glpfv + (2.f * rgb[c][indx >> 1] + rgb[c][(indx + v2) >> 1] + rgb[c][(indx - v2) >> 1])); + grblpfh[indx >> 1] = 0.25f * (glpfh + (2.f * rgb[c][indx >> 1] + rgb[c][(indx + 2) >> 1] + rgb[c][(indx - 2) >> 1])); + } + } + + for (int dir = 0; dir < 2; dir++) { + for (int k = 0; k < 3; k++) { + for (int c = 0; c < 2; c++) { + coeff[dir][k][c] = 0; + } + } + } + + #ifdef __SSE2__ + vfloat zd3v = F2V(0.3f); + vfloat zd1v = F2V(0.1f); + vfloat zd5v = F2V(0.5f); + #endif + + // along line segments, find the point along each segment that minimizes the colour variance + // averaged over the tile; evaluate for up/down and left/right away from R/B grid point + for (int rr = 8; rr < rr1 - 8; rr++) { + int cc = 8 + (FC(rr, 2) & 1); + int indx = rr * ts + cc; + int c = FC(rr, cc); + #ifdef __SSE2__ + vfloat coeff00v = ZEROV; + vfloat coeff01v = ZEROV; + vfloat coeff02v = ZEROV; + vfloat coeff10v = ZEROV; + vfloat coeff11v = ZEROV; + vfloat coeff12v = ZEROV; + for (; cc < cc1 - 14; cc += 8, indx += 8) { + + //in linear interpolation, colour differences are a quadratic function of interpolation position; + //solve for the interpolation position that minimizes colour difference variance over the tile + + //vertical + vfloat temp1 = zd3v * (LC2VFU(rgb[1][indx + ts + 1]) - LC2VFU(rgb[1][indx - ts - 1])); + vfloat temp2 = zd3v * (LC2VFU(rgb[1][indx - ts + 1]) - LC2VFU(rgb[1][indx + ts - 1])); + vfloat gdiffvv = (LC2VFU(rgb[1][indx + ts]) - LC2VFU(rgb[1][indx - ts])) + (temp1 - temp2); + vfloat deltgrbv = LVFU(rgb[c][indx >> 1]) - LC2VFU(rgb[1][indx]); + + vfloat gradwtvv = (LVFU(rbhpfv[indx >> 1]) + zd5v * (LVFU(rbhpfv[(indx >> 1) + 1]) + LVFU(rbhpfv[(indx >> 1) - 1]))) * (LVFU(grblpfv[(indx >> 1) - v1]) + LVFU(grblpfv[(indx >> 1) + v1])) / (epsv + zd1v * (LVFU(grblpfv[(indx >> 1) - v1]) + LVFU(grblpfv[(indx >> 1) + v1])) + LVFU(rblpfv[(indx >> 1) - v1]) + LVFU(rblpfv[(indx >> 1) + v1])); + + coeff00v += gradwtvv * deltgrbv * deltgrbv; + coeff01v += gradwtvv * gdiffvv * deltgrbv; + coeff02v += gradwtvv * gdiffvv * gdiffvv; + + //horizontal + vfloat gdiffhv = (LC2VFU(rgb[1][indx + 1]) - LC2VFU(rgb[1][indx - 1])) + (temp1 + temp2); + + vfloat gradwthv = (LVFU(rbhpfh[indx >> 1]) + zd5v * (LVFU(rbhpfh[(indx >> 1) + v1]) + LVFU(rbhpfh[(indx >> 1) - v1]))) * (LVFU(grblpfh[(indx >> 1) - 1]) + LVFU(grblpfh[(indx >> 1) + 1])) / (epsv + zd1v * (LVFU(grblpfh[(indx >> 1) - 1]) + LVFU(grblpfh[(indx >> 1) + 1])) + LVFU(rblpfh[(indx >> 1) - 1]) + LVFU(rblpfh[(indx >> 1) + 1])); + + coeff10v += gradwthv * deltgrbv * deltgrbv; + coeff11v += gradwthv * gdiffhv * deltgrbv; + coeff12v += gradwthv * gdiffhv * gdiffhv; + } + + coeff[0][0][c>>1] += vhadd(coeff00v); + coeff[0][1][c>>1] += vhadd(coeff01v); + coeff[0][2][c>>1] += vhadd(coeff02v); + coeff[1][0][c>>1] += vhadd(coeff10v); + coeff[1][1][c>>1] += vhadd(coeff11v); + coeff[1][2][c>>1] += vhadd(coeff12v); + + #endif + for (; cc < cc1 - 8; cc += 2, indx += 2) { + + //in linear interpolation, colour differences are a quadratic function of interpolation position; + //solve for the interpolation position that minimizes colour difference variance over the tile + + //vertical + float gdiff = (rgb[1][indx + ts] - rgb[1][indx - ts]) + 0.3f * (rgb[1][indx + ts + 1] - rgb[1][indx - ts + 1] + rgb[1][indx + ts - 1] - rgb[1][indx - ts - 1]); + float deltgrb = (rgb[c][indx >> 1] - rgb[1][indx]); + + float gradwt = (rbhpfv[indx >> 1] + 0.5f * (rbhpfv[(indx >> 1) + 1] + rbhpfv[(indx >> 1) - 1]) ) * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) / (eps + 0.1f * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) + rblpfv[(indx >> 1) - v1] + rblpfv[(indx >> 1) + v1]); + + coeff[0][0][c>>1] += gradwt * deltgrb * deltgrb; + coeff[0][1][c>>1] += gradwt * gdiff * deltgrb; + coeff[0][2][c>>1] += gradwt * gdiff * gdiff; + + //horizontal + gdiff = (rgb[1][indx + 1] - rgb[1][indx - 1]) + 0.3f * (rgb[1][indx + 1 + ts] - rgb[1][indx - 1 + ts] + rgb[1][indx + 1 - ts] - rgb[1][indx - 1 - ts]); + + gradwt = (rbhpfh[indx >> 1] + 0.5f * (rbhpfh[(indx >> 1) + v1] + rbhpfh[(indx >> 1) - v1]) ) * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) / (eps + 0.1f * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) + rblpfh[(indx >> 1) - 1] + rblpfh[(indx >> 1) + 1]); + + coeff[1][0][c>>1] += gradwt * deltgrb * deltgrb; + coeff[1][1][c>>1] += gradwt * gdiff * deltgrb; + coeff[1][2][c>>1] += gradwt * gdiff * gdiff; + + // In Mathematica, + // f[x_]=Expand[Total[Flatten[ + // ((1-x) RotateLeft[Gint,shift1]+x RotateLeft[Gint,shift2]-cfapad)^2[[dv;;-1;;2,dh;;-1;;2]]]]]; + // extremum = -.5Coefficient[f[x],x]/Coefficient[f[x],x^2] + } + } + + for (int dir = 0; dir < 2; dir++) { + for (int k = 0; k < 3; k++) { + for (int c = 0; c < 2; c++) { + coeff[dir][k][c] *= 0.25f; + if(k == 1) { + coeff[dir][k][c] *= 0.3125f; + } else if(k == 2) { + coeff[dir][k][c] *= SQR(0.3125f); + } + } + } + } + + for (int c = 0; c < 2; c++) { + for (int dir = 0; dir < 2; dir++) { // vert/hor + + // CAshift[dir][c] are the locations + // that minimize colour difference variances; + // This is the approximate _optical_ location of the R/B pixels + if (coeff[dir][2][c] > eps2) { + CAshift[dir][c] = coeff[dir][1][c] / coeff[dir][2][c]; + blockwt[vblock * hblsz + hblock] = coeff[dir][2][c] / (eps + coeff[dir][0][c]) ; + } else { + CAshift[dir][c] = 17.0; + blockwt[vblock * hblsz + hblock] = 0; + } + + //data structure = CAshift[vert/hor][colour] + //dir : 0=vert, 1=hor + + //offset gives NW corner of square containing the min; dir : 0=vert, 1=hor + if (fabsf(CAshift[dir][c]) < 2.0f) { + blockavethr[dir][c] += CAshift[dir][c]; + blocksqavethr[dir][c] += SQR(CAshift[dir][c]); + blockdenomthr[dir][c] += 1; + } + //evaluate the shifts to the location that minimizes CA within the tile + blockshifts[vblock * hblsz + hblock][c][dir] = CAshift[dir][c]; //vert/hor CA shift for R/B + + }//vert/hor + }//colour + + if(plistener) { + progresscounter++; + + if(progresscounter % 8 == 0) + #pragma omp critical (cadetectpass1) + { + progress += (double)(8.0 * (ts - border2) * (ts - border2)) / (2 * height * width); + + if (progress > 1.0) { + progress = 1.0; + } + + plistener->setProgress(progress); + } + } + + } + + //end of diagnostic pass + #pragma omp critical (cadetectpass2) + { + for (int dir = 0; dir < 2; dir++) + for (int c = 0; c < 2; c++) { + blockdenom[dir][c] += blockdenomthr[dir][c]; + blocksqave[dir][c] += blocksqavethr[dir][c]; + blockave[dir][c] += blockavethr[dir][c]; + } + } + #pragma omp barrier + + #pragma omp single + { + for (int dir = 0; dir < 2; dir++) + for (int c = 0; c < 2; c++) { + if (blockdenom[dir][c]) { + blockvar[dir][c] = blocksqave[dir][c] / blockdenom[dir][c] - SQR(blockave[dir][c] / blockdenom[dir][c]); } else { + processpasstwo = false; + printf ("blockdenom vanishes \n"); + break; + } + } - //gradient weights using difference from G at CA shift points and G at grid points - float p0 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[indx >> 1])); - float p1 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[(indx - GRBdir1) >> 1])); - float p2 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[((rr - GRBdir0) * ts + cc) >> 1])); - float p3 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1])); + // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - grbdiffint = (p0 * grbdiff[indx >> 1] + p1 * grbdiff[(indx - GRBdir1) >> 1] + - p2 * grbdiff[((rr - GRBdir0) * ts + cc) >> 1] + p3 * grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1]) / (p0 + p1 + p2 + p3) ; - - //now determine R/B at grid points using interpolated colour differences and interpolated G value at grid point - if (fabsf(grbdiffold) > fabsf(grbdiffint) ) { - rgb[c][indx >> 1] = rgb[1][indx] - grbdiffint; + //now prepare for CA correction pass + //first, fill border blocks of blockshift array + if(processpasstwo) { + for (int vblock = 1; vblock < vblsz - 1; vblock++) { //left and right sides + for (int c = 0; c < 2; c++) { + for (int i = 0; i < 2; i++) { + blockshifts[vblock * hblsz][c][i] = blockshifts[(vblock) * hblsz + 2][c][i]; + blockshifts[vblock * hblsz + hblsz - 1][c][i] = blockshifts[(vblock) * hblsz + hblsz - 3][c][i]; } } + } - //if colour difference interpolation overshot the correction, just desaturate - if (grbdiffold * grbdiffint < 0) { - rgb[c][indx >> 1] = rgb[1][indx] - 0.5f * (grbdiffold + grbdiffint); + for (int hblock = 0; hblock < hblsz; hblock++) { //top and bottom sides + for (int c = 0; c < 2; c++) { + for (int i = 0; i < 2; i++) { + blockshifts[hblock][c][i] = blockshifts[2 * hblsz + hblock][c][i]; + blockshifts[(vblsz - 1)*hblsz + hblock][c][i] = blockshifts[(vblsz - 3) * hblsz + hblock][c][i]; + } } } - } - // copy CA corrected results to temporary image matrix - for (int rr = border; rr < rr1 - border; rr++) { - int c = FC(rr + top, left + border + (FC(rr + top, 2) & 1)); - int row = rr + top; - int cc = border + (FC(rr, 2) & 1); - int indx = (row * width + cc + left) >> 1; - int indx1 = (rr * ts + cc) >> 1; -#ifdef __SSE2__ - for (; indx < (row * width + cc1 - border - 7 + left) >> 1; indx+=4, indx1 += 4) { - STVFU(RawDataTmp[indx], c65535v * LVFU(rgb[c][indx1])); + //end of filling border pixels of blockshift array + + //initialize fit arrays + double polymat[2][2][256], shiftmat[2][2][16]; + + for (int i = 0; i < 256; i++) { + polymat[0][0][i] = polymat[0][1][i] = polymat[1][0][i] = polymat[1][1][i] = 0; } -#endif - for (; indx < (row * width + cc1 - border + left) >> 1; indx++, indx1++) { - RawDataTmp[indx] = 65535.f * rgb[c][indx1]; + + for (int i = 0; i < 16; i++) { + shiftmat[0][0][i] = shiftmat[0][1][i] = shiftmat[1][0][i] = shiftmat[1][1][i] = 0; } - } - if(plistener) { - progresscounter++; + int numblox[2] = {0, 0}; - if(progresscounter % 8 == 0) - #pragma omp critical (cacorrect) - { - progress += (double)(8.0 * (ts - border2) * (ts - border2)) / (2 * height * width); + for (int vblock = 1; vblock < vblsz - 1; vblock++) + for (int hblock = 1; hblock < hblsz - 1; hblock++) { + // block 3x3 median of blockshifts for robustness + for (int c = 0; c < 2; c ++) { + float bstemp[2]; + for (int dir = 0; dir < 2; dir++) { + //temporary storage for median filter + const std::array p = { + blockshifts[(vblock - 1) * hblsz + hblock - 1][c][dir], + blockshifts[(vblock - 1) * hblsz + hblock][c][dir], + blockshifts[(vblock - 1) * hblsz + hblock + 1][c][dir], + blockshifts[(vblock) * hblsz + hblock - 1][c][dir], + blockshifts[(vblock) * hblsz + hblock][c][dir], + blockshifts[(vblock) * hblsz + hblock + 1][c][dir], + blockshifts[(vblock + 1) * hblsz + hblock - 1][c][dir], + blockshifts[(vblock + 1) * hblsz + hblock][c][dir], + blockshifts[(vblock + 1) * hblsz + hblock + 1][c][dir] + }; + bstemp[dir] = median(p); + } - if (progress > 1.0) { - progress = 1.0; + //now prepare coefficient matrix; use only data points within caautostrength/2 std devs of zero + if (SQR(bstemp[0]) > caautostrength * blockvar[0][c] || SQR(bstemp[1]) > caautostrength * blockvar[1][c]) { + continue; + } + + numblox[c]++; + + for (int dir = 0; dir < 2; dir++) { + double powVblockInit = 1.0; + for (int i = 0; i < polyord; i++) { + double powHblockInit = 1.0; + for (int j = 0; j < polyord; j++) { + double powVblock = powVblockInit; + for (int m = 0; m < polyord; m++) { + double powHblock = powHblockInit; + for (int n = 0; n < polyord; n++) { + polymat[c][dir][numpar * (polyord * i + j) + (polyord * m + n)] += powVblock * powHblock * blockwt[vblock * hblsz + hblock]; + powHblock *= hblock; + } + powVblock *= vblock; + } + shiftmat[c][dir][(polyord * i + j)] += powVblockInit * powHblockInit * bstemp[dir] * blockwt[vblock * hblsz + hblock]; + powHblockInit *= hblock; + } + powVblockInit *= vblock; + }//monomials + }//dir + }//c + }//blocks + + numblox[1] = min(numblox[0], numblox[1]); + + //if too few data points, restrict the order of the fit to linear + if (numblox[1] < 32) { + polyord = 2; + numpar = 4; + + if (numblox[1] < 10) { + + printf ("numblox = %d \n", numblox[1]); + processpasstwo = false; } - - plistener->setProgress(progress); } + + if(processpasstwo) + + //fit parameters to blockshifts + for (int c = 0; c < 2; c++) + for (int dir = 0; dir < 2; dir++) { + if (!LinEqSolve(numpar, polymat[c][dir], shiftmat[c][dir], fitparams[c][dir])) { + printf("CA correction pass failed -- can't solve linear equations for colour %d direction %d...\n", c, dir); + processpasstwo = false; + } + } } + //fitparams[polyord*i+j] gives the coefficients of (vblock^i hblock^j) in a polynomial fit for i,j<=4 } - - #pragma omp barrier -// copy temporary image matrix back to image matrix - #pragma omp for - - for(int row = 0; row < height; row++) { - int col = FC(row, 0) & 1; - int indx = (row * width + col) >> 1; -#ifdef __SSE2__ - for(; col < width - 7; col += 8, indx += 4) { - STC2VFU(rawData[row][col], LVFU(RawDataTmp[indx])); - } -#endif - for(; col < width - (W & 1); col += 2, indx++) { - rawData[row][col] = RawDataTmp[indx]; - } + //end of initialization for CA correction pass + //only executed if autoCA is true } + // Main algorithm: Tile loop + if(processpasstwo) { + float *grbdiff = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); // there is no overlap in buffer usage => share + //green interpolated to optical sample points for R/B + float *gshift = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); // there is no overlap in buffer usage => share + #pragma omp for schedule(dynamic) collapse(2) nowait + + for (int top = -border; top < height; top += ts - border2) + for (int left = -border; left < width - (W & 1); left += ts - border2) { + memset(bufferThr, 0, buffersizePassTwo); + float lblockshifts[2][2]; + const int vblock = ((top + border) / (ts - border2)) + 1; + const int hblock = ((left + border) / (ts - border2)) + 1; + const int bottom = min(top + ts, height + border); + const int right = min(left + ts, width - (W & 1) + border); + const int rr1 = bottom - top; + const int cc1 = right - left; + + const int rrmin = top < 0 ? border : 0; + const int rrmax = bottom > height ? height - top : rr1; + const int ccmin = left < 0 ? border : 0; + const int ccmax = (right > width - (W & 1)) ? width - (W & 1) - left : cc1; + + // rgb from input CFA data + // rgb values should be floating point number between 0 and 1 + // after white balance multipliers are applied + + #ifdef __SSE2__ + vfloat c65535v = F2V(65535.f); + vmask gmask = _mm_set_epi32(0, 0xffffffff, 0, 0xffffffff); + #endif + for (int rr = rrmin; rr < rrmax; rr++) { + int row = rr + top; + int cc = ccmin; + int col = cc + left; + int indx = row * width + col; + int indx1 = rr * ts + cc; + #ifdef __SSE2__ + int c = FC(rr, cc); + if(c & 1) { + rgb[1][indx1] = rawData[row][col] / 65535.f; + indx++; + indx1++; + cc++; + col++; + c = FC(rr, cc); + } + for (; cc < ccmax - 7; cc += 8, col += 8, indx += 8, indx1 += 8) { + vfloat val1v = LVFU(rawData[row][col]) / c65535v; + vfloat val2v = LVFU(rawData[row][col + 4]) / c65535v; + STVFU(rgb[c][indx1 >> 1], _mm_shuffle_ps(val1v, val2v, _MM_SHUFFLE(2, 0, 2, 0))); + vfloat gtmpv = LVFU(Gtmp[indx >> 1]); + STVFU(rgb[1][indx1], vself(gmask, PERMUTEPS(gtmpv, _MM_SHUFFLE(1, 1, 0, 0)), val1v)); + STVFU(rgb[1][indx1 + 4], vself(gmask, PERMUTEPS(gtmpv, _MM_SHUFFLE(3, 3, 2, 2)), val2v)); + } + #endif + for (; cc < ccmax; cc++, col++, indx++, indx1++) { + int c = FC(rr, cc); + rgb[c][indx1 >> ((c & 1) ^ 1)] = rawData[row][col] / 65535.f; + + if ((c & 1) == 0) { + rgb[1][indx1] = Gtmp[indx >> 1]; + } + } + } + // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //fill borders + if (rrmin > 0) { + for (int rr = 0; rr < border; rr++) + for (int cc = ccmin; cc < ccmax; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)]; + rgb[1][rr * ts + cc] = rgb[1][(border2 - rr) * ts + cc]; + } + } + + if (rrmax < rr1) { + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) + for (int cc = ccmin; cc < ccmax; cc++) { + int c = FC(rr, cc); + rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][left + cc]) / 65535.f; + if ((c & 1) == 0) { + rgb[1][(rrmax + rr)*ts + cc] = Gtmp[((height - rr - 2) * width + left + cc) >> 1]; + } + } + } + + if (ccmin > 0) { + for (int rr = rrmin; rr < rrmax; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)]; + rgb[1][rr * ts + cc] = rgb[1][rr * ts + border2 - cc]; + } + } + + if (ccmax < cc1) { + for (int rr = rrmin; rr < rrmax; rr++) + for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(top + rr)][(width - cc - 2)]) / 65535.f; + if ((c & 1) == 0) { + rgb[1][rr * ts + ccmax + cc] = Gtmp[((top + rr) * width + (width - cc - 2)) >> 1]; + } + } + } + + //also, fill the image corners + if (rrmin > 0 && ccmin > 0) { + for (int rr = 0; rr < border; rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = (rawData[border2 - rr][border2 - cc]) / 65535.f; + if ((c & 1) == 0) { + rgb[1][rr * ts + cc] = Gtmp[((border2 - rr) * width + border2 - cc) >> 1]; + } + } + } + + if (rrmax < rr1 && ccmax < cc1) { + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) + for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { + int c = FC(rr, cc); + rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(width - cc - 2)]) / 65535.f; + if ((c & 1) == 0) { + rgb[1][(rrmax + rr)*ts + ccmax + cc] = Gtmp[((height - rr - 2) * width + (width - cc - 2)) >> 1]; + } + } + } + + if (rrmin > 0 && ccmax < cc1) { + for (int rr = 0; rr < border; rr++) + for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { + int c = FC(rr, cc); + rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(border2 - rr)][(width - cc - 2)]) / 65535.f; + if ((c & 1) == 0) { + rgb[1][rr * ts + ccmax + cc] = Gtmp[((border2 - rr) * width + (width - cc - 2)) >> 1]; + } + } + } + + if (rrmax < rr1 && ccmin > 0) { + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) + for (int cc = 0; cc < border; cc++) { + int c = FC(rr, cc); + rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(border2 - cc)]) / 65535.f; + if ((c & 1) == 0) { + rgb[1][(rrmax + rr)*ts + cc] = Gtmp[((height - rr - 2) * width + (border2 - cc)) >> 1]; + } + } + } + + //end of border fill + // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if (!autoCA || fitParamsIn) { + #ifdef __SSE2__ + const vfloat onev = F2V(1.f); + const vfloat epsv = F2V(eps); + #endif + + //manual CA correction; use red/blue slider values to set CA shift parameters + for (int rr = 3; rr < rr1 - 3; rr++) { + int cc = 3 + FC(rr, 1), c = FC(rr,cc), indx = rr * ts + cc; + #ifdef __SSE2__ + for (; cc < cc1 - 10; cc += 8, indx += 8) { + //compute directional weights using image gradients + vfloat val1v = epsv + vabsf(LC2VFU(rgb[1][(rr + 1) * ts + cc]) - LC2VFU(rgb[1][(rr - 1) * ts + cc])); + vfloat val2v = epsv + vabsf(LC2VFU(rgb[1][indx + 1]) - LC2VFU(rgb[1][indx - 1])); + vfloat wtuv = onev / SQRV(val1v + vabsf(LVFU(rgb[c][(rr * ts + cc) >> 1]) - LVFU(rgb[c][((rr - 2) * ts + cc) >> 1])) + vabsf(LC2VFU(rgb[1][(rr - 1) * ts + cc]) - LC2VFU(rgb[1][(rr - 3) * ts + cc]))); + vfloat wtdv = onev / SQRV(val1v + vabsf(LVFU(rgb[c][(rr * ts + cc) >> 1]) - LVFU(rgb[c][((rr + 2) * ts + cc) >> 1])) + vabsf(LC2VFU(rgb[1][(rr + 1) * ts + cc]) - LC2VFU(rgb[1][(rr + 3) * ts + cc]))); + vfloat wtlv = onev / SQRV(val2v + vabsf(LVFU(rgb[c][indx >> 1]) - LVFU(rgb[c][(indx - 2) >> 1])) + vabsf(LC2VFU(rgb[1][indx - 1]) - LC2VFU(rgb[1][indx - 3]))); + vfloat wtrv = onev / SQRV(val2v + vabsf(LVFU(rgb[c][indx >> 1]) - LVFU(rgb[c][(indx + 2) >> 1])) + vabsf(LC2VFU(rgb[1][indx + 1]) - LC2VFU(rgb[1][indx + 3]))); + + //store in rgb array the interpolated G value at R/B grid points using directional weighted average + STC2VFU(rgb[1][indx], (wtuv * LC2VFU(rgb[1][indx - v1]) + wtdv * LC2VFU(rgb[1][indx + v1]) + wtlv * LC2VFU(rgb[1][indx - 1]) + wtrv * LC2VFU(rgb[1][indx + 1])) / (wtuv + wtdv + wtlv + wtrv)); + } + #endif + for (; cc < cc1 - 3; cc += 2, indx += 2) { + //compute directional weights using image gradients + float wtu = 1.f / SQR(eps + fabsf(rgb[1][(rr + 1) * ts + cc] - rgb[1][(rr - 1) * ts + cc]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][((rr - 2) * ts + cc) >> 1]) + fabsf(rgb[1][(rr - 1) * ts + cc] - rgb[1][(rr - 3) * ts + cc])); + float wtd = 1.f / SQR(eps + fabsf(rgb[1][(rr + 1) * ts + cc] - rgb[1][(rr - 1) * ts + cc]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][((rr + 2) * ts + cc) >> 1]) + fabsf(rgb[1][(rr + 1) * ts + cc] - rgb[1][(rr + 3) * ts + cc])); + float wtl = 1.f / SQR(eps + fabsf(rgb[1][rr * ts + cc + 1] - rgb[1][rr * ts + cc - 1]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][(rr * ts + cc - 2) >> 1]) + fabsf(rgb[1][rr * ts + cc - 1] - rgb[1][rr * ts + cc - 3])); + float wtr = 1.f / SQR(eps + fabsf(rgb[1][rr * ts + cc + 1] - rgb[1][rr * ts + cc - 1]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][(rr * ts + cc + 2) >> 1]) + fabsf(rgb[1][rr * ts + cc + 1] - rgb[1][rr * ts + cc + 3])); + + //store in rgb array the interpolated G value at R/B grid points using directional weighted average + rgb[1][indx] = (wtu * rgb[1][indx - v1] + wtd * rgb[1][indx + v1] + wtl * rgb[1][indx - 1] + wtr * rgb[1][indx + 1]) / (wtu + wtd + wtl + wtr); + } + } + } + if (!autoCA) { + float hfrac = -((float)(hblock - 0.5) / (hblsz - 2) - 0.5); + float vfrac = -((float)(vblock - 0.5) / (vblsz - 2) - 0.5) * height / width; + lblockshifts[0][0] = 2 * vfrac * cared; + lblockshifts[0][1] = 2 * hfrac * cared; + lblockshifts[1][0] = 2 * vfrac * cablue; + lblockshifts[1][1] = 2 * hfrac * cablue; + } else { + //CA auto correction; use CA diagnostic pass to set shift parameters + lblockshifts[0][0] = lblockshifts[0][1] = 0; + lblockshifts[1][0] = lblockshifts[1][1] = 0; + double powVblock = 1.0; + for (int i = 0; i < polyord; i++) { + double powHblock = powVblock; + for (int j = 0; j < polyord; j++) { + lblockshifts[0][0] += powHblock * fitparams[0][0][polyord * i + j]; + lblockshifts[0][1] += powHblock * fitparams[0][1][polyord * i + j]; + lblockshifts[1][0] += powHblock * fitparams[1][0][polyord * i + j]; + lblockshifts[1][1] += powHblock * fitparams[1][1][polyord * i + j]; + powHblock *= hblock; + } + powVblock *= vblock; + } + constexpr float bslim = 3.99; //max allowed CA shift + lblockshifts[0][0] = LIM(lblockshifts[0][0], -bslim, bslim); + lblockshifts[0][1] = LIM(lblockshifts[0][1], -bslim, bslim); + lblockshifts[1][0] = LIM(lblockshifts[1][0], -bslim, bslim); + lblockshifts[1][1] = LIM(lblockshifts[1][1], -bslim, bslim); + }//end of setting CA shift parameters + + + for (int c = 0; c < 3; c += 2) { + + //some parameters for the bilinear interpolation + shiftvfloor[c] = floor((float)lblockshifts[c>>1][0]); + shiftvceil[c] = ceil((float)lblockshifts[c>>1][0]); + shiftvfrac[c] = lblockshifts[c>>1][0] - shiftvfloor[c]; + + shifthfloor[c] = floor((float)lblockshifts[c>>1][1]); + shifthceil[c] = ceil((float)lblockshifts[c>>1][1]); + shifthfrac[c] = lblockshifts[c>>1][1] - shifthfloor[c]; + + GRBdir[0][c] = lblockshifts[c>>1][0] > 0 ? 2 : -2; + GRBdir[1][c] = lblockshifts[c>>1][1] > 0 ? 2 : -2; + + } + + + for (int rr = 4; rr < rr1 - 4; rr++) { + int cc = 4 + (FC(rr, 2) & 1); + int c = FC(rr, cc); + int indx = (rr * ts + cc) >> 1; + int indxfc = (rr + shiftvfloor[c]) * ts + cc + shifthceil[c]; + int indxff = (rr + shiftvfloor[c]) * ts + cc + shifthfloor[c]; + int indxcc = (rr + shiftvceil[c]) * ts + cc + shifthceil[c]; + int indxcf = (rr + shiftvceil[c]) * ts + cc + shifthfloor[c]; + #ifdef __SSE2__ + vfloat shifthfracv = F2V(shifthfrac[c]); + vfloat shiftvfracv = F2V(shiftvfrac[c]); + for (; cc < cc1 - 10; cc += 8, indxfc += 8, indxff += 8, indxcc += 8, indxcf += 8, indx += 4) { + //perform CA correction using colour ratios or colour differences + vfloat Ginthfloorv = vintpf(shifthfracv, LC2VFU(rgb[1][indxfc]), LC2VFU(rgb[1][indxff])); + vfloat Ginthceilv = vintpf(shifthfracv, LC2VFU(rgb[1][indxcc]), LC2VFU(rgb[1][indxcf])); + //Gint is bilinear interpolation of G at CA shift point + vfloat Gintv = vintpf(shiftvfracv, Ginthceilv, Ginthfloorv); + + //determine R/B at grid points using colour differences at shift point plus interpolated G value at grid point + //but first we need to interpolate G-R/G-B to grid points... + STVFU(grbdiff[indx], Gintv - LVFU(rgb[c][indx])); + STVFU(gshift[indx], Gintv); + } + + #endif + for (; cc < cc1 - 4; cc += 2, indxfc += 2, indxff += 2, indxcc += 2, indxcf += 2, ++indx) { + //perform CA correction using colour ratios or colour differences + float Ginthfloor = intp(shifthfrac[c], rgb[1][indxfc], rgb[1][indxff]); + float Ginthceil = intp(shifthfrac[c], rgb[1][indxcc], rgb[1][indxcf]); + //Gint is bilinear interpolation of G at CA shift point + float Gint = intp(shiftvfrac[c], Ginthceil, Ginthfloor); + + //determine R/B at grid points using colour differences at shift point plus interpolated G value at grid point + //but first we need to interpolate G-R/G-B to grid points... + grbdiff[indx] = Gint - rgb[c][indx]; + gshift[indx] = Gint; + } + } + + shifthfrac[0] /= 2.f; + shifthfrac[2] /= 2.f; + shiftvfrac[0] /= 2.f; + shiftvfrac[2] /= 2.f; + + #ifdef __SSE2__ + vfloat zd25v = F2V(0.25f); + vfloat onev = F2V(1.f); + vfloat zd5v = F2V(0.5f); + vfloat epsv = F2V(eps); + #endif + for (int rr = 8; rr < rr1 - 8; rr++) { + int cc = 8 + (FC(rr, 2) & 1); + int c = FC(rr, cc); + int GRBdir0 = GRBdir[0][c]; + int GRBdir1 = GRBdir[1][c]; + #ifdef __SSE2__ + vfloat shifthfracc = F2V(shifthfrac[c]); + vfloat shiftvfracc = F2V(shiftvfrac[c]); + for (int indx = rr * ts + cc; cc < cc1 - 14; cc += 8, indx += 8) { + //interpolate colour difference from optical R/B locations to grid locations + vfloat grbdiffinthfloor = vintpf(shifthfracc, LVFU(grbdiff[(indx - GRBdir1) >> 1]), LVFU(grbdiff[indx >> 1])); + vfloat grbdiffinthceil = vintpf(shifthfracc, LVFU(grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1]), LVFU(grbdiff[((rr - GRBdir0) * ts + cc) >> 1])); + //grbdiffint is bilinear interpolation of G-R/G-B at grid point + vfloat grbdiffint = vintpf(shiftvfracc, grbdiffinthceil, grbdiffinthfloor); + + //now determine R/B at grid points using interpolated colour differences and interpolated G value at grid point + vfloat cinv = LVFU(rgb[c][indx >> 1]); + vfloat rinv = LC2VFU(rgb[1][indx]); + vfloat RBint = rinv - grbdiffint; + vmask cmask = vmaskf_ge(vabsf(RBint - cinv), zd25v * (RBint + cinv)); + if(_mm_movemask_ps((vfloat)cmask)) { + // if for any of the 4 pixels the condition is true, do the math for all 4 pixels and mask the unused out at the end + //gradient weights using difference from G at CA shift points and G at grid points + vfloat p0 = onev / (epsv + vabsf(rinv - LVFU(gshift[indx >> 1]))); + vfloat p1 = onev / (epsv + vabsf(rinv - LVFU(gshift[(indx - GRBdir1) >> 1]))); + vfloat p2 = onev / (epsv + vabsf(rinv - LVFU(gshift[((rr - GRBdir0) * ts + cc) >> 1]))); + vfloat p3 = onev / (epsv + vabsf(rinv - LVFU(gshift[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1]))); + + grbdiffint = vself(cmask, (p0 * LVFU(grbdiff[indx >> 1]) + p1 * LVFU(grbdiff[(indx - GRBdir1) >> 1]) + + p2 * LVFU(grbdiff[((rr - GRBdir0) * ts + cc) >> 1]) + p3 * LVFU(grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1])) / (p0 + p1 + p2 + p3), grbdiffint); + + } + vfloat grbdiffold = rinv - cinv; + RBint = rinv - grbdiffint; + RBint = vself(vmaskf_gt(vabsf(grbdiffold), vabsf(grbdiffint)), RBint, cinv); + RBint = vself(vmaskf_lt(grbdiffold * grbdiffint, ZEROV), rinv - zd5v * (grbdiffold + grbdiffint), RBint); + STVFU(rgb[c][indx >> 1], RBint); + } + #endif + for (int c = FC(rr, cc), indx = rr * ts + cc; cc < cc1 - 8; cc += 2, indx += 2) { + float grbdiffold = rgb[1][indx] - rgb[c][indx >> 1]; + + //interpolate colour difference from optical R/B locations to grid locations + float grbdiffinthfloor = intp(shifthfrac[c], grbdiff[(indx - GRBdir1) >> 1], grbdiff[indx >> 1]); + float grbdiffinthceil = intp(shifthfrac[c], grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1], grbdiff[((rr - GRBdir0) * ts + cc) >> 1]); + //grbdiffint is bilinear interpolation of G-R/G-B at grid point + float grbdiffint = intp(shiftvfrac[c], grbdiffinthceil, grbdiffinthfloor); + + //now determine R/B at grid points using interpolated colour differences and interpolated G value at grid point + float RBint = rgb[1][indx] - grbdiffint; + + if (fabsf(RBint - rgb[c][indx >> 1]) < 0.25f * (RBint + rgb[c][indx >> 1])) { + if (fabsf(grbdiffold) > fabsf(grbdiffint) ) { + rgb[c][indx >> 1] = RBint; + } + } else { + + //gradient weights using difference from G at CA shift points and G at grid points + float p0 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[indx >> 1])); + float p1 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[(indx - GRBdir1) >> 1])); + float p2 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[((rr - GRBdir0) * ts + cc) >> 1])); + float p3 = 1.f / (eps + fabsf(rgb[1][indx] - gshift[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1])); + + grbdiffint = (p0 * grbdiff[indx >> 1] + p1 * grbdiff[(indx - GRBdir1) >> 1] + + p2 * grbdiff[((rr - GRBdir0) * ts + cc) >> 1] + p3 * grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1]) / (p0 + p1 + p2 + p3) ; + + //now determine R/B at grid points using interpolated colour differences and interpolated G value at grid point + if (fabsf(grbdiffold) > fabsf(grbdiffint) ) { + rgb[c][indx >> 1] = rgb[1][indx] - grbdiffint; + } + } + + //if colour difference interpolation overshot the correction, just desaturate + if (grbdiffold * grbdiffint < 0) { + rgb[c][indx >> 1] = rgb[1][indx] - 0.5f * (grbdiffold + grbdiffint); + } + } + } + + // copy CA corrected results to temporary image matrix + for (int rr = border; rr < rr1 - border; rr++) { + int c = FC(rr + top, left + border + (FC(rr + top, 2) & 1)); + int row = rr + top; + int cc = border + (FC(rr, 2) & 1); + int indx = (row * width + cc + left) >> 1; + int indx1 = (rr * ts + cc) >> 1; + #ifdef __SSE2__ + for (; indx < (row * width + cc1 - border - 7 + left) >> 1; indx+=4, indx1 += 4) { + STVFU(RawDataTmp[indx], c65535v * LVFU(rgb[c][indx1])); + } + #endif + for (; indx < (row * width + cc1 - border + left) >> 1; indx++, indx1++) { + RawDataTmp[indx] = 65535.f * rgb[c][indx1]; + } + } + + if(plistener) { + progresscounter++; + + if(progresscounter % 8 == 0) + #pragma omp critical (cacorrect) + { + progress += (double)(8.0 * (ts - border2) * (ts - border2)) / (2 * height * width); + + if (progress > 1.0) { + progress = 1.0; + } + + plistener->setProgress(progress); + } + } + + } + + #pragma omp barrier + // copy temporary image matrix back to image matrix + #pragma omp for + + for(int row = 0; row < height; row++) { + int col = FC(row, 0) & 1; + int indx = (row * width + col) >> 1; + #ifdef __SSE2__ + for(; col < width - 7; col += 8, indx += 4) { + STC2VFU(rawData[row][col], LVFU(RawDataTmp[indx])); + } + #endif + for(; col < width - (W & 1); col += 2, indx++) { + rawData[row][col] = RawDataTmp[indx]; + } + } + + } + + // clean up + free(bufferThr); } - - // clean up - free(bufferThr); } - if(autoCA && fitParamsTransfer && fitParamsOut) { // store calculated parameters int index = 0; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e7225e993..29e52b905 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2561,6 +2561,7 @@ RAWParams::RAWParams() : ff_AutoClipControl(false), ff_clipControl(0), ca_autocorrect(false), + caautoiterations(1), cared(0.0), cablue(0.0), expos(1.0), @@ -2585,6 +2586,7 @@ bool RAWParams::operator ==(const RAWParams& other) const && ff_AutoClipControl == other.ff_AutoClipControl && ff_clipControl == other.ff_clipControl && ca_autocorrect == other.ca_autocorrect + && caautoiterations == other.caautoiterations && cared == other.cared && cablue == other.cablue && expos == other.expos @@ -3381,6 +3383,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->raw.ff_AutoClipControl, "RAW", "FlatFieldAutoClipControl", raw.ff_AutoClipControl, keyFile); saveToKeyfile(!pedited || pedited->raw.ff_clipControl, "RAW", "FlatFieldClipControl", raw.ff_clipControl, keyFile); saveToKeyfile(!pedited || pedited->raw.ca_autocorrect, "RAW", "CA", raw.ca_autocorrect, keyFile); + saveToKeyfile(!pedited || pedited->raw.caautoiterations, "RAW", "CAAutoIterations", raw.caautoiterations, keyFile); saveToKeyfile(!pedited || pedited->raw.cared, "RAW", "CARed", raw.cared, keyFile); saveToKeyfile(!pedited || pedited->raw.cablue, "RAW", "CABlue", raw.cablue, keyFile); saveToKeyfile(!pedited || pedited->raw.hotPixelFilter, "RAW", "HotPixelFilter", raw.hotPixelFilter, keyFile); @@ -4753,6 +4756,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } assignFromKeyfile(keyFile, "RAW", "CA", pedited, raw.ca_autocorrect, pedited->raw.ca_autocorrect); + assignFromKeyfile(keyFile, "RAW", "CAAutoIterations", pedited, raw.caautoiterations, pedited->raw.caautoiterations); assignFromKeyfile(keyFile, "RAW", "CARed", pedited, raw.cared, pedited->raw.cared); assignFromKeyfile(keyFile, "RAW", "CABlue", pedited, raw.cablue, pedited->raw.cablue); // For compatibility to elder pp3 versions diff --git a/rtengine/procparams.h b/rtengine/procparams.h index bbc9763cf..8e8978601 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1368,6 +1368,7 @@ struct RAWParams { int ff_clipControl; bool ca_autocorrect; + int caautoiterations; double cared; double cablue; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 85a02c85e..a4a68cc17 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2009,13 +2009,13 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } if(numFrames == 4) { double fitParams[64]; - float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, *rawDataFrames[0], fitParams, false, true, nullptr, false); + float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, *rawDataFrames[0], fitParams, false, true, nullptr, false); for(int i = 1; i < 3; ++i) { - CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, *rawDataFrames[i], fitParams, true, false, buffer, false); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, *rawDataFrames[i], fitParams, true, false, buffer, false); } - CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, *rawDataFrames[3], fitParams, true, false, buffer, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, *rawDataFrames[3], fitParams, true, false, buffer, true); } else { - CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, rawData, nullptr, false, false, nullptr, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, rawData, nullptr, false, false, nullptr, true); } } diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 95c4dbe22..47fc756a9 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -239,7 +239,7 @@ protected: inline void interpolate_row_rb (float* ar, float* ab, float* pg, float* cg, float* ng, int i); inline void interpolate_row_rb_mul_pp (const array2D &rawData, float* ar, float* ab, float* pg, float* cg, float* ng, int i, float r_mul, float g_mul, float b_mul, int x1, int width, int skip); - float* CA_correct_RT (const bool autoCA, const double cared, const double cablue, const double caautostrength, array2D &rawData, double *fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, float * buffer, bool freeBuffer); + float* CA_correct_RT (const bool autoCA, const size_t autoIterations, const double cared, const double cablue, const double caautostrength, array2D &rawData, double *fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, float * buffer, bool freeBuffer); void ddct8x8s(int isgn, float a[8][8]); void processRawWhitepoint (float expos, float preser, array2D &rawData); // exposure before interpolation diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 400568203..c9ce7affc 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -431,6 +431,7 @@ void ParamsEdited::set(bool v) raw.xtranssensor.exBlackGreen = v; raw.xtranssensor.exBlackBlue = v; raw.ca_autocorrect = v; + raw.caautoiterations = v; raw.cablue = v; raw.cared = v; raw.hotPixelFilter = v; @@ -986,6 +987,7 @@ void ParamsEdited::initFrom(const std::vector& raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen; raw.xtranssensor.exBlackBlue = raw.xtranssensor.exBlackBlue && p.raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue; raw.ca_autocorrect = raw.ca_autocorrect && p.raw.ca_autocorrect == other.raw.ca_autocorrect; + raw.caautoiterations = raw.caautoiterations && p.raw.caautoiterations == other.raw.caautoiterations; raw.cared = raw.cared && p.raw.cared == other.raw.cared; raw.cablue = raw.cablue && p.raw.cablue == other.raw.cablue; raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter; @@ -2626,6 +2628,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect; } + if (raw.caautoiterations) { + toEdit.raw.caautoiterations = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.caautoiterations + mods.raw.caautoiterations : mods.raw.caautoiterations; + } + if (raw.cared) { toEdit.raw.cared = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cared + mods.raw.cared : mods.raw.cared; } @@ -3127,7 +3133,7 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const bool RAWParamsEdited::isUnchanged() const { - return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame + return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && caautoiterations && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame && df_autoselect && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index c4c36ce61..1cd16290c 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -787,6 +787,7 @@ public: XTransSensor xtranssensor; bool ca_autocorrect; + bool caautoiterations; bool cared; bool cablue; bool hotPixelFilter; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index eb1bbbfee..556360bda 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -901,6 +901,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param if (!raw_ca_autocorrect->get_active ()) { filterPE.raw.ca_autocorrect = falsePE.raw.ca_autocorrect; + filterPE.raw.caautoiterations = falsePE.raw.caautoiterations; } if (!raw_caredblue->get_active ()) { diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 2f3c54522..7e75682e0 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "rawcacorrection.h" +#include "eventmapper.h" #include "guiutils.h" #include "rtimage.h" @@ -25,6 +26,9 @@ using namespace rtengine::procparams; RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROMATABERR_LABEL")) { + auto m = ProcEventMapper::getInstance(); + EvPreProcessCAAutoiterations = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_AUTOIT"); + Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png")); Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png")); Gtk::Image* icablueL = Gtk::manage (new RTImage ("circle-blue-yellow-small.png")); @@ -33,6 +37,13 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage)); caAutocorrect->setCheckBoxListener (this); + caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 3, 1, 1)); + caAutoiterations->setAdjusterListener (this); + + if (caAutoiterations->delay < options.adjusterMaxDelay) { + caAutoiterations->delay = options.adjusterMaxDelay; + } + caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"), -8.0, 8.0, 0.1, 0, icaredL, icaredR)); caRed->setAdjusterListener (this); @@ -51,6 +62,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caBlue->show(); pack_start( *caAutocorrect, Gtk::PACK_SHRINK, 4); + pack_start( *caAutoiterations, Gtk::PACK_SHRINK, 4); pack_start( *caRed, Gtk::PACK_SHRINK, 4); pack_start( *caBlue, Gtk::PACK_SHRINK, 4); @@ -62,15 +74,18 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi if(pedited ) { caAutocorrect->setEdited(pedited->raw.ca_autocorrect); + caAutoiterations->setEditedState( pedited->raw.cared ? Edited : UnEdited ); caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited ); caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited ); } // disable Red and Blue sliders when caAutocorrect is enabled + caAutoiterations->set_sensitive(pp->raw.ca_autocorrect); caRed->set_sensitive(!pp->raw.ca_autocorrect); caBlue->set_sensitive(!pp->raw.ca_autocorrect); caAutocorrect->setValue(pp->raw.ca_autocorrect); + caAutoiterations->setValue (pp->raw.caautoiterations); caRed->setValue (pp->raw.cared); caBlue->setValue (pp->raw.cablue); @@ -80,11 +95,13 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) { pp->raw.ca_autocorrect = caAutocorrect->getLastActive(); + pp->raw.caautoiterations = caAutoiterations->getValue(); pp->raw.cared = caRed->getValue(); pp->raw.cablue = caBlue->getValue(); if (pedited) { pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent(); + pedited->raw.caautoiterations = caAutoiterations->getEditedState (); pedited->raw.cared = caRed->getEditedState (); pedited->raw.cablue = caBlue->getEditedState (); } @@ -97,7 +114,9 @@ void RAWCACorr::adjusterChanged (Adjuster* a, double newval) Glib::ustring value = a->getTextValue(); - if (a == caRed) { + if (a == caAutoiterations) { + listener->panelChanged (EvPreProcessCAAutoiterations, value ); + } else if (a == caRed) { listener->panelChanged (EvPreProcessCARed, value ); } else if (a == caBlue) { listener->panelChanged (EvPreProcessCABlue, value ); @@ -110,6 +129,7 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) if (c == caAutocorrect) { if (!batchMode) { // disable Red and Blue sliders when caAutocorrect is enabled + caAutoiterations->set_sensitive(caAutocorrect->getLastActive ()); caRed->set_sensitive(!caAutocorrect->getLastActive ()); caBlue->set_sensitive(!caAutocorrect->getLastActive ()); } @@ -122,19 +142,23 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) void RAWCACorr::setBatchMode(bool batchMode) { ToolPanel::setBatchMode (batchMode); + caAutoiterations->showEditedCB (); caRed->showEditedCB (); caBlue->showEditedCB (); } void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { + caAutoiterations->setDefault( defParams->raw.caautoiterations); caRed->setDefault( defParams->raw.cared); caBlue->setDefault( defParams->raw.cablue); if (pedited) { + caAutoiterations->setDefaultEditedState( pedited->raw.caautoiterations ? Edited : UnEdited); caRed->setDefaultEditedState( pedited->raw.cared ? Edited : UnEdited); caBlue->setDefaultEditedState( pedited->raw.cablue ? Edited : UnEdited); } else { + caAutoiterations->setDefaultEditedState( Irrelevant ); caRed->setDefaultEditedState( Irrelevant ); caBlue->setDefaultEditedState( Irrelevant ); } @@ -150,6 +174,7 @@ void RAWCACorr::setAdjusterBehavior (bool caadd) void RAWCACorr::trimValues (rtengine::procparams::ProcParams* pp) { + caAutoiterations->trimValue(pp->raw.caautoiterations); caRed->trimValue(pp->raw.cared); caBlue->trimValue(pp->raw.cablue); } diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index 69292b1aa..27e486247 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -29,9 +29,12 @@ class RAWCACorr : public ToolParamBlock, public AdjusterListener, public CheckBo protected: CheckBox* caAutocorrect; + Adjuster* caAutoiterations; Adjuster* caRed; Adjuster* caBlue; + rtengine::ProcEvent EvPreProcessCAAutoiterations; + public: RAWCACorr (); From ac1db9922086339847bce6658f146dcfb9d714f7 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 5 Sep 2018 17:54:11 +0200 Subject: [PATCH 06/53] CA_correct_RT(): readability changes suggested by @Floessie; increased range of iterations adjuster to 5, #4774 --- rtengine/CA_correct_RT.cc | 33 +++++++++++++++++++++++++++------ rtengine/rawimagesource.h | 14 +++++++++++++- rtgui/rawcacorrection.cc | 2 +- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 35e36ce05..0a53ba469 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -111,7 +111,19 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) using namespace std; using namespace rtengine; -float* RawImageSource::CA_correct_RT(const bool autoCA, const size_t autoIterations, const double cared, const double cablue, const double caautostrength, array2D &rawData, double *fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, float *buffer, bool freeBuffer) +float* RawImageSource::CA_correct_RT( + bool autoCA, + size_t autoIterations, + double cared, + double cablue, + double caautostrength, + const array2D &rawData, + double* fitParamsTransfer, + bool fitParamsIn, + bool fitParamsOut, + float* buffer, + bool freeBuffer +) { // multithreaded and vectorized by Ingo Weyrich constexpr int ts = 128; @@ -120,14 +132,16 @@ float* RawImageSource::CA_correct_RT(const bool autoCA, const size_t autoIterati constexpr int v1 = ts, v2 = 2 * ts, v3 = 3 * ts, v4 = 4 * ts; //, p1=-ts+1, p2=-2*ts+2, p3=-3*ts+3, m1=ts+1, m2=2*ts+2, m3=3*ts+3; // Test for RGB cfa - for(int i = 0; i < 2; i++) - for(int j = 0; j < 2; j++) + for(int i = 0; i < 2; i++) { + for(int j = 0; j < 2; j++) { if(FC(i, j) == 3) { printf("CA correction supports only RGB Colour filter arrays\n"); return buffer; } + } + } - volatile double progress = 0.0; + double progress = 0.0; if(plistener) { plistener->setProgress (progress); @@ -159,9 +173,16 @@ float* RawImageSource::CA_correct_RT(const bool autoCA, const size_t autoIterati bool processpasstwo = true; double fitparams[2][2][16]; - const size_t iterations = autoCA ? std::max(autoIterations, static_cast(1)) : 1; + const size_t iterations = + autoCA + ? std::max(autoIterations, 1) + : 1; + for (size_t it = 0; it < iterations && processpasstwo; ++it) { - float blockave[2][2] = {{0, 0}, {0, 0}}, blocksqave[2][2] = {{0, 0}, {0, 0}}, blockdenom[2][2] = {{0, 0}, {0, 0}}, blockvar[2][2]; + float blockave[2][2] = {}; + float blocksqave[2][2] = {}; + float blockdenom[2][2] = {}; + float blockvar[2][2]; const bool fitParamsSet = fitParamsTransfer && fitParamsIn; if(autoCA && fitParamsSet && iterations < 2) { // use stored parameters diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 47fc756a9..b9729555b 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -239,7 +239,19 @@ protected: inline void interpolate_row_rb (float* ar, float* ab, float* pg, float* cg, float* ng, int i); inline void interpolate_row_rb_mul_pp (const array2D &rawData, float* ar, float* ab, float* pg, float* cg, float* ng, int i, float r_mul, float g_mul, float b_mul, int x1, int width, int skip); - float* CA_correct_RT (const bool autoCA, const size_t autoIterations, const double cared, const double cablue, const double caautostrength, array2D &rawData, double *fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, float * buffer, bool freeBuffer); + float* CA_correct_RT( + bool autoCA, + size_t autoIterations, + double cared, + double cablue, + double caautostrength, + const array2D &rawData, + double* fitParamsTransfer, + bool fitParamsIn, + bool fitParamsOut, + float* buffer, + bool freeBuffer + ); void ddct8x8s(int isgn, float a[8][8]); void processRawWhitepoint (float expos, float preser, array2D &rawData); // exposure before interpolation diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 7e75682e0..8c917c910 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -37,7 +37,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage)); caAutocorrect->setCheckBoxListener (this); - caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 3, 1, 1)); + caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 5, 1, 1)); caAutoiterations->setAdjusterListener (this); if (caAutoiterations->delay < options.adjusterMaxDelay) { From 5fcb64634dfe2c960ff856f15569b432401e0eb9 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 5 Sep 2018 20:33:48 +0200 Subject: [PATCH 07/53] CA_correct_RT(), minor change --- rtengine/CA_correct_RT.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 0a53ba469..f8fc9b39e 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -27,6 +27,7 @@ #include "rawimagesource.h" #include "rt_math.h" #include "median.h" +//#define BENCHMARK #include "StopWatch.h" namespace { @@ -125,6 +126,7 @@ float* RawImageSource::CA_correct_RT( bool freeBuffer ) { + BENCHFUN // multithreaded and vectorized by Ingo Weyrich constexpr int ts = 128; constexpr int tsh = ts / 2; @@ -178,23 +180,25 @@ float* RawImageSource::CA_correct_RT( ? std::max(autoIterations, 1) : 1; + const bool fitParamsSet = fitParamsTransfer && fitParamsIn && iterations < 2; + if(autoCA && fitParamsSet) { + // use stored parameters + int index = 0; + for(int c = 0; c < 2; ++c) { + for(int d = 0; d < 2; ++d) { + for(int e = 0; e < 16; ++e) { + fitparams[c][d][e] = fitParamsTransfer[index++]; + } + } + } + } + for (size_t it = 0; it < iterations && processpasstwo; ++it) { float blockave[2][2] = {}; float blocksqave[2][2] = {}; float blockdenom[2][2] = {}; float blockvar[2][2]; - const bool fitParamsSet = fitParamsTransfer && fitParamsIn; - if(autoCA && fitParamsSet && iterations < 2) { - // use stored parameters - int index = 0; - for(int c = 0; c < 2; ++c) { - for(int d = 0; d < 2; ++d) { - for(int e = 0; e < 16; ++e) { - fitparams[c][d][e] = fitParamsTransfer[index++]; - } - } - } - } + //order of 2d polynomial fit (polyord), and numpar=polyord^2 int polyord = 4, numpar = 16; From 01618e1b7f06b6c04ef13852d81df49be8c03c4d Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 5 Sep 2018 21:47:16 +0200 Subject: [PATCH 08/53] Set default value for raw auto ca correction iterations to 2 while keeping backwars compatibility, #4774 --- rtengine/procparams.cc | 8 ++++++-- rtgui/ppversion.h | 4 +++- rtgui/rawcacorrection.cc | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 29e52b905..eb06e5b16 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2561,7 +2561,7 @@ RAWParams::RAWParams() : ff_AutoClipControl(false), ff_clipControl(0), ca_autocorrect(false), - caautoiterations(1), + caautoiterations(2), cared(0.0), cablue(0.0), expos(1.0), @@ -4756,7 +4756,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } assignFromKeyfile(keyFile, "RAW", "CA", pedited, raw.ca_autocorrect, pedited->raw.ca_autocorrect); - assignFromKeyfile(keyFile, "RAW", "CAAutoIterations", pedited, raw.caautoiterations, pedited->raw.caautoiterations); + if (ppVersion >= 342) { + assignFromKeyfile(keyFile, "RAW", "CAAutoIterations", pedited, raw.caautoiterations, pedited->raw.caautoiterations); + } else { + raw.caautoiterations = 1; + } assignFromKeyfile(keyFile, "RAW", "CARed", pedited, raw.cared, pedited->raw.cared); assignFromKeyfile(keyFile, "RAW", "CABlue", pedited, raw.cablue, pedited->raw.cablue); // For compatibility to elder pp3 versions diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index f4ca1f360..dd89c9f99 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,11 +1,13 @@ #pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 340 +#define PPVERSION 341 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /* Log of version changes + 342 2018-09-05 + raw auto ca correction iterations 341 2018-07-22 [ICM] enhanced custom output profile 340 2018-07-08 diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 8c917c910..9957ca9be 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -37,7 +37,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage)); caAutocorrect->setCheckBoxListener (this); - caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 5, 1, 1)); + caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 5, 1, 2)); caAutoiterations->setAdjusterListener (this); if (caAutoiterations->delay < options.adjusterMaxDelay) { From f6195877e54a205a7b4a2092dfd8bcecc0c05b59 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 5 Sep 2018 21:51:36 +0200 Subject: [PATCH 09/53] Fix wrong ppversion --- rtgui/ppversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index dd89c9f99..5380943bf 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,7 +1,7 @@ #pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 341 +#define PPVERSION 342 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /* From bcc7a3fb855de67366ba295eeec6fd88b8a983b4 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 6 Sep 2018 13:52:48 +0200 Subject: [PATCH 10/53] raw ca correction: first try to avoid colour shift, #4777 --- rtdata/languages/default | 2 ++ rtengine/CA_correct_RT.cc | 39 ++++++++++++++++++++++++++++++++++++++ rtengine/procparams.cc | 9 +++++++++ rtengine/procparams.h | 1 + rtengine/rawimagesource.cc | 8 ++++---- rtengine/rawimagesource.h | 1 + rtgui/paramsedited.cc | 8 +++++++- rtgui/paramsedited.h | 1 + rtgui/ppversion.h | 4 +++- rtgui/rawcacorrection.cc | 16 +++++++++++++++- rtgui/rawcacorrection.h | 2 ++ 11 files changed, 84 insertions(+), 7 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 05498985f..e786b5355 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -749,6 +749,7 @@ HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold HISTORY_MSG_RAW_BORDER;Raw border HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1782,6 +1783,7 @@ TP_PRSHARPENING_LABEL;Post-Resize Sharpening TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. TP_RAWCACORR_AUTO;Auto-correction TP_RAWCACORR_AUTOIT;Iterations +TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift TP_RAWCACORR_CABLUE;Blue TP_RAWCACORR_CARED;Red TP_RAWCACORR_CASTR;Strength diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index f8fc9b39e..7e05c856c 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -26,6 +26,7 @@ #include "rtengine.h" #include "rawimagesource.h" #include "rt_math.h" +#include "gauss.h" #include "median.h" //#define BENCHMARK #include "StopWatch.h" @@ -118,6 +119,7 @@ float* RawImageSource::CA_correct_RT( double cared, double cablue, double caautostrength, + bool avoidColourshift, const array2D &rawData, double* fitParamsTransfer, bool fitParamsIn, @@ -142,6 +144,14 @@ float* RawImageSource::CA_correct_RT( } } } + array2D oldraw(W,H); + if (avoidColourshift) { + for(int i = 0; i < H; ++i) { + for(int j = 0; j < W; ++j) { + oldraw[i][j] = rawData[i][j]; + } + } + } double progress = 0.0; @@ -1230,6 +1240,35 @@ float* RawImageSource::CA_correct_RT( buffer = nullptr; } + + if (avoidColourshift) { + array2D redFactor((W+1)/2, (H+1)/2); + array2D blueFactor((W+1)/2, (H+1)/2); + + for(int i = 0; i < H; ++i) { + for(int j = 0; j < W; ++j) { + float factor = (rawData[i][j] * oldraw[i][j] == 0.0 ? 1.0 : oldraw[i][j] / rawData[i][j]); + if(FC(i,j) == 0) { + redFactor[i/2][j/2] = factor; + } else if(FC(i,j) == 2) { + blueFactor[i/2][j/2] = factor; + } + } + } + gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0); + gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0); + + for(int i = 0; i < H; ++i) { + for(int j = 0; j < W; ++j) { + if(FC(i,j) == 0) { + rawData[i][j] *= redFactor[i/2][j/2]; + } else if(FC(i,j) == 2) { + rawData[i][j] *= blueFactor[i/2][j/2]; + } + } + } + } + if(plistener) { plistener->setProgress(1.0); } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index eb06e5b16..af89f99a1 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2561,6 +2561,7 @@ RAWParams::RAWParams() : ff_AutoClipControl(false), ff_clipControl(0), ca_autocorrect(false), + ca_avoidcolourshift(true), caautoiterations(2), cared(0.0), cablue(0.0), @@ -2586,6 +2587,7 @@ bool RAWParams::operator ==(const RAWParams& other) const && ff_AutoClipControl == other.ff_AutoClipControl && ff_clipControl == other.ff_clipControl && ca_autocorrect == other.ca_autocorrect + && ca_avoidcolourshift == other.ca_avoidcolourshift && caautoiterations == other.caautoiterations && cared == other.cared && cablue == other.cablue @@ -3383,6 +3385,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->raw.ff_AutoClipControl, "RAW", "FlatFieldAutoClipControl", raw.ff_AutoClipControl, keyFile); saveToKeyfile(!pedited || pedited->raw.ff_clipControl, "RAW", "FlatFieldClipControl", raw.ff_clipControl, keyFile); saveToKeyfile(!pedited || pedited->raw.ca_autocorrect, "RAW", "CA", raw.ca_autocorrect, keyFile); + saveToKeyfile(!pedited || pedited->raw.ca_avoidcolourshift, "RAW", "CAAvoidColourshift", raw.ca_avoidcolourshift, keyFile); saveToKeyfile(!pedited || pedited->raw.caautoiterations, "RAW", "CAAutoIterations", raw.caautoiterations, keyFile); saveToKeyfile(!pedited || pedited->raw.cared, "RAW", "CARed", raw.cared, keyFile); saveToKeyfile(!pedited || pedited->raw.cablue, "RAW", "CABlue", raw.cablue, keyFile); @@ -4761,6 +4764,12 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } else { raw.caautoiterations = 1; } + + if (ppVersion >= 343) { + assignFromKeyfile(keyFile, "RAW", "CAAvoidColourshift", pedited, raw.ca_avoidcolourshift, pedited->raw.ca_avoidcolourshift); + } else { + raw.ca_avoidcolourshift = false; + } assignFromKeyfile(keyFile, "RAW", "CARed", pedited, raw.cared, pedited->raw.cared); assignFromKeyfile(keyFile, "RAW", "CABlue", pedited, raw.cablue, pedited->raw.cablue); // For compatibility to elder pp3 versions diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 8e8978601..0b8b5ba56 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1368,6 +1368,7 @@ struct RAWParams { int ff_clipControl; bool ca_autocorrect; + bool ca_avoidcolourshift; int caautoiterations; double cared; double cablue; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index a4a68cc17..77c6285be 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2009,13 +2009,13 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } if(numFrames == 4) { double fitParams[64]; - float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, *rawDataFrames[0], fitParams, false, true, nullptr, false); + float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false); for(int i = 1; i < 3; ++i) { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, *rawDataFrames[i], fitParams, true, false, buffer, false); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false); } - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, *rawDataFrames[3], fitParams, true, false, buffer, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true); } else { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, rawData, nullptr, false, false, nullptr, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true); } } diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index b9729555b..972e1fe64 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -245,6 +245,7 @@ protected: double cared, double cablue, double caautostrength, + bool avoidColourshift, const array2D &rawData, double* fitParamsTransfer, bool fitParamsIn, diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index c9ce7affc..2ccb62f65 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -431,6 +431,7 @@ void ParamsEdited::set(bool v) raw.xtranssensor.exBlackGreen = v; raw.xtranssensor.exBlackBlue = v; raw.ca_autocorrect = v; + raw.ca_avoidcolourshift = v; raw.caautoiterations = v; raw.cablue = v; raw.cared = v; @@ -987,6 +988,7 @@ void ParamsEdited::initFrom(const std::vector& raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen; raw.xtranssensor.exBlackBlue = raw.xtranssensor.exBlackBlue && p.raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue; raw.ca_autocorrect = raw.ca_autocorrect && p.raw.ca_autocorrect == other.raw.ca_autocorrect; + raw.ca_avoidcolourshift = raw.ca_avoidcolourshift && p.raw.ca_avoidcolourshift == other.raw.ca_avoidcolourshift; raw.caautoiterations = raw.caautoiterations && p.raw.caautoiterations == other.raw.caautoiterations; raw.cared = raw.cared && p.raw.cared == other.raw.cared; raw.cablue = raw.cablue && p.raw.cablue == other.raw.cablue; @@ -2628,6 +2630,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect; } + if (raw.ca_avoidcolourshift) { + toEdit.raw.ca_avoidcolourshift = mods.raw.ca_avoidcolourshift; + } + if (raw.caautoiterations) { toEdit.raw.caautoiterations = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.caautoiterations + mods.raw.caautoiterations : mods.raw.caautoiterations; } @@ -3133,7 +3139,7 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const bool RAWParamsEdited::isUnchanged() const { - return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && caautoiterations && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame + return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && ca_avoidcolourshift && caautoiterations && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame && df_autoselect && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 1cd16290c..0a795696c 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -787,6 +787,7 @@ public: XTransSensor xtranssensor; bool ca_autocorrect; + bool ca_avoidcolourshift; bool caautoiterations; bool cared; bool cablue; diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index 5380943bf..050c4c653 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,11 +1,13 @@ #pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 342 +#define PPVERSION 343 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /* Log of version changes + 343 2018-09-06 + raw auto ca correction avoid colour shift 342 2018-09-05 raw auto ca correction iterations 341 2018-07-22 diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 9957ca9be..9a1001f74 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -28,6 +28,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM { auto m = ProcEventMapper::getInstance(); EvPreProcessCAAutoiterations = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_AUTOIT"); + EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png")); Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png")); @@ -66,6 +67,11 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM pack_start( *caRed, Gtk::PACK_SHRINK, 4); pack_start( *caBlue, Gtk::PACK_SHRINK, 4); + caAvoidcolourshift = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AVOIDCOLORSHIFT"), multiImage)); + caAvoidcolourshift->setCheckBoxListener (this); + pack_start( *caAvoidcolourshift, Gtk::PACK_SHRINK, 4); + + } void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) @@ -74,7 +80,8 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi if(pedited ) { caAutocorrect->setEdited(pedited->raw.ca_autocorrect); - caAutoiterations->setEditedState( pedited->raw.cared ? Edited : UnEdited ); + caAvoidcolourshift->setEdited(pedited->raw.ca_avoidcolourshift); + caAutoiterations->setEditedState( pedited->raw.caautoiterations ? Edited : UnEdited ); caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited ); caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited ); } @@ -85,6 +92,7 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi caBlue->set_sensitive(!pp->raw.ca_autocorrect); caAutocorrect->setValue(pp->raw.ca_autocorrect); + caAvoidcolourshift->setValue(pp->raw.ca_avoidcolourshift); caAutoiterations->setValue (pp->raw.caautoiterations); caRed->setValue (pp->raw.cared); caBlue->setValue (pp->raw.cablue); @@ -95,12 +103,14 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) { pp->raw.ca_autocorrect = caAutocorrect->getLastActive(); + pp->raw.ca_avoidcolourshift = caAvoidcolourshift->getLastActive(); pp->raw.caautoiterations = caAutoiterations->getValue(); pp->raw.cared = caRed->getValue(); pp->raw.cablue = caBlue->getValue(); if (pedited) { pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent(); + pedited->raw.ca_avoidcolourshift = !caAvoidcolourshift->get_inconsistent(); pedited->raw.caautoiterations = caAutoiterations->getEditedState (); pedited->raw.cared = caRed->getEditedState (); pedited->raw.cablue = caBlue->getEditedState (); @@ -136,6 +146,10 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) if (listener) { listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); } + } else if (c == caAvoidcolourshift) { + if (listener) { + listener->panelChanged (EvPreProcessCAColourshift, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); + } } } diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index 27e486247..614bd4b90 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -32,8 +32,10 @@ protected: Adjuster* caAutoiterations; Adjuster* caRed; Adjuster* caBlue; + CheckBox* caAvoidcolourshift; rtengine::ProcEvent EvPreProcessCAAutoiterations; + rtengine::ProcEvent EvPreProcessCAColourshift; public: From 68ee9d422ba679e5fcb3a37af43d923f546ae9e7 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 6 Sep 2018 16:05:06 +0200 Subject: [PATCH 11/53] raw ca correction: optimized avoid colour shift, #4777 --- rtengine/CA_correct_RT.cc | 137 ++++++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 59 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 7e05c856c..b6c4b0375 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -144,11 +144,17 @@ float* RawImageSource::CA_correct_RT( } } } - array2D oldraw(W,H); + array2D* oldraw = nullptr; if (avoidColourshift) { + oldraw = new array2D((W + 1) / 2, H); + #pragma omp parallel for for(int i = 0; i < H; ++i) { - for(int j = 0; j < W; ++j) { - oldraw[i][j] = rawData[i][j]; + int j = FC(i, 0) & 1; + for(; j < W - 1; j += 2) { + (*oldraw)[i][j / 2] = rawData[i][j]; + } + if(j < W) { + (*oldraw)[i][j / 2] = rawData[i][j]; } } } @@ -284,15 +290,15 @@ float* RawImageSource::CA_correct_RT( // rgb values should be floating point numbers between 0 and 1 // after white balance multipliers are applied - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat c65535v = F2V(65535.f); - #endif +#endif for (int rr = rrmin; rr < rrmax; rr++) { int row = rr + top; int cc = ccmin; int col = cc + left; - #ifdef __SSE2__ +#ifdef __SSE2__ int c0 = FC(rr, cc); if(c0 == 1) { rgb[c0][rr * ts + cc] = rawData[row][col] / 65535.f; @@ -309,7 +315,7 @@ float* RawImageSource::CA_correct_RT( STVFU(rgb[1][indx1], val1); STVFU(rgb[1][indx1 + 4], val2); } - #endif +#endif for (; cc < ccmax; cc++, col++) { int c = FC(rr, cc); int indx1 = rr * ts + cc; @@ -389,16 +395,16 @@ float* RawImageSource::CA_correct_RT( //end of initialization - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat onev = F2V(1.f); vfloat epsv = F2V(eps); - #endif +#endif for (int rr = 3; rr < rr1 - 3; rr++) { int row = rr + top; int cc = 3 + (FC(rr,3) & 1); int indx = rr * ts + cc; int c = FC(rr,cc); - #ifdef __SSE2__ +#ifdef __SSE2__ for (; cc < cc1 - 9; cc+=8, indx+=8) { //compute directional weights using image gradients vfloat rgb1mv1v = LC2VFU(rgb[1][indx - v1]); @@ -417,7 +423,7 @@ float* RawImageSource::CA_correct_RT( STC2VFU(rgb[1][indx], (wtuv * rgb1mv1v + wtdv * rgb1pv1v + wtlv * rgb1m1v + wtrv * rgb1p1v) / (wtuv + wtdv + wtlv + wtrv)); } - #endif +#endif for (; cc < cc1 - 3; cc+=2, indx+=2) { //compute directional weights using image gradients float wtu = 1.f / SQR(eps + fabsf(rgb[1][indx + v1] - rgb[1][indx - v1]) + fabsf(rgb[c][indx >> 1] - rgb[c][(indx - v2) >> 1]) + fabsf(rgb[1][indx - v1] - rgb[1][indx - v3])); @@ -433,11 +439,11 @@ float* RawImageSource::CA_correct_RT( int offset = (FC(row,max(left + 3, 0)) & 1); int col = max(left + 3, 0) + offset; int indx = rr * ts + 3 - (left < 0 ? (left+3) : 0) + offset; - #ifdef __SSE2__ +#ifdef __SSE2__ for(; col < min(cc1 + left - 3, width) - 7; col+=8, indx+=8) { STVFU(Gtmp[(row * width + col) >> 1], LC2VFU(rgb[1][indx])); } - #endif +#endif for(; col < min(cc1 + left - 3, width); col+=2, indx+=2) { Gtmp[(row * width + col) >> 1] = rgb[1][indx]; } @@ -445,14 +451,14 @@ float* RawImageSource::CA_correct_RT( } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat zd25v = F2V(0.25f); - #endif +#endif for (int rr = 4; rr < rr1 - 4; rr++) { int cc = 4 + (FC(rr, 2) & 1); int indx = rr * ts + cc; int c = FC(rr, cc); - #ifdef __SSE2__ +#ifdef __SSE2__ for (; cc < cc1 - 10; cc += 8, indx += 8) { vfloat rgb1v = LC2VFU(rgb[1][indx]); vfloat rgbcv = LVFU(rgb[c][indx >> 1]); @@ -480,7 +486,7 @@ float* RawImageSource::CA_correct_RT( STVFU(grblpfh[indx >> 1], zd25v * (glpfhv + (rgbcv + LVFU(rgb[c][(indx + 2) >> 1]) + LVFU(rgb[c][(indx - 2) >> 1])))); } - #endif +#endif for (; cc < cc1 - 4; cc += 2, indx += 2) { rbhpfv[indx >> 1] = fabsf(fabsf((rgb[1][indx] - rgb[c][indx >> 1]) - (rgb[1][indx + v4] - rgb[c][(indx + v4) >> 1])) + fabsf((rgb[1][indx - v4] - rgb[c][(indx - v4) >> 1]) - (rgb[1][indx] - rgb[c][indx >> 1])) - @@ -507,11 +513,11 @@ float* RawImageSource::CA_correct_RT( } } - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat zd3v = F2V(0.3f); vfloat zd1v = F2V(0.1f); vfloat zd5v = F2V(0.5f); - #endif +#endif // along line segments, find the point along each segment that minimizes the colour variance // averaged over the tile; evaluate for up/down and left/right away from R/B grid point @@ -519,7 +525,7 @@ float* RawImageSource::CA_correct_RT( int cc = 8 + (FC(rr, 2) & 1); int indx = rr * ts + cc; int c = FC(rr, cc); - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat coeff00v = ZEROV; vfloat coeff01v = ZEROV; vfloat coeff02v = ZEROV; @@ -560,7 +566,7 @@ float* RawImageSource::CA_correct_RT( coeff[1][1][c>>1] += vhadd(coeff11v); coeff[1][2][c>>1] += vhadd(coeff12v); - #endif +#endif for (; cc < cc1 - 8; cc += 2, indx += 2) { //in linear interpolation, colour differences are a quadratic function of interpolation position; @@ -825,17 +831,17 @@ float* RawImageSource::CA_correct_RT( // rgb values should be floating point number between 0 and 1 // after white balance multipliers are applied - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat c65535v = F2V(65535.f); vmask gmask = _mm_set_epi32(0, 0xffffffff, 0, 0xffffffff); - #endif +#endif for (int rr = rrmin; rr < rrmax; rr++) { int row = rr + top; int cc = ccmin; int col = cc + left; int indx = row * width + col; int indx1 = rr * ts + cc; - #ifdef __SSE2__ +#ifdef __SSE2__ int c = FC(rr, cc); if(c & 1) { rgb[1][indx1] = rawData[row][col] / 65535.f; @@ -853,7 +859,7 @@ float* RawImageSource::CA_correct_RT( STVFU(rgb[1][indx1], vself(gmask, PERMUTEPS(gtmpv, _MM_SHUFFLE(1, 1, 0, 0)), val1v)); STVFU(rgb[1][indx1 + 4], vself(gmask, PERMUTEPS(gtmpv, _MM_SHUFFLE(3, 3, 2, 2)), val2v)); } - #endif +#endif for (; cc < ccmax; cc++, col++, indx++, indx1++) { int c = FC(rr, cc); rgb[c][indx1 >> ((c & 1) ^ 1)] = rawData[row][col] / 65535.f; @@ -954,15 +960,15 @@ float* RawImageSource::CA_correct_RT( // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (!autoCA || fitParamsIn) { - #ifdef __SSE2__ +#ifdef __SSE2__ const vfloat onev = F2V(1.f); const vfloat epsv = F2V(eps); - #endif +#endif //manual CA correction; use red/blue slider values to set CA shift parameters for (int rr = 3; rr < rr1 - 3; rr++) { int cc = 3 + FC(rr, 1), c = FC(rr,cc), indx = rr * ts + cc; - #ifdef __SSE2__ +#ifdef __SSE2__ for (; cc < cc1 - 10; cc += 8, indx += 8) { //compute directional weights using image gradients vfloat val1v = epsv + vabsf(LC2VFU(rgb[1][(rr + 1) * ts + cc]) - LC2VFU(rgb[1][(rr - 1) * ts + cc])); @@ -975,7 +981,7 @@ float* RawImageSource::CA_correct_RT( //store in rgb array the interpolated G value at R/B grid points using directional weighted average STC2VFU(rgb[1][indx], (wtuv * LC2VFU(rgb[1][indx - v1]) + wtdv * LC2VFU(rgb[1][indx + v1]) + wtlv * LC2VFU(rgb[1][indx - 1]) + wtrv * LC2VFU(rgb[1][indx + 1])) / (wtuv + wtdv + wtlv + wtrv)); } - #endif +#endif for (; cc < cc1 - 3; cc += 2, indx += 2) { //compute directional weights using image gradients float wtu = 1.f / SQR(eps + fabsf(rgb[1][(rr + 1) * ts + cc] - rgb[1][(rr - 1) * ts + cc]) + fabsf(rgb[c][(rr * ts + cc) >> 1] - rgb[c][((rr - 2) * ts + cc) >> 1]) + fabsf(rgb[1][(rr - 1) * ts + cc] - rgb[1][(rr - 3) * ts + cc])); @@ -1044,7 +1050,7 @@ float* RawImageSource::CA_correct_RT( int indxff = (rr + shiftvfloor[c]) * ts + cc + shifthfloor[c]; int indxcc = (rr + shiftvceil[c]) * ts + cc + shifthceil[c]; int indxcf = (rr + shiftvceil[c]) * ts + cc + shifthfloor[c]; - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat shifthfracv = F2V(shifthfrac[c]); vfloat shiftvfracv = F2V(shiftvfrac[c]); for (; cc < cc1 - 10; cc += 8, indxfc += 8, indxff += 8, indxcc += 8, indxcf += 8, indx += 4) { @@ -1060,7 +1066,7 @@ float* RawImageSource::CA_correct_RT( STVFU(gshift[indx], Gintv); } - #endif +#endif for (; cc < cc1 - 4; cc += 2, indxfc += 2, indxff += 2, indxcc += 2, indxcf += 2, ++indx) { //perform CA correction using colour ratios or colour differences float Ginthfloor = intp(shifthfrac[c], rgb[1][indxfc], rgb[1][indxff]); @@ -1080,18 +1086,18 @@ float* RawImageSource::CA_correct_RT( shiftvfrac[0] /= 2.f; shiftvfrac[2] /= 2.f; - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat zd25v = F2V(0.25f); vfloat onev = F2V(1.f); vfloat zd5v = F2V(0.5f); vfloat epsv = F2V(eps); - #endif +#endif for (int rr = 8; rr < rr1 - 8; rr++) { int cc = 8 + (FC(rr, 2) & 1); int c = FC(rr, cc); int GRBdir0 = GRBdir[0][c]; int GRBdir1 = GRBdir[1][c]; - #ifdef __SSE2__ +#ifdef __SSE2__ vfloat shifthfracc = F2V(shifthfrac[c]); vfloat shiftvfracc = F2V(shiftvfrac[c]); for (int indx = rr * ts + cc; cc < cc1 - 14; cc += 8, indx += 8) { @@ -1124,7 +1130,7 @@ float* RawImageSource::CA_correct_RT( RBint = vself(vmaskf_lt(grbdiffold * grbdiffint, ZEROV), rinv - zd5v * (grbdiffold + grbdiffint), RBint); STVFU(rgb[c][indx >> 1], RBint); } - #endif +#endif for (int c = FC(rr, cc), indx = rr * ts + cc; cc < cc1 - 8; cc += 2, indx += 2) { float grbdiffold = rgb[1][indx] - rgb[c][indx >> 1]; @@ -1172,11 +1178,11 @@ float* RawImageSource::CA_correct_RT( int cc = border + (FC(rr, 2) & 1); int indx = (row * width + cc + left) >> 1; int indx1 = (rr * ts + cc) >> 1; - #ifdef __SSE2__ +#ifdef __SSE2__ for (; indx < (row * width + cc1 - border - 7 + left) >> 1; indx+=4, indx1 += 4) { STVFU(RawDataTmp[indx], c65535v * LVFU(rgb[c][indx1])); } - #endif +#endif for (; indx < (row * width + cc1 - border + left) >> 1; indx++, indx1++) { RawDataTmp[indx] = 65535.f * rgb[c][indx1]; } @@ -1201,17 +1207,17 @@ float* RawImageSource::CA_correct_RT( } #pragma omp barrier - // copy temporary image matrix back to image matrix + // copy temporary image matrix back to image matrix #pragma omp for for(int row = 0; row < height; row++) { int col = FC(row, 0) & 1; int indx = (row * width + col) >> 1; - #ifdef __SSE2__ +#ifdef __SSE2__ for(; col < width - 7; col += 8, indx += 4) { STC2VFU(rawData[row][col], LVFU(RawDataTmp[indx])); } - #endif +#endif for(; col < width - (W & 1); col += 2, indx++) { rawData[row][col] = RawDataTmp[indx]; } @@ -1244,29 +1250,42 @@ float* RawImageSource::CA_correct_RT( if (avoidColourshift) { array2D redFactor((W+1)/2, (H+1)/2); array2D blueFactor((W+1)/2, (H+1)/2); + array2D* nonGreen; - for(int i = 0; i < H; ++i) { - for(int j = 0; j < W; ++j) { - float factor = (rawData[i][j] * oldraw[i][j] == 0.0 ? 1.0 : oldraw[i][j] / rawData[i][j]); - if(FC(i,j) == 0) { - redFactor[i/2][j/2] = factor; - } else if(FC(i,j) == 2) { - blueFactor[i/2][j/2] = factor; - } - } - } - gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0); - gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0); - - for(int i = 0; i < H; ++i) { - for(int j = 0; j < W; ++j) { - if(FC(i,j) == 0) { - rawData[i][j] *= redFactor[i/2][j/2]; - } else if(FC(i,j) == 2) { - rawData[i][j] *= blueFactor[i/2][j/2]; + #pragma omp parallel + { + #pragma omp for + for(int i = 0; i < H; ++i) { + int firstCol = FC(i, 0) & 1; + int colour = FC(i, firstCol); + nonGreen = colour == 0 ? &redFactor : &blueFactor; + int j = firstCol; + for(; j < W - 1; j += 2) { + (*nonGreen)[i/2][j/2] = (rawData[i][j] * (*oldraw)[i][j / 2] == 0.0 ? 1.0 : (*oldraw)[i][j / 2] / rawData[i][j]); + } + if (j < W) { + (*nonGreen)[i/2][j/2] = (rawData[i][j] * (*oldraw)[i][j / 2] == 0.0 ? 1.0 : (*oldraw)[i][j / 2] / rawData[i][j]); + } + } + + gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0); + gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0); + + #pragma omp for + for(int i = 0; i < H; ++i) { + int firstCol = FC(i, 0) & 1; + int colour = FC(i, firstCol); + nonGreen = colour == 0 ? &redFactor : &blueFactor; + int j = firstCol; + for(; j < W - 1; j += 2) { + rawData[i][j] *= (*nonGreen)[i/2][j/2]; + } + if (j < W) { + rawData[i][j] *= (*nonGreen)[i/2][j/2]; } } } + delete oldraw; } if(plistener) { From fac0e8ee789a9c7852bc2e869f217c2f96712919 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 6 Sep 2018 17:59:08 +0200 Subject: [PATCH 12/53] raw ca correction: fix blob artifacts when avoid colourshift is enabled, #4777 --- rtengine/CA_correct_RT.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index b6c4b0375..be85fff47 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -1252,6 +1252,12 @@ float* RawImageSource::CA_correct_RT( array2D blueFactor((W+1)/2, (H+1)/2); array2D* nonGreen; + for(int i = 0; i < (H+1)/2; ++i) { + for(int j = 0; j < (W+1)/2; ++j) { + redFactor[i][j] = blueFactor[i][j] = 1.f; + } + } + #pragma omp parallel { #pragma omp for @@ -1261,10 +1267,10 @@ float* RawImageSource::CA_correct_RT( nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; for(; j < W - 1; j += 2) { - (*nonGreen)[i/2][j/2] = (rawData[i][j] * (*oldraw)[i][j / 2] == 0.0 ? 1.0 : (*oldraw)[i][j / 2] / rawData[i][j]); + (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 1.5f); } if (j < W) { - (*nonGreen)[i/2][j/2] = (rawData[i][j] * (*oldraw)[i][j / 2] == 0.0 ? 1.0 : (*oldraw)[i][j / 2] / rawData[i][j]); + (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 1.5f); } } From c9d89c9b1b4a497b9a5769ab998c79d43af4654a Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 6 Sep 2018 19:31:01 +0200 Subject: [PATCH 13/53] raw ca correction. Be less restrictive during test phase --- rtengine/CA_correct_RT.cc | 4 ++-- rtgui/rawcacorrection.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index be85fff47..7abd9bfcc 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -1267,10 +1267,10 @@ float* RawImageSource::CA_correct_RT( nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; for(; j < W - 1; j += 2) { - (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 1.5f); + (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); } if (j < W) { - (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 1.5f); + (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); } } diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 9a1001f74..fd69ab063 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -38,7 +38,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage)); caAutocorrect->setCheckBoxListener (this); - caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 5, 1, 2)); + caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 10, 1, 2)); caAutoiterations->setAdjusterListener (this); if (caAutoiterations->delay < options.adjusterMaxDelay) { From 198989d5983beccc58da4ae4924149130898dcac Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 7 Sep 2018 13:50:42 +0200 Subject: [PATCH 14/53] raw ca correction/avoid colour shift: fix colour cast when (height % 2) == 1, #4777 --- rtengine/CA_correct_RT.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 7abd9bfcc..3d5f806de 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -1274,6 +1274,20 @@ float* RawImageSource::CA_correct_RT( } } + #pragma omp single + { + if (H % 2) { + int firstCol = FC(H - 1, 0) & 1; + int colour = FC(H - 1, firstCol); + nonGreen = colour == 0 ? &redFactor : &blueFactor; + for (int j = 0; j < (W + 1) / 2; ++j) { + (*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j]; + } + } + } + + #pragma omp barrier + gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0); gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0); From c7ab5ff288dcd33dff9563ba98c11e297681f98e Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 7 Sep 2018 16:20:30 +0200 Subject: [PATCH 15/53] raw ca correction/avoid colour shift: further bugfixes, #4777 --- rtengine/CA_correct_RT.cc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 3d5f806de..322bf23f7 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -1214,11 +1214,11 @@ float* RawImageSource::CA_correct_RT( int col = FC(row, 0) & 1; int indx = (row * width + col) >> 1; #ifdef __SSE2__ - for(; col < width - 7; col += 8, indx += 4) { + for(; col < width - 7 - (3 * (W & 1)); col += 8, indx += 4) { STC2VFU(rawData[row][col], LVFU(RawDataTmp[indx])); } #endif - for(; col < width - (W & 1); col += 2, indx++) { + for(; col < width - (3 * (W & 1)); col += 2, indx++) { rawData[row][col] = RawDataTmp[indx]; } } @@ -1250,13 +1250,6 @@ float* RawImageSource::CA_correct_RT( if (avoidColourshift) { array2D redFactor((W+1)/2, (H+1)/2); array2D blueFactor((W+1)/2, (H+1)/2); - array2D* nonGreen; - - for(int i = 0; i < (H+1)/2; ++i) { - for(int j = 0; j < (W+1)/2; ++j) { - redFactor[i][j] = blueFactor[i][j] = 1.f; - } - } #pragma omp parallel { @@ -1264,7 +1257,7 @@ float* RawImageSource::CA_correct_RT( for(int i = 0; i < H; ++i) { int firstCol = FC(i, 0) & 1; int colour = FC(i, firstCol); - nonGreen = colour == 0 ? &redFactor : &blueFactor; + array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; for(; j < W - 1; j += 2) { (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); @@ -1279,11 +1272,21 @@ float* RawImageSource::CA_correct_RT( if (H % 2) { int firstCol = FC(H - 1, 0) & 1; int colour = FC(H - 1, firstCol); - nonGreen = colour == 0 ? &redFactor : &blueFactor; + array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; for (int j = 0; j < (W + 1) / 2; ++j) { (*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j]; } } + + if (W % 2) { + int ngRow = 1 - (FC(0, 0) & 1); + int ngCol = FC(ngRow, 0) & 1; + int colour = FC(ngRow, ngCol); + array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; + for (int i = 0; i < (H + 1) / 2; ++i) { + (*nonGreen)[i][(W + 1) / 2 - 1] = redFactor[i][(W + 1) / 2 - 2]; + } + } } #pragma omp barrier @@ -1295,7 +1298,7 @@ float* RawImageSource::CA_correct_RT( for(int i = 0; i < H; ++i) { int firstCol = FC(i, 0) & 1; int colour = FC(i, firstCol); - nonGreen = colour == 0 ? &redFactor : &blueFactor; + array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; for(; j < W - 1; j += 2) { rawData[i][j] *= (*nonGreen)[i/2][j/2]; From 910b5165539fe63a8f33e386e5c91252ccd73110 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 7 Sep 2018 17:56:55 +0200 Subject: [PATCH 16/53] raw ca correction/avoid colour shift: bugfix, #4777 --- rtengine/CA_correct_RT.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 322bf23f7..90fb3932b 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -1270,9 +1270,9 @@ float* RawImageSource::CA_correct_RT( #pragma omp single { if (H % 2) { - int firstCol = FC(H - 1, 0) & 1; - int colour = FC(H - 1, firstCol); - array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; + int firstCol = FC(0, 0) & 1; + int colour = FC(0, firstCol); + array2D* nonGreen = colour == 0 ? &blueFactor : &redFactor; for (int j = 0; j < (W + 1) / 2; ++j) { (*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j]; } From becfc1a9fdf38a985a7141d12a4221cde2825ac8 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 7 Sep 2018 18:46:39 +0200 Subject: [PATCH 17/53] raw ca correction: smooth progress bar also for > 1 iterations, #4774 --- rtengine/CA_correct_RT.cc | 43 ++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 90fb3932b..7dd140328 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -146,6 +146,7 @@ float* RawImageSource::CA_correct_RT( } array2D* oldraw = nullptr; if (avoidColourshift) { + // copy raw values before ca correction oldraw = new array2D((W + 1) / 2, H); #pragma omp parallel for for(int i = 0; i < H; ++i) { @@ -646,12 +647,8 @@ float* RawImageSource::CA_correct_RT( if(progresscounter % 8 == 0) #pragma omp critical (cadetectpass1) { - progress += (double)(8.0 * (ts - border2) * (ts - border2)) / (2 * height * width); - - if (progress > 1.0) { - progress = 1.0; - } - + progress += 4.0 * SQR(ts - border2) / (iterations * height * width); + progress = std::min(progress, 1.0); plistener->setProgress(progress); } } @@ -1194,12 +1191,8 @@ float* RawImageSource::CA_correct_RT( if(progresscounter % 8 == 0) #pragma omp critical (cacorrect) { - progress += (double)(8.0 * (ts - border2) * (ts - border2)) / (2 * height * width); - - if (progress > 1.0) { - progress = 1.0; - } - + progress += 4.0 * SQR(ts - border2) / (iterations * height * width); + progress = std::min(progress, 1.0); plistener->setProgress(progress); } } @@ -1255,9 +1248,9 @@ float* RawImageSource::CA_correct_RT( { #pragma omp for for(int i = 0; i < H; ++i) { - int firstCol = FC(i, 0) & 1; - int colour = FC(i, firstCol); - array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; + const int firstCol = FC(i, 0) & 1; + const int colour = FC(i, firstCol); + const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; for(; j < W - 1; j += 2) { (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); @@ -1270,19 +1263,19 @@ float* RawImageSource::CA_correct_RT( #pragma omp single { if (H % 2) { - int firstCol = FC(0, 0) & 1; - int colour = FC(0, firstCol); - array2D* nonGreen = colour == 0 ? &blueFactor : &redFactor; + const int firstCol = FC(0, 0) & 1; + const int colour = FC(0, firstCol); + const array2D* nonGreen = colour == 0 ? &blueFactor : &redFactor; for (int j = 0; j < (W + 1) / 2; ++j) { (*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j]; } } if (W % 2) { - int ngRow = 1 - (FC(0, 0) & 1); - int ngCol = FC(ngRow, 0) & 1; - int colour = FC(ngRow, ngCol); - array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; + const int ngRow = 1 - (FC(0, 0) & 1); + const int ngCol = FC(ngRow, 0) & 1; + const int colour = FC(ngRow, ngCol); + const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; for (int i = 0; i < (H + 1) / 2; ++i) { (*nonGreen)[i][(W + 1) / 2 - 1] = redFactor[i][(W + 1) / 2 - 2]; } @@ -1296,9 +1289,9 @@ float* RawImageSource::CA_correct_RT( #pragma omp for for(int i = 0; i < H; ++i) { - int firstCol = FC(i, 0) & 1; - int colour = FC(i, firstCol); - array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; + const int firstCol = FC(i, 0) & 1; + const int colour = FC(i, firstCol); + const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; for(; j < W - 1; j += 2) { rawData[i][j] *= (*nonGreen)[i/2][j/2]; From 09796f06942d3a08b0b940656b599fae6ee3c67e Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 8 Sep 2018 00:52:39 +0200 Subject: [PATCH 18/53] raw ca correction: beautified code --- rtengine/CA_correct_RT.cc | 287 +++++++++++++++++++------------------ rtengine/rawimagesource.cc | 8 +- rtengine/rawimagesource.h | 1 - 3 files changed, 152 insertions(+), 144 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 7dd140328..ef1e534c0 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -1,11 +1,11 @@ //////////////////////////////////////////////////////////////// // -// Chromatic Aberration Auto-correction +// Chromatic Aberration correction on raw bayer cfa data // -// copyright (c) 2008-2010 Emil Martinec +// copyright (c) 2008-2010 Emil Martinec +// copyright (c) for improvements (speedups, iterated correction and avoid colour shift) 2018 Ingo Weyrich // -// -// code dated: November 26, 2010 +// code dated: September 8, 2018 // // CA_correct_RT.cc is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -14,14 +14,13 @@ // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //////////////////////////////////////////////////////////////// -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #include "rtengine.h" #include "rawimagesource.h" @@ -51,22 +50,22 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) int i, j, k; - for(k = 0; k < (nDim - 1); k++) { // base row of matrix + for (k = 0; k < (nDim - 1); k++) { // base row of matrix // search of line with max element - double fMaxElem = fabs( pfMatr[k * nDim + k] ); + double fMaxElem = fabs(pfMatr[k * nDim + k]); int m = k; for (i = k + 1; i < nDim; i++) { - if(fMaxElem < fabs(pfMatr[i * nDim + k]) ) { + if (fMaxElem < fabs(pfMatr[i * nDim + k])) { fMaxElem = pfMatr[i * nDim + k]; m = i; } } // permutation of base line (index k) and max element line(index m) - if(m != k) { - for(i = k; i < nDim; i++) { - fAcc = pfMatr[k * nDim + i]; + if (m != k) { + for (i = k; i < nDim; i++) { + fAcc = pfMatr[k * nDim + i]; pfMatr[k * nDim + i] = pfMatr[m * nDim + i]; pfMatr[m * nDim + i] = fAcc; } @@ -76,16 +75,16 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) pfVect[m] = fAcc; } - if( pfMatr[k * nDim + k] == 0.) { + if (pfMatr[k * nDim + k] == 0.) { //linear system has no solution return false; // needs improvement !!! } // triangulation of matrix with coefficients - for(j = (k + 1); j < nDim; j++) { // current row of matrix + for (j = (k + 1); j < nDim; j++) { // current row of matrix fAcc = - pfMatr[j * nDim + k] / pfMatr[k * nDim + k]; - for(i = k; i < nDim; i++) { + for (i = k; i < nDim; i++) { pfMatr[j * nDim + i] = pfMatr[j * nDim + i] + fAcc * pfMatr[k * nDim + i]; } @@ -93,10 +92,10 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) } } - for(k = (nDim - 1); k >= 0; k--) { + for (k = (nDim - 1); k >= 0; k--) { pfSolution[k] = pfVect[k]; - for(i = (k + 1); i < nDim; i++) { + for (i = (k + 1); i < nDim; i++) { pfSolution[k] -= (pfMatr[k * nDim + i] * pfSolution[i]); } @@ -106,8 +105,6 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) return true; } //end of linear equation solver -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - } using namespace std; @@ -118,7 +115,6 @@ float* RawImageSource::CA_correct_RT( size_t autoIterations, double cared, double cablue, - double caautostrength, bool avoidColourshift, const array2D &rawData, double* fitParamsTransfer, @@ -132,29 +128,30 @@ float* RawImageSource::CA_correct_RT( // multithreaded and vectorized by Ingo Weyrich constexpr int ts = 128; constexpr int tsh = ts / 2; - //shifts to location of vertical and diagonal neighbors + //shifts to location of vertical and diagonal neighbours constexpr int v1 = ts, v2 = 2 * ts, v3 = 3 * ts, v4 = 4 * ts; //, p1=-ts+1, p2=-2*ts+2, p3=-3*ts+3, m1=ts+1, m2=2*ts+2, m3=3*ts+3; // Test for RGB cfa - for(int i = 0; i < 2; i++) { - for(int j = 0; j < 2; j++) { - if(FC(i, j) == 3) { - printf("CA correction supports only RGB Colour filter arrays\n"); + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 2; j++) { + if (FC(i, j) == 3) { + std::cout << "CA correction supports only RGB Colour filter arrays" << std::endl; return buffer; } } } + array2D* oldraw = nullptr; if (avoidColourshift) { // copy raw values before ca correction oldraw = new array2D((W + 1) / 2, H); #pragma omp parallel for - for(int i = 0; i < H; ++i) { + for (int i = 0; i < H; ++i) { int j = FC(i, 0) & 1; - for(; j < W - 1; j += 2) { + for (; j < W - 1; j += 2) { (*oldraw)[i][j / 2] = rawData[i][j]; } - if(j < W) { + if (j < W) { (*oldraw)[i][j / 2] = rawData[i][j]; } } @@ -162,7 +159,7 @@ float* RawImageSource::CA_correct_RT( double progress = 0.0; - if(plistener) { + if (plistener) { plistener->setProgress (progress); } @@ -180,11 +177,11 @@ float* RawImageSource::CA_correct_RT( if (!buffer) { buffer = static_cast(malloc ((height * width + vblsz * hblsz * (2 * 2 + 1)) * sizeof(float))); } - float *Gtmp = buffer; - float *RawDataTmp = buffer + (height * width) / 2; + float* Gtmp = buffer; + float* RawDataTmp = buffer + (height * width) / 2; //block CA shift values and weight assigned to block - float *const blockwt = buffer + (height * width); + float* const blockwt = buffer + (height * width); memset(blockwt, 0, vblsz * hblsz * (2 * 2 + 1) * sizeof(float)); float (*blockshifts)[2][2] = (float (*)[2][2])(blockwt + vblsz * hblsz); @@ -198,12 +195,12 @@ float* RawImageSource::CA_correct_RT( : 1; const bool fitParamsSet = fitParamsTransfer && fitParamsIn && iterations < 2; - if(autoCA && fitParamsSet) { + if (autoCA && fitParamsSet) { // use stored parameters int index = 0; - for(int c = 0; c < 2; ++c) { - for(int d = 0; d < 2; ++d) { - for(int e = 0; e < 16; ++e) { + for (int c = 0; c < 2; ++c) { + for (int d = 0; d < 2; ++d) { + for (int e = 0; e < 16; ++e) { fitparams[c][d][e] = fitParamsTransfer[index++]; } } @@ -232,36 +229,37 @@ float* RawImageSource::CA_correct_RT( //polynomial fit coefficients //residual CA shift amount within a plaquette - float shifthfrac[3], shiftvfrac[3]; + float shifthfrac[3], shiftvfrac[3]; // assign working space constexpr int buffersize = sizeof(float) * ts * ts + 8 * sizeof(float) * ts * tsh + 8 * 64 + 63; constexpr int buffersizePassTwo = sizeof(float) * ts * ts + 4 * sizeof(float) * ts * tsh + 4 * 64 + 63; char * const bufferThr = (char *) malloc((autoCA && !fitParamsSet) ? buffersize : buffersizePassTwo); - char * const data = (char*)( ( uintptr_t(bufferThr) + uintptr_t(63)) / 64 * 64); + char * const data = (char*)((uintptr_t(bufferThr) + uintptr_t(63)) / 64 * 64); // shift the beginning of all arrays but the first by 64 bytes to avoid cache miss conflicts on CPUs which have <= 4-way associative L1-Cache //rgb data in a tile float* rgb[3]; - rgb[0] = (float (*)) data; - rgb[1] = (float (*)) (data + sizeof(float) * ts * tsh + 1 * 64); - rgb[2] = (float (*)) (data + sizeof(float) * (ts * ts + ts * tsh) + 2 * 64); + rgb[0] = (float*) data; + rgb[1] = (float*) (data + sizeof(float) * ts * tsh + 1 * 64); + rgb[2] = (float*) (data + sizeof(float) * (ts * ts + ts * tsh) + 2 * 64); if (autoCA && !fitParamsSet) { + constexpr float caAutostrength = 8.f; //high pass filter for R/B in vertical direction - float *rbhpfh = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); + float* rbhpfh = (float*) (data + 2 * sizeof(float) * ts * ts + 3 * 64); //high pass filter for R/B in horizontal direction - float *rbhpfv = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); + float* rbhpfv = (float*) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); //low pass filter for R/B in horizontal direction - float *rblpfh = (float (*)) (data + 3 * sizeof(float) * ts * ts + 5 * 64); + float* rblpfh = (float*) (data + 3 * sizeof(float) * ts * ts + 5 * 64); //low pass filter for R/B in vertical direction - float *rblpfv = (float (*)) (data + 3 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 6 * 64); + float* rblpfv = (float*) (data + 3 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 6 * 64); //low pass filter for colour differences in horizontal direction - float *grblpfh = (float (*)) (data + 4 * sizeof(float) * ts * ts + 7 * 64); + float* grblpfh = (float*) (data + 4 * sizeof(float) * ts * ts + 7 * 64); //low pass filter for colour differences in vertical direction - float *grblpfv = (float (*)) (data + 4 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 8 * 64); + float* grblpfv = (float*) (data + 4 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 8 * 64); // Main algorithm: Tile loop calculating correction parameters per tile //local quadratic fit to shift data within a tile @@ -270,14 +268,16 @@ float* RawImageSource::CA_correct_RT( float CAshift[2][2]; //per thread data for evaluation of block CA shift variance - float blockavethr[2][2] = {{0, 0}, {0, 0}}, blocksqavethr[2][2] = {{0, 0}, {0, 0}}, blockdenomthr[2][2] = {{0, 0}, {0, 0}}; + float blockavethr[2][2] = {}; + float blocksqavethr[2][2] = {}; + float blockdenomthr[2][2] = {}; #pragma omp for collapse(2) schedule(dynamic) nowait - for (int top = -border ; top < height; top += ts - border2) + for (int top = -border ; top < height; top += ts - border2) { for (int left = -border; left < width - (W & 1); left += ts - border2) { memset(bufferThr, 0, buffersize); - const int vblock = ((top + border) / (ts - border2)) + 1; - const int hblock = ((left + border) / (ts - border2)) + 1; + const int vblock = (top + border) / (ts - border2) + 1; + const int hblock = (left + border) / (ts - border2) + 1; const int bottom = min(top + ts, height + border); const int right = min(left + ts, width - (W & 1) + border); const int rr1 = bottom - top; @@ -301,7 +301,7 @@ float* RawImageSource::CA_correct_RT( int col = cc + left; #ifdef __SSE2__ int c0 = FC(rr, cc); - if(c0 == 1) { + if (c0 == 1) { rgb[c0][rr * ts + cc] = rawData[row][col] / 65535.f; cc++; col++; @@ -311,7 +311,7 @@ float* RawImageSource::CA_correct_RT( for (; cc < ccmax - 7; cc+=8, col+=8, indx1 += 8) { vfloat val1 = LVFU(rawData[row][col]) / c65535v; vfloat val2 = LVFU(rawData[row][col + 4]) / c65535v; - vfloat nonGreenv = _mm_shuffle_ps(val1,val2,_MM_SHUFFLE( 2,0,2,0 )); + vfloat nonGreenv = _mm_shuffle_ps(val1,val2,_MM_SHUFFLE(2,0,2,0)); STVFU(rgb[c0][indx1 >> 1], nonGreenv); STVFU(rgb[1][indx1], val1); STVFU(rgb[1][indx1 + 4], val2); @@ -324,78 +324,83 @@ float* RawImageSource::CA_correct_RT( } } - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //fill borders if (rrmin > 0) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = ccmin; cc < ccmax; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)]; } + } } if (rrmax < rr1) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = ccmin; cc < ccmax; cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][left + cc] / 65535.f; } + } } if (ccmin > 0) { - for (int rr = rrmin; rr < rrmax; rr++) + for (int rr = rrmin; rr < rrmax; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)]; } + } } if (ccmax < cc1) { - for (int rr = rrmin; rr < rrmax; rr++) + for (int rr = rrmin; rr < rrmax; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(top + rr)][(width - cc - 2)] / 65535.f; } + } } //also, fill the image corners if (rrmin > 0 && ccmin > 0) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rawData[border2 - rr][border2 - cc] / 65535.f; } + } } if (rrmax < rr1 && ccmax < cc1) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(width - cc - 2)] / 65535.f; } + } } if (rrmin > 0 && ccmax < cc1) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(border2 - rr)][(width - cc - 2)] / 65535.f; } + } } if (rrmax < rr1 && ccmin > 0) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(border2 - cc)] / 65535.f; } + } } //end of border fill - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //end of initialization - #ifdef __SSE2__ vfloat onev = F2V(1.f); vfloat epsv = F2V(eps); @@ -441,17 +446,16 @@ float* RawImageSource::CA_correct_RT( int col = max(left + 3, 0) + offset; int indx = rr * ts + 3 - (left < 0 ? (left+3) : 0) + offset; #ifdef __SSE2__ - for(; col < min(cc1 + left - 3, width) - 7; col+=8, indx+=8) { + for (; col < min(cc1 + left - 3, width) - 7; col+=8, indx+=8) { STVFU(Gtmp[(row * width + col) >> 1], LC2VFU(rgb[1][indx])); } #endif - for(; col < min(cc1 + left - 3, width); col+=2, indx+=2) { + for (; col < min(cc1 + left - 3, width); col+=2, indx+=2) { Gtmp[(row * width + col) >> 1] = rgb[1][indx]; } } - } - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + #ifdef __SSE2__ vfloat zd25v = F2V(0.25f); #endif @@ -486,7 +490,6 @@ float* RawImageSource::CA_correct_RT( STVFU(grblpfv[indx >> 1], zd25v * (glpfvv + (rgbcv + LVFU(rgb[c][(indx + v2) >> 1]) + LVFU(rgb[c][(indx - v2) >> 1])))); STVFU(grblpfh[indx >> 1], zd25v * (glpfhv + (rgbcv + LVFU(rgb[c][(indx + 2) >> 1]) + LVFU(rgb[c][(indx - 2) >> 1])))); } - #endif for (; cc < cc1 - 4; cc += 2, indx += 2) { rbhpfv[indx >> 1] = fabsf(fabsf((rgb[1][indx] - rgb[c][indx >> 1]) - (rgb[1][indx + v4] - rgb[c][(indx + v4) >> 1])) + @@ -534,7 +537,6 @@ float* RawImageSource::CA_correct_RT( vfloat coeff11v = ZEROV; vfloat coeff12v = ZEROV; for (; cc < cc1 - 14; cc += 8, indx += 8) { - //in linear interpolation, colour differences are a quadratic function of interpolation position; //solve for the interpolation position that minimizes colour difference variance over the tile @@ -569,7 +571,6 @@ float* RawImageSource::CA_correct_RT( #endif for (; cc < cc1 - 8; cc += 2, indx += 2) { - //in linear interpolation, colour differences are a quadratic function of interpolation position; //solve for the interpolation position that minimizes colour difference variance over the tile @@ -577,7 +578,7 @@ float* RawImageSource::CA_correct_RT( float gdiff = (rgb[1][indx + ts] - rgb[1][indx - ts]) + 0.3f * (rgb[1][indx + ts + 1] - rgb[1][indx - ts + 1] + rgb[1][indx + ts - 1] - rgb[1][indx - ts - 1]); float deltgrb = (rgb[c][indx >> 1] - rgb[1][indx]); - float gradwt = (rbhpfv[indx >> 1] + 0.5f * (rbhpfv[(indx >> 1) + 1] + rbhpfv[(indx >> 1) - 1]) ) * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) / (eps + 0.1f * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) + rblpfv[(indx >> 1) - v1] + rblpfv[(indx >> 1) + v1]); + float gradwt = (rbhpfv[indx >> 1] + 0.5f * (rbhpfv[(indx >> 1) + 1] + rbhpfv[(indx >> 1) - 1])) * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) / (eps + 0.1f * (grblpfv[(indx >> 1) - v1] + grblpfv[(indx >> 1) + v1]) + rblpfv[(indx >> 1) - v1] + rblpfv[(indx >> 1) + v1]); coeff[0][0][c>>1] += gradwt * deltgrb * deltgrb; coeff[0][1][c>>1] += gradwt * gdiff * deltgrb; @@ -586,7 +587,7 @@ float* RawImageSource::CA_correct_RT( //horizontal gdiff = (rgb[1][indx + 1] - rgb[1][indx - 1]) + 0.3f * (rgb[1][indx + 1 + ts] - rgb[1][indx - 1 + ts] + rgb[1][indx + 1 - ts] - rgb[1][indx - 1 - ts]); - gradwt = (rbhpfh[indx >> 1] + 0.5f * (rbhpfh[(indx >> 1) + v1] + rbhpfh[(indx >> 1) - v1]) ) * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) / (eps + 0.1f * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) + rblpfh[(indx >> 1) - 1] + rblpfh[(indx >> 1) + 1]); + gradwt = (rbhpfh[indx >> 1] + 0.5f * (rbhpfh[(indx >> 1) + v1] + rbhpfh[(indx >> 1) - v1])) * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) / (eps + 0.1f * (grblpfh[(indx >> 1) - 1] + grblpfh[(indx >> 1) + 1]) + rblpfh[(indx >> 1) - 1] + rblpfh[(indx >> 1) + 1]); coeff[1][0][c>>1] += gradwt * deltgrb * deltgrb; coeff[1][1][c>>1] += gradwt * gdiff * deltgrb; @@ -603,9 +604,9 @@ float* RawImageSource::CA_correct_RT( for (int k = 0; k < 3; k++) { for (int c = 0; c < 2; c++) { coeff[dir][k][c] *= 0.25f; - if(k == 1) { + if (k == 1) { coeff[dir][k][c] *= 0.3125f; - } else if(k == 2) { + } else if (k == 2) { coeff[dir][k][c] *= SQR(0.3125f); } } @@ -637,33 +638,33 @@ float* RawImageSource::CA_correct_RT( } //evaluate the shifts to the location that minimizes CA within the tile blockshifts[vblock * hblsz + hblock][c][dir] = CAshift[dir][c]; //vert/hor CA shift for R/B - }//vert/hor }//colour - if(plistener) { + if (plistener) { progresscounter++; - if(progresscounter % 8 == 0) + if (progresscounter % 8 == 0) { #pragma omp critical (cadetectpass1) - { - progress += 4.0 * SQR(ts - border2) / (iterations * height * width); - progress = std::min(progress, 1.0); - plistener->setProgress(progress); + { + progress += 4.0 * SQR(ts - border2) / (iterations * height * width); + progress = std::min(progress, 1.0); + plistener->setProgress(progress); + } } } - } - + } //end of diagnostic pass #pragma omp critical (cadetectpass2) { - for (int dir = 0; dir < 2; dir++) + for (int dir = 0; dir < 2; dir++) { for (int c = 0; c < 2; c++) { blockdenom[dir][c] += blockdenomthr[dir][c]; blocksqave[dir][c] += blocksqavethr[dir][c]; blockave[dir][c] += blockavethr[dir][c]; } + } } #pragma omp barrier @@ -675,16 +676,14 @@ float* RawImageSource::CA_correct_RT( blockvar[dir][c] = blocksqave[dir][c] / blockdenom[dir][c] - SQR(blockave[dir][c] / blockdenom[dir][c]); } else { processpasstwo = false; - printf ("blockdenom vanishes \n"); + std::cout << "blockdenom vanishes" << std::endl; break; } } - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //now prepare for CA correction pass //first, fill border blocks of blockshift array - if(processpasstwo) { + if (processpasstwo) { for (int vblock = 1; vblock < vblsz - 1; vblock++) { //left and right sides for (int c = 0; c < 2; c++) { for (int i = 0; i < 2; i++) { @@ -718,7 +717,7 @@ float* RawImageSource::CA_correct_RT( int numblox[2] = {0, 0}; - for (int vblock = 1; vblock < vblsz - 1; vblock++) + for (int vblock = 1; vblock < vblsz - 1; vblock++) { for (int hblock = 1; hblock < hblsz - 1; hblock++) { // block 3x3 median of blockshifts for robustness for (int c = 0; c < 2; c ++) { @@ -739,8 +738,8 @@ float* RawImageSource::CA_correct_RT( bstemp[dir] = median(p); } - //now prepare coefficient matrix; use only data points within caautostrength/2 std devs of zero - if (SQR(bstemp[0]) > caautostrength * blockvar[0][c] || SQR(bstemp[1]) > caautostrength * blockvar[1][c]) { + //now prepare coefficient matrix; use only data points within caAutostrength/2 std devs of zero + if (SQR(bstemp[0]) > caAutostrength * blockvar[0][c] || SQR(bstemp[1]) > caAutostrength * blockvar[1][c]) { continue; } @@ -768,7 +767,7 @@ float* RawImageSource::CA_correct_RT( }//dir }//c }//blocks - + } numblox[1] = min(numblox[0], numblox[1]); //if too few data points, restrict the order of the fit to linear @@ -777,24 +776,23 @@ float* RawImageSource::CA_correct_RT( numpar = 4; if (numblox[1] < 10) { - - printf ("numblox = %d \n", numblox[1]); + std::cout << "numblox = " << numblox[1] << std::endl; processpasstwo = false; } } - if(processpasstwo) - + if (processpasstwo) { //fit parameters to blockshifts - for (int c = 0; c < 2; c++) + for (int c = 0; c < 2; c++) { for (int dir = 0; dir < 2; dir++) { if (!LinEqSolve(numpar, polymat[c][dir], shiftmat[c][dir], fitparams[c][dir])) { - printf("CA correction pass failed -- can't solve linear equations for colour %d direction %d...\n", c, dir); + std::cout << "CA correction pass failed -- can't solve linear equations for colour %d direction " << c << std::endl; processpasstwo = false; } } + } + } } - //fitparams[polyord*i+j] gives the coefficients of (vblock^i hblock^j) in a polynomial fit for i,j<=4 } //end of initialization for CA correction pass @@ -802,13 +800,13 @@ float* RawImageSource::CA_correct_RT( } // Main algorithm: Tile loop - if(processpasstwo) { - float *grbdiff = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); // there is no overlap in buffer usage => share + if (processpasstwo) { + float* grbdiff = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); // there is no overlap in buffer usage => share //green interpolated to optical sample points for R/B - float *gshift = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); // there is no overlap in buffer usage => share + float* gshift = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); // there is no overlap in buffer usage => share #pragma omp for schedule(dynamic) collapse(2) nowait - for (int top = -border; top < height; top += ts - border2) + for (int top = -border; top < height; top += ts - border2) { for (int left = -border; left < width - (W & 1); left += ts - border2) { memset(bufferThr, 0, buffersizePassTwo); float lblockshifts[2][2]; @@ -840,7 +838,7 @@ float* RawImageSource::CA_correct_RT( int indx1 = rr * ts + cc; #ifdef __SSE2__ int c = FC(rr, cc); - if(c & 1) { + if (c & 1) { rgb[1][indx1] = rawData[row][col] / 65535.f; indx++; indx1++; @@ -866,19 +864,20 @@ float* RawImageSource::CA_correct_RT( } } } - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //fill borders if (rrmin > 0) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = ccmin; cc < ccmax; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)]; rgb[1][rr * ts + cc] = rgb[1][(border2 - rr) * ts + cc]; } + } } if (rrmax < rr1) { - for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) { for (int cc = ccmin; cc < ccmax; cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][left + cc]) / 65535.f; @@ -886,19 +885,21 @@ float* RawImageSource::CA_correct_RT( rgb[1][(rrmax + rr)*ts + cc] = Gtmp[((height - rr - 2) * width + left + cc) >> 1]; } } + } } if (ccmin > 0) { - for (int rr = rrmin; rr < rrmax; rr++) + for (int rr = rrmin; rr < rrmax; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)]; rgb[1][rr * ts + cc] = rgb[1][rr * ts + border2 - cc]; } + } } if (ccmax < cc1) { - for (int rr = rrmin; rr < rrmax; rr++) + for (int rr = rrmin; rr < rrmax; rr++) { for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(top + rr)][(width - cc - 2)]) / 65535.f; @@ -906,11 +907,12 @@ float* RawImageSource::CA_correct_RT( rgb[1][rr * ts + ccmax + cc] = Gtmp[((top + rr) * width + (width - cc - 2)) >> 1]; } } + } } //also, fill the image corners if (rrmin > 0 && ccmin > 0) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = (rawData[border2 - rr][border2 - cc]) / 65535.f; @@ -918,10 +920,11 @@ float* RawImageSource::CA_correct_RT( rgb[1][rr * ts + cc] = Gtmp[((border2 - rr) * width + border2 - cc) >> 1]; } } + } } if (rrmax < rr1 && ccmax < cc1) { - for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) { for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(width - cc - 2)]) / 65535.f; @@ -929,10 +932,11 @@ float* RawImageSource::CA_correct_RT( rgb[1][(rrmax + rr)*ts + ccmax + cc] = Gtmp[((height - rr - 2) * width + (width - cc - 2)) >> 1]; } } + } } if (rrmin > 0 && ccmax < cc1) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < border; rr++) { for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(border2 - rr)][(width - cc - 2)]) / 65535.f; @@ -940,10 +944,11 @@ float* RawImageSource::CA_correct_RT( rgb[1][rr * ts + ccmax + cc] = Gtmp[((border2 - rr) * width + (width - cc - 2)) >> 1]; } } + } } if (rrmax < rr1 && ccmin > 0) { - for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) { for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(border2 - cc)]) / 65535.f; @@ -951,17 +956,16 @@ float* RawImageSource::CA_correct_RT( rgb[1][(rrmax + rr)*ts + cc] = Gtmp[((height - rr - 2) * width + (border2 - cc)) >> 1]; } } + } } //end of border fill - // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (!autoCA || fitParamsIn) { #ifdef __SSE2__ const vfloat onev = F2V(1.f); const vfloat epsv = F2V(eps); #endif - //manual CA correction; use red/blue slider values to set CA shift parameters for (int rr = 3; rr < rr1 - 3; rr++) { int cc = 3 + FC(rr, 1), c = FC(rr,cc), indx = rr * ts + cc; @@ -991,6 +995,7 @@ float* RawImageSource::CA_correct_RT( } } } + if (!autoCA) { float hfrac = -((float)(hblock - 0.5) / (hblsz - 2) - 0.5); float vfrac = -((float)(vblock - 0.5) / (vblsz - 2) - 0.5) * height / width; @@ -1035,7 +1040,6 @@ float* RawImageSource::CA_correct_RT( GRBdir[0][c] = lblockshifts[c>>1][0] > 0 ? 2 : -2; GRBdir[1][c] = lblockshifts[c>>1][1] > 0 ? 2 : -2; - } @@ -1109,7 +1113,7 @@ float* RawImageSource::CA_correct_RT( vfloat rinv = LC2VFU(rgb[1][indx]); vfloat RBint = rinv - grbdiffint; vmask cmask = vmaskf_ge(vabsf(RBint - cinv), zd25v * (RBint + cinv)); - if(_mm_movemask_ps((vfloat)cmask)) { + if (_mm_movemask_ps((vfloat)cmask)) { // if for any of the 4 pixels the condition is true, do the math for all 4 pixels and mask the unused out at the end //gradient weights using difference from G at CA shift points and G at grid points vfloat p0 = onev / (epsv + vabsf(rinv - LVFU(gshift[indx >> 1]))); @@ -1141,7 +1145,7 @@ float* RawImageSource::CA_correct_RT( float RBint = rgb[1][indx] - grbdiffint; if (fabsf(RBint - rgb[c][indx >> 1]) < 0.25f * (RBint + rgb[c][indx >> 1])) { - if (fabsf(grbdiffold) > fabsf(grbdiffint) ) { + if (fabsf(grbdiffold) > fabsf(grbdiffint)) { rgb[c][indx >> 1] = RBint; } } else { @@ -1156,7 +1160,7 @@ float* RawImageSource::CA_correct_RT( p2 * grbdiff[((rr - GRBdir0) * ts + cc) >> 1] + p3 * grbdiff[((rr - GRBdir0) * ts + cc - GRBdir1) >> 1]) / (p0 + p1 + p2 + p3) ; //now determine R/B at grid points using interpolated colour differences and interpolated G value at grid point - if (fabsf(grbdiffold) > fabsf(grbdiffint) ) { + if (fabsf(grbdiffold) > fabsf(grbdiffint)) { rgb[c][indx >> 1] = rgb[1][indx] - grbdiffint; } } @@ -1185,10 +1189,10 @@ float* RawImageSource::CA_correct_RT( } } - if(plistener) { + if (plistener) { progresscounter++; - if(progresscounter % 8 == 0) + if (progresscounter % 8 == 0) #pragma omp critical (cacorrect) { progress += 4.0 * SQR(ts - border2) / (iterations * height * width); @@ -1196,63 +1200,66 @@ float* RawImageSource::CA_correct_RT( plistener->setProgress(progress); } } - } + } #pragma omp barrier // copy temporary image matrix back to image matrix #pragma omp for - for(int row = 0; row < height; row++) { + for (int row = 0; row < height; row++) { int col = FC(row, 0) & 1; int indx = (row * width + col) >> 1; #ifdef __SSE2__ - for(; col < width - 7 - (3 * (W & 1)); col += 8, indx += 4) { + for (; col < width - 7 - (3 * (W & 1)); col += 8, indx += 4) { STC2VFU(rawData[row][col], LVFU(RawDataTmp[indx])); } #endif - for(; col < width - (3 * (W & 1)); col += 2, indx++) { + for (; col < width - (3 * (W & 1)); col += 2, indx++) { rawData[row][col] = RawDataTmp[indx]; } } } - // clean up free(bufferThr); } } - if(autoCA && fitParamsTransfer && fitParamsOut) { + if (autoCA && fitParamsTransfer && fitParamsOut) { // store calculated parameters int index = 0; - for(int c = 0; c < 2; ++c) { - for(int d = 0; d < 2; ++d) { - for(int e = 0; e < 16; ++e) { + for (int c = 0; c < 2; ++c) { + for (int d = 0; d < 2; ++d) { + for (int e = 0; e < 16; ++e) { fitParamsTransfer[index++] = fitparams[c][d][e]; } } } } - if(freeBuffer) { + if (freeBuffer) { free(buffer); buffer = nullptr; } if (avoidColourshift) { + // to avoid or at least reduce the colour shift caused by raw ca correction we compute the per pixel difference factors + // of red and blue channel and apply a gaussian blur on them. + // Then we apply the resulting factors per pixel on the result of raw ca correction + array2D redFactor((W+1)/2, (H+1)/2); array2D blueFactor((W+1)/2, (H+1)/2); #pragma omp parallel { #pragma omp for - for(int i = 0; i < H; ++i) { + for (int i = 0; i < H; ++i) { const int firstCol = FC(i, 0) & 1; const int colour = FC(i, firstCol); const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; - for(; j < W - 1; j += 2) { + for (; j < W - 1; j += 2) { (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); } if (j < W) { @@ -1263,6 +1270,7 @@ float* RawImageSource::CA_correct_RT( #pragma omp single { if (H % 2) { + // odd height => factors for one one channel are not set in last row => use values of preceding row const int firstCol = FC(0, 0) & 1; const int colour = FC(0, firstCol); const array2D* nonGreen = colour == 0 ? &blueFactor : &redFactor; @@ -1272,6 +1280,7 @@ float* RawImageSource::CA_correct_RT( } if (W % 2) { + // odd width => factors for one one channel are not set in last column => use value of preceding column const int ngRow = 1 - (FC(0, 0) & 1); const int ngCol = FC(ngRow, 0) & 1; const int colour = FC(ngRow, ngCol); @@ -1282,18 +1291,18 @@ float* RawImageSource::CA_correct_RT( } } - #pragma omp barrier - + // blur correction factors gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0); gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0); + // apply correction factors to avoid (reduce) colour shift #pragma omp for - for(int i = 0; i < H; ++i) { + for (int i = 0; i < H; ++i) { const int firstCol = FC(i, 0) & 1; const int colour = FC(i, firstCol); const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; - for(; j < W - 1; j += 2) { + for (; j < W - 1; j += 2) { rawData[i][j] *= (*nonGreen)[i/2][j/2]; } if (j < W) { @@ -1304,7 +1313,7 @@ float* RawImageSource::CA_correct_RT( delete oldraw; } - if(plistener) { + if (plistener) { plistener->setProgress(1.0); } return buffer; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 77c6285be..1396ae245 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2009,13 +2009,13 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } if(numFrames == 4) { double fitParams[64]; - float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false); + float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false); for(int i = 1; i < 3; ++i) { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false); } - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true); } else { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, 8.0, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true); } } diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 972e1fe64..ad7807a44 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -244,7 +244,6 @@ protected: size_t autoIterations, double cared, double cablue, - double caautostrength, bool avoidColourshift, const array2D &rawData, double* fitParamsTransfer, From ec4115512a3779b07ee1bc6398d069cde58ce40a Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 8 Sep 2018 13:08:44 +0200 Subject: [PATCH 19/53] raw ca correction/avoid colour shift: Vectorized one loop, #4777 --- rtengine/CA_correct_RT.cc | 45 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index ef1e534c0..9cf1af145 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -147,11 +147,7 @@ float* RawImageSource::CA_correct_RT( oldraw = new array2D((W + 1) / 2, H); #pragma omp parallel for for (int i = 0; i < H; ++i) { - int j = FC(i, 0) & 1; - for (; j < W - 1; j += 2) { - (*oldraw)[i][j / 2] = rawData[i][j]; - } - if (j < W) { + for (int j = FC(i, 0) & 1; j < W; j += 2) { (*oldraw)[i][j / 2] = rawData[i][j]; } } @@ -804,8 +800,7 @@ float* RawImageSource::CA_correct_RT( float* grbdiff = (float (*)) (data + 2 * sizeof(float) * ts * ts + 3 * 64); // there is no overlap in buffer usage => share //green interpolated to optical sample points for R/B float* gshift = (float (*)) (data + 2 * sizeof(float) * ts * ts + sizeof(float) * ts * tsh + 4 * 64); // there is no overlap in buffer usage => share - #pragma omp for schedule(dynamic) collapse(2) nowait - + #pragma omp for schedule(dynamic) collapse(2) for (int top = -border; top < height; top += ts - border2) { for (int left = -border; left < width - (W & 1); left += ts - border2) { memset(bufferThr, 0, buffersizePassTwo); @@ -958,7 +953,6 @@ float* RawImageSource::CA_correct_RT( } } } - //end of border fill if (!autoCA || fitParamsIn) { @@ -1026,7 +1020,6 @@ float* RawImageSource::CA_correct_RT( lblockshifts[1][1] = LIM(lblockshifts[1][1], -bslim, bslim); }//end of setting CA shift parameters - for (int c = 0; c < 3; c += 2) { //some parameters for the bilinear interpolation @@ -1042,7 +1035,6 @@ float* RawImageSource::CA_correct_RT( GRBdir[1][c] = lblockshifts[c>>1][1] > 0 ? 2 : -2; } - for (int rr = 4; rr < rr1 - 4; rr++) { int cc = 4 + (FC(rr, 2) & 1); int c = FC(rr, cc); @@ -1203,7 +1195,6 @@ float* RawImageSource::CA_correct_RT( } } - #pragma omp barrier // copy temporary image matrix back to image matrix #pragma omp for @@ -1245,7 +1236,7 @@ float* RawImageSource::CA_correct_RT( if (avoidColourshift) { // to avoid or at least reduce the colour shift caused by raw ca correction we compute the per pixel difference factors - // of red and blue channel and apply a gaussian blur on them. + // of red and blue channel and apply a gaussian blur to them. // Then we apply the resulting factors per pixel on the result of raw ca correction array2D redFactor((W+1)/2, (H+1)/2); @@ -1253,24 +1244,36 @@ float* RawImageSource::CA_correct_RT( #pragma omp parallel { +#ifdef __SSE2__ + const vfloat onev = F2V(1.f); + const vfloat twov = F2V(2.f); + const vfloat zd5v = F2V(0.5f); +#endif #pragma omp for for (int i = 0; i < H; ++i) { const int firstCol = FC(i, 0) & 1; const int colour = FC(i, firstCol); const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; int j = firstCol; - for (; j < W - 1; j += 2) { - (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); +#ifdef __SSE2__ + for (; j < W - 7; j += 8) { + const vfloat newvals = LC2VFU(rawData[i][j]); + const vfloat oldvals = LVFU((*oldraw)[i][j / 2]); + vfloat factors = oldvals / newvals; + factors = vself(vmaskf_le(newvals, onev), onev, factors); + factors = vself(vmaskf_le(oldvals, onev), onev, factors); + STVFU((*nonGreen)[i/2][j/2], LIMV(factors, zd5v, twov)); } - if (j < W) { - (*nonGreen)[i/2][j/2] = rtengine::LIM((rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : (*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); +#endif + for (; j < W; j += 2) { + (*nonGreen)[i/2][j/2] = (rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : rtengine::LIM((*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); } } #pragma omp single { if (H % 2) { - // odd height => factors for one one channel are not set in last row => use values of preceding row + // odd height => factors for one channel are not set in last row => use values of preceding row const int firstCol = FC(0, 0) & 1; const int colour = FC(0, firstCol); const array2D* nonGreen = colour == 0 ? &blueFactor : &redFactor; @@ -1280,7 +1283,7 @@ float* RawImageSource::CA_correct_RT( } if (W % 2) { - // odd width => factors for one one channel are not set in last column => use value of preceding column + // odd width => factors for one channel are not set in last column => use value of preceding column const int ngRow = 1 - (FC(0, 0) & 1); const int ngCol = FC(ngRow, 0) & 1; const int colour = FC(ngRow, ngCol); @@ -1301,11 +1304,7 @@ float* RawImageSource::CA_correct_RT( const int firstCol = FC(i, 0) & 1; const int colour = FC(i, firstCol); const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; - int j = firstCol; - for (; j < W - 1; j += 2) { - rawData[i][j] *= (*nonGreen)[i/2][j/2]; - } - if (j < W) { + for (int j = firstCol; j < W; j += 2) { rawData[i][j] *= (*nonGreen)[i/2][j/2]; } } From 88d0f60d6bb3e561d1f498f456786afaa3b98b19 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 8 Sep 2018 13:09:55 +0200 Subject: [PATCH 20/53] raw ca correction/avoid colour shift: fire event only if raw ca correction is active, #4777 --- rtgui/rawcacorrection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index fd69ab063..02b7a65e3 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -147,7 +147,7 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); } } else if (c == caAvoidcolourshift) { - if (listener) { + if (listener && (caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0)) { listener->panelChanged (EvPreProcessCAColourshift, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); } } From ddbf94e94099f953811baaf1bfaaa11ac2e2dd2b Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 8 Sep 2018 13:26:23 +0200 Subject: [PATCH 21/53] raw ca correction: generate history entry but don't reprocess when changing 'avoid colour shift' while ca correction is disabled, #4777 --- rtgui/rawcacorrection.cc | 5 +++-- rtgui/rawcacorrection.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 02b7a65e3..dc5657ece 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -29,6 +29,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM auto m = ProcEventMapper::getInstance(); EvPreProcessCAAutoiterations = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_AUTOIT"); EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); + EvPreProcessCAColourshiftHistory = m->newEvent(M_VOID, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png")); Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png")); @@ -147,8 +148,8 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); } } else if (c == caAvoidcolourshift) { - if (listener && (caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0)) { - listener->panelChanged (EvPreProcessCAColourshift, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); + if (listener) { + listener->panelChanged ((caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0) ? EvPreProcessCAColourshift : EvPreProcessCAColourshiftHistory, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); } } } diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index 614bd4b90..dea9ef738 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -36,6 +36,7 @@ protected: rtengine::ProcEvent EvPreProcessCAAutoiterations; rtengine::ProcEvent EvPreProcessCAColourshift; + rtengine::ProcEvent EvPreProcessCAColourshiftHistory; public: From f85ec677ffc8b29831c66add0665fbd8da20e275 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sun, 9 Sep 2018 12:53:44 +0200 Subject: [PATCH 22/53] raw ca correction: avoid colour shift per iteration, #4777 --- rtengine/CA_correct_RT.cc | 157 ++++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 76 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 9cf1af145..81fd8d593 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -141,10 +141,14 @@ float* RawImageSource::CA_correct_RT( } } + array2D* redFactor = nullptr; + array2D* blueFactor = nullptr; array2D* oldraw = nullptr; if (avoidColourshift) { - // copy raw values before ca correction + redFactor = new array2D((W+1)/2, (H+1)/2); + blueFactor = new array2D((W+1)/2, (H+1)/2); oldraw = new array2D((W + 1) / 2, H); + // copy raw values before ca correction #pragma omp parallel for for (int i = 0; i < H; ++i) { for (int j = FC(i, 0) & 1; j < W; j += 2) { @@ -1215,7 +1219,81 @@ float* RawImageSource::CA_correct_RT( // clean up free(bufferThr); } + if (avoidColourshift) { + // to avoid or at least reduce the colour shift caused by raw ca correction we compute the per pixel difference factors + // of red and blue channel and apply a gaussian blur to them. + // Then we apply the resulting factors per pixel on the result of raw ca correction + + #pragma omp parallel + { + #ifdef __SSE2__ + const vfloat onev = F2V(1.f); + const vfloat twov = F2V(2.f); + const vfloat zd5v = F2V(0.5f); + #endif + #pragma omp for + for (int i = 0; i < H; ++i) { + const int firstCol = FC(i, 0) & 1; + const int colour = FC(i, firstCol); + const array2D* nonGreen = colour == 0 ? redFactor : blueFactor; + int j = firstCol; + #ifdef __SSE2__ + for (; j < W - 7; j += 8) { + const vfloat newvals = LC2VFU(rawData[i][j]); + const vfloat oldvals = LVFU((*oldraw)[i][j / 2]); + vfloat factors = oldvals / newvals; + factors = vself(vmaskf_le(newvals, onev), onev, factors); + factors = vself(vmaskf_le(oldvals, onev), onev, factors); + STVFU((*nonGreen)[i/2][j/2], LIMV(factors, zd5v, twov)); + } + #endif + for (; j < W; j += 2) { + (*nonGreen)[i/2][j/2] = (rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : rtengine::LIM((*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); + } + } + + #pragma omp single + { + if (H % 2) { + // odd height => factors for one channel are not set in last row => use values of preceding row + const int firstCol = FC(0, 0) & 1; + const int colour = FC(0, firstCol); + const array2D* nonGreen = colour == 0 ? blueFactor : redFactor; + for (int j = 0; j < (W + 1) / 2; ++j) { + (*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j]; + } + } + + if (W % 2) { + // odd width => factors for one channel are not set in last column => use value of preceding column + const int ngRow = 1 - (FC(0, 0) & 1); + const int ngCol = FC(ngRow, 0) & 1; + const int colour = FC(ngRow, ngCol); + const array2D* nonGreen = colour == 0 ? redFactor : blueFactor; + for (int i = 0; i < (H + 1) / 2; ++i) { + (*nonGreen)[i][(W + 1) / 2 - 1] = (*nonGreen)[i][(W + 1) / 2 - 2]; + } + } + } + + // blur correction factors + gaussianBlur(*redFactor, *redFactor, (W+1)/2, (H+1)/2, 30.0); + gaussianBlur(*blueFactor, *blueFactor, (W+1)/2, (H+1)/2, 30.0); + + // apply correction factors to avoid (reduce) colour shift + #pragma omp for + for (int i = 0; i < H; ++i) { + const int firstCol = FC(i, 0) & 1; + const int colour = FC(i, firstCol); + const array2D* nonGreen = colour == 0 ? redFactor : blueFactor; + for (int j = firstCol; j < W; j += 2) { + rawData[i][j] *= (*nonGreen)[i/2][j/2]; + } + } + } + } } + if (autoCA && fitParamsTransfer && fitParamsOut) { // store calculated parameters int index = 0; @@ -1233,83 +1311,10 @@ float* RawImageSource::CA_correct_RT( buffer = nullptr; } - if (avoidColourshift) { - // to avoid or at least reduce the colour shift caused by raw ca correction we compute the per pixel difference factors - // of red and blue channel and apply a gaussian blur to them. - // Then we apply the resulting factors per pixel on the result of raw ca correction - - array2D redFactor((W+1)/2, (H+1)/2); - array2D blueFactor((W+1)/2, (H+1)/2); - - #pragma omp parallel - { -#ifdef __SSE2__ - const vfloat onev = F2V(1.f); - const vfloat twov = F2V(2.f); - const vfloat zd5v = F2V(0.5f); -#endif - #pragma omp for - for (int i = 0; i < H; ++i) { - const int firstCol = FC(i, 0) & 1; - const int colour = FC(i, firstCol); - const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; - int j = firstCol; -#ifdef __SSE2__ - for (; j < W - 7; j += 8) { - const vfloat newvals = LC2VFU(rawData[i][j]); - const vfloat oldvals = LVFU((*oldraw)[i][j / 2]); - vfloat factors = oldvals / newvals; - factors = vself(vmaskf_le(newvals, onev), onev, factors); - factors = vself(vmaskf_le(oldvals, onev), onev, factors); - STVFU((*nonGreen)[i/2][j/2], LIMV(factors, zd5v, twov)); - } -#endif - for (; j < W; j += 2) { - (*nonGreen)[i/2][j/2] = (rawData[i][j] <= 1.f || (*oldraw)[i][j / 2] <= 1.f) ? 1.f : rtengine::LIM((*oldraw)[i][j / 2] / rawData[i][j], 0.5f, 2.f); - } - } - - #pragma omp single - { - if (H % 2) { - // odd height => factors for one channel are not set in last row => use values of preceding row - const int firstCol = FC(0, 0) & 1; - const int colour = FC(0, firstCol); - const array2D* nonGreen = colour == 0 ? &blueFactor : &redFactor; - for (int j = 0; j < (W + 1) / 2; ++j) { - (*nonGreen)[(H + 1) / 2 - 1][j] = (*nonGreen)[(H + 1) / 2 - 2][j]; - } - } - - if (W % 2) { - // odd width => factors for one channel are not set in last column => use value of preceding column - const int ngRow = 1 - (FC(0, 0) & 1); - const int ngCol = FC(ngRow, 0) & 1; - const int colour = FC(ngRow, ngCol); - const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; - for (int i = 0; i < (H + 1) / 2; ++i) { - (*nonGreen)[i][(W + 1) / 2 - 1] = redFactor[i][(W + 1) / 2 - 2]; - } - } - } - - // blur correction factors - gaussianBlur(redFactor, redFactor, (W+1)/2, (H+1)/2, 30.0); - gaussianBlur(blueFactor, blueFactor, (W+1)/2, (H+1)/2, 30.0); - - // apply correction factors to avoid (reduce) colour shift - #pragma omp for - for (int i = 0; i < H; ++i) { - const int firstCol = FC(i, 0) & 1; - const int colour = FC(i, firstCol); - const array2D* nonGreen = colour == 0 ? &redFactor : &blueFactor; - for (int j = firstCol; j < W; j += 2) { - rawData[i][j] *= (*nonGreen)[i/2][j/2]; - } - } - } delete oldraw; + delete redFactor; + delete blueFactor; } if (plistener) { From 8e678c285a4bb241f5ebbbac546c30153dd78660 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 10 Sep 2018 02:33:20 -0700 Subject: [PATCH 23/53] support camera dng LEICA M MONOCHROM (Typ 246) Patch by @heckflosse https://github.com/Beep6581/RawTherapee/issues/4785#issuecomment-419713993 --- rtengine/dcraw.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index ccfd16187..bd9fa4b47 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -1136,7 +1136,7 @@ void CLASS lossless_dng_load_raw() fseek (ifp, get4(), SEEK_SET); if (!ljpeg_start (&jh, 0)) break; jwide = jh.wide; - if (filters) jwide *= jh.clrs; + if (filters || (colors == 1 && jh.clrs > 1)) jwide *= jh.clrs; jwide /= MIN (is_raw, tiff_samples); switch (jh.algo) { case 0xc1: From a42b2236d977ee4071c285396e82d29bb5c4fbbc Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 10 Sep 2018 11:43:31 -0700 Subject: [PATCH 24/53] save format panel PNG options fix Patch by @heckflosse https://github.com/Beep6581/RawTherapee/issues/4789 --- rtgui/saveformatpanel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/saveformatpanel.cc b/rtgui/saveformatpanel.cc index 2a6d5cad1..755cb9239 100644 --- a/rtgui/saveformatpanel.cc +++ b/rtgui/saveformatpanel.cc @@ -182,7 +182,7 @@ void SaveFormatPanel::formatChanged () int act = format->get_active_row_number(); - if (act < 0 || act > 5) { + if (act < 0 || act > 6) { return; } From 6969303878bc84f231318ee92b74db7caca7cbfa Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 11 Sep 2018 17:11:38 +0200 Subject: [PATCH 25/53] Compressed 16-bit TIFF output broken, fixes #4792 --- rtengine/imageio.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 8bfe81504..08922e436 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -1471,7 +1471,7 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, float isFloat, bool uncompr getScanline (row, linebuffer, bps, isFloat); if (bps == 16) { - if(needsReverse && !uncompressed) { + if(needsReverse && !uncompressed && isFloat) { for(int i = 0; i < lineWidth; i += 2) { char temp = linebuffer[i]; linebuffer[i] = linebuffer[i + 1]; From dc34658683c226b5667d36433d854dc37d7522a1 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Tue, 11 Sep 2018 20:08:01 +0200 Subject: [PATCH 26/53] Gray-out Retinex tool when editing non-raw image Closes #4795 --- rtgui/guiutils.cc | 5 +++++ rtgui/guiutils.h | 3 +++ rtgui/toolpanel.cc | 11 ++++++++++- rtgui/toolpanel.h | 1 + rtgui/toolpanelcoord.cc | 5 +++++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 1e4f4eac8..23c006d3b 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -917,6 +917,11 @@ bool MyExpander::on_enabled_change(GdkEventButton* event) return false; } +void MyExpander::setSensitive(bool makeSensitive) +{ + set_sensitive(makeSensitive); +} + /* * * Derived class of some widgets to properly handle the scroll wheel ; diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index fb627a78a..fbc2ef999 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -268,6 +268,9 @@ public: /// Set the collapsed/expanded state of the expander void set_expanded( bool expanded ); + // Set whether the expander should be grayed-out. + void setSensitive(bool makeSensitive); + /// Get the collapsed/expanded state of the expander bool get_expanded(); diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc index 0d441e01f..515fb60ef 100644 --- a/rtgui/toolpanel.cc +++ b/rtgui/toolpanel.cc @@ -146,5 +146,14 @@ void FoldableToolPanel::setEnabledTooltipText(Glib::ustring tooltipText) } } - +void FoldableToolPanel::setGrayedOut(bool doGrayOut) +{ + if (doGrayOut) { + exp->setEnabled(false); + exp->set_expanded(false); + exp->setSensitive(false); + } else { + exp->setSensitive(true); + } +} diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index d3d7439a9..fd7d27fbe 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -205,6 +205,7 @@ public: void setEnabledTooltipText(Glib::ustring tooltipText); bool get_inconsistent(); // related to the enabled/disabled state void set_inconsistent(bool isInconsistent); // related to the enabled/disabled state + void setGrayedOut(bool doGrayOut); // Set whether the tool should be disabled, collapsed and grayed-out. void setLevel (int level); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 5a69119c2..5d35a9ad5 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -275,6 +275,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt self->sensorbayer->FoldableToolPanel::show(); self->preprocess->FoldableToolPanel::show(); self->flatfield->FoldableToolPanel::show(); + self->retinex->FoldableToolPanel::setGrayedOut(false); return FALSE; }; @@ -289,6 +290,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt self->sensorbayer->FoldableToolPanel::hide(); self->preprocess->FoldableToolPanel::show(); self->flatfield->FoldableToolPanel::show(); + self->retinex->FoldableToolPanel::setGrayedOut(false); return FALSE; }; @@ -303,6 +305,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt self->sensorxtrans->FoldableToolPanel::hide(); self->preprocess->FoldableToolPanel::hide(); self->flatfield->FoldableToolPanel::show(); + self->retinex->FoldableToolPanel::setGrayedOut(false); return FALSE; }; @@ -316,6 +319,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt self->sensorxtrans->FoldableToolPanel::hide(); self->preprocess->FoldableToolPanel::hide(); self->flatfield->FoldableToolPanel::hide(); + self->retinex->FoldableToolPanel::setGrayedOut(false); return FALSE; }; @@ -326,6 +330,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt ToolPanelCoordinator* const self = static_cast(data); self->rawPanelSW->set_sensitive (false); + self->retinex->FoldableToolPanel::setGrayedOut(true); return FALSE; }; From 2062555e47965f729dde07418abab540880d7561 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 11 Sep 2018 23:43:39 +0200 Subject: [PATCH 27/53] remove raw ca correction 'avoid colour shift' from gui, #4777 --- rtgui/rawcacorrection.cc | 25 +++++++++++++------------ rtgui/rawcacorrection.h | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index dc5657ece..5ad5d30a3 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -39,7 +39,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage)); caAutocorrect->setCheckBoxListener (this); - caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 10, 1, 2)); + caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 5, 1, 2)); caAutoiterations->setAdjusterListener (this); if (caAutoiterations->delay < options.adjusterMaxDelay) { @@ -68,9 +68,9 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM pack_start( *caRed, Gtk::PACK_SHRINK, 4); pack_start( *caBlue, Gtk::PACK_SHRINK, 4); - caAvoidcolourshift = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AVOIDCOLORSHIFT"), multiImage)); - caAvoidcolourshift->setCheckBoxListener (this); - pack_start( *caAvoidcolourshift, Gtk::PACK_SHRINK, 4); +// caAvoidcolourshift = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AVOIDCOLORSHIFT"), multiImage)); +// caAvoidcolourshift->setCheckBoxListener (this); +// pack_start( *caAvoidcolourshift, Gtk::PACK_SHRINK, 4); } @@ -81,7 +81,7 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi if(pedited ) { caAutocorrect->setEdited(pedited->raw.ca_autocorrect); - caAvoidcolourshift->setEdited(pedited->raw.ca_avoidcolourshift); +// caAvoidcolourshift->setEdited(pedited->raw.ca_avoidcolourshift); caAutoiterations->setEditedState( pedited->raw.caautoiterations ? Edited : UnEdited ); caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited ); caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited ); @@ -93,7 +93,7 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi caBlue->set_sensitive(!pp->raw.ca_autocorrect); caAutocorrect->setValue(pp->raw.ca_autocorrect); - caAvoidcolourshift->setValue(pp->raw.ca_avoidcolourshift); +// caAvoidcolourshift->setValue(pp->raw.ca_avoidcolourshift); caAutoiterations->setValue (pp->raw.caautoiterations); caRed->setValue (pp->raw.cared); caBlue->setValue (pp->raw.cablue); @@ -104,14 +104,14 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) { pp->raw.ca_autocorrect = caAutocorrect->getLastActive(); - pp->raw.ca_avoidcolourshift = caAvoidcolourshift->getLastActive(); +// pp->raw.ca_avoidcolourshift = caAvoidcolourshift->getLastActive(); pp->raw.caautoiterations = caAutoiterations->getValue(); pp->raw.cared = caRed->getValue(); pp->raw.cablue = caBlue->getValue(); if (pedited) { pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent(); - pedited->raw.ca_avoidcolourshift = !caAvoidcolourshift->get_inconsistent(); +// pedited->raw.ca_avoidcolourshift = !caAvoidcolourshift->get_inconsistent(); pedited->raw.caautoiterations = caAutoiterations->getEditedState (); pedited->raw.cared = caRed->getEditedState (); pedited->raw.cablue = caBlue->getEditedState (); @@ -147,11 +147,12 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) if (listener) { listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); } - } else if (c == caAvoidcolourshift) { - if (listener) { - listener->panelChanged ((caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0) ? EvPreProcessCAColourshift : EvPreProcessCAColourshiftHistory, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); - } } +// else if (c == caAvoidcolourshift) { +// if (listener) { +// listener->panelChanged ((caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0) ? EvPreProcessCAColourshift : EvPreProcessCAColourshiftHistory, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); +// } +// } } void RAWCACorr::setBatchMode(bool batchMode) diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index dea9ef738..1c1ced53b 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -32,7 +32,7 @@ protected: Adjuster* caAutoiterations; Adjuster* caRed; Adjuster* caBlue; - CheckBox* caAvoidcolourshift; +// CheckBox* caAvoidcolourshift; rtengine::ProcEvent EvPreProcessCAAutoiterations; rtengine::ProcEvent EvPreProcessCAColourshift; From adddd5aafa11c3d039a64d34cfd9a706242335f9 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 11 Sep 2018 23:44:42 +0200 Subject: [PATCH 28/53] set raw ca correction 'avoid colour shift' as default, #4777 --- rtengine/rawimagesource.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 1396ae245..0f6d7cc93 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2009,13 +2009,13 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } if(numFrames == 4) { double fitParams[64]; - float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false); + float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[0], fitParams, false, true, nullptr, false); for(int i = 1; i < 3; ++i) { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[i], fitParams, true, false, buffer, false); } - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[3], fitParams, true, false, buffer, true); } else { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, rawData, nullptr, false, false, nullptr, true); } } From ef0d9fac99985a3c6adaa5ff720500784b084f4f Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Wed, 12 Sep 2018 13:16:17 +0200 Subject: [PATCH 29/53] Removed unnecessary method, PR #4796 --- rtgui/guiutils.cc | 5 ----- rtgui/guiutils.h | 3 --- rtgui/toolpanel.cc | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 23c006d3b..1e4f4eac8 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -917,11 +917,6 @@ bool MyExpander::on_enabled_change(GdkEventButton* event) return false; } -void MyExpander::setSensitive(bool makeSensitive) -{ - set_sensitive(makeSensitive); -} - /* * * Derived class of some widgets to properly handle the scroll wheel ; diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index fbc2ef999..fb627a78a 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -268,9 +268,6 @@ public: /// Set the collapsed/expanded state of the expander void set_expanded( bool expanded ); - // Set whether the expander should be grayed-out. - void setSensitive(bool makeSensitive); - /// Get the collapsed/expanded state of the expander bool get_expanded(); diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc index 515fb60ef..c9c4f823c 100644 --- a/rtgui/toolpanel.cc +++ b/rtgui/toolpanel.cc @@ -151,9 +151,9 @@ void FoldableToolPanel::setGrayedOut(bool doGrayOut) if (doGrayOut) { exp->setEnabled(false); exp->set_expanded(false); - exp->setSensitive(false); + exp->set_sensitive(false); } else { - exp->setSensitive(true); + exp->set_sensitive(true); } } From 7cbf1f6d8d1053e82a876932f47b39e4629764b8 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 12 Sep 2018 14:24:41 +0200 Subject: [PATCH 30/53] Fix calculation of interpolation parameters for negative block shifts, #4774, #4777 --- rtengine/CA_correct_RT.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 81fd8d593..a27ee7998 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -1029,11 +1029,17 @@ float* RawImageSource::CA_correct_RT( //some parameters for the bilinear interpolation shiftvfloor[c] = floor((float)lblockshifts[c>>1][0]); shiftvceil[c] = ceil((float)lblockshifts[c>>1][0]); - shiftvfrac[c] = lblockshifts[c>>1][0] - shiftvfloor[c]; + if (lblockshifts[c>>1][0] < 0.f) { + std::swap(shiftvfloor[c], shiftvceil[c]); + } + shiftvfrac[c] = fabs(lblockshifts[c>>1][0] - shiftvfloor[c]); shifthfloor[c] = floor((float)lblockshifts[c>>1][1]); shifthceil[c] = ceil((float)lblockshifts[c>>1][1]); - shifthfrac[c] = lblockshifts[c>>1][1] - shifthfloor[c]; + if (lblockshifts[c>>1][1] < 0.f) { + std::swap(shifthfloor[c], shifthceil[c]); + } + shifthfrac[c] = fabs(lblockshifts[c>>1][1] - shifthfloor[c]); GRBdir[0][c] = lblockshifts[c>>1][0] > 0 ? 2 : -2; GRBdir[1][c] = lblockshifts[c>>1][1] > 0 ? 2 : -2; From 85d55ebeb64eed29a8325d4f5b4e9bfa627a8aea Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 2 Sep 2018 13:39:55 +0200 Subject: [PATCH 31/53] Modifications to store histogram settings across sessions --- rtgui/editorpanel.cc | 2 +- rtgui/histogrampanel.cc | 85 ++++++++++++++++++++--------------------- rtgui/histogrampanel.h | 21 +++++----- rtgui/options.cc | 33 ++++++++++++++++ rtgui/options.h | 3 +- 5 files changed, 89 insertions(+), 55 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index c99ed2dbd..3f0909d88 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -2242,7 +2242,7 @@ void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & his { if (histogramPanel) { - histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); + histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); } tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 1d8ce89db..5293c6c00 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -129,14 +129,14 @@ HistogramPanel::HistogramPanel () buttonGrid = Gtk::manage (new Gtk::Grid ()); buttonGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); - showRed->set_active (true); - showGreen->set_active (true); - showBlue->set_active (true); - showValue->set_active (false);//unactive by default - showChro->set_active (false);//unactive by default - showRAW->set_active (false); + showRed->set_active (options.histogramRed); + showGreen->set_active (options.histogramGreen); + showBlue->set_active (options.histogramBlue); + showValue->set_active (options.histogramLuma); + showChro->set_active (options.histogramChroma); + showRAW->set_active (options.histogramRAW); // no showMode->set_active(), as it's not a ToggleButton - showBAR->set_active (options.histogramBar); + showBAR->set_active (options.histogramBar); showRed->set_image (showRed->get_active() ? *redImage : *redImage_g); showGreen->set_image (showGreen->get_active() ? *greenImage : *greenImage_g); @@ -297,12 +297,12 @@ void HistogramPanel::bar_toggled () void HistogramPanel::rgbv_toggled () { // Update Display - histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showChro->get_active(), options.histogramDrawMode); + histogramArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showChro->get_active(), showRAW->get_active(), options.histogramDrawMode); histogramArea->queue_draw (); - histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showRAW->get_active(), showBAR->get_active(), showChro->get_active()); + histogramRGBArea->updateOptions (showRed->get_active(), showGreen->get_active(), showBlue->get_active(), showValue->get_active(), showChro->get_active(), showRAW->get_active(), showBAR->get_active()); histogramRGBArea->updateBackBuffer (0, 0, 0); - histogramArea->queue_draw (); + histogramRGBArea->queue_draw (); } void HistogramPanel::setHistRGBInvalid () @@ -369,8 +369,11 @@ double HistogramScaling::log(double vsize, double val) // // // HistogramRGBArea -HistogramRGBArea::HistogramRGBArea () ://needChroma unactive by default, luma too - val(0), r(0), g(0), b(0), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(false), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false), parent(nullptr) +HistogramRGBArea::HistogramRGBArea () : + val(0), r(0), g(0), b(0), valid(false), + needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue), + needLuma(options.histogramLuma), needChroma(options.histogramChroma), rawMode(options.histogramRAW), + showMode(options.histogramBar), barDisplayed(options.histogramBar), parent(nullptr) { get_style_context()->add_class("drawingarea"); @@ -583,28 +586,23 @@ void HistogramRGBArea::update (int valh, int rh, int gh, int bh) idle_register.add(func, harih); } -void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool bar, bool c) +void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool bar) { - needRed = r; - needGreen = g; - needBlue = b; - needLuma = l; - rawMode = raw; - showMode = bar; - needChroma = c; - - // Histogram RGB BAR button logic goes here + options.histogramRed = needRed = r; + options.histogramGreen = needGreen = g; + options.histogramBlue = needBlue = b; + options.histogramLuma = needLuma = l; + options.histogramChroma = needChroma = c; + options.histogramRAW = rawMode = raw; + options.histogramBar = showMode = bar; + // Show/hide the RGB bar widget if (bar && !barDisplayed) { - // Toggled on, add (show) the widget parent->add(*this); - options.histogramBar = true; barDisplayed = true; } else if (!bar && barDisplayed) { - // Toggled off, remove (hide) the widget removeIfThere(parent, this, false); - options.histogramBar = false; barDisplayed = false; } @@ -661,16 +659,18 @@ void HistogramRGBArea::factorChanged (double newFactor) // // // HistogramArea -HistogramArea::HistogramArea (DrawModeListener *fml) : //needChroma unactive by default, luma too +HistogramArea::HistogramArea (DrawModeListener *fml) : valid(false), drawMode(options.histogramDrawMode), myDrawModeListener(fml), - oldwidth(-1), oldheight(-1), needLuma(false), needRed(true), needGreen(true), needBlue(true), - rawMode(false), needChroma(false), isPressed(false), movingPosition(0.0) + oldwidth(-1), oldheight(-1), + needRed(options.histogramRed), needGreen(options.histogramGreen), needBlue(options.histogramBlue), + needLuma(options.histogramLuma), needChroma(options.histogramChroma), rawMode(options.histogramRAW), + isPressed(false), movingPosition(0.0) { - lhist(256); rhist(256); ghist(256); bhist(256); + lhist(256); chist(256); get_style_context()->add_class("drawingarea"); @@ -724,32 +724,31 @@ void HistogramArea::get_preferred_width_for_height_vfunc (int height, int &minim get_preferred_width_vfunc (minimum_width, natural_width); } -void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool c, int mode) +void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode) { - - needRed = r; - needGreen = g; - needBlue = b; - needLuma = l; - rawMode = raw; - needChroma = c; - drawMode = mode; + + options.histogramRed = needRed = r; + options.histogramGreen = needGreen = g; + options.histogramBlue = needBlue = b; + options.histogramLuma = needLuma = l; + options.histogramChroma = needChroma = c; + options.histogramRAW = rawMode = raw; + options.histogramDrawMode = drawMode = mode; updateBackBuffer (); } -void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) +void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) { if (histRed) { - lhist = histLuma; - chist = histChroma; rhist = histRed; ghist = histGreen; bhist = histBlue; + lhist = histLuma; + chist = histChroma; rhistRaw = histRedRaw; ghistRaw = histGreenRaw; bhistRaw = histBlueRaw; - valid = true; } else { valid = false; diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index d3788d057..7c2e11162 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -70,10 +70,10 @@ protected: bool needGreen; bool needBlue; bool needLuma; + bool needChroma; bool rawMode; bool showMode; bool barDisplayed; - bool needChroma; Gtk::Grid* parent; @@ -91,7 +91,7 @@ public: }; void update (int val, int rh, int gh, int bh); - void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool show, bool c); + void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, bool show); void on_realize(); bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); @@ -104,7 +104,7 @@ private: void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const; void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const; void get_preferred_width_for_height_vfunc (int h, int &minimum_width, int &natural_width) const; - // Some ... + }; class DrawModeListener @@ -124,15 +124,16 @@ private: type_signal_factor_changed sigFactorChanged; protected: - LUTu lhist, rhist, ghist, bhist, chist; - LUTu lhistRaw, rhistRaw, ghistRaw, bhistRaw; + LUTu rhist, ghist, bhist, lhist, chist; + LUTu rhistRaw, ghistRaw, bhistRaw, lhistRaw; //lhistRaw is unused? bool valid; int drawMode; DrawModeListener *myDrawModeListener; int oldwidth, oldheight; - bool needLuma, needRed, needGreen, needBlue, rawMode, needChroma; + bool needRed, needGreen, needBlue, needLuma, needChroma; + bool rawMode; bool isPressed; double movingPosition; @@ -143,8 +144,8 @@ public: ~HistogramArea(); void updateBackBuffer (); - void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma); - void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool c, int mode); + void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw); + void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode); void on_realize(); bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); bool on_button_press_event (GdkEventButton* event); @@ -208,9 +209,9 @@ public: HistogramPanel (); ~HistogramPanel (); - void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw, LUTu &histChroma) + void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) { - histogramArea->update (histRed, histGreen, histBlue, histLuma, histRedRaw, histGreenRaw, histBlueRaw, histChroma); + histogramArea->update (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); } // pointermotionlistener interface void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false); diff --git a/rtgui/options.cc b/rtgui/options.cc index dcba775b6..dcd0d8b43 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -419,6 +419,9 @@ void Options::setDefaults() mainNBVertical = true; multiDisplayMode = 0; histogramPosition = 1; + histogramRed = true; + histogramGreen = true; + histogramBlue = true; histogramBar = true; histogramHeight = 200; histogramDrawMode = 0; @@ -1272,6 +1275,30 @@ void Options::readFromFile(Glib::ustring fname) if (keyFile.has_key("GUI", "HistogramPosition")) { histogramPosition = keyFile.get_integer("GUI", "HistogramPosition"); } + + if (keyFile.has_key("GUI", "HistogramRed")) { + histogramRed = keyFile.get_boolean("GUI", "HistogramRed"); + } + + if (keyFile.has_key("GUI", "HistogramGreen")) { + histogramGreen = keyFile.get_boolean("GUI", "HistogramGreen"); + } + + if (keyFile.has_key("GUI", "HistogramBlue")) { + histogramBlue = keyFile.get_boolean("GUI", "HistogramBlue"); + } + + if (keyFile.has_key("GUI", "HistogramLuma")) { + histogramLuma = keyFile.get_boolean("GUI", "HistogramLuma"); + } + + if (keyFile.has_key("GUI", "HistogramChroma")) { + histogramChroma = keyFile.get_boolean("GUI", "HistogramChroma"); + } + + if (keyFile.has_key("GUI", "HistogramRAW")) { + histogramRAW = keyFile.get_boolean("GUI", "HistogramRAW"); + } if (keyFile.has_key("GUI", "HistogramBar")) { histogramBar = keyFile.get_boolean("GUI", "HistogramBar"); @@ -1994,6 +2021,12 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_double_list ("GUI", "CutOverlayBrush", cutOverlayBrush); keyFile.set_double_list ("GUI", "NavGuideBrush", navGuideBrush); keyFile.set_integer ("GUI", "HistogramPosition", histogramPosition); + keyFile.set_boolean ("GUI", "HistogramRed", histogramRed); + keyFile.set_boolean ("GUI", "HistogramGreen", histogramGreen); + keyFile.set_boolean ("GUI", "HistogramBlue", histogramBlue); + keyFile.set_boolean ("GUI", "HistogramLuma", histogramLuma); + keyFile.set_boolean ("GUI", "HistogramChroma", histogramChroma); + keyFile.set_boolean ("GUI", "HistogramRAW", histogramRAW); keyFile.set_boolean ("GUI", "HistogramBar", histogramBar); keyFile.set_integer ("GUI", "HistogramHeight", histogramHeight); keyFile.set_integer ("GUI", "HistogramDrawMode", histogramDrawMode); diff --git a/rtgui/options.h b/rtgui/options.h index ee95d5cb3..6c473949b 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -256,7 +256,8 @@ public: bool sndEnable; int histogramPosition; // 0=disabled, 1=left pane, 2=right pane - //int histogramWorking; // 0=disabled, 1=left pane, 2=right pane + bool histogramRed, histogramGreen, histogramBlue; + bool histogramLuma, histogramChroma, histogramRAW; bool histogramBar; int histogramHeight; int histogramDrawMode; From 9be449fc1ea04d29439eaedf90f5ab595ca158c5 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 15 Sep 2018 00:14:22 +0200 Subject: [PATCH 32/53] Cleanup for unused raw ca corrtection avoid colour shift stuff --- rtgui/rawcacorrection.cc | 4 ++-- rtgui/rawcacorrection.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 5ad5d30a3..8dd96e3a4 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -28,8 +28,8 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM { auto m = ProcEventMapper::getInstance(); EvPreProcessCAAutoiterations = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_AUTOIT"); - EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); - EvPreProcessCAColourshiftHistory = m->newEvent(M_VOID, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); +// EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); +// EvPreProcessCAColourshiftHistory = m->newEvent(M_VOID, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png")); Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png")); diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index 1c1ced53b..566f93e03 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -35,8 +35,8 @@ protected: // CheckBox* caAvoidcolourshift; rtengine::ProcEvent EvPreProcessCAAutoiterations; - rtengine::ProcEvent EvPreProcessCAColourshift; - rtengine::ProcEvent EvPreProcessCAColourshiftHistory; +// rtengine::ProcEvent EvPreProcessCAColourshift; +// rtengine::ProcEvent EvPreProcessCAColourshiftHistory; public: From 80acf0f5e28d59e8ff56c142f3fa9103e548a4e5 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sat, 15 Sep 2018 00:21:31 +0200 Subject: [PATCH 33/53] generateTranslationDiffs --- rtdata/languages/Catala | 11 ++++++++++- rtdata/languages/Chinese (Simplified) | 14 +++++++++++--- rtdata/languages/Chinese (Traditional) | 16 ++++++++++++---- rtdata/languages/Czech | 10 ++++++++++ rtdata/languages/Dansk | 16 ++++++++++++---- rtdata/languages/Deutsch | 15 ++++++++++++++- rtdata/languages/English (UK) | 16 ++++++++++++---- rtdata/languages/English (US) | 16 ++++++++++++---- rtdata/languages/Espanol | 11 ++++++++++- rtdata/languages/Euskara | 16 ++++++++++++---- rtdata/languages/Francais | 8 ++++++++ rtdata/languages/Greek | 16 ++++++++++++---- rtdata/languages/Hebrew | 16 ++++++++++++---- rtdata/languages/Italiano | 11 ++++++++++- rtdata/languages/Japanese | 13 +++++++++++++ rtdata/languages/Latvian | 16 ++++++++++++---- rtdata/languages/Magyar | 12 ++++++++++-- rtdata/languages/Nederlands | 11 ++++++++++- rtdata/languages/Norsk BM | 16 ++++++++++++---- rtdata/languages/Polish | 11 ++++++++++- rtdata/languages/Polish (Latin Characters) | 11 ++++++++++- rtdata/languages/Portugues (Brasil) | 10 ++++++++++ rtdata/languages/Russian | 11 ++++++++++- rtdata/languages/Serbian (Cyrilic Characters) | 11 ++++++++++- rtdata/languages/Serbian (Latin Characters) | 11 ++++++++++- rtdata/languages/Slovak | 14 +++++++++++--- rtdata/languages/Suomi | 16 ++++++++++++---- rtdata/languages/Swedish | 11 ++++++++++- rtdata/languages/Turkish | 16 ++++++++++++---- rtdata/languages/default | 8 ++++---- 30 files changed, 323 insertions(+), 67 deletions(-) diff --git a/rtdata/languages/Catala b/rtdata/languages/Catala index 9d9fa288a..a8d381a8e 100644 --- a/rtdata/languages/Catala +++ b/rtdata/languages/Catala @@ -1015,6 +1015,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_166;Exposure - Reset !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_174;CIECAM02 @@ -1341,6 +1342,8 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1535,6 +1538,8 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1554,6 +1559,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1580,6 +1586,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. @@ -1919,6 +1926,8 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAWEXPOS_BLACK_0;Green 1 (lead) !TP_RAWEXPOS_BLACK_1;Red @@ -2007,7 +2016,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Chinese (Simplified) b/rtdata/languages/Chinese (Simplified) index afc2f2b3a..78667ee02 100644 --- a/rtdata/languages/Chinese (Simplified) +++ b/rtdata/languages/Chinese (Simplified) @@ -1034,9 +1034,9 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_86;RGB Curves - Luminosity mode @@ -1419,6 +1419,8 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1539,7 +1541,10 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !PREFERENCES_CUSTPROFBUILDHINT;Executable (or script) file called when a new initial processing profile should be generated for an image.\n\nThe path of the communication file (*.ini style, a.k.a. "Keyfile") is added as a command line parameter. It contains various parameters required for the scripts and image Exif to allow a rules-based processing profile generation.\n\nWARNING: You are responsible for using double quotes where necessary if you're using paths containing spaces. !PREFERENCES_DIRECTORIES;Directories !PREFERENCES_EDITORCMDLINE;Custom command line +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_SAVE_TP_OPEN_NOW;Save tools collapsed/expanded state now +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show !PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Neutral raw rendering @@ -1566,6 +1571,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SHCSELECTOR_TOOLTIP;Click right mouse button to reset the position of those 3 sliders. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. @@ -1888,6 +1894,8 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAWEXPOS_BLACKS;Black Levels !TP_RAWEXPOS_BLACK_0;Green 1 (lead) @@ -1986,7 +1994,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Chinese (Traditional) b/rtdata/languages/Chinese (Traditional) index 94385640d..6e7698f9a 100644 --- a/rtdata/languages/Chinese (Traditional) +++ b/rtdata/languages/Chinese (Traditional) @@ -583,9 +583,9 @@ TP_WBALANCE_TEMPERATURE;色溫 !GENERAL_SLIDER;Slider !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -1003,6 +1003,8 @@ TP_WBALANCE_TEMPERATURE;色溫 !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1086,7 +1088,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1298,6 +1300,8 @@ TP_WBALANCE_TEMPERATURE;色溫 !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1327,6 +1331,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1366,6 +1371,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1830,6 +1836,8 @@ TP_WBALANCE_TEMPERATURE;色溫 !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1934,7 +1942,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Czech b/rtdata/languages/Czech index 225970a1a..671fde250 100644 --- a/rtdata/languages/Czech +++ b/rtdata/languages/Czech @@ -2197,6 +2197,7 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !ADJUSTER_RESET_TO_DEFAULT;Click - reset to default value.\nCtrl+click - reset to initial value. !GENERAL_RESET;Reset !GENERAL_SAVE_AS;Save as... +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_235;B&W - CM - Auto !HISTORY_MSG_237;B&W - CM !HISTORY_MSG_273;CT - Color Balance SMH @@ -2214,6 +2215,8 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold !HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - Demosaic method for motion !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -2267,8 +2270,12 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !PARTIALPASTE_RAW_BORDER;Raw border !PARTIALPASTE_SOFTLIGHT;Soft light !PARTIALPASTE_TM_FATTAL;Dynamic range compression +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) +!PREFERENCES_TAB_PERFORMANCE;Performance !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !TP_BWMIX_MIXC;Channel Mixer !TP_BWMIX_NEUTRAL;Reset !TP_ICM_WORKING_TRC;Tone response curve: @@ -2277,6 +2284,8 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !TP_ICM_WORKING_TRC_NONE;None !TP_ICM_WORKING_TRC_SLOPE;Slope !TP_ICM_WORKING_TRC_TOOLTIP;Only for built-in profiles. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAW_2PASS;1-pass+fast !TP_RAW_4PASS;3-pass+fast !TP_RAW_AMAZEVNG4;AMaZE+VNG4 @@ -2286,6 +2295,7 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !TP_RAW_PIXELSHIFTDMETHOD;Demosaic method for motion !TP_RAW_RCDVNG4;RCD+VNG4 !TP_RESIZE_ALLOW_UPSCALING;Allow Upscaling +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Dansk b/rtdata/languages/Dansk index 6b9cfd32e..9e1d79191 100644 --- a/rtdata/languages/Dansk +++ b/rtdata/languages/Dansk @@ -578,9 +578,9 @@ TP_WBALANCE_TEMPERATURE;Temperatur !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -998,6 +998,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1081,7 +1083,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1295,6 +1297,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1324,6 +1328,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1363,6 +1368,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1827,6 +1833,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1932,7 +1940,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index 5acac7841..d9488295e 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -310,9 +310,9 @@ HISTOGRAM_TOOLTIP_B;Blau-Histogramm ein-/ausblenden. HISTOGRAM_TOOLTIP_BAR;RGB-Anzeigeleiste ein-/ausblenden. HISTOGRAM_TOOLTIP_CHRO;Chromatizität-Histogramm ein/ausblenden. HISTOGRAM_TOOLTIP_FULL;Skaliertes Histogramm ein/ausschalten. -HISTOGRAM_TOOLTIP_MODE;Schaltet zwischen linearer, logarithmischer-linearer und\nlogarithmischer-logarithmischer Skalierung um. HISTOGRAM_TOOLTIP_G;Grün-Histogramm ein-/ausblenden. HISTOGRAM_TOOLTIP_L;CIELab-Luminanz-Histogramm ein-/ausblenden. +HISTOGRAM_TOOLTIP_MODE;Schaltet zwischen linearer, logarithmischer-linearer und\nlogarithmischer-logarithmischer Skalierung um. HISTOGRAM_TOOLTIP_R;Rot-Histogramm ein-/ausblenden. HISTOGRAM_TOOLTIP_RAW;Zwischen normalen Histogrammen und\nRAW-Histogrammen umschalten. HISTORY_CHANGED;Geändert @@ -2347,3 +2347,16 @@ ZOOMPANEL_ZOOMFITCROPSCREEN;Ausschnitt an Bildschirm anpassen\nTaste: f ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen\nTaste: Alt + f ZOOMPANEL_ZOOMIN;Hineinzoomen\nTaste: + ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: - + +!!!!!!!!!!!!!!!!!!!!!!!!! +! Untranslated keys follow; remove the ! prefix after an entry is translated. +!!!!!!!!!!!!!!!!!!!!!!!!! + +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) +!PREFERENCES_TAB_PERFORMANCE;Performance +!SAVEDLG_FILEFORMAT_FLOAT; floating-point +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift diff --git a/rtdata/languages/English (UK) b/rtdata/languages/English (UK) index 33df84742..9fdef1914 100644 --- a/rtdata/languages/English (UK) +++ b/rtdata/languages/English (UK) @@ -26,6 +26,7 @@ HISTORY_MSG_392;W - Residual - Colour Balance HISTORY_MSG_419;Retinex - Colour space HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colours HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Colour correction +HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid colour shift MAIN_TAB_COLOR;Colour MAIN_TOOLTIP_BACKCOLOR0;Background colour of the preview: Theme-based\nShortcut: 9 MAIN_TOOLTIP_BACKCOLOR1;Background colour of the preview: Black\nShortcut: 9 @@ -99,6 +100,7 @@ TP_LABCURVE_AVOIDCOLORSHIFT;Avoid colour shift TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;Fit colours into gamut of the working colour space and apply Munsell correction. TP_PCVIGNETTE_FEATHER_TOOLTIP;Feathering:\n0 = corners only,\n50 = halfway to centre,\n100 = to centre. TP_PFCURVE_CURVEEDITOR_CH_TOOLTIP;Controls defringe strength by colour.\nHigher = more,\nLower = less. +TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid colour shift TP_RAW_FALSECOLOR;False colour suppression steps TP_RAW_PIXELSHIFTEQUALBRIGHT_TOOLTIP;Equalize the brightness of the frames to the brightness of the selected frame.\nIf there are overexposed areas in the frames select the brightest frame to avoid magenta colour cast in overexposed areas or enable motion correction. TP_RGBCURVES_LUMAMODE_TOOLTIP;Luminosity mode allows to vary the contribution of R, G and B channels to the luminosity of the image, without altering image colour. @@ -349,11 +351,11 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. !HISTOGRAM_TOOLTIP_B;Show/Hide blue histogram. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. !HISTOGRAM_TOOLTIP_G;Show/Hide green histogram. !HISTOGRAM_TOOLTIP_L;Show/Hide CIELab luminance histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_R;Show/Hide red histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_CHANGED;Changed @@ -834,6 +836,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -938,7 +941,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PREFERENCES;Preferences !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR;Edit image in external editor !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m @@ -1217,6 +1220,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list. !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1260,6 +1265,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules !PREFERENCES_TAB_GENERAL;General !PREFERENCES_TAB_IMPROC;Image Processing +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1321,6 +1327,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists !SAVEDLG_FILEFORMAT;File format +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_JPEGQUAL;JPEG quality !SAVEDLG_PUTTOQUEUE;Put into processing queue @@ -1790,6 +1797,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1901,7 +1909,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/English (US) b/rtdata/languages/English (US) index 926931720..944457486 100644 --- a/rtdata/languages/English (US) +++ b/rtdata/languages/English (US) @@ -240,11 +240,11 @@ !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. !HISTOGRAM_TOOLTIP_B;Show/Hide blue histogram. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. !HISTOGRAM_TOOLTIP_G;Show/Hide green histogram. !HISTOGRAM_TOOLTIP_L;Show/Hide CIELab luminance histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_R;Show/Hide red histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_CHANGED;Changed @@ -748,6 +748,8 @@ !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -852,7 +854,7 @@ !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PREFERENCES;Preferences !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR;Edit image in external editor !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m @@ -1149,6 +1151,8 @@ !PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list. !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1195,6 +1199,7 @@ !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules !PREFERENCES_TAB_GENERAL;General !PREFERENCES_TAB_IMPROC;Image Processing +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1256,6 +1261,7 @@ !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists !SAVEDLG_FILEFORMAT;File format +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_JPEGQUAL;JPEG quality !SAVEDLG_PUTTOQUEUE;Put into processing queue @@ -1777,6 +1783,8 @@ !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1890,7 +1898,7 @@ !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Espanol b/rtdata/languages/Espanol index 913a0ac1f..8560fd93c 100644 --- a/rtdata/languages/Espanol +++ b/rtdata/languages/Espanol @@ -1517,6 +1517,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_166;Exposure - Reset !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space @@ -1725,6 +1726,8 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1873,6 +1876,8 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1892,6 +1897,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1910,6 +1916,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. @@ -2010,6 +2017,8 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAW_1PASSMEDIUM;1-pass (Markesteijn) !TP_RAW_2PASS;1-pass+fast @@ -2082,7 +2091,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Euskara b/rtdata/languages/Euskara index 4b821ae94..e3559ff98 100644 --- a/rtdata/languages/Euskara +++ b/rtdata/languages/Euskara @@ -579,9 +579,9 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -999,6 +999,8 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1082,7 +1084,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1296,6 +1298,8 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1325,6 +1329,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1364,6 +1369,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1828,6 +1834,8 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1933,7 +1941,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 9b076abee..a20f9251d 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -2217,6 +2217,7 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - !ADJUSTER_RESET_TO_DEFAULT;Click - reset to default value.\nCtrl+click - reset to initial value. !EXIFFILTER_IMAGETYPE;Image type !GENERAL_RESET;Reset +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_235;B&W - CM - Auto !HISTORY_MSG_237;B&W - CM !HISTORY_MSG_273;CT - Color Balance SMH @@ -2237,6 +2238,8 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -2250,6 +2253,9 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - !PARTIALPASTE_RAW_BORDER;Raw border !PARTIALPASTE_SOFTLIGHT;Soft light !PARTIALPASTE_TM_FATTAL;Dynamic range compression +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show !PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Neutral raw rendering @@ -2264,6 +2270,8 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - !TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical !TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAW_2PASS;1-pass+fast !TP_RAW_4PASS;3-pass+fast !TP_RAW_AMAZEVNG4;AMaZE+VNG4 diff --git a/rtdata/languages/Greek b/rtdata/languages/Greek index 18f97324b..9c7c024f9 100644 --- a/rtdata/languages/Greek +++ b/rtdata/languages/Greek @@ -578,9 +578,9 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -998,6 +998,8 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1081,7 +1083,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1295,6 +1297,8 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1324,6 +1328,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1363,6 +1368,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1827,6 +1833,8 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1932,7 +1940,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Hebrew b/rtdata/languages/Hebrew index 5364b3745..85bc43c05 100644 --- a/rtdata/languages/Hebrew +++ b/rtdata/languages/Hebrew @@ -579,9 +579,9 @@ TP_WBALANCE_TEMPERATURE;מידת חום !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -999,6 +999,8 @@ TP_WBALANCE_TEMPERATURE;מידת חום !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1082,7 +1084,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1296,6 +1298,8 @@ TP_WBALANCE_TEMPERATURE;מידת חום !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1325,6 +1329,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1364,6 +1369,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1828,6 +1834,8 @@ TP_WBALANCE_TEMPERATURE;מידת חום !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1933,7 +1941,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Italiano b/rtdata/languages/Italiano index 5d22d29c5..9ee5e607a 100644 --- a/rtdata/languages/Italiano +++ b/rtdata/languages/Italiano @@ -1352,6 +1352,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_166;Exposure - Reset !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space @@ -1600,6 +1601,8 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1745,6 +1748,8 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1764,6 +1769,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1782,6 +1788,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. @@ -1940,6 +1947,8 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAWEXPOS_BLACK_0;Green 1 (lead) !TP_RAWEXPOS_BLACK_1;Red @@ -2023,7 +2032,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index e4f12585c..44b2a39fb 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -2278,3 +2278,16 @@ ZOOMPANEL_ZOOMFITSCREEN;画像全体を画面に合わせる\nショートカッ ZOOMPANEL_ZOOMIN;ズームイン\nショートカット: + ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - +!!!!!!!!!!!!!!!!!!!!!!!!! +! Untranslated keys follow; remove the ! prefix after an entry is translated. +!!!!!!!!!!!!!!!!!!!!!!!!! + +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) +!PREFERENCES_TAB_PERFORMANCE;Performance +!SAVEDLG_FILEFORMAT_FLOAT; floating-point +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift diff --git a/rtdata/languages/Latvian b/rtdata/languages/Latvian index 3cfe5ad75..212330c9c 100644 --- a/rtdata/languages/Latvian +++ b/rtdata/languages/Latvian @@ -579,9 +579,9 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -999,6 +999,8 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1082,7 +1084,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1296,6 +1298,8 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1325,6 +1329,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1364,6 +1369,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1828,6 +1834,8 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1933,7 +1941,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Magyar b/rtdata/languages/Magyar index df2aecb99..00dc4d800 100644 --- a/rtdata/languages/Magyar +++ b/rtdata/languages/Magyar @@ -939,7 +939,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_166;Exposure - Reset !HISTORY_MSG_167;Demosaicing method !HISTORY_MSG_168;L*a*b* - CC curve @@ -1272,6 +1272,8 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1472,6 +1474,8 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1491,6 +1495,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1518,6 +1523,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1912,6 +1918,8 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAWEXPOS_BLACK_0;Green 1 (lead) !TP_RAWEXPOS_BLACK_1;Red @@ -2000,7 +2008,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Nederlands b/rtdata/languages/Nederlands index 40f0a9b09..d002263bc 100644 --- a/rtdata/languages/Nederlands +++ b/rtdata/languages/Nederlands @@ -2085,6 +2085,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space !HISTORY_MSG_235;B&W - CM - Auto @@ -2134,6 +2135,8 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -2213,9 +2216,12 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !PREFERENCES_EDITORCMDLINE;Custom command line !PREFERENCES_GREY18_OLD;Yb=18 CIE L#50 !PREFERENCES_LANG;Language +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PROFILESAVEBOTH;Save processing profile both to the cache and next to the input file !PREFERENCES_PROFILESAVELOCATION;Processing profile saving location !PREFERENCES_SAVE_TP_OPEN_NOW;Save tools collapsed/expanded state now +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -2232,6 +2238,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. !TP_BWMIX_MIXC;Channel Mixer @@ -2272,6 +2279,8 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical !TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAW_2PASS;1-pass+fast !TP_RAW_4PASS;3-pass+fast !TP_RAW_AMAZEVNG4;AMaZE+VNG4 @@ -2290,7 +2299,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !TP_RESIZE_ALLOW_UPSCALING;Allow Upscaling !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Norsk BM b/rtdata/languages/Norsk BM index 84870d5ab..f61fa7a88 100644 --- a/rtdata/languages/Norsk BM +++ b/rtdata/languages/Norsk BM @@ -578,9 +578,9 @@ TP_WBALANCE_TEMPERATURE;Temperatur !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -998,6 +998,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1081,7 +1083,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1295,6 +1297,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1324,6 +1328,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1363,6 +1368,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1827,6 +1833,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1932,7 +1940,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Polish b/rtdata/languages/Polish index 93d611257..3558870b8 100644 --- a/rtdata/languages/Polish +++ b/rtdata/languages/Polish @@ -1474,6 +1474,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_166;Exposure - Reset !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space @@ -1682,6 +1683,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1821,6 +1824,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1840,6 +1845,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1858,6 +1864,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. @@ -1957,6 +1964,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAW_1PASSMEDIUM;1-pass (Markesteijn) !TP_RAW_2PASS;1-pass+fast @@ -2029,7 +2038,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Polish (Latin Characters) b/rtdata/languages/Polish (Latin Characters) index b7cb8a842..27740a48c 100644 --- a/rtdata/languages/Polish (Latin Characters) +++ b/rtdata/languages/Polish (Latin Characters) @@ -1474,6 +1474,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_166;Exposure - Reset !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space @@ -1682,6 +1683,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1821,6 +1824,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1840,6 +1845,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1858,6 +1864,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. @@ -1957,6 +1964,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAW_1PASSMEDIUM;1-pass (Markesteijn) !TP_RAW_2PASS;1-pass+fast @@ -2029,7 +2038,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Portugues (Brasil) b/rtdata/languages/Portugues (Brasil) index d81457ead..ba33f8228 100644 --- a/rtdata/languages/Portugues (Brasil) +++ b/rtdata/languages/Portugues (Brasil) @@ -2254,5 +2254,15 @@ ZOOMPANEL_ZOOMOUT;Menos Zoom\nAtalho: - ! Untranslated keys follow; remove the ! prefix after an entry is translated. !!!!!!!!!!!!!!!!!!!!!!!!! +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !ICCPROFCREATOR_DESCRIPTION_ADDPARAM;Append gamma and slope values to the description +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) +!PREFERENCES_TAB_PERFORMANCE;Performance +!SAVEDLG_FILEFORMAT_FLOAT; floating-point +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. diff --git a/rtdata/languages/Russian b/rtdata/languages/Russian index 123d9c04b..774e2d580 100644 --- a/rtdata/languages/Russian +++ b/rtdata/languages/Russian @@ -1417,6 +1417,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !GENERAL_RESET;Reset !GENERAL_SAVE_AS;Save as... !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_235;B&W - CM - Auto !HISTORY_MSG_237;B&W - CM !HISTORY_MSG_252;CbDL - Skin tar/prot @@ -1654,6 +1655,8 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1783,6 +1786,8 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PRINTER;Printer (Soft-Proofing) !PREFERENCES_PROFILESAVEBOTH;Save processing profile both to the cache and next to the input file !PREFERENCES_PROFILESAVELOCATION;Processing profile saving location @@ -1797,6 +1802,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !PREFERENCES_SERIALIZE_TIFF_READ_LABEL;Serialize read of tiff files !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show !PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Neutral raw rendering @@ -1814,6 +1820,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. @@ -1967,6 +1974,8 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAWEXPOS_BLACK_0;Green 1 (lead) !TP_RAWEXPOS_BLACK_1;Red @@ -2029,7 +2038,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Serbian (Cyrilic Characters) b/rtdata/languages/Serbian (Cyrilic Characters) index adbf07ba1..675e710aa 100644 --- a/rtdata/languages/Serbian (Cyrilic Characters) +++ b/rtdata/languages/Serbian (Cyrilic Characters) @@ -1325,6 +1325,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space !HISTORY_MSG_235;B&W - CM - Auto @@ -1576,6 +1577,8 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1734,6 +1737,8 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1753,6 +1758,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1770,6 +1776,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. !THRESHOLDSELECTOR_BL;Bottom-left @@ -1941,6 +1948,8 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAWEXPOS_BLACK_0;Green 1 (lead) !TP_RAWEXPOS_BLACK_1;Red @@ -2024,7 +2033,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Serbian (Latin Characters) b/rtdata/languages/Serbian (Latin Characters) index e80ae4001..f41d7e36e 100644 --- a/rtdata/languages/Serbian (Latin Characters) +++ b/rtdata/languages/Serbian (Latin Characters) @@ -1325,6 +1325,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space !HISTORY_MSG_235;B&W - CM - Auto @@ -1576,6 +1577,8 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1734,6 +1737,8 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1753,6 +1758,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. !PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -1770,6 +1776,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. !THRESHOLDSELECTOR_BL;Bottom-left @@ -1941,6 +1948,8 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CASTR;Strength !TP_RAWEXPOS_BLACK_0;Green 1 (lead) !TP_RAWEXPOS_BLACK_1;Red @@ -2024,7 +2033,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Slovak b/rtdata/languages/Slovak index 559f4b08d..b5ff03253 100644 --- a/rtdata/languages/Slovak +++ b/rtdata/languages/Slovak @@ -651,9 +651,9 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !GENERAL_SLIDER;Slider !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_88;Impulse NR threshold !HISTORY_MSG_93;CbDL - Value @@ -1061,6 +1061,8 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1343,6 +1345,8 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1368,6 +1372,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1404,6 +1409,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1842,6 +1848,8 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1942,7 +1950,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Suomi b/rtdata/languages/Suomi index 297512b2d..e0ca416d0 100644 --- a/rtdata/languages/Suomi +++ b/rtdata/languages/Suomi @@ -580,9 +580,9 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -1000,6 +1000,8 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1083,7 +1085,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1297,6 +1299,8 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1326,6 +1330,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1365,6 +1370,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1828,6 +1834,8 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1933,7 +1941,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/Swedish b/rtdata/languages/Swedish index f7de30334..049162e68 100644 --- a/rtdata/languages/Swedish +++ b/rtdata/languages/Swedish @@ -1851,6 +1851,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !GENERAL_SAVE_AS;Save as... !GENERAL_SLIDER;Slider !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTORY_MSG_173;NR - Detail recovery !HISTORY_MSG_203;NR - Color space !HISTORY_MSG_235;B&W - CM - Auto @@ -1937,6 +1938,8 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -2052,6 +2055,8 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !PREFERENCES_MONITOR;Monitor !PREFERENCES_MONPROFILE;Default color profile !PREFERENCES_MONPROFILE_WARNOSX;Due to MacOS limitations, only sRGB is supported. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PRINTER;Printer (Soft-Proofing) !PREFERENCES_PROFILESAVEBOTH;Save processing profile both to the cache and next to the input file !PREFERENCES_PROFILESAVELOCATION;Processing profile saving location @@ -2060,6 +2065,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !PREFERENCES_SAVE_TP_OPEN_NOW;Save tools collapsed/expanded state now !PREFERENCES_SERIALIZE_TIFF_READ;Tiff Read Settings !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview !PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show @@ -2077,6 +2083,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !SAMPLEFORMAT_16;16-bit floating-point !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. !SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. !TP_BWMIX_MIXC;Channel Mixer @@ -2142,6 +2149,8 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical !TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAW_1PASSMEDIUM;1-pass (Markesteijn) !TP_RAW_2PASS;1-pass+fast !TP_RAW_3PASSBEST;3-pass (Markesteijn) @@ -2199,7 +2208,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !TP_RETINEX_CONTEDIT_MAP;Mask equalizer !TP_RETINEX_CURVEEDITOR_CD_TOOLTIP;Luminance according to luminance L=f(L)\nCorrect raw data to reduce halos and artifacts. !TP_RETINEX_CURVEEDITOR_MAP_TOOLTIP;This curve can be applied alone or with a Gaussian mask or wavelet mask.\nBeware of artifacts! -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA_TOOLTIP;Restore tones by applying gamma before and after Retinex. Different from Retinex curves or others curves (Lab, Exposure, etc.). !TP_RETINEX_HIGHLIGHT_TOOLTIP;Increase action of High algorithm.\nMay require you to re-adjust "Neighboring pixels" and to increase the "White-point correction" in the Raw tab -> Raw White Points tool. diff --git a/rtdata/languages/Turkish b/rtdata/languages/Turkish index e62678791..bae5f69de 100644 --- a/rtdata/languages/Turkish +++ b/rtdata/languages/Turkish @@ -579,9 +579,9 @@ TP_WBALANCE_TEMPERATURE;Isı !GENERAL_UNCHANGED;(Unchanged) !GENERAL_WARNING;Warning !GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +!HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. !HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -!HISTOGRAM_TOOLTIP_FULL;Toggle full (off) or scaled (on) histogram. +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. !HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. !HISTORY_MSG_82;Profile changed !HISTORY_MSG_83;S/H - Sharp mask @@ -999,6 +999,8 @@ TP_WBALANCE_TEMPERATURE;Isı !HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction !HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter !HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold +!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations +!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold @@ -1082,7 +1084,7 @@ TP_WBALANCE_TEMPERATURE;Isı !MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 !MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). !MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Put current image to processing queue.\nShortcut: Ctrl+b -!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s +!MAIN_BUTTON_SAVE_TOOLTIP;Save current image.\nShortcut: Ctrl+s\nSave current profile (.pp3).\nShortcut: Ctrl+Shift+s !MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor.\nShortcut: Ctrl+e !MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels.\nShortcut: m !MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen @@ -1296,6 +1298,8 @@ TP_WBALANCE_TEMPERATURE;Isı !PREFERENCES_PANFACTORLABEL;Pan rate amplification !PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. !PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +!PREFERENCES_PERFORMANCE_THREADS;Threads +!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) !PREFERENCES_PREVDEMO;Preview Demosaic Method !PREFERENCES_PREVDEMO_FAST;Fast !PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1325,6 +1329,7 @@ TP_WBALANCE_TEMPERATURE;Isı !PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done !PREFERENCES_SND_THRESHOLDSECS;After seconds !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules +!PREFERENCES_TAB_PERFORMANCE;Performance !PREFERENCES_TAB_SOUND;Sounds !PREFERENCES_THEME;Theme !PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview @@ -1364,6 +1369,7 @@ TP_WBALANCE_TEMPERATURE;Isı !SAMPLEFORMAT_32;24-bit floating-point !SAMPLEFORMAT_64;32-bit floating-point !SAVEDLG_AUTOSUFFIX;Automatically add a suffix if the file already exists +!SAVEDLG_FILEFORMAT_FLOAT; floating-point !SAVEDLG_FORCEFORMATOPTS;Force saving options !SAVEDLG_SUBSAMP;Subsampling !SAVEDLG_SUBSAMP_1;Best compression @@ -1827,6 +1833,8 @@ TP_WBALANCE_TEMPERATURE;Isı !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_AUTO;Auto-correction +!TP_RAWCACORR_AUTOIT;Iterations +!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift !TP_RAWCACORR_CABLUE;Blue !TP_RAWCACORR_CARED;Red !TP_RAWCACORR_CASTR;Strength @@ -1932,7 +1940,7 @@ TP_WBALANCE_TEMPERATURE;Isı !TP_RETINEX_GAIN;Gain !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission -!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_GAIN_TOOLTIP;Acts on the restored image.\n\nThis is very different from the others settings. Used for black or white pixels, and to help balance the histogram. !TP_RETINEX_GAMMA;Gamma !TP_RETINEX_GAMMA_FREE;Free diff --git a/rtdata/languages/default b/rtdata/languages/default index e786b5355..7cf0a48cb 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -241,9 +241,9 @@ GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done edit HISTOGRAM_TOOLTIP_B;Show/Hide blue histogram. HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. -HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. HISTOGRAM_TOOLTIP_G;Show/Hide green histogram. HISTOGRAM_TOOLTIP_L;Show/Hide CIELab luminance histogram. +HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. HISTOGRAM_TOOLTIP_R;Show/Hide red histogram. HISTOGRAM_TOOLTIP_RAW;Show/Hide raw histogram. HISTORY_CHANGED;Changed @@ -747,9 +747,9 @@ HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - Demosaic method for motion HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold -HISTORY_MSG_RAW_BORDER;Raw border HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift +HISTORY_MSG_RAW_BORDER;Raw border HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1150,6 +1150,8 @@ PREFERENCES_PARSEDEXTADDHINT;Add entered extension to the list. PREFERENCES_PARSEDEXTDELHINT;Delete selected extension from the list. PREFERENCES_PARSEDEXTDOWNHINT;Move selected extension down in the list. PREFERENCES_PARSEDEXTUPHINT;Move selected extension up in the list. +PREFERENCES_PERFORMANCE_THREADS;Threads +PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) PREFERENCES_PREVDEMO;Preview Demosaic Method PREFERENCES_PREVDEMO_FAST;Fast PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: @@ -1171,8 +1173,6 @@ PREFERENCES_PSPATH;Adobe Photoshop installation directory PREFERENCES_REMEMBERZOOMPAN;Remember zoom % and pan offset PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Remember the zoom % and pan offset of the current image when opening a new image.\n\nThis option only works in "Single Editor Tab Mode" and when "Demosaicing method used for the preview at <100% zoom" is set to "As in PP3". PREFERENCES_SAVE_TP_OPEN_NOW;Save tools collapsed/expanded state now -PREFERENCES_PERFORMANCE_THREADS;Threads -PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) PREFERENCES_SELECTFONT;Select main font PREFERENCES_SELECTFONT_COLPICKER;Select Color Picker's font PREFERENCES_SELECTLANG;Select language From 2e3479ef8fc0f08586835f6117c007da2af266d9 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 15 Sep 2018 12:24:27 +0200 Subject: [PATCH 34/53] raw ca correction: reintroduced avoid colour shift checkbox because avoid colour shift sometimes fails --- rtengine/rawimagesource.cc | 8 ++++---- rtgui/rawcacorrection.cc | 28 ++++++++++++++-------------- rtgui/rawcacorrection.h | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 0f6d7cc93..1396ae245 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2009,13 +2009,13 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } if(numFrames == 4) { double fitParams[64]; - float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[0], fitParams, false, true, nullptr, false); + float *buffer = CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[0], fitParams, false, true, nullptr, false); for(int i = 1; i < 3; ++i) { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[i], fitParams, true, false, buffer, false); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[i], fitParams, true, false, buffer, false); } - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, *rawDataFrames[3], fitParams, true, false, buffer, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, *rawDataFrames[3], fitParams, true, false, buffer, true); } else { - CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, true, rawData, nullptr, false, false, nullptr, true); + CA_correct_RT(raw.ca_autocorrect, raw.caautoiterations, raw.cared, raw.cablue, raw.ca_avoidcolourshift, rawData, nullptr, false, false, nullptr, true); } } diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 8dd96e3a4..647fa28cc 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -28,8 +28,8 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM { auto m = ProcEventMapper::getInstance(); EvPreProcessCAAutoiterations = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_AUTOIT"); -// EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); -// EvPreProcessCAColourshiftHistory = m->newEvent(M_VOID, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); + EvPreProcessCAColourshift = m->newEvent(DARKFRAME, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); + EvPreProcessCAColourshiftHistory = m->newEvent(M_VOID, "HISTORY_MSG_RAWCACORR_COLOURSHIFT"); Gtk::Image* icaredL = Gtk::manage (new RTImage ("circle-red-cyan-small.png")); Gtk::Image* icaredR = Gtk::manage (new RTImage ("circle-cyan-red-small.png")); @@ -68,9 +68,9 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM pack_start( *caRed, Gtk::PACK_SHRINK, 4); pack_start( *caBlue, Gtk::PACK_SHRINK, 4); -// caAvoidcolourshift = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AVOIDCOLORSHIFT"), multiImage)); -// caAvoidcolourshift->setCheckBoxListener (this); -// pack_start( *caAvoidcolourshift, Gtk::PACK_SHRINK, 4); + caAvoidcolourshift = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AVOIDCOLORSHIFT"), multiImage)); + caAvoidcolourshift->setCheckBoxListener (this); + pack_start( *caAvoidcolourshift, Gtk::PACK_SHRINK, 4); } @@ -81,7 +81,7 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi if(pedited ) { caAutocorrect->setEdited(pedited->raw.ca_autocorrect); -// caAvoidcolourshift->setEdited(pedited->raw.ca_avoidcolourshift); + caAvoidcolourshift->setEdited(pedited->raw.ca_avoidcolourshift); caAutoiterations->setEditedState( pedited->raw.caautoiterations ? Edited : UnEdited ); caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited ); caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited ); @@ -93,7 +93,7 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi caBlue->set_sensitive(!pp->raw.ca_autocorrect); caAutocorrect->setValue(pp->raw.ca_autocorrect); -// caAvoidcolourshift->setValue(pp->raw.ca_avoidcolourshift); + caAvoidcolourshift->setValue(pp->raw.ca_avoidcolourshift); caAutoiterations->setValue (pp->raw.caautoiterations); caRed->setValue (pp->raw.cared); caBlue->setValue (pp->raw.cablue); @@ -104,14 +104,14 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) { pp->raw.ca_autocorrect = caAutocorrect->getLastActive(); -// pp->raw.ca_avoidcolourshift = caAvoidcolourshift->getLastActive(); + pp->raw.ca_avoidcolourshift = caAvoidcolourshift->getLastActive(); pp->raw.caautoiterations = caAutoiterations->getValue(); pp->raw.cared = caRed->getValue(); pp->raw.cablue = caBlue->getValue(); if (pedited) { pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent(); -// pedited->raw.ca_avoidcolourshift = !caAvoidcolourshift->get_inconsistent(); + pedited->raw.ca_avoidcolourshift = !caAvoidcolourshift->get_inconsistent(); pedited->raw.caautoiterations = caAutoiterations->getEditedState (); pedited->raw.cared = caRed->getEditedState (); pedited->raw.cablue = caBlue->getEditedState (); @@ -148,11 +148,11 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) listener->panelChanged (EvPreProcessAutoCA, caAutocorrect->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); } } -// else if (c == caAvoidcolourshift) { -// if (listener) { -// listener->panelChanged ((caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0) ? EvPreProcessCAColourshift : EvPreProcessCAColourshiftHistory, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); -// } -// } + else if (c == caAvoidcolourshift) { + if (listener) { + listener->panelChanged ((caAutocorrect->getLastActive() || caRed->getValue() != 0 || caBlue->getValue() != 0) ? EvPreProcessCAColourshift : EvPreProcessCAColourshiftHistory, caAvoidcolourshift->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); + } + } } void RAWCACorr::setBatchMode(bool batchMode) diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index 566f93e03..dea9ef738 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -32,11 +32,11 @@ protected: Adjuster* caAutoiterations; Adjuster* caRed; Adjuster* caBlue; -// CheckBox* caAvoidcolourshift; + CheckBox* caAvoidcolourshift; rtengine::ProcEvent EvPreProcessCAAutoiterations; -// rtengine::ProcEvent EvPreProcessCAColourshift; -// rtengine::ProcEvent EvPreProcessCAColourshiftHistory; + rtengine::ProcEvent EvPreProcessCAColourshift; + rtengine::ProcEvent EvPreProcessCAColourshiftHistory; public: From 857da39f1d96869ea12b3bcec896aa03760fe07a Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 15 Sep 2018 12:50:56 +0200 Subject: [PATCH 35/53] raw ca correction: do not disable adjusters when in batch edit mode --- rtgui/rawcacorrection.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 647fa28cc..37f01cfcf 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -87,11 +87,12 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited ); } - // disable Red and Blue sliders when caAutocorrect is enabled - caAutoiterations->set_sensitive(pp->raw.ca_autocorrect); - caRed->set_sensitive(!pp->raw.ca_autocorrect); - caBlue->set_sensitive(!pp->raw.ca_autocorrect); - + if (!batchMode) { + // disable Red and Blue sliders when caAutocorrect is enabled + caAutoiterations->set_sensitive(pp->raw.ca_autocorrect); + caRed->set_sensitive(!pp->raw.ca_autocorrect); + caBlue->set_sensitive(!pp->raw.ca_autocorrect); + } caAutocorrect->setValue(pp->raw.ca_autocorrect); caAvoidcolourshift->setValue(pp->raw.ca_avoidcolourshift); caAutoiterations->setValue (pp->raw.caautoiterations); From c3fbaafc9a9fcbe53a8ffad5ab0f48f9da28b6e6 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 15 Sep 2018 14:21:49 +0200 Subject: [PATCH 36/53] Fix segfault when hovering over preview while demosaic none is selected --- rtengine/rawimagesource.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 1396ae245..da89810c4 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -5462,6 +5462,8 @@ void RawImageSource::getRawValues(int x, int y, int rotate, int &R, int &G, int ynew = H - 1 - ynew; } + xnew = LIM(xnew, 0, W - 1); + ynew = LIM(ynew, 0, H - 1); int c = ri->getSensorType() == ST_FUJI_XTRANS ? ri->XTRANSFC(ynew,xnew) : ri->FC(ynew,xnew); int val = round(rawData[ynew][xnew] / scale_mul[c]); if(c == 0) { From 04b2d42d46b516bb0ff394090f3d70fc3b35e61a Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 15 Sep 2018 14:48:51 +0200 Subject: [PATCH 37/53] Segfault when closing rt immediately after using batch edit, fixes #4806 --- rtgui/filebrowserentry.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 6046d372d..71e6aef24 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -211,6 +211,9 @@ void FileBrowserEntry::procParamsChanged (Thumbnail* thm, int whoChangedIt) void FileBrowserEntry::updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams) { + if (!feih) { + return; + } redrawRequests++; feih->pending++; From e99bcff8bb1c5bb3f3ed931c7469c6bbf8aa85de Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sat, 15 Sep 2018 18:11:05 +0200 Subject: [PATCH 38/53] Japanese translation updated by firefly, closes #4807 --- rtdata/languages/Japanese | 44 ++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index 44b2a39fb..038548deb 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -275,6 +275,7 @@ HISTOGRAM_TOOLTIP_CHRO;色度・ヒストグラム 表示/非表示 HISTOGRAM_TOOLTIP_FULL;完全/縮尺調整の表示切り替え HISTOGRAM_TOOLTIP_G;グリーン・ヒストグラム 表示/非表示 HISTOGRAM_TOOLTIP_L;CIEL*a*b* 輝度・ヒストグラム 表示/非表示 +HISTOGRAM_TOOLTIP_MODE;ヒストグラムの尺度を線形、対数-線形、対数-対数でトグルします HISTOGRAM_TOOLTIP_R;レッド・ヒストグラム 表示/非表示 HISTOGRAM_TOOLTIP_RAW;rawヒストグラム 表示/非表示 HISTORY_CHANGED;変更されました @@ -778,11 +779,13 @@ HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - 振れに対するデモザイクの方式 HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;ラインノイズフィルタの方向 HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAFラインフィルタ HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - コントラストのしきい値 +HISTORY_MSG_RAWCACORR_AUTOIT;Rawの色順応補正 - 繰り返し +HISTORY_MSG_RAWCACORR_COLOURSHIFT;Rawの色順応補正 - 色ずれを回避 HISTORY_MSG_RAW_BORDER;Rawの境界 HISTORY_MSG_RESIZE_ALLOWUPSCALING;リサイズ - アップスケーリングを可能にする HISTORY_MSG_SHARPENING_CONTRAST;シャープ化 - コントラストのしきい値 -HISTORY_MSG_SOFTLIGHT_ENABLED;ソフトな明るさ -HISTORY_MSG_SOFTLIGHT_STRENGTH;ソフトな明るさ - 強さ +HISTORY_MSG_SOFTLIGHT_ENABLED;ソフトライト +HISTORY_MSG_SOFTLIGHT_STRENGTH;ソフトライト - 強さ HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - アンカー HISTORY_NEWSNAPSHOT;追加 HISTORY_NEWSNAPSHOT_TOOLTIP;ショートカット: Alt-s @@ -963,7 +966,7 @@ NAVIGATOR_R;R: NAVIGATOR_S;S: NAVIGATOR_V;V: NAVIGATOR_XY_FULL;幅 = %1, 高さ = %2 -NAVIGATOR_XY_NA;x = n/a, y = n/a +NAVIGATOR_XY_NA;x: --, y: -- OPTIONS_BUNDLED_MISSING;付属のプロファイル "%1"が見つかりません\n\nインストールされたプロファイルが損傷しているかもしれません\n\nその場合はデフォルトの値が使われます OPTIONS_DEFIMG_MISSING;rawではない画像のデフォルプロファイルが見つからないか、設定されていません\n\nプロファイル・ディレクトリを確認してください、存在しないか破損しているかもしれません\n\nデフォルト設定値が使用されます OPTIONS_DEFRAW_MISSING;raw画像のデフォル・プロファイルが見つからないか、設定されていません\n\nプロファイル・ディレクトリを確認してください、存在しないか破損しているかもしれません\n\nデフォルト設定値が使用されます @@ -1179,6 +1182,8 @@ PREFERENCES_PARSEDEXTADDHINT;拡張子を記入し このボタンでリスト PREFERENCES_PARSEDEXTDELHINT;選択した拡張子をリストから削除します PREFERENCES_PARSEDEXTDOWNHINT;選択した拡張子をリストの下に移動 PREFERENCES_PARSEDEXTUPHINT;選択した拡張子をリストの上に移動 +PREFERENCES_PERFORMANCE_THREADS;スレッド +PREFERENCES_PERFORMANCE_THREADS_LABEL;ノイズ低減とウェーブレットレベルに関するスレッドの最大数(0 = 自動) PREFERENCES_PREVDEMO;プレビューのデモザイク方式 PREFERENCES_PREVDEMO_FAST;Fast PREFERENCES_PREVDEMO_LABEL;プレビューのズームレベルが100%以下の場合に使うデモザイクアルゴリズム: @@ -1225,6 +1230,7 @@ PREFERENCES_TAB_COLORMGR;カラーマネジメント PREFERENCES_TAB_DYNAMICPROFILE;ダイナミックプロファイルの規定 PREFERENCES_TAB_GENERAL;一般 PREFERENCES_TAB_IMPROC;画像処理 +PREFERENCES_TAB_PERFORMANCE;パフォーマンス PREFERENCES_TAB_SOUND;サウンド PREFERENCES_THEME;テーマ PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;埋め込まれているJPEGのプレビュー @@ -1286,6 +1292,7 @@ SAMPLEFORMAT_32;24ビット浮動小数点 SAMPLEFORMAT_64;32ビット浮動小数点 SAVEDLG_AUTOSUFFIX;ファイルが存在する場合、自動的に末尾に文字を加える SAVEDLG_FILEFORMAT;ファイル形式 +SAVEDLG_FILEFORMAT_FLOAT;浮動小数点 SAVEDLG_FORCEFORMATOPTS;強制保存オプション SAVEDLG_JPEGQUAL;JPEG 品質 SAVEDLG_PUTTOQUEUE;キュー処理に追加 @@ -1294,9 +1301,9 @@ SAVEDLG_PUTTOQUEUETAIL;キュー処理の最後に追加 SAVEDLG_SAVEIMMEDIATELY;すぐに保存 SAVEDLG_SAVESPP;設定値も保存する SAVEDLG_SUBSAMP;サブ・サンプリング -SAVEDLG_SUBSAMP_1;高圧縮 +SAVEDLG_SUBSAMP_1;最適な圧縮 SAVEDLG_SUBSAMP_2;バランス -SAVEDLG_SUBSAMP_3;高画質 +SAVEDLG_SUBSAMP_3;最適な画質 SAVEDLG_SUBSAMP_TOOLTIP;最適な圧縮率:\nJ:a:b 4:2:0\nh/v 2/2\n色度は水平方向・垂直方向で半分になります\n\nバランスを重視した圧縮率:\nJ:a:b 4:2:2\nh/v 2/1\n色度は水平方向で半分になります\n\n質を重視した圧縮率:\nJ:a:b 4:4:4\nh/v 1/1\n色度のサブサンプリングはありません. SAVEDLG_TIFFUNCOMPRESSED;非圧縮 TIFF SAVEDLG_WARNFILENAME;ファイルに名前が付けられます @@ -1674,7 +1681,7 @@ TP_HLREC_ENA_TOOLTIP;自動露光でも動作可 TP_HLREC_LABEL;ハイライト復元 TP_HLREC_LUMINANCE;輝度復元 TP_HLREC_METHOD;方式: -TP_HSVEQUALIZER_CHANNEL;HSV チャンネル +TP_HSVEQUALIZER_CHANNEL;チャンネル TP_HSVEQUALIZER_HUE;H TP_HSVEQUALIZER_LABEL;HSV イコライザ TP_HSVEQUALIZER_SAT;S @@ -1807,6 +1814,8 @@ TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Sonyのミラーレスカメラの一部 TP_PRSHARPENING_LABEL;リサイズ後のシャープ化 TP_PRSHARPENING_TOOLTIP;リサイズ後の画像をシャープ化します。但し、リサイズの方式がランチョスの場合に限ります。プレビュー画面でこの機能の効果を見ることは出来ません。使用法に関してはRawPediaを参照して下さい。 TP_RAWCACORR_AUTO;自動補正 +TP_RAWCACORR_AUTOIT;繰り返し +TP_RAWCACORR_AVOIDCOLORSHIFT;色ずれを回避 TP_RAWCACORR_CABLUE;ブルー TP_RAWCACORR_CARED;レッド TP_RAWCACORR_CASTR;強さ @@ -1822,10 +1831,10 @@ TP_RAWEXPOS_LINEAR;ホワイトポイント補正 TP_RAWEXPOS_PRESER;ハイライトを保持 TP_RAWEXPOS_RGB;レッド、グリーン、ブルー TP_RAWEXPOS_TWOGREEN;2つのグリーンを連動 -TP_RAW_1PASSMEDIUM;1-パス (ミディアム) -TP_RAW_2PASS;1-pass+fast -TP_RAW_3PASSBEST;3-Pass (最良) -TP_RAW_4PASS;4-パス +TP_RAW_1PASSMEDIUM;1-パス (Markesteijn) +TP_RAW_2PASS;1-パス+fast +TP_RAW_3PASSBEST;3-Pass (Markesteijn) +TP_RAW_4PASS;3-パス+fast TP_RAW_AHD;AHD TP_RAW_AMAZE;AMaZE TP_RAW_AMAZEVNG4;AMaZE+VNG4 @@ -2029,7 +2038,7 @@ TP_SHARPENMICRO_CONTRAST;コントラストのしきい値 TP_SHARPENMICRO_LABEL;マイクロコントラスト TP_SHARPENMICRO_MATRIX;3×3マトリクスの代わりに 5×5 TP_SHARPENMICRO_UNIFORMITY;均等 -TP_SOFTLIGHT_LABEL;ソフトな明るさ +TP_SOFTLIGHT_LABEL;ソフトライト TP_SOFTLIGHT_STRENGTH;強さ TP_TM_FATTAL_AMOUNT;量 TP_TM_FATTAL_ANCHOR;アンカー @@ -2278,16 +2287,3 @@ ZOOMPANEL_ZOOMFITSCREEN;画像全体を画面に合わせる\nショートカッ ZOOMPANEL_ZOOMIN;ズームイン\nショートカット: + ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - -!!!!!!!!!!!!!!!!!!!!!!!!! -! Untranslated keys follow; remove the ! prefix after an entry is translated. -!!!!!!!!!!!!!!!!!!!!!!!!! - -!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. -!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations -!HISTORY_MSG_RAWCACORR_COLOURSHIFT;Raw CA Correction - Avoid color shift -!PREFERENCES_PERFORMANCE_THREADS;Threads -!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) -!PREFERENCES_TAB_PERFORMANCE;Performance -!SAVEDLG_FILEFORMAT_FLOAT; floating-point -!TP_RAWCACORR_AUTOIT;Iterations -!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift From 0355a9c9176b74cc76dc75c125e76e11ef3d8fdf Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 17 Sep 2018 08:04:25 +0200 Subject: [PATCH 39/53] Japanese translation correction, fixes #4811 --- rtdata/languages/Japanese | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index 038548deb..2615eccb3 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -779,8 +779,8 @@ HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - 振れに対するデモザイクの方式 HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;ラインノイズフィルタの方向 HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAFラインフィルタ HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - コントラストのしきい値 -HISTORY_MSG_RAWCACORR_AUTOIT;Rawの色順応補正 - 繰り返し -HISTORY_MSG_RAWCACORR_COLOURSHIFT;Rawの色順応補正 - 色ずれを回避 +HISTORY_MSG_RAWCACORR_AUTOIT;Rawの色収差補正 - 繰り返し +HISTORY_MSG_RAWCACORR_COLOURSHIFT;Rawの色収差補正 - 色ずれを回避 HISTORY_MSG_RAW_BORDER;Rawの境界 HISTORY_MSG_RESIZE_ALLOWUPSCALING;リサイズ - アップスケーリングを可能にする HISTORY_MSG_SHARPENING_CONTRAST;シャープ化 - コントラストのしきい値 From 65ec17b621b00c66ebb603d53e5bb6223db5b4d3 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 17 Sep 2018 12:30:48 +0200 Subject: [PATCH 40/53] decode Nikon Z7 uncompressed 12-bit NEF, #4801 --- rtengine/dcraw.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index bd9fa4b47..d302eb425 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -6692,6 +6692,14 @@ void CLASS apply_tiff() load_raw = &CLASS unpacked_load_raw; load_flags = 4; order = 0x4d4d; + } else if ((raw_width * raw_height * 2 * tiff_bps) / 16 == tiff_ifd[raw].bytes) { + // 12 bit uncompressed from Nikon Z7 + load_raw = &CLASS packed_load_raw; + } else if ((raw_width * 2 * tiff_bps / 16 + 8) * raw_height == tiff_ifd[raw].bytes) { + // 14 bit uncompressed from Nikon Z7, still wrong + // each line has 8 padding byte. To inform 'packed_load_raw' about his padding, we have to set load_flags = padding << 9 + load_flags = 8 << 9; + load_raw = &CLASS packed_load_raw; } else load_raw = &CLASS nikon_load_raw; break; case 65535: From 7d6fffcbffd3d7353c01a4d21f4b0cd0cfab5496 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 17 Sep 2018 13:10:34 +0200 Subject: [PATCH 41/53] Coverity 191036 Dereference after null check --- rtgui/icmpanel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 936b68fd0..01b15d4b8 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -686,7 +686,7 @@ void ICMPanel::setDefaults(const ProcParams* defParams, const ParamsEdited* pedi void ICMPanel::adjusterChanged(Adjuster* a, double newval) { - if (listener || batchMode) { + if (listener) { Glib::ustring costr2 = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), newval); if (a == wGamma) { From 2590afa2f40560b51634a3bfc2f086f73650a3fb Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 17 Sep 2018 13:18:58 +0200 Subject: [PATCH 42/53] Coverity 191034 Uninitialized scalar variable --- rtengine/dcrop.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 2d376044e..002747070 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -960,9 +960,7 @@ void Crop::update(int todo) if (params.wavelet.Tilesmethod == "big") { realtile = 22; - } - - if (params.wavelet.Tilesmethod == "lit") { + } else /*if (params.wavelet.Tilesmethod == "lit")*/ { realtile = 12; } From 5d00cb05b41f4d97ed9fce222716cc54ccdccdb6 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 17 Sep 2018 13:26:50 +0200 Subject: [PATCH 43/53] Coverity 185774, 185779 Uninitialized pointer read --- rtengine/FTblockDN.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 0e5cd58a2..ce3b3ac9b 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -1741,7 +1741,7 @@ BENCHFUN } - if (denoiseLuminance) { + if (denoiseLuminance && numtiles >= 1) { for (int i = 0; i < denoiseNestedLevels * numthreads; ++i) { fftwf_free(LbloxArray[i]); fftwf_free(fLbloxArray[i]); From e50b68208daacec90d505be8681beb1c315b7022 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 17 Sep 2018 17:21:02 +0200 Subject: [PATCH 44/53] manual raw ca correction: set usable range to [-4;4] --- rtgui/rawcacorrection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 37f01cfcf..bdcc13442 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -46,7 +46,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutoiterations->delay = options.adjusterMaxDelay; } - caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"), -8.0, 8.0, 0.1, 0, icaredL, icaredR)); + caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"), -4.0, 4.0, 0.1, 0, icaredL, icaredR)); caRed->setAdjusterListener (this); if (caRed->delay < options.adjusterMaxDelay) { From 6fb92a41655f42a27f76bb03968e1a33f9bd2698 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 17 Sep 2018 12:49:55 -0700 Subject: [PATCH 45/53] Mac: make Frameworks folder flat codesign command does not accept subfolders in Frameworks, so mv the contents of two subfolders back out to the Frameworks directory. --- tools/osx/macosx_bundle.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 20a140ce5..591699cbb 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -125,10 +125,15 @@ find -E "${LIB}" -type f -regex '.*\.(a|la|cache)$' | while read -r; do rm "${RE msg "Copying configuration files from ${GTK_PREFIX}:" install -d "${ETC}/gtk-3.0" -cp "${GTK_PREFIX}/etc/gtk-3.0/im-multipress.conf" "${ETC}/gtk-3.0" -"${GTK_PREFIX}/bin/gdk-pixbuf-query-loaders" "${LIB}"/gdk-pixbuf-2.0/*/loaders/*.so > "${ETC}/gtk-3.0/gdk-pixbuf.loaders" -"${GTK_PREFIX}/bin/gtk-query-immodules-3.0" "${LIB}"/gtk-3.0/*/immodules/*.so > "${ETC}/gtk-3.0/gtk.immodules" -#sed -i "" -e "s|${PWD}|/tmp|" "${ETC}/gtk-3.0/gdk-pixbuf.loaders" "${ETC}/gtk-3.0/gtk.immodules" + +# Make Frameworks folder flat +mv "${LIB}"/gdk-pixbuf-2.0/2*/loaders/*.so "${LIB}" +mv "${LIB}"/gtk-3.0/3*/immodules/*.so "${LIB}" +rm -r "${LIB}"/gtk-3.0 +rm -r "${LIB}"/gdk-pixbuf-2.0 + +"${GTK_PREFIX}/bin/gdk-pixbuf-query-loaders" "${LIB}"/libpix*.so > "${ETC}/gtk-3.0/gdk-pixbuf.loaders" +"${GTK_PREFIX}/bin/gtk-query-immodules-3.0" "${LIB}"/{im*.so,libprint*.so} > "${ETC}/gtk-3.0/gtk.immodules" sed -i "" -e "s|${PWD}/RawTherapee.app/Contents/|@executable_path/../|" "${ETC}/gtk-3.0/gdk-pixbuf.loaders" "${ETC}/gtk-3.0/gtk.immodules" ditto {"${GTK_PREFIX}","${RESOURCES}"}/share/glib-2.0/schemas @@ -147,13 +152,6 @@ done ditto {"${GTK_PREFIX}","${RESOURCES}"}/share/icons/Adwaita/index.theme "${GTK_PREFIX}/bin/gtk-update-icon-cache-3.0" "${RESOURCES}/share/icons/Adwaita" -### Pending deletion: -# fontconfig files (X11 backend only) -# if otool -L "${EXECUTABLE}" | grep -sq 'libgtk-x11-2.0'; then -# msg "Installing fontconfig files (Using X11 backend. FONTCONFIG_PATH will be set by executable loader.)" -# cp -RL "${GTK_PREFIX}/etc/fonts" "${ETC}" -# fi - # Copy the Lensfun database into the app bundle mkdir -p "${RESOURCES}/share/lensfun" cp /opt/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" From 1a191363ce1728b15f0c8324c82342d23226c20d Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 17 Sep 2018 22:46:57 +0200 Subject: [PATCH 46/53] review ImProcFunctions::CompressDR(), fixes #4815 --- rtengine/improcfun.h | 3 +- rtengine/ipwavelet.cc | 99 ++++++------------------------------------- 2 files changed, 13 insertions(+), 89 deletions(-) diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index c857d3d05..a97ecef40 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -255,9 +255,8 @@ public: void EPDToneMapResid(float * WavCoeffs_L0, unsigned int Iterates, int skip, struct cont_params& cp, int W_L, int H_L, float max0, float min0); - float *CompressDR(float *Source, int W_L, int H_L, float Compression, float DetailBoost, float *Compressed); + void CompressDR(float *Source, int W_L, int H_L, float Compression, float DetailBoost); void ContrastResid(float * WavCoeffs_L0, struct cont_params &cp, int W_L, int H_L, float max0, float min0); - float *ContrastDR(float *Source, int W_L, int H_L, float *Contrast = nullptr); void EPDToneMap(LabImage *lab, unsigned int Iterates = 0, int skip = 1); void EPDToneMapCIE(CieImage *ncie, float a_w, float c_, int Wid, int Hei, float minQ, float maxQ, unsigned int Iterates = 0, int skip = 1); diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index def469b70..35a9d0f16 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1425,67 +1425,11 @@ void ImProcFunctions::Eval2 (float ** WavCoeffs_L, int level, MaxN[level] = maxLN; } -float *ImProcFunctions::ContrastDR(float *Source, int W_L, int H_L, float *Contrast) -{ - int n = W_L * H_L; - - if(Contrast == nullptr) { - Contrast = new float[n]; - } - - memcpy(Contrast, Source, n * sizeof(float)); -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int i = 0; i < W_L * H_L; i++) { //contrast - Contrast[i] = Source[i] ; - } - - return Contrast; -} - -float *ImProcFunctions::CompressDR(float *Source, int W_L, int H_L, float Compression, float DetailBoost, float *Compressed) +void ImProcFunctions::CompressDR(float *Source, int W_L, int H_L, float Compression, float DetailBoost) { - const float eps = 0.000001f; - int n = W_L * H_L; - -#ifdef __SSE2__ -#ifdef _OPENMP - #pragma omp parallel -#endif - { - __m128 epsv = _mm_set1_ps( eps ); -#ifdef _OPENMP - #pragma omp for -#endif - - for(int ii = 0; ii < n - 3; ii += 4) { - _mm_storeu_ps( &Source[ii], xlogf(LVFU(Source[ii]) + epsv)); - } - } - - for(int ii = n - (n % 4); ii < n; ii++) { - Source[ii] = xlogf(Source[ii] + eps); - } - -#else -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for(int ii = 0; ii < n; ii++) { - Source[ii] = xlogf(Source[ii] + eps); - } - -#endif - - float *ucr = ContrastDR(Source, W_L, H_L); - - if(Compressed == nullptr) { - Compressed = ucr; - } + constexpr float eps = 0.000001f; + const int n = W_L * H_L; float temp; @@ -1501,39 +1445,30 @@ float *ImProcFunctions::CompressDR(float *Source, int W_L, int H_L, float Compre float betemp = expf(-(2.f - DetailBoost + 0.694f)) - 1.f; //0.694 = log(2) temp = 1.2f * xlogf( -betemp); temp /= (-2.f * DetailBoost + 5.5f); - } - - else { + } else { temp = (Compression - 1.0f) / 20.f; } + temp += 1.f; + #ifdef __SSE2__ #ifdef _OPENMP #pragma omp parallel #endif { - __m128 cev, uev, sourcev; - __m128 epsv = _mm_set1_ps( eps ); - __m128 DetailBoostv = _mm_set1_ps( DetailBoost ); - __m128 tempv = _mm_set1_ps( temp ); + vfloat epsv = F2V(eps); + vfloat tempv = F2V(temp); #ifdef _OPENMP #pragma omp for #endif for(int i = 0; i < n - 3; i += 4) { - cev = xexpf(LVFU(Source[i]) + LVFU(ucr[i]) * (tempv)) - epsv; - uev = xexpf(LVFU(ucr[i])) - epsv; - sourcev = xexpf(LVFU(Source[i])) - epsv; - _mm_storeu_ps( &Source[i], sourcev); - _mm_storeu_ps( &Compressed[i], cev + DetailBoostv * (sourcev - uev) ); + STVFU(Source[i], xexpf(xlogf(LVFU(Source[i]) + epsv) * tempv) - epsv); } } for(int i = n - (n % 4); i < n; i++) { - float ce = xexpf(Source[i] + ucr[i] * (temp)) - eps; - float ue = xexpf(ucr[i]) - eps; - Source[i] = xexpf(Source[i]) - eps; - Compressed[i] = ce + DetailBoost * (Source[i] - ue); + Source[i] = xexpf(xlogf(Source[i] + eps) * temp) - eps; } #else @@ -1542,21 +1477,11 @@ float *ImProcFunctions::CompressDR(float *Source, int W_L, int H_L, float Compre #endif for(int i = 0; i < n; i++) { - float ce = xexpf(Source[i] + ucr[i] * (temp)) - eps; - float ue = xexpf(ucr[i]) - eps; - Source[i] = xexpf(Source[i]) - eps; - Compressed[i] = ce + DetailBoost * (Source[i] - ue); + Source[i] = xexpf(xlogf(Source[i] + eps) * temp) - eps; } #endif - if(Compressed != ucr) { - delete[] ucr; - } - - return Compressed; - - } void ImProcFunctions::ContrastResid(float * WavCoeffs_L0, struct cont_params &cp, int W_L, int H_L, float max0, float min0) @@ -1589,7 +1514,7 @@ void ImProcFunctions::ContrastResid(float * WavCoeffs_L0, struct cont_params &cp } - CompressDR(WavCoeffs_L0, W_L, H_L, Compression, DetailBoost, WavCoeffs_L0); + CompressDR(WavCoeffs_L0, W_L, H_L, Compression, DetailBoost); #ifdef _OPENMP From 2bea84cfa80b22ce06715961697d01873af911e5 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 17 Sep 2018 23:46:36 +0200 Subject: [PATCH 47/53] ImProcFunctions::CompressDR(): eliminate eps, #4815 --- rtengine/ipwavelet.cc | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 35a9d0f16..e4a61caa0 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1427,48 +1427,46 @@ void ImProcFunctions::Eval2 (float ** WavCoeffs_L, int level, void ImProcFunctions::CompressDR(float *Source, int W_L, int H_L, float Compression, float DetailBoost) { - - constexpr float eps = 0.000001f; const int n = W_L * H_L; - float temp; + float exponent; if(DetailBoost > 0.f && DetailBoost < 0.05f ) { float betemp = expf(-(2.f - DetailBoost + 0.694f)) - 1.f; //0.694 = log(2) - temp = 1.2f * xlogf( -betemp); - temp /= 20.f; + exponent = 1.2f * xlogf( -betemp); + exponent /= 20.f; } else if(DetailBoost >= 0.05f && DetailBoost < 0.25f ) { float betemp = expf(-(2.f - DetailBoost + 0.694f)) - 1.f; //0.694 = log(2) - temp = 1.2f * xlogf( -betemp); - temp /= (-75.f * DetailBoost + 23.75f); + exponent = 1.2f * xlogf( -betemp); + exponent /= (-75.f * DetailBoost + 23.75f); } else if(DetailBoost >= 0.25f) { float betemp = expf(-(2.f - DetailBoost + 0.694f)) - 1.f; //0.694 = log(2) - temp = 1.2f * xlogf( -betemp); - temp /= (-2.f * DetailBoost + 5.5f); + exponent = 1.2f * xlogf( -betemp); + exponent /= (-2.f * DetailBoost + 5.5f); } else { - temp = (Compression - 1.0f) / 20.f; + exponent = (Compression - 1.0f) / 20.f; } - temp += 1.f; + exponent += 1.f; + // now calculate Source = pow(Source, exponent) #ifdef __SSE2__ #ifdef _OPENMP #pragma omp parallel #endif { - vfloat epsv = F2V(eps); - vfloat tempv = F2V(temp); + vfloat exponentv = F2V(exponent); #ifdef _OPENMP #pragma omp for #endif for(int i = 0; i < n - 3; i += 4) { - STVFU(Source[i], xexpf(xlogf(LVFU(Source[i]) + epsv) * tempv) - epsv); + STVFU(Source[i], xexpf(xlogf(LVFU(Source[i])) * exponentv)); } } for(int i = n - (n % 4); i < n; i++) { - Source[i] = xexpf(xlogf(Source[i] + eps) * temp) - eps; + Source[i] = xexpf(xlogf(Source[i]) * exponent); } #else @@ -1477,7 +1475,7 @@ void ImProcFunctions::CompressDR(float *Source, int W_L, int H_L, float Compress #endif for(int i = 0; i < n; i++) { - Source[i] = xexpf(xlogf(Source[i] + eps) * temp) - eps; + Source[i] = xexpf(xlogf(Source[i]) * exponent); } #endif From efaae15f111814b50f1cedd1fd2a653db3eed8e2 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 17 Sep 2018 15:51:59 -0700 Subject: [PATCH 48/53] Mac: set a cached variable with codesign ID --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea95d818c..bca387153 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,12 @@ if(DEFINED LENSFUNDBDIR AND NOT IS_ABSOLUTE "${LENSFUNDBDIR}") set(LENSFUNDBDIR "${DATADIR}/${LENSFUNDBDIR}") endif() +if(APPLE) + if("${CODESIGNID}") + set(CODESIGNID "${CODESIGNID}" CAHCE STRING "Codesigning Identity") + endif() +endif() + # Enforce absolute paths for non-bundle builds: if(NOT BUILD_BUNDLE) foreach(path BINDIR DATADIR LIBDIR DOCDIR CREDITSDIR LICENCEDIR) From d6e4ba296e9018835b8150cc0bb2a80bd0720bc8 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 17 Sep 2018 15:58:19 -0700 Subject: [PATCH 49/53] Mac: codesign app and dmg Gets the cached CODESIGNID value via cmake and signs the app and dmg with it. --- tools/osx/macosx_bundle.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 591699cbb..e5c9d0bd3 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -199,8 +199,11 @@ s|@arch@|${arch}|" \ "${CONTENTS}/Info.plist" plutil -convert binary1 "${CONTENTS}/Info.plist" - - +# Sign the app +CODESIGNID="$(cmake .. -LA -N | grep "CODESIGNID" | cut -d "=" -f2)" +codesign --deep --force -v -s "${CODESIGNID}" "${APP}" +spctl -a -vvvv "${APP}" + function CreateDmg { local srcDir="$(mktemp -dt $$)" @@ -227,6 +230,9 @@ function CreateDmg { msg "Creating disk image:" hdiutil create -format UDBZ -srcdir "${srcDir}" -volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" "${dmg_name}.dmg" + # Sign disk image + codesign --deep --force -v -s "${CODESIGNID}" "${dmg_name}.dmg" + # Zip disk image for redistribution zip "${dmg_name}.zip" "${dmg_name}.dmg" AboutThisBuild.txt rm "${dmg_name}.dmg" From cdc187f9aa88135f7c57dfad71374da85d93f6ac Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 17 Sep 2018 16:39:48 -0700 Subject: [PATCH 50/53] Mac: fix typo I made --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bca387153..f2739c4da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,7 +254,7 @@ endif() if(APPLE) if("${CODESIGNID}") - set(CODESIGNID "${CODESIGNID}" CAHCE STRING "Codesigning Identity") + set(CODESIGNID "${CODESIGNID}" CACHE STRING "Codesigning Identity") endif() endif() From 1ae01f40b984091738d6ff7c5f977f7da3687f85 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 18 Sep 2018 13:09:58 +0200 Subject: [PATCH 51/53] Verbose console output is jumbled, fixes #4558 --- rtengine/init.cc | 2 +- rtgui/lensprofile.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/init.cc b/rtengine/init.cc index 0d4560c6b..7d944fc0b 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -49,7 +49,7 @@ int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDi RawImageSource::init(); #ifdef _OPENMP -#pragma omp parallel sections +#pragma omp parallel sections if (!settings->verbose) #endif { #ifdef _OPENMP diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index a89fdb51e..a725ae9f8 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -604,7 +604,7 @@ bool LensProfilePanel::checkLensfunCanCorrect(bool automatch) LensProfilePanel::LFDbHelper::LFDbHelper() { #ifdef _OPENMP -#pragma omp parallel sections +#pragma omp parallel sections if (!options.rtSettings.verbose) #endif { #ifdef _OPENMP From 260d7fadf99fa26d6e265fb4fec1e819d8bf7ba6 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 18 Sep 2018 14:28:39 +0200 Subject: [PATCH 52/53] Adjustments in Batch Edit sometimes clear the HaldCLUT combo box, fixes #4720 --- rtgui/filmsimulation.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc index ba8f6740b..73e35b2f8 100644 --- a/rtgui/filmsimulation.cc +++ b/rtgui/filmsimulation.cc @@ -135,6 +135,8 @@ void FilmSimulation::read( const rtengine::procparams::ProcParams* pp, const Par : pp->filmSimulation.clutFilename ); m_oldClutFilename = m_clutComboBox->getSelectedClut(); + } else { + m_clutComboBox->set_active(-1); } m_strength->setValue(pp->filmSimulation.strength); @@ -249,7 +251,7 @@ void ClutComboBox::setBatchMode(bool yes) if (batchMode != yes) { batchMode = yes; set_model(m_model()); - if (batchMode && options.multiDisplayMode) { + if (batchMode) { updateUnchangedEntry(); } } @@ -270,7 +272,6 @@ void ClutComboBox::updateUnchangedEntry() if (c.size() > 0) { Gtk::TreeModel::Row row = c[c.size()-1]; if (row[m_columns().clutFilename] == "NULL") { - std::cout << " removing " << ((void *)this) << std::endl; m_model()->erase(row); } } From bf13654a67320a73ef778b047c5f44fcb3f6927e Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 18 Sep 2018 19:19:39 +0200 Subject: [PATCH 53/53] Finally fix covertiy issues 185774 and 185779 / Uninitialized pointer read --- rtengine/FTblockDN.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index ce3b3ac9b..8f90be744 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -805,8 +805,8 @@ BENCHFUN } #endif - float *LbloxArray[denoiseNestedLevels * numthreads]; - float *fLbloxArray[denoiseNestedLevels * numthreads]; + float *LbloxArray[denoiseNestedLevels * numthreads] = {}; + float *fLbloxArray[denoiseNestedLevels * numthreads] = {}; if (numtiles > 1 && denoiseLuminance) { for (int i = 0; i < denoiseNestedLevels * numthreads; ++i) { @@ -1741,9 +1741,11 @@ BENCHFUN } - if (denoiseLuminance && numtiles >= 1) { - for (int i = 0; i < denoiseNestedLevels * numthreads; ++i) { + for (int i = 0; i < denoiseNestedLevels * numthreads; ++i) { + if (LbloxArray[i]) { fftwf_free(LbloxArray[i]); + } + if (fLbloxArray[i]) { fftwf_free(fLbloxArray[i]); } }