merge wit dev

This commit is contained in:
Desmis 2019-11-07 07:17:19 +01:00
commit d621721ffe
417 changed files with 4353 additions and 5352 deletions

View File

@ -89,6 +89,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}")
# Stop compilation on typos such as std:swap (missing colon will be detected as unused label):
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-label")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=delete-incomplete")
# Special treatment for x87 and x86-32 SSE (see GitHub issue #4324)
include(FindX87Math)

Binary file not shown.

Binary file not shown.

View File

@ -1867,9 +1867,9 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: <b>-</b>
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_LABEL;Film Simulation
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?

View File

@ -1814,9 +1814,9 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: <b>-</b>
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_LABEL;Film Simulation
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?

View File

@ -961,8 +961,8 @@ MAIN_TOOLTIP_BACKCOLOR2;Barva pozadí náhledu: <b>bílá</b>\nZkratka: <b>9</b>
MAIN_TOOLTIP_BACKCOLOR3;Barva pozadí náhledu: <b>středně šedá</b>\nZkratka: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Zamknout</b> / <b>Odemknout</b> pohled <b>Před</b>\n\n<b>Zamknout</b>: ponechá pohled <b>Před</b> nezměněn.\nUžitečné pro posouzení výsledného efektu po použití více nástrojů.\nNavíc může být porovnání provedeno proti kterémukoli stavu v historii.\n\n<b>Odemknout</b>: pohled <b>Před</b> bude následovat pohled <b>Poté</b>, vždy jen o jeden krok zpět, představí vliv právě použitého nástroje.
MAIN_TOOLTIP_HIDEHP;Zobrazit či schovat levý panel (obsahující historii).\nZkratka: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Zvýraznit oříznutá světla.\nZkratka: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Zvýraznit oříznuté stíny.\nZkratka: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Zvýraznit oříznutá světla.\nZkratka: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Zvýraznit oříznuté stíny.\nZkratka: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Náhled <b>modrého kanálu</b>.\nZkratka: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Náhled <b>masky zaostření</b>.\nZkratka: <b>Shift-f</b>\n\nVíce přesné u snímků s nízkou hloubkou ostrosti, nízkým šumem a na vyšších úrovních zvětšení.\n\nPoužijte přiblížení v rozsahu 10 až 30% pro zlepšení přesnosti detekce u zašuměných snímků.
MAIN_TOOLTIP_PREVIEWG;Náhled <b>zeleného kanálu</b>.\nZkratka: <b>g</b>
@ -2340,9 +2340,9 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: <b>-</b>
!TP_DEHAZE_LUMINANCE;Luminance only
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_PDSHARPENING_LABEL;Capture Sharpening
!TP_SHARPENING_GAMMA;Gamma

View File

@ -82,6 +82,7 @@
#81 15.04.2019 Erweiterung (TooWaBoo) RT 5.6
#82 25.05.2019 Erweiterung (TooWaBoo) RT 5.6
#83 06.07.2019 Erweiterung (TooWaBoo) RT 5.6
#84 06.10.2019 Erweiterung (TooWaBoo) RT 5.7
#84 18.07.2019 Erweiterung (TooWaBoo) RT 5.6
ABOUT_TAB_BUILD;Version
@ -808,6 +809,7 @@ HISTORY_MSG_490;(Dynamikkompression)\nIntensität
HISTORY_MSG_491;(Weißabgleich)
HISTORY_MSG_492;(RGB-Kurven)
HISTORY_MSG_493;(L*a*b*)
HISTORY_MSG_494;(Eingangsschärfung)
HISTORY_MSG_CLAMPOOG;(Belichtung) - Farben\nauf Farbraum beschränken
HISTORY_MSG_COLORTONING_LABGRID_VALUE;(Farbanpassungen)\nL*a*b*-Farbkorrektur
HISTORY_MSG_COLORTONING_LABREGION_AB;(Farbanpassungen)\nL*a*b*-Farbkorrektur\nBereich
@ -825,6 +827,7 @@ HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;(Farbanpassungen)\nL*a*b*-Farbkorrekt
HISTORY_MSG_COLORTONING_LABREGION_SLOPE;(Farbanpassungen)\nL*a*b*-Farbkorrektur\nBereich - Steigung
HISTORY_MSG_DEHAZE_DEPTH;(Bildschleier entfernen)\nTiefe
HISTORY_MSG_DEHAZE_ENABLED;(Bildschleier entfernen)
HISTORY_MSG_DEHAZE_LUMINANCE;(Bildschleier entfernen)\nNur Luminanz
HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;(Bildschleier entfernen)\nMaske anzeigen
HISTORY_MSG_DEHAZE_STRENGTH;(Bildschleier entfernen)\nIntensität
HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;(Sensor—Matrix)\nFarbinterpolation\nAuto-Kontrastschwelle
@ -845,6 +848,13 @@ HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;(Lokaler Kontrast)\nHelle Bereiche
HISTORY_MSG_LOCALCONTRAST_RADIUS;(Lokaler Kontrast)\nRadius
HISTORY_MSG_METADATA_MODE;(Metadaten)\nKopiermodus
HISTORY_MSG_MICROCONTRAST_CONTRAST;(Mikrokontrast)\nKontrastschwelle
HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;(Eingangsschärfung)\nAuto-Schwelle
HISTORY_MSG_PDSHARPEN_AUTO_RADIUS;(Eingangsschärfung)\nAuto-Radius
HISTORY_MSG_PDSHARPEN_CONTRAST;(Eingangsschärfung)\nKontrastschwelle
HISTORY_MSG_PDSHARPEN_GAMMA;(Eingangsschärfung)\nGamma
HISTORY_MSG_PDSHARPEN_ITERATIONS;(Eingangsschärfung)\nIterationen
HISTORY_MSG_PDSHARPEN_RADIUS;(Eingangsschärfung)\nRadius
HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;(Eingangsschärfung)\nRandschärfe erhöhen
HISTORY_MSG_PIXELSHIFT_DEMOSAIC;(Sensor-Matrix)\nFarbinterpolation - PS\nBewegungsmethode
HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;(Sensor-Matrix)\nVorverarbeitung\nRichtung
HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;(Sensor-Matrix)\nVorverarbeitung\nPDAF-Zeilenfilter
@ -855,6 +865,7 @@ HISTORY_MSG_RAW_BORDER;(Sensor-Matrix)\nFarbinterpolation\nBildrand
HISTORY_MSG_RESIZE_ALLOWUPSCALING;(Skalieren)\nHochskalieren zulassen
HISTORY_MSG_SHARPENING_BLUR;(Schärfung)\nWeichzeichnerradius
HISTORY_MSG_SHARPENING_CONTRAST;(Schärfung)\nKontrastschwelle
HISTORY_MSG_SHARPENING_GAMMA;(Schärfung) - Gamma
HISTORY_MSG_SH_COLORSPACE;Farbraum
HISTORY_MSG_SOFTLIGHT_ENABLED;(Weiches Licht)
HISTORY_MSG_SOFTLIGHT_STRENGTH;(Weiches Licht)\nIntensität
@ -1011,8 +1022,8 @@ MAIN_TOOLTIP_BACKCOLOR2;Hintergrundfarbe der Vorschau: <b>Weiß</b>\nTaste: <b>9
MAIN_TOOLTIP_BACKCOLOR3;Hintergrundfarbe der Vorschau: <b>Mittleres Grau</b>\nTaste: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Vorher-Ansicht:</b> Sperren / Entsperren\n\n<b>Gesperrt</b>: Friert die Vorher-Ansicht ein, so\ndass sich die Gesamtwirkung mehrerer\nBearbeitungsschritte beurteilen lässt.\n\n<b>Entsperrt</b>: Die Vorher-Ansicht hinkt dem\naktuellen Bild immer einen Bearbeitungs-\nschritt hinterher.
MAIN_TOOLTIP_HIDEHP;Linkes Bedienfeld ein-/ausblenden.\nTaste: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Anzeige zu heller Bereiche ein-/ausschalten.\nTaste: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Anzeige zu dunkler Bereiche ein-/ausschalten.\nTaste: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Anzeige zu heller Bereiche ein-/ausschalten.\nTaste: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Anzeige zu dunkler Bereiche ein-/ausschalten.\nTaste: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Vorschau Blau-Kanal\nTaste: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Vorschau Fokusmaske\nTaste: <b>Umschalt</b> + <b>f</b>\n\nPräziser bei Bildern mit geringer Tiefenschärfe,\nniedrigem Rauschen und bei hoher Vergrößerung.
MAIN_TOOLTIP_PREVIEWG;Vorschau Grün-Kanal\nTaste: <b>g</b>
@ -1613,6 +1624,7 @@ TP_DEFRINGE_RADIUS;Radius
TP_DEFRINGE_THRESHOLD;Schwelle
TP_DEHAZE_DEPTH;Tiefe
TP_DEHAZE_LABEL;Bildschleier entfernen
TP_DEHAZE_LUMINANCE;Nur Luminanz
TP_DEHAZE_SHOW_DEPTH_MAP;Maske anzeigen
TP_DEHAZE_STRENGTH;Intensität
TP_DIRPYRDENOISE_CHROMINANCE_AMZ;Auto-Multizonen
@ -1723,9 +1735,9 @@ TP_EXPOS_BLACKPOINT_LABEL;Schwarzpunkt
TP_EXPOS_WHITEPOINT_LABEL;Weißpunkt
TP_FILMNEGATIVE_BLUE;Blauverhältnis
TP_FILMNEGATIVE_GREEN;Bezugsexponent (Kontrast)
TP_FILMNEGATIVE_GUESS_TOOLTIP;Berechnet die Exponenten durch Auswahl zweier neutraler\nReferenzpunkte im Bild. Weiß (Hellgrau) und Schwarz (Dunkelgrau).\nDie Reihenfolge spielt keine Rolle. Die Exponenten werden aktualisiert,\nnachdem der zweite Punkt ausgewählt wurde.
TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
TP_FILMNEGATIVE_LABEL;Filmnegativ
TP_FILMNEGATIVE_PICK;Weißen und schwarzen Bereich auswählen
TP_FILMNEGATIVE_PICK;Pick neutral spots
TP_FILMNEGATIVE_RED;Rotverhältnis
TP_FILMSIMULATION_LABEL;Filmsimulation
TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee sucht nach Hald-CLUT-Bildern, die für die Filmsimulation benötigt werden, in einem Ordner, der viel Zeit benötigt.\nGehen Sie zu\n< Einstellungen > Bildbearbeitung > Filmsimulation >\nund prüfen Sie welcher Order benutzt wird. Wählen Sie den Ordner aus, der nur die Hald-CLUT-Bilder beinhaltet, oder einen leeren Ordner, wenn Sie die Filsimulation nicht verwenden möchten.\n\nWeitere Informationen über die Filmsimulation finden Sie auf RawPedia.\n\nMöchten Sie die Suche beenden?
@ -1875,6 +1887,7 @@ TP_PCVIGNETTE_ROUNDNESS;Form
TP_PCVIGNETTE_ROUNDNESS_TOOLTIP;Form:\n0 = Rechteck\n50 = Ellipse\n100 = Kreis
TP_PCVIGNETTE_STRENGTH;Intensität
TP_PCVIGNETTE_STRENGTH_TOOLTIP;Filterstärke in Blendenstufen (bezogen auf die Bildecken).
TP_PDSHARPENING_LABEL;Eingangsschärfung
TP_PERSPECTIVE_HORIZONTAL;Horizontal
TP_PERSPECTIVE_LABEL;Perspektive
TP_PERSPECTIVE_VERTICAL;Vertikal
@ -2104,12 +2117,14 @@ TP_SHARPENING_BLUR;Weichzeichnerradius
TP_SHARPENING_CONTRAST;Kontrastschwelle
TP_SHARPENING_EDRADIUS;Radius
TP_SHARPENING_EDTOLERANCE;Kantentoleranz
TP_SHARPENING_GAMMA;Gamma
TP_SHARPENING_HALOCONTROL;Halokontrolle
TP_SHARPENING_HCAMOUNT;Intensität
TP_SHARPENING_LABEL;Schärfung
TP_SHARPENING_METHOD;Methode
TP_SHARPENING_ONLYEDGES;Nur Kanten schärfen
TP_SHARPENING_RADIUS;Radius
TP_SHARPENING_RADIUS_BOOST;Randschärfe erhöhen
TP_SHARPENING_RLD;RL-Dekonvolution
TP_SHARPENING_RLD_AMOUNT;Intensität
TP_SHARPENING_RLD_DAMPING;Dämpfung
@ -2371,21 +2386,3 @@ ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen.\nTaste: <b>Alt</b> + <b>f</b>
ZOOMPANEL_ZOOMIN;Hineinzoomen\nTaste: <b>+</b>
ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: <b>-</b>
!!!!!!!!!!!!!!!!!!!!!!!!!
! Untranslated keys follow; remove the ! prefix after an entry is translated.
!!!!!!!!!!!!!!!!!!!!!!!!!
!HISTORY_MSG_494;Capture Sharpening
!HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only
!HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold
!HISTORY_MSG_PDSHARPEN_AUTO_RADIUS;CS - Auto radius
!HISTORY_MSG_PDSHARPEN_CONTRAST;CS - Contrast threshold
!HISTORY_MSG_PDSHARPEN_GAMMA;CS - Gamma
!HISTORY_MSG_PDSHARPEN_ITERATIONS;CS - Iterations
!HISTORY_MSG_PDSHARPEN_RADIUS;CS - Radius
!HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;CS - Corner radius boost
!HISTORY_MSG_SHARPENING_GAMMA;Sharpening - Gamma
!TP_DEHAZE_LUMINANCE;Luminance only
!TP_PDSHARPENING_LABEL;Capture Sharpening
!TP_SHARPENING_GAMMA;Gamma
!TP_SHARPENING_RADIUS_BOOST;Corner radius boost

View File

@ -88,6 +88,7 @@ TP_DIRPYREQUALIZER_ALGO;Skin Colour Range
TP_DIRPYREQUALIZER_ALGO_TOOLTIP;Fine: closer to the colours of the skin, minimizing the action on other colours\nLarge: avoid more artifacts.
TP_DIRPYREQUALIZER_TOOLTIP;Attempts to reduce artifacts in the transitions between skin colours (hue, chroma, luma) and the rest of the image.
TP_EXPOSURE_CLAMPOOG;Clip out-of-gamut colours
TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no colour) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
TP_FLATFIELD_CLIPCONTROL_TOOLTIP;Clip control avoids clipped highlights caused by applying the flat field. If there are already clipped highlights before applying the flat field, clip control can lead to colour cast.
TP_GRADIENT_CENTER;Centre
TP_GRADIENT_CENTER_X;Centre X
@ -1022,8 +1023,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh
!MAIN_TAB_TRANSFORM_TOOLTIP;Shortcut: <b>Alt-t</b>
!MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Lock</b> / <b>Unlock</b> the <b>Before</b> view\n\n<b>Lock</b>: keep the <b>Before</b> view unchanged.\nUseful to evaluate the cumulative effect of multiple tools.\nAdditionally, comparisons can be made to any state in the History.\n\n<b>Unlock</b>: the <b>Before</b> view will follow the <b>After</b> view one step behind, showing the image before the effect of the currently used tool.
!MAIN_TOOLTIP_HIDEHP;Show/Hide the left panel (including the history).\nShortcut: <b>l</b>
!MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication.\nShortcut: <b>&lt;</b>
!MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication.\nShortcut: <b>&gt;</b>
!MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication.\nShortcut: <b>&gt;</b>
!MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication.\nShortcut: <b>&lt;</b>
!MAIN_TOOLTIP_PREVIEWB;Preview the <b>blue channel</b>.\nShortcut: <b>b</b>
!MAIN_TOOLTIP_PREVIEWFOCUSMASK;Preview the <b>focus mask</b>.\nShortcut: <b>Shift-f</b>\n\nMore accurate on images with shallow depth of field, low noise and at higher zoom levels.\nZoom out to 10-30% to improve detection accuracy on noisy images.
!MAIN_TOOLTIP_PREVIEWG;Preview the <b>green channel</b>.\nShortcut: <b>g</b>
@ -1681,9 +1682,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_LABEL;Film Simulation
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?

View File

@ -939,8 +939,8 @@
!MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: <b>middle grey</b>\nShortcut: <b>9</b>
!MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Lock</b> / <b>Unlock</b> the <b>Before</b> view\n\n<b>Lock</b>: keep the <b>Before</b> view unchanged.\nUseful to evaluate the cumulative effect of multiple tools.\nAdditionally, comparisons can be made to any state in the History.\n\n<b>Unlock</b>: the <b>Before</b> view will follow the <b>After</b> view one step behind, showing the image before the effect of the currently used tool.
!MAIN_TOOLTIP_HIDEHP;Show/Hide the left panel (including the history).\nShortcut: <b>l</b>
!MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication.\nShortcut: <b>&lt;</b>
!MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication.\nShortcut: <b>&gt;</b>
!MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication.\nShortcut: <b>&gt;</b>
!MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication.\nShortcut: <b>&lt;</b>
!MAIN_TOOLTIP_PREVIEWB;Preview the <b>blue channel</b>.\nShortcut: <b>b</b>
!MAIN_TOOLTIP_PREVIEWFOCUSMASK;Preview the <b>focus mask</b>.\nShortcut: <b>Shift-f</b>\n\nMore accurate on images with shallow depth of field, low noise and at higher zoom levels.\nZoom out to 10-30% to improve detection accuracy on noisy images.
!MAIN_TOOLTIP_PREVIEWG;Preview the <b>green channel</b>.\nShortcut: <b>g</b>
@ -1652,9 +1652,9 @@
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_LABEL;Film Simulation
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?

View File

@ -979,8 +979,8 @@ MAIN_TOOLTIP_BACKCOLOR2;Color de fondo de la previsualización: <b>Blanco</b>\nT
MAIN_TOOLTIP_BACKCOLOR3;Color de fondo de la vista previa: <b> Medio gris </b> \nMétodo rápido: <b> 9 </b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Bloquear</b> / <b>Desbloquear</b> la vista <b>Antes</b>\n\n<b>Bloquear</b>: la vista <b>Antes</b> permanece inalterada - \nútil para evaluar el efecto acumulativo de varias herramientas.\nAdemás, se puede hacer una comparación con cualquier estado en el Historial\n\n<b>Desbloquear</b>: la vista <b>Antes</b> seguirá a la vista <b>Después</b> un paso por detrás, mostrando la imagen antes del efecto de la herramienta que se está usando
MAIN_TOOLTIP_HIDEHP;Mostrar/Ocultar panel izquierdo (incluyendo historial).\nTecla de Atajo: <b>i</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indicación de luces altas recortadas.\nTecla de Atajo: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indicación de sombras recortadas.\nTecla de Atajo: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indicación de luces altas recortadas.\nTecla de Atajo: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indicación de sombras recortadas.\nTecla de Atajo: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Previsualización <b>Canal azul</b>.\nTecla de Atajo: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Previsualización <b>Máscara de Foco</b>.\nTecla de Atajo: <b>Shift-F</b>\n\nMás preciso en imágenes con poca profundidad de campo, bajo ruido y a mayores niveles de aumento\n\nPara mejorar la precisión en imágenes con ruido evalúe usando menor aumento (10%-30%)\n\nLa vista previa es realizada más lentamente cuando la Máscara de Foco esta activa.
MAIN_TOOLTIP_PREVIEWG;Previsualización <b>Canal verde</b>.\nTecla de Atajo: <b>g</b>
@ -2358,9 +2358,9 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nTecla de Atajo: <b>-</b>
!TP_DEHAZE_LUMINANCE;Luminance only
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected
!TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected

View File

@ -916,8 +916,8 @@ MAIN_TOOLTIP_BACKCOLOR2;Couleur de fond de l'aperçu: <b>Blanc</b>\nRaccourci: <
MAIN_TOOLTIP_BACKCOLOR3;Couleur de fond de l'aperçu: <b>Gris moyen</b>\nRaccourci : <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Vérouille</b> / <b>déverouille</b> la vue <b>Avant</b>\n\n<b>Vérouille</b>: garde la vue <b>Avant</b> inchangée - \nutile pour évaluer l'effet cumulatif de plusieurs outils.\nDe plus, une comparaison peut être faite à partir de n'importe quelle étape de l'historique\n\n<b>Déverouille</b>: la vue <b>Avant</b> représentera l'étape précédant la vue <b>Après</b>, montrant l'effet qui vient d'être modifié
MAIN_TOOLTIP_HIDEHP;Montrer/cacher le panneau gauche (incluant l'historique)\nRaccourci: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indication hautes lumières hors domaine\nRaccourci: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indication ombres hors domaine\nRaccourci: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indication hautes lumières hors domaine\nRaccourci: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indication ombres hors domaine\nRaccourci: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Affichage du <b>canal Bleu</b>\nRaccourci: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Affichage du <b>Masque du focus</b>\nRaccourci: <b>Shift-f</b>\n\nPlus précis sur les images avec une faible profondeur de champ, à faible bruit et à des niveaux de zoom élevé\n\nPour améliorer la précision de détection des images bruitées, évaluez les à un facteur de zoom de 10-30%\n\nLa prévisualisation met plus de temps à se calculer lorsque cet outil est actif.
MAIN_TOOLTIP_PREVIEWG;Affichage du <b>canal Vert</b>\nRaccourci: <b>g</b>
@ -2291,9 +2291,9 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: <b>-</b>
!TP_DEHAZE_LUMINANCE;Luminance only
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected
!TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected

View File

@ -519,8 +519,8 @@ MAIN_TOOLTIP_BACKCOLOR1;Colore di sfondo dell'anteprima: <b>Nero</b>\nScorciatoi
MAIN_TOOLTIP_BACKCOLOR2;Colore di sfondo dell'anteprima: <b>Bianco</b>\nScorciatoia: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Blocca</b>/<b>Sblocca</b> la vista <b>Prima</b>\n\n<b>Blocca</b>: Conserva la vista <b>Prima</b>.\nUtile per valutare l'effetto cumulativo di diversi strumenti.\nIn più, possono essere confrontati diversi passi della cronologia.\n\n<b>Sblocca</b>: la vista <b>Prima</b> segue di un passo la vista <b>Dopo</b>, mostrando l'immagine prima dell'effetto dello strumento corrente.
MAIN_TOOLTIP_HIDEHP;Mostra/Nascondi il pannello sinistro (inclusa la cronologia)\nScorciatoia: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indicazione delle alteluci tosate.\nScorciatoia: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indicazione delle ombre tosate.\nScorciatoia: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indicazione delle alteluci tosate.\nScorciatoia: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indicazione delle ombre tosate.\nScorciatoia: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Anteprima del <b>Canale Blu</b>.\nScorciatoia: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Anteprima della <b>Focus Mask</b>.\nScorciatoia: <b>Maiuscolo-F</b>\n\nPiù accurato su immagini con bassa profondità di campo, poco rumore e ad elevati livelli di zoom.\n\nPer aumentare l'accuratezza della rilevazione su immagini con molto rumore, riduci le dimensioni del 10-30%.
MAIN_TOOLTIP_PREVIEWG;Anteprima del <b>Canale Verde</b>.\nScorciatoia: <b>g</b>
@ -1919,9 +1919,9 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: <b>-</b>
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_LABEL;Film Simulation
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?

View File

@ -960,8 +960,8 @@ MAIN_TOOLTIP_BACKCOLOR2;プレビューの背景色を指定します: <b>白</b
MAIN_TOOLTIP_BACKCOLOR3;プレビューの背景色を指定します: <b>中間のグレー</b>\nショートカット: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>固定</b> / <b>固定解除</b> - <b>補正前</b> の表示設定\n\n<b>固定</b>: <b>補正前</b>をそのまま表示し変更されません\n複数のツールの累積効果を評価するのに役立ちます\nさらに、比較は履歴上のどこからでも行うことができます\n\n<b>固定解除</b>: 現在使用のツールの効果が <b>補正後</b> に表示され、その1段階前が <b>補正前</b> に表示されます
MAIN_TOOLTIP_HIDEHP;左パネル 表示/非表示 (履歴含む)\nショートカット: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;ハイライト・クリッピング領域の表示\nショートカット: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;シャドウ・クリッピング領域の表示\nショートカット: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;ハイライト・クリッピング領域の表示\nショートカット: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;シャドウ・クリッピング領域の表示\nショートカット: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;<b>ブルー チャンネル</b>表示\nショートカット: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;<b>フォーカス・マスク</b>表示\nショートカット: <b>Shift-f</b>\n\n浅い被写界深度、低イズ、高ズームの画像の場合は、より正確に\n\nイズの多い画像に対しては、検出精度を向上させるため10から30%縮小して評価します\n\nフォーカス・マスクをオンにすると表示に時間が掛かります
MAIN_TOOLTIP_PREVIEWG;<b>グリーン チャンネル</b>表示\nショートカット: <b>g</b>
@ -1672,9 +1672,9 @@ TP_EXPOS_BLACKPOINT_LABEL;raw ブラック・ポイント
TP_EXPOS_WHITEPOINT_LABEL;raw ホワイト・ポイント
TP_FILMNEGATIVE_BLUE;ブルーの比率
TP_FILMNEGATIVE_GREEN;参考指数(コントラスト)
TP_FILMNEGATIVE_GUESS_TOOLTIP;画像の中でニュートラルな参考ポイントを2点選んで指数を計算します;白い(明るいグレー)1点と黒い(暗いグレー)1点を選びます。順番は関係ありません。2つ目のポイントが選択されると指数が更新されます。
TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
TP_FILMNEGATIVE_LABEL;ネガフィルム
TP_FILMNEGATIVE_PICK;白と黒のポイントをピックアップする
TP_FILMNEGATIVE_PICK;Pick neutral spots
TP_FILMNEGATIVE_RED;レッドの比率
TP_FILMSIMULATION_LABEL;フィルムシミュレーション
TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapeeはフィルムシミュレーション機能に使う画像をHald CLUTフォルダーの中から探すよう設計されていますプログラムに組み込むにはフォルダーが大き過ぎるため。\n変更するには、環境設定 > 画像処理 > フィルムシミュレーションと進み\nどのフォルダーが使われているか確認します。機能を利用する場合は、Hald CLUTだけが入っているフォルダーを指定するか、 この機能を使わない場合はそのフォルダーを空にしておきます。\n\n詳しくはRawPediaを参照して下さい。\n\nフィルム画像のスキャンを止めますか

View File

@ -1832,9 +1832,9 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés <b>-</b>
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_LABEL;Film Simulation
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?

View File

@ -788,8 +788,8 @@ MAIN_TOOLTIP_BACKCOLOR1;Achtergrond kleur van het voorbeeld: <b>Zwart</b>\nSnelt
MAIN_TOOLTIP_BACKCOLOR2;Achtergrond kleur van het voorbeeld: <b>Wit</b>\nSneltoets: <b>0</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Vergrendel</b> / <b>Ontgrendel</b> de <b>Voor</b>afbeelding.\n\n<b>Vergrendel</b>: hou de <b>Voor</b>afbeelding ongewijzigd.\nDit is handig om het cumulatieve effect van meerdere gereedschappen te beoordelen.\nBovendien kan er worden vergeleken met elke stap in de geschiedenislijst.\n\n<b>Ontgrendel</b>: de <b>Voor</b>afbeelding volgt een stap achter de <b>Na</b>afbeelding en laat de afbeelding zien zonder het effect van het huidige gereedschap.
MAIN_TOOLTIP_HIDEHP;Toon/verberg linkerpaneel (geschiedenis).\nSneltoets: <b>H</b>
MAIN_TOOLTIP_INDCLIPPEDH;Overbelichtingsindicatie.\nSneltoets: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Onderbelichtingsindicatie.\nSneltoets: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Overbelichtingsindicatie.\nSneltoets: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Onderbelichtingsindicatie.\nSneltoets: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Bekijk het <b>Blauwe kanaal</b>.\nSneltoets: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Bekijk het <b>Focus Masker</b>.\nSneltoets: <b>Shift-F</b>\n\nAccurater bij afbeeldingen met geringe scherptediepte, weinig ruis en hogere zoomniveaus.\n\nBekijk de afbeelding op lagere zoomniveaus (10-30%) om de accuratesse te vergroten bij afbeeldingen met veel ruis.\n\nHet voorbeeld wordt langzamer aangemaakt als Focus Masker aanstaat.
MAIN_TOOLTIP_PREVIEWG;Bekijk het <b>Groene kanaal</b>.\nSneltoets: <b>g</b>
@ -2246,9 +2246,9 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: <b>-</b>
!TP_EXPOSURE_HISTMATCHING_TOOLTIP;Automatically adjust sliders and curves (except exposure compensation) to match the look of the embedded JPEG thumbnail.
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_ICM_WORKING_TRC;Tone response curve:
!TP_ICM_WORKING_TRC_CUSTOM;Custom

View File

@ -563,8 +563,8 @@ MAIN_TOOLTIP_BACKCOLOR1;Kolor tła podglądu: <b>Czarny</b>\nSkrót: <b>9</b>
MAIN_TOOLTIP_BACKCOLOR2;Kolor tła podglądu: <b>Biały</b>\nSkrót: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Zablokuj</b> / <b>Odblokuj</b> widok <b>Przed</b>\n\n<b>Zablokuj</b>: nie zmieniaj widoku <b>Przed</b> - \nPrzydatne w porównywaniu zablokowanego obrazu z obrazem na ktorym wykonano wiele zmian.\n\n<b>Odblokuj</b>: widok <b>Przed</b> będzie śledził widok <b>Po</b> o jeden krok do tyłu, pokazując obraz przed efektem aktualnie użytego narzędzia.
MAIN_TOOLTIP_HIDEHP;Pokaż/ukryj lewy panel (razem z historią).\nSkrót: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Pokaż obcięte prześwietlenia.\nSkrót: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Pokaż obcięte niedoświetlenia.\nSkrót: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Pokaż obcięte prześwietlenia.\nSkrót: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Pokaż obcięte niedoświetlenia.\nSkrót: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Podgląd <b>kanału niebieskiego</b>.\nSkrót: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Podgląd <b>maski ostrości</b>.\nSkrót: <b>Shift-f</b>\n\nDokładniejsze w przypadku zdjęc o płytkiej głębi ostrości, niskim pozimie szumów i o większym przybliżeniu. W przypadku zdjęć o wyższym poziomie szumów maska ostrości będzie dokładniejsza przy mniejszym zoomie (10-30%).
MAIN_TOOLTIP_PREVIEWG;Podgląd <b>kanału zielonego</b>.\nSkrót: <b>g</b>
@ -1945,9 +1945,9 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: <b>-</b>
!TP_EXPOSURE_TCMODE_PERCEPTUAL;Perceptual
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?
!TP_ICM_APPLYBASELINEEXPOSUREOFFSET;Baseline exposure

View File

@ -916,8 +916,8 @@ MAIN_TOOLTIP_BACKCOLOR2;Cor de fundo da pré-visualização: <b>branco</b>\nAtal
MAIN_TOOLTIP_BACKCOLOR3;Cor de fundo da pré-visualização: <b>cinza médio</b>\nAtalho: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Bloquear</b> / <b>desbloquear</b> a visualização <b>antes</b>\n\n<b>Bloquear</b>: manter a visualização <b>antes</b> inalterada.\nÚtil para avaliar o efeito cumulativo de várias ferramentas.\nAlém disso, podem ser feitas comparações a qualquer momento no histórico.\n\n<b>Desbloquear</b>: a visualização <b>antes</b> seguirá a visualização <b>depois</b> um passo antes, mostrando a imagem antes do efeito da ferramenta atualmente utilizada.
MAIN_TOOLTIP_HIDEHP;Mostrar o painel esquerdo (incluindo o histórico).\nAtalho: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Ver altas luzes cortadas.\nAtalho: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Ver sombras cortadas.\nAtalho: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Ver altas luzes cortadas.\nAtalho: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Ver sombras cortadas.\nAtalho: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Pré-visualizar o <b>canal azul</b>.\nAtalho: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Pré-visualizar a <b>máscara de foco</b>.\nAtalho: <b>Shift-f</b>\n\nMais preciso em imagens com pouca profundidade de campo, baixo ruído e níveis de zoom mais altos.\n\nUtilize um zoom menor entre 10-30% para melhorar a precisão da deteção de imagens com muito ruído.
MAIN_TOOLTIP_PREVIEWG;Pré-visualizar o <b>canal verde</b>.\nAtalho: <b>g</b>
@ -2290,9 +2290,9 @@ ZOOMPANEL_ZOOMOUT;Afastar\nAtalho: <b>-</b>
!TP_DEHAZE_LUMINANCE;Luminance only
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_LENSPROFILE_CORRECTION_AUTOMATCH;Automatically selected
!TP_LENSPROFILE_CORRECTION_MANUAL;Manually selected

View File

@ -923,8 +923,8 @@ MAIN_TOOLTIP_BACKCOLOR2;Cor de fundo da pré-visualização: <b>Branco</b>\nAtal
MAIN_TOOLTIP_BACKCOLOR3;Cor de fundo da pré-visualização: <b>Cinza médio</b>\nAtalho: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Travar</b> / <b>Destravar</b> a <b>Antes</b> visualização\n\n<b>Travar</b>: mantenha o <b>Antes</b> visualização inalterada.\nÚtil para avaliar o efeito cumulativo de várias ferramentas.\nAlém disso, comparações podem ser feitas a qualquer momento.\n\n<b>Destravar</b>: o <b>Antes</b> visualização seguinte <b>Depois</b> visualização anterior, mostrando a imagem antes do efeito da ferramenta atualmente utilizada.
MAIN_TOOLTIP_HIDEHP;Mostrar/Ocultar o painel esquerdo (incluindo o histórico).\nAtalho: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indicação de realce recortado.\nAtalho: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indicação de sombra recortada.\nAtalho: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Indicação de realce recortado.\nAtalho: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Indicação de sombra recortada.\nAtalho: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Pré-visualize o <b>Canal Azul</b>.\nAtalho: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Pré-visualize a <b>Máscara de Foco</b>.\nAtalho: <b>Shift-f</b>\n\nMais preciso em imagens com pouca profundidade de campo, baixo ruído e níveis de zoom mais altos.\n\nPara melhorar a precisão da detecção de imagens ruidosas, avalie com zoom menor, cerca de 10-30%.
MAIN_TOOLTIP_PREVIEWG;Pré-visualize o <b>Canal verde</b>.\nAtalho: <b>g</b>
@ -1626,7 +1626,7 @@ TP_EXPOSURE_TCMODE_WEIGHTEDSTD;Padrão Ponderado
TP_EXPOS_BLACKPOINT_LABEL;Pontos Pretos Raw
TP_EXPOS_WHITEPOINT_LABEL;Pontos Brancos Raw
TP_FILMNEGATIVE_BLUE;Relação de azul
TP_FILMNEGATIVE_PICK;Escolher os pontos brancos e pretos
TP_FILMNEGATIVE_PICK;Pick neutral spots
TP_FILMNEGATIVE_RED;Relação de vermelho
TP_FILMSIMULATION_LABEL;Simulação de Filme
TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee está configurado para procurar por imagens Hald CLUT, que são usadas para a ferramenta Simulação de Filme, numa pasta que está demorando para carregar.\nVá para Preferências > Processamento de Imagem > Simulação de Filme\npara ver qual pasta está sendo usada. Deves apontar RawTherapee para uma pasta que contenha apenas imagens Hald CLUT e nada mais, ou para uma pasta vazia, se não quiseres usar a ferramenta Simulação de Filme.\n\nLeia o artigo sobre Simulação de Filme na RawPedia para mais informações.\n\nDesejas cancelar a verificação agora?
@ -2293,7 +2293,7 @@ ZOOMPANEL_ZOOMOUT;Menos Zoom\nAtalho: <b>-</b>
!TP_CROP_PPI;PPI
!TP_DEHAZE_LUMINANCE;Luminance only
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_LENSPROFILE_LENS_WARNING;Warning: the crop factor used for lens profiling is larger than the crop factor of the camera, the results might be wrong.
!TP_LENSPROFILE_USE_HEADER;Correct

View File

@ -613,8 +613,8 @@ MAIN_TOOLTIP_BACKCOLOR1;Фоновый цвет предпросмотра: <b>
MAIN_TOOLTIP_BACKCOLOR2;Фоновый цвет предпросмотра: <b>Белый</b>\nГорячая клавиша: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Заблокировать</b> / <b>Разблокировать</b> <b>предыдущий</b> вид\n\n<b>Заблокировать</b>: сохраняет <b>предыдущий</b> вид неизменным.\nПолезно для оценки общего эффекта от применения нескольких инструментов.\nК тому же, сравнения могут быть произведены на любом состоянии истории\n\n<b>Разблокировать</b>: <b>предыдущий</b> вид будет следовать сразу за <b>следующим</b>, показывая состояние изображения до применения текущего инструмента.
MAIN_TOOLTIP_HIDEHP;Показать/скрыть левую панель (включая историю).\nГорячая клавиша <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Индикатор пересветов.\nГорячая клавиша: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Индикатор затемнений.\nГорячая клавиша: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Индикатор пересветов.\nГорячая клавиша: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Индикатор затемнений.\nГорячая клавиша: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Просмотреть <b>канал синего</b>.\nГорячая клавиша: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Просмотреть <b>Маску резкости</b>.\nГорячая клавиша: <b>Shift-F</b>\n\nБолее точна на изображениях с небольшой глубиной резкости, малым шумом и при большем приближении изображения\n\nДля улучшения определения на шумных изображениях используйте на маленьком зуме 10-30%
MAIN_TOOLTIP_PREVIEWG;Просмотреть <b>канал зеленого</b>.\nГорячая клавиша: <b>g</b>
@ -1990,9 +1990,9 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: <b>-</b>
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?
!TP_FLATFIELD_CLIPCONTROL;Clip control

View File

@ -1918,9 +1918,9 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике <b>-</b>
!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FILMSIMULATION_LABEL;Film Simulation
!TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?

View File

@ -698,8 +698,8 @@ MAIN_TOOLTIP_BACKCOLOR1;Bakgrundsfärg: <b>Svart</b>\nKortkommando: <b>9</b>
MAIN_TOOLTIP_BACKCOLOR2;Bakgrundsfärg: <b>Vit</b>\nKortkommando: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Lås</b> / <b>Lås upp</b> <b>före-vyn</b>\n\n<b>Lås</b>: behåll <b>före-vyn</b> oförändrad.\nAnvändbart för att utvärdera den sammanlagda effekten av flera stegs redigering. Dessutom kan jämförelser göras gentemot varje annat steg i historiken.\n\n<b>Lås upp</b>: <b>Före-vyn</b> kommer hela tiden visa ett tidigare steg jämfört med <b>efter-vyn</b>, och visar därmed effekten av det verktyg som användes senast.
MAIN_TOOLTIP_HIDEHP;Visa/göm den vänstra panelen. Kortkommando: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Markera högdagerindikation.\nKortkommando: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Markera skuggindikation.\nKortkommando: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Markera högdagerindikation.\nKortkommando: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Markera skuggindikation.\nKortkommando: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Förhandsgranska den <b>blå kanalen</b>.\nGenväg: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Förhandsgranska <b>fokusmasken</b>.\nKortkommando: <b>Shift-f</b>\n\nNoggrannare på bilder med kort skärpedjup, lågt brus och där en hög zoom-grad är vald.\n\nFör att förbättra detekteringen för brusiga bilder, utvärdera vid en zoom-grad om 10-30%\n\nFörhandsvisningen görs långsammare med fokusmasken påslagen.
MAIN_TOOLTIP_PREVIEWG;Förhandsgranska den <b>gröna kanalen</b>.\nGenväg: <b>g</b>
@ -2133,9 +2133,9 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: <b>-</b>
!TP_EXPOSURE_HISTMATCHING_TOOLTIP;Automatically adjust sliders and curves (except exposure compensation) to match the look of the embedded JPEG thumbnail.
!TP_FILMNEGATIVE_BLUE;Blue ratio
!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
!TP_FILMNEGATIVE_LABEL;Film Negative
!TP_FILMNEGATIVE_PICK;Pick white and black spots
!TP_FILMNEGATIVE_PICK;Pick neutral spots
!TP_FILMNEGATIVE_RED;Red ratio
!TP_FLATFIELD_CLIPCONTROL;Clip control
!TP_FLATFIELD_CLIPCONTROL_TOOLTIP;Clip control avoids clipped highlights caused by applying the flat field. If there are already clipped highlights before applying the flat field, clip control can lead to color cast.

View File

@ -948,8 +948,8 @@ MAIN_TOOLTIP_BACKCOLOR2;Background color of the preview: <b>white</b>\nShortcut:
MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: <b>middle grey</b>\nShortcut: <b>9</b>
MAIN_TOOLTIP_BEFOREAFTERLOCK;<b>Lock</b> / <b>Unlock</b> the <b>Before</b> view\n\n<b>Lock</b>: keep the <b>Before</b> view unchanged.\nUseful to evaluate the cumulative effect of multiple tools.\nAdditionally, comparisons can be made to any state in the History.\n\n<b>Unlock</b>: the <b>Before</b> view will follow the <b>After</b> view one step behind, showing the image before the effect of the currently used tool.
MAIN_TOOLTIP_HIDEHP;Show/Hide the left panel (including the history).\nShortcut: <b>l</b>
MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication.\nShortcut: <b>&lt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication.\nShortcut: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication.\nShortcut: <b>&gt;</b>
MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication.\nShortcut: <b>&lt;</b>
MAIN_TOOLTIP_PREVIEWB;Preview the <b>blue channel</b>.\nShortcut: <b>b</b>
MAIN_TOOLTIP_PREVIEWFOCUSMASK;Preview the <b>focus mask</b>.\nShortcut: <b>Shift-f</b>\n\nMore accurate on images with shallow depth of field, low noise and at higher zoom levels.\nZoom out to 10-30% to improve detection accuracy on noisy images.
MAIN_TOOLTIP_PREVIEWG;Preview the <b>green channel</b>.\nShortcut: <b>g</b>
@ -1661,9 +1661,9 @@ TP_EXPOS_BLACKPOINT_LABEL;Raw Black Points
TP_EXPOS_WHITEPOINT_LABEL;Raw White Points
TP_FILMNEGATIVE_BLUE;Blue ratio
TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards.
TP_FILMNEGATIVE_LABEL;Film Negative
TP_FILMNEGATIVE_PICK;Pick white and black spots
TP_FILMNEGATIVE_PICK;Pick neutral spots
TP_FILMNEGATIVE_RED;Red ratio
TP_FILMSIMULATION_LABEL;Film Simulation
TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee is configured to look for Hald CLUT images, which are used for the Film Simulation tool, in a folder which is taking too long to load.\nGo to Preferences > Image Processing > Film Simulation\nto see which folder is being used. You should either point RawTherapee to a folder which contains only Hald CLUT images and nothing more, or to an empty folder if you don't want to use the Film Simulation tool.\n\nRead the Film Simulation article in RawPedia for more information.\n\nDo you want to cancel the scan now?
@ -1677,7 +1677,7 @@ TP_FLATFIELD_BT_HORIZONTAL;Horizontal
TP_FLATFIELD_BT_VERTHORIZ;Vertical + Horizontal
TP_FLATFIELD_BT_VERTICAL;Vertical
TP_FLATFIELD_CLIPCONTROL;Clip control
TP_FLATFIELD_CLIPCONTROL_TOOLTIP;Clip control avoids clipped highlights caused by applying the flat field. If there are already clipped highlights before applying the flat field, clip control can lead to color cast.
TP_FLATFIELD_CLIPCONTROL_TOOLTIP;Clip control avoids clipped highlights caused by applying the flat field. If there are already clipped highlights before applying the flat field, value 0 is used.
TP_FLATFIELD_LABEL;Flat-Field
TP_GENERAL_11SCALE_TOOLTIP;The effects of this tool are only visible or only accurate at a preview scale of 1:1.
TP_GRADIENT_CENTER;Center

View File

@ -17,4 +17,5 @@ Terminal=false
MimeType=image/jpeg;image/png;image/tiff;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-crf;image/x-canon-crw;image/x-fuji-raf;image/x-hasselblad-3fr;image/x-hasselblad-fff;image/x-jpg;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-leaf-mos;image/x-leica-rwl;image/x-mamiya-mef;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-raw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-pentax-raw;image/x-phaseone-iiq;image/x-raw;image/x-rwz;image/x-samsung-srw;image/x-sigma-x3f;image/x-sony-arq;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-tif;
Categories=Graphics;Photography;2DGraphics;RasterGraphics;GTK;
Keywords=raw;photo;photography;develop;pp3;graphics;
StartupNotify=true
StartupWMClass=rawtherapee

View File

@ -28,6 +28,14 @@
#include "gauss.h"
#include "median.h"
#include "StopWatch.h"
namespace
{
unsigned fc(const unsigned int cfa[2][2], int r, int c) {
return cfa[r & 1][c & 1];
}
}
namespace {
bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution)
@ -106,10 +114,6 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution)
//end of linear equation solver
}
namespace rtengine {
extern const Settings* settings;
}
using namespace std;
using namespace rtengine;
@ -138,6 +142,7 @@ float* RawImageSource::CA_correct_RT(
}
// multithreaded and vectorized by Ingo Weyrich
const unsigned int cfa[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}};
constexpr int ts = 128;
constexpr int tsh = ts / 2;
constexpr int cb = 2; // 2 pixels border will be excluded from correction
@ -148,7 +153,7 @@ float* RawImageSource::CA_correct_RT(
// Test for RGB cfa
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
if (FC(i, j) == 3) {
if (fc(cfa, i, j) == 3) {
std::cout << "CA correction supports only RGB Colour filter arrays" << std::endl;
return buffer;
}
@ -167,7 +172,7 @@ float* RawImageSource::CA_correct_RT(
#pragma omp parallel for
#endif
for (int i = cb; i < H - cb; ++i) {
for (int j = cb + (FC(i, 0) & 1); j < W - cb; j += 2) {
for (int j = cb + (fc(cfa, i, 0) & 1); j < W - cb; j += 2) {
(*oldraw)[i - cb][(j - cb) / 2] = rawData[i][j];
}
}
@ -198,7 +203,7 @@ float* RawImageSource::CA_correct_RT(
//block CA shift values and weight assigned to block
float* const blockwt = buffer + (height * width);
memset(blockwt, 0, vblsz * hblsz * (2 * 2 + 1) * sizeof(float));
memset(blockwt, 0, static_cast<unsigned long>(vblsz) * hblsz * (2 * 2 + 1) * sizeof(float));
float (*blockshifts)[2][2] = (float (*)[2][2])(blockwt + vblsz * hblsz);
// Because we can't break parallel processing, we need a switch do handle the errors
@ -320,12 +325,12 @@ float* RawImageSource::CA_correct_RT(
int cc = ccmin;
int col = cc + left;
#ifdef __SSE2__
int c0 = FC(rr, cc);
int c0 = fc(cfa, rr, cc);
if (c0 == 1) {
rgb[c0][rr * ts + cc] = rawData[row][col] / 65535.f;
cc++;
col++;
c0 = FC(rr, cc);
c0 = fc(cfa, rr, cc);
}
int indx1 = rr * ts + cc;
for (; cc < ccmax - 7; cc+=8, col+=8, indx1 += 8) {
@ -338,7 +343,7 @@ float* RawImageSource::CA_correct_RT(
}
#endif
for (; cc < ccmax; cc++, col++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
int indx1 = rr * ts + cc;
rgb[c][indx1 >> ((c & 1) ^ 1)] = rawData[row][col] / 65535.f;
}
@ -348,7 +353,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmin > 0) {
for (int rr = 0; rr < border; rr++) {
for (int cc = ccmin; cc < ccmax; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][((border2 - rr) * ts + cc) >> ((c & 1) ^ 1)];
}
}
@ -357,7 +362,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmax < rr1) {
for (int rr = 0; rr < border; rr++) {
for (int cc = ccmin; cc < ccmax; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][left + cc] / 65535.f;
}
}
@ -366,7 +371,7 @@ float* RawImageSource::CA_correct_RT(
if (ccmin > 0) {
for (int rr = rrmin; rr < rrmax; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rgb[c][(rr * ts + border2 - cc) >> ((c & 1) ^ 1)];
}
}
@ -375,7 +380,7 @@ float* RawImageSource::CA_correct_RT(
if (ccmax < cc1) {
for (int rr = rrmin; rr < rrmax; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(top + rr)][(width - cc - 2)] / 65535.f;
}
}
@ -385,7 +390,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmin > 0 && ccmin > 0) {
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][(rr * ts + cc) >> ((c & 1) ^ 1)] = rawData[border2 - rr][border2 - cc] / 65535.f;
}
}
@ -394,7 +399,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmax < rr1 && ccmax < cc1) {
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(width - cc - 2)] / 65535.f;
}
}
@ -403,7 +408,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmin > 0 && ccmax < cc1) {
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = rawData[(border2 - rr)][(width - cc - 2)] / 65535.f;
}
}
@ -412,7 +417,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmax < rr1 && ccmin > 0) {
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = rawData[(height - rr - 2)][(border2 - cc)] / 65535.f;
}
}
@ -427,9 +432,9 @@ float* RawImageSource::CA_correct_RT(
#endif
for (int rr = 3; rr < rr1 - 3; rr++) {
int row = rr + top;
int cc = 3 + (FC(rr,3) & 1);
int cc = 3 + (fc(cfa, rr,3) & 1);
int indx = rr * ts + cc;
int c = FC(rr,cc);
int c = fc(cfa, rr,cc);
#ifdef __SSE2__
for (; cc < cc1 - 9; cc+=8, indx+=8) {
//compute directional weights using image gradients
@ -463,7 +468,7 @@ float* RawImageSource::CA_correct_RT(
}
if (row > -1 && row < height) {
int offset = (FC(row,max(left + 3, 0)) & 1);
int offset = (fc(cfa, 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__
@ -481,9 +486,9 @@ float* RawImageSource::CA_correct_RT(
vfloat zd25v = F2V(0.25f);
#endif
for (int rr = 4; rr < rr1 - 4; rr++) {
int cc = 4 + (FC(rr, 2) & 1);
int cc = 4 + (fc(cfa, rr, 2) & 1);
int indx = rr * ts + cc;
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
#ifdef __SSE2__
for (; cc < cc1 - 10; cc += 8, indx += 8) {
vfloat rgb1v = LC2VFU(rgb[1][indx]);
@ -547,9 +552,9 @@ float* RawImageSource::CA_correct_RT(
// 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 cc = 8 + (fc(cfa, rr, 2) & 1);
int indx = rr * ts + cc;
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
#ifdef __SSE2__
vfloat coeff00v = ZEROV;
vfloat coeff01v = ZEROV;
@ -871,14 +876,14 @@ float* RawImageSource::CA_correct_RT(
int indx = row * width + col;
int indx1 = rr * ts + cc;
#ifdef __SSE2__
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
if (c & 1) {
rgb[1][indx1] = rawData[row][col] / 65535.f;
indx++;
indx1++;
cc++;
col++;
c = FC(rr, cc);
c = fc(cfa, rr, cc);
}
for (; cc < ccmax - 7; cc += 8, col += 8, indx += 8, indx1 += 8) {
vfloat val1v = LVFU(rawData[row][col]) / c65535v;
@ -890,7 +895,7 @@ float* RawImageSource::CA_correct_RT(
}
#endif
for (; cc < ccmax; cc++, col++, indx++, indx1++) {
int c = FC(rr, cc);
int c = fc(cfa, rr, cc);
rgb[c][indx1 >> ((c & 1) ^ 1)] = rawData[row][col] / 65535.f;
if ((c & 1) == 0) {
@ -903,7 +908,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmin > 0) {
for (int rr = 0; rr < border; rr++) {
for (int cc = ccmin; cc < ccmax; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, 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];
}
@ -913,7 +918,7 @@ float* RawImageSource::CA_correct_RT(
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);
int c = fc(cfa, 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];
@ -925,7 +930,7 @@ float* RawImageSource::CA_correct_RT(
if (ccmin > 0) {
for (int rr = rrmin; rr < rrmax; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, 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];
}
@ -935,7 +940,7 @@ float* RawImageSource::CA_correct_RT(
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);
int c = fc(cfa, 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];
@ -948,7 +953,7 @@ float* RawImageSource::CA_correct_RT(
if (rrmin > 0 && ccmin > 0) {
for (int rr = 0; rr < border; rr++) {
for (int cc = 0; cc < border; cc++) {
int c = FC(rr, cc);
int c = fc(cfa, 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];
@ -960,7 +965,7 @@ float* RawImageSource::CA_correct_RT(
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);
int c = fc(cfa, 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];
@ -972,7 +977,7 @@ float* RawImageSource::CA_correct_RT(
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);
int c = fc(cfa, 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];
@ -984,7 +989,7 @@ float* RawImageSource::CA_correct_RT(
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);
int c = fc(cfa, 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];
@ -1001,7 +1006,7 @@ float* RawImageSource::CA_correct_RT(
#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;
int cc = 3 + fc(cfa, rr, 1), c = fc(cfa, rr,cc), indx = rr * ts + cc;
#ifdef __SSE2__
for (; cc < cc1 - 10; cc += 8, indx += 8) {
//compute directional weights using image gradients
@ -1082,8 +1087,8 @@ float* RawImageSource::CA_correct_RT(
}
for (int rr = 4; rr < rr1 - 4; rr++) {
int cc = 4 + (FC(rr, 2) & 1);
int c = FC(rr, cc);
int cc = 4 + (fc(cfa, rr, 2) & 1);
int c = fc(cfa, 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];
@ -1132,8 +1137,8 @@ float* RawImageSource::CA_correct_RT(
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 cc = 8 + (fc(cfa, rr, 2) & 1);
int c = fc(cfa, rr, cc);
int GRBdir0 = GRBdir[0][c];
int GRBdir1 = GRBdir[1][c];
#ifdef __SSE2__
@ -1170,7 +1175,7 @@ float* RawImageSource::CA_correct_RT(
STVFU(rgb[c][indx >> 1], RBint);
}
#endif
for (int c = FC(rr, cc), indx = rr * ts + cc; cc < cc1 - 8; cc += 2, indx += 2) {
for (int c = fc(cfa, 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
@ -1212,9 +1217,9 @@ float* RawImageSource::CA_correct_RT(
// 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 c = fc(cfa, rr + top, left + border + (fc(cfa, rr + top, 2) & 1));
int row = rr + top;
int cc = border + (FC(rr, 2) & 1);
int cc = border + (fc(cfa, rr, 2) & 1);
int indx = (row * width + cc + left) >> 1;
int indx1 = (rr * ts + cc) >> 1;
#ifdef __SSE2__
@ -1249,7 +1254,7 @@ float* RawImageSource::CA_correct_RT(
#endif
for (int row = cb; row < height - cb; row++) {
int col = cb + (FC(row, 0) & 1);
int col = cb + (fc(cfa, row, 0) & 1);
int indx = (row * width + col) >> 1;
#ifdef __SSE2__
for (; col < width - 7 - cb; col += 8, indx += 4) {
@ -1284,8 +1289,8 @@ float* RawImageSource::CA_correct_RT(
#pragma omp for
#endif
for (int i = 0; i < H - 2 * cb; ++i) {
const int firstCol = FC(i, 0) & 1;
const int colour = FC(i, firstCol);
const int firstCol = fc(cfa, i, 0) & 1;
const int colour = fc(cfa, i, firstCol);
const array2D<float>* nonGreen = colour == 0 ? redFactor : blueFactor;
int j = firstCol;
#ifdef __SSE2__
@ -1317,9 +1322,9 @@ float* RawImageSource::CA_correct_RT(
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 int ngRow = 1 - (fc(cfa, 0, 0) & 1);
const int ngCol = fc(cfa, ngRow, 0) & 1;
const int colour = fc(cfa, ngRow, ngCol);
const array2D<float>* nonGreen = colour == 0 ? redFactor : blueFactor;
for (int i = 0; i < (H + 1 - 2 * cb) / 2; ++i) {
(*nonGreen)[i][(W - 2 * cb + 1) / 2 - 1] = (*nonGreen)[i][(W - 2* cb + 1) / 2 - 2];
@ -1336,8 +1341,8 @@ float* RawImageSource::CA_correct_RT(
#pragma omp for
#endif
for (int i = 0; i < H - 2 * cb; ++i) {
const int firstCol = FC(i, 0) & 1;
const int colour = FC(i, firstCol);
const int firstCol = fc(cfa, i, 0) & 1;
const int colour = fc(cfa, i, firstCol);
const array2D<float>* nonGreen = colour == 0 ? redFactor : blueFactor;
for (int j = firstCol; j < W - 2 * cb; j += 2) {
rawData[i + cb][j + cb] *= (*nonGreen)[i / 2][j / 2];

View File

@ -33,6 +33,7 @@ set(RTENGINESOURCEFILES
ahd_demosaic_RT.cc
amaze_demosaic_RT.cc
badpixels.cc
boxblur.cc
CA_correct_RT.cc
calc_distort.cc
camconst.cc
@ -111,6 +112,7 @@ set(RTENGINESOURCEFILES
processingjob.cc
procparams.cc
profilestore.cc
rawflatfield.cc
rawimage.cc
rawimagesource.cc
rcd_demosaic.cc
@ -120,7 +122,6 @@ set(RTENGINESOURCEFILES
rtthumbnail.cc
shmap.cc
simpleprocess.cc
slicer.cc
stdimagesource.cc
tmo_fattal02.cc
utils.cc

View File

@ -4,8 +4,7 @@
#ifdef _OPENMP
#include <omp.h>
#endif
#include "sleef.c"
#include "opthelper.h"
#include "sleef.h"
#define DIAGONALS 5
#define DIAGONALSP1 6

View File

@ -23,25 +23,34 @@
////////////////////////////////////////////////////////////////
#include <cmath>
#include <fftw3.h>
#include "../rtgui/threadutils.h"
#include "rtengine.h"
#include "improcfun.h"
#include "LUT.h"
#include "array2D.h"
#include "iccmatrices.h"
#include "boxblur.h"
#include "rt_math.h"
#include "mytime.h"
#include "sleef.c"
#include "opthelper.h"
#include "cplx_wavelet_dec.h"
#include "median.h"
#include "color.h"
#include "curves.h"
#include "iccmatrices.h"
#include "iccstore.h"
#include "imagefloat.h"
#include "improcfun.h"
#include "labimage.h"
#include "LUT.h"
#include "median.h"
#include "mytime.h"
#include "opthelper.h"
#include "procparams.h"
#include "rt_math.h"
#include "sleef.h"
#include "../rtgui/threadutils.h"
#include "../rtgui/options.h"
#ifdef _OPENMP
#include <omp.h>
#endif
//#define BENCHMARK
#include "StopWatch.h"
@ -69,11 +78,7 @@ namespace rtengine
*/
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
extern const Settings* settings;
extern MyMutex *fftwMutex;
@ -479,6 +484,7 @@ enum nrquality {QUALITY_STANDARD, QUALITY_HIGH};
void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve, const NoiseCurve & noiseCCurve, float &nresi, float &highresi)
{
BENCHFUN
//#ifdef _DEBUG
MyTime t1e, t2e;
t1e.set();
@ -687,8 +693,8 @@ BENCHFUN
}
}
int tilesize;
int overlap;
int tilesize = 0;
int overlap = 0;
if (settings->leveldnti == 0) {
tilesize = 1024;
@ -1341,8 +1347,6 @@ BENCHFUN
#ifdef _OPENMP
int masterThread = omp_get_thread_num();
#endif
#ifdef _OPENMP
#pragma omp parallel num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1)
#endif
{
@ -1351,11 +1355,9 @@ BENCHFUN
#else
int subThread = 0;
#endif
float blurbuffer[TS * TS] ALIGNED64;
float *Lblox = LbloxArray[subThread];
float *fLblox = fLbloxArray[subThread];
float pBuf[width + TS + 2 * blkrad * offset] ALIGNED16;
float nbrwt[TS * TS] ALIGNED64;
#ifdef _OPENMP
#pragma omp for
#endif
@ -1430,7 +1432,7 @@ BENCHFUN
for (int hblk = 0; hblk < numblox_W; ++hblk) {
RGBtile_denoise(fLblox, hblk, noisevar_Ldetail, nbrwt, blurbuffer);
RGBtile_denoise(fLblox, hblk, noisevar_Ldetail);
}//end of horizontal block loop
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -1447,14 +1449,8 @@ BENCHFUN
//add row of blocks to output image tile
RGBoutput_tile_row(Lblox, Ldetail, tilemask_out, height, width, topproc);
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}//end of vertical block loop
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#ifdef _OPENMP
#pragma omp parallel for num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1)
@ -2041,26 +2037,20 @@ BENCHFUN
}//end of main RGB_denoise
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void ImProcFunctions::RGBtile_denoise(float * fLblox, int hblproc, float noisevar_Ldetail, float * nbrwt, float * blurbuffer) //for DCT
void ImProcFunctions::RGBtile_denoise(float* fLblox, int hblproc, float noisevar_Ldetail) //for DCT
{
int blkstart = hblproc * TS * TS;
float nbrwt[TS * TS] ALIGNED64;
const int blkstart = hblproc * TS * TS;
boxabsblur(fLblox + blkstart, nbrwt, 3, 3, TS, TS, blurbuffer); //blur neighbor weights for more robust estimation //for DCT
boxabsblur(fLblox + blkstart, nbrwt, 3, TS, TS, false); //blur neighbor weights for more robust estimation //for DCT
#ifdef __SSE2__
__m128 tempv;
__m128 noisevar_Ldetailv = _mm_set1_ps(noisevar_Ldetail);
__m128 onev = _mm_set1_ps(1.0f);
const vfloat noisevar_Ldetailv = F2V(-1.f / noisevar_Ldetail);
const vfloat onev = F2V(1.f);
for (int n = 0; n < TS * TS; n += 4) { //for DCT
tempv = onev - xexpf(-SQRV(LVF(nbrwt[n])) / noisevar_Ldetailv);
_mm_storeu_ps(&fLblox[blkstart + n], LVFU(fLblox[blkstart + n]) * tempv);
const vfloat tempv = onev - xexpf(SQRV(LVF(nbrwt[n])) * noisevar_Ldetailv);
STVF(fLblox[blkstart + n], LVF(fLblox[blkstart + n]) * tempv);
}//output neighbor averaged result
#else
@ -2071,14 +2061,7 @@ void ImProcFunctions::RGBtile_denoise(float * fLblox, int hblproc, float noiseva
#endif
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//printf("vblk=%d hlk=%d wsqave=%f || ",vblproc,hblproc,wsqave);
}//end of function tile_denoise
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
void ImProcFunctions::RGBoutput_tile_row(float *bloxrow_L, float ** Ldetail, float ** tilemask_out, int height, int width, int top)
{
@ -2207,7 +2190,7 @@ void ImProcFunctions::Noise_residualAB(const wavelet_decomposition &WaveletCoeff
chmaxresid = maxresid;
}
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3])
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(const wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3])
{
int maxlvl = min(WaveletCoeffs_L.maxlevel(), 5);
const float eps = 0.01f;
@ -2258,23 +2241,22 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(wavelet_decomposition &Wavelet
//simple wavelet shrinkage
float * sfave = buffer[0] + 32;
float * sfaved = buffer[2] + 96;
float * blurBuffer = buffer[1] + 64;
float mad_Lr = madL[lvl][dir - 1];
float levelFactor = mad_Lr * 5.f / (lvl + 1);
#ifdef __SSE2__
__m128 mad_Lv;
__m128 ninev = _mm_set1_ps(9.0f);
__m128 epsv = _mm_set1_ps(eps);
__m128 mag_Lv;
__m128 levelFactorv = _mm_set1_ps(levelFactor);
vfloat mad_Lv;
vfloat ninev = F2V(9.0f);
vfloat epsv = F2V(eps);
vfloat mag_Lv;
vfloat levelFactorv = F2V(levelFactor);
int coeffloc_L;
for (coeffloc_L = 0; coeffloc_L < Hlvl_L * Wlvl_L - 3; coeffloc_L += 4) {
mad_Lv = LVFU(noisevarlum[coeffloc_L]) * levelFactorv;
mag_Lv = SQRV(LVFU(WavCoeffs_L[dir][coeffloc_L]));
_mm_storeu_ps(&sfave[coeffloc_L], mag_Lv / (mag_Lv + mad_Lv * xexpf(-mag_Lv / (mad_Lv * ninev)) + epsv));
STVFU(sfave[coeffloc_L], mag_Lv / (mag_Lv + mad_Lv * xexpf(-mag_Lv / (mad_Lv * ninev)) + epsv));
}
for (; coeffloc_L < Hlvl_L * Wlvl_L; ++coeffloc_L) {
@ -2294,15 +2276,15 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(wavelet_decomposition &Wavelet
}
#endif
boxblur(sfave, sfaved, blurBuffer, lvl + 2, lvl + 2, Wlvl_L, Hlvl_L); //increase smoothness by locally averaging shrinkage
boxblur(sfave, sfaved, lvl + 2, Wlvl_L, Hlvl_L, false); //increase smoothness by locally averaging shrinkage
#ifdef __SSE2__
__m128 sfavev;
__m128 sf_Lv;
vfloat sfavev;
vfloat sf_Lv;
for (coeffloc_L = 0; coeffloc_L < Hlvl_L * Wlvl_L - 3; coeffloc_L += 4) {
sfavev = LVFU(sfaved[coeffloc_L]);
sf_Lv = LVFU(sfave[coeffloc_L]);
_mm_storeu_ps(&WavCoeffs_L[dir][coeffloc_L], LVFU(WavCoeffs_L[dir][coeffloc_L]) * (SQRV(sfavev) + SQRV(sf_Lv)) / (sfavev + sf_Lv + epsv));
STVFU(WavCoeffs_L[dir][coeffloc_L], LVFU(WavCoeffs_L[dir][coeffloc_L]) * (SQRV(sfavev) + SQRV(sf_Lv)) / (sfavev + sf_Lv + epsv));
//use smoothed shrinkage unless local shrinkage is much less
}
@ -2340,7 +2322,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkL(wavelet_decomposition &Wavelet
return (!memoryAllocationFailed);
}
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab,
bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(const wavelet_decomposition &WaveletCoeffs_L, const wavelet_decomposition &WaveletCoeffs_ab,
float *noisevarchrom, float madL[8][3], float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb)
{
int maxlvl = WaveletCoeffs_L.maxlevel();
@ -2422,12 +2404,12 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(wavelet_decomposition &Wavele
if (noisevar_ab > 0.001f) {
#ifdef __SSE2__
__m128 onev = _mm_set1_ps(1.f);
__m128 mad_abrv = _mm_set1_ps(mad_abr);
__m128 rmad_Lm9v = onev / _mm_set1_ps(mad_Lr * 9.f);
__m128 mad_abv;
__m128 mag_Lv, mag_abv;
__m128 tempabv;
vfloat onev = F2V(1.f);
vfloat mad_abrv = F2V(mad_abr);
vfloat rmad_Lm9v = onev / F2V(mad_Lr * 9.f);
vfloat mad_abv;
vfloat mag_Lv, mag_abv;
vfloat tempabv;
int coeffloc_ab;
for (coeffloc_ab = 0; coeffloc_ab < Hlvl_ab * Wlvl_ab - 3; coeffloc_ab += 4) {
@ -2437,7 +2419,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(wavelet_decomposition &Wavele
mag_Lv = LVFU(WavCoeffs_L[dir][coeffloc_ab]);
mag_abv = SQRV(tempabv);
mag_Lv = SQRV(mag_Lv) * rmad_Lm9v;
_mm_storeu_ps(&WavCoeffs_ab[dir][coeffloc_ab], tempabv * SQRV((onev - xexpf(-(mag_abv / mad_abv) - (mag_Lv)))));
STVFU(WavCoeffs_ab[dir][coeffloc_ab], tempabv * SQRV((onev - xexpf(-(mag_abv / mad_abv) - (mag_Lv)))));
}
// few remaining pixels
@ -2470,9 +2452,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(wavelet_decomposition &Wavele
}
for (int i = 2; i >= 0; i--) {
if (buffer[i] != nullptr) {
delete[] buffer[i];
}
delete[] buffer[i];
}
}
@ -2480,7 +2460,7 @@ bool ImProcFunctions::WaveletDenoiseAll_BiShrinkAB(wavelet_decomposition &Wavele
}
bool ImProcFunctions::WaveletDenoiseAllL(wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3], float * vari, int edge)//mod JD
bool ImProcFunctions::WaveletDenoiseAllL(const wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3], float * vari, int edge)//mod JD
{
@ -2530,16 +2510,14 @@ bool ImProcFunctions::WaveletDenoiseAllL(wavelet_decomposition &WaveletCoeffs_L,
}
for (int i = 3; i >= 0; i--) {
if (buffer[i] != nullptr) {
delete[] buffer[i];
}
delete[] buffer[i];
}
}
return (!memoryAllocationFailed);
}
bool ImProcFunctions::WaveletDenoiseAllAB(wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab,
bool ImProcFunctions::WaveletDenoiseAllAB(const wavelet_decomposition &WaveletCoeffs_L, const wavelet_decomposition &WaveletCoeffs_ab,
float *noisevarchrom, float madL[8][3], float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb)//mod JD
{
@ -2596,7 +2574,7 @@ bool ImProcFunctions::WaveletDenoiseAllAB(wavelet_decomposition &WaveletCoeffs_L
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void ImProcFunctions::ShrinkAllL(wavelet_decomposition &WaveletCoeffs_L, float **buffer, int level, int dir,
void ImProcFunctions::ShrinkAllL(const wavelet_decomposition &WaveletCoeffs_L, float **buffer, int level, int dir,
float *noisevarlum, float * madL, float * vari, int edge)
{
@ -2607,12 +2585,12 @@ void ImProcFunctions::ShrinkAllL(wavelet_decomposition &WaveletCoeffs_L, float *
float * sfaved = buffer[1] + 64;
float * blurBuffer = buffer[2] + 96;
int W_L = WaveletCoeffs_L.level_W(level);
int H_L = WaveletCoeffs_L.level_H(level);
const int W_L = WaveletCoeffs_L.level_W(level);
const int H_L = WaveletCoeffs_L.level_H(level);
float ** WavCoeffs_L = WaveletCoeffs_L.level_coeffs(level);
// printf("OK lev=%d\n",level);
float mad_L = madL[dir - 1] ;
const float mad_L = madL[dir - 1] ;
const float levelFactor = mad_L * 5.f / static_cast<float>(level + 1);
if (edge == 1 && vari) {
noisevarlum = blurBuffer; // we need one buffer, but fortunately we don't have to allocate a new one because we can use blurBuffer
@ -2622,71 +2600,45 @@ void ImProcFunctions::ShrinkAllL(wavelet_decomposition &WaveletCoeffs_L, float *
}
}
float levelFactor = mad_L * 5.f / static_cast<float>(level + 1);
int i = 0;
#ifdef __SSE2__
__m128 magv;
__m128 levelFactorv = _mm_set1_ps(levelFactor);
__m128 mad_Lv;
__m128 ninev = _mm_set1_ps(9.0f);
__m128 epsv = _mm_set1_ps(eps);
int i;
const vfloat levelFactorv = F2V(levelFactor);
const vfloat ninev = F2V(9.f);
const vfloat epsv = F2V(eps);
for (i = 0; i < W_L * H_L - 3; i += 4) {
mad_Lv = LVFU(noisevarlum[i]) * levelFactorv;
magv = SQRV(LVFU(WavCoeffs_L[dir][i]));
_mm_storeu_ps(&sfave[i], magv / (magv + mad_Lv * xexpf(-magv / (ninev * mad_Lv)) + epsv));
for (; i < W_L * H_L - 3; i += 4) {
const vfloat mad_Lv = LVFU(noisevarlum[i]) * levelFactorv;
const vfloat magv = SQRV(LVFU(WavCoeffs_L[dir][i]));
STVFU(sfave[i], magv / (magv + mad_Lv * xexpf(-magv / (ninev * mad_Lv)) + epsv));
}
#endif
// few remaining pixels
for (; i < W_L * H_L; ++i) {
float mag = SQR(WavCoeffs_L[dir][i]);
const float mag = SQR(WavCoeffs_L[dir][i]);
sfave[i] = mag / (mag + levelFactor * noisevarlum[i] * xexpf(-mag / (9 * levelFactor * noisevarlum[i])) + eps);
}
#else
for (int i = 0; i < W_L * H_L; ++i) {
float mag = SQR(WavCoeffs_L[dir][i]);
float shrinkfactor = mag / (mag + levelFactor * noisevarlum[i] * xexpf(-mag / (9 * levelFactor * noisevarlum[i])) + eps);
sfave[i] = shrinkfactor;
}
#endif
boxblur(sfave, sfaved, blurBuffer, level + 2, level + 2, W_L, H_L); //increase smoothness by locally averaging shrinkage
boxblur(sfave, sfaved, level + 2, W_L, H_L, false); //increase smoothness by locally averaging shrinkage
i = 0;
#ifdef __SSE2__
__m128 sfv;
for (i = 0; i < W_L * H_L - 3; i += 4) {
sfv = LVFU(sfave[i]);
for (; i < W_L * H_L - 3; i += 4) {
const vfloat sfv = LVFU(sfave[i]);
//use smoothed shrinkage unless local shrinkage is much less
_mm_storeu_ps(&WavCoeffs_L[dir][i], _mm_loadu_ps(&WavCoeffs_L[dir][i]) * (SQRV(LVFU(sfaved[i])) + SQRV(sfv)) / (LVFU(sfaved[i]) + sfv + epsv));
STVFU(WavCoeffs_L[dir][i], LVFU(WavCoeffs_L[dir][i]) * (SQRV(LVFU(sfaved[i])) + SQRV(sfv)) / (LVFU(sfaved[i]) + sfv + epsv));
}
#endif
// few remaining pixels
for (; i < W_L * H_L; ++i) {
float sf = sfave[i];
const float sf = sfave[i];
//use smoothed shrinkage unless local shrinkage is much less
WavCoeffs_L[dir][i] *= (SQR(sfaved[i]) + SQR(sf)) / (sfaved[i] + sf + eps);
}//now luminance coefficients are denoised
#else
for (int i = 0; i < W_L * H_L; ++i) {
float sf = sfave[i];
//use smoothed shrinkage unless local shrinkage is much less
WavCoeffs_L[dir][i] *= (SQR(sfaved[i]) + SQR(sf)) / (sfaved[i] + sf + eps);
}//now luminance coefficients are denoised
#endif
}
void ImProcFunctions::ShrinkAllAB(wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab, float **buffer, int level, int dir,
void ImProcFunctions::ShrinkAllAB(const wavelet_decomposition &WaveletCoeffs_L, const wavelet_decomposition &WaveletCoeffs_ab, float **buffer, int level, int dir,
float *noisevarchrom, float noisevar_ab, const bool useNoiseCCurve, bool autoch,
bool denoiseMethodRgb, float * madL, float * madaab, bool madCalculated)
@ -2700,7 +2652,6 @@ void ImProcFunctions::ShrinkAllAB(wavelet_decomposition &WaveletCoeffs_L, wavele
float * sfaveab = buffer[0] + 32;
float * sfaveabd = buffer[1] + 64;
float * blurBuffer = buffer[2] + 96;
int W_ab = WaveletCoeffs_ab.level_W(level);
int H_ab = WaveletCoeffs_ab.level_H(level);
@ -2724,12 +2675,12 @@ void ImProcFunctions::ShrinkAllAB(wavelet_decomposition &WaveletCoeffs_L, wavele
if (noisevar_ab > 0.001f) {
madab = useNoiseCCurve ? madab : madab * noisevar_ab;
#ifdef __SSE2__
__m128 onev = _mm_set1_ps(1.f);
__m128 mad_abrv = _mm_set1_ps(madab);
vfloat onev = F2V(1.f);
vfloat mad_abrv = F2V(madab);
__m128 rmadLm9v = onev / _mm_set1_ps(mad_L * 9.f);
__m128 mad_abv ;
__m128 mag_Lv, mag_abv;
vfloat rmadLm9v = onev / F2V(mad_L * 9.f);
vfloat mad_abv ;
vfloat mag_Lv, mag_abv;
int coeffloc_ab;
for (coeffloc_ab = 0; coeffloc_ab < H_ab * W_ab - 3; coeffloc_ab += 4) {
@ -2738,7 +2689,7 @@ void ImProcFunctions::ShrinkAllAB(wavelet_decomposition &WaveletCoeffs_L, wavele
mag_Lv = LVFU(WavCoeffs_L[dir][coeffloc_ab]);
mag_abv = SQRV(LVFU(WavCoeffs_ab[dir][coeffloc_ab]));
mag_Lv = (SQRV(mag_Lv)) * rmadLm9v;
_mm_storeu_ps(&sfaveab[coeffloc_ab], (onev - xexpf(-(mag_abv / mad_abv) - (mag_Lv))));
STVFU(sfaveab[coeffloc_ab], (onev - xexpf(-(mag_abv / mad_abv) - (mag_Lv))));
}
// few remaining pixels
@ -2761,18 +2712,18 @@ void ImProcFunctions::ShrinkAllAB(wavelet_decomposition &WaveletCoeffs_L, wavele
#endif
boxblur(sfaveab, sfaveabd, blurBuffer, level + 2, level + 2, W_ab, H_ab); //increase smoothness by locally averaging shrinkage
boxblur(sfaveab, sfaveabd, level + 2, W_ab, H_ab, false); //increase smoothness by locally averaging shrinkage
#ifdef __SSE2__
__m128 epsv = _mm_set1_ps(eps);
__m128 sfabv;
__m128 sfaveabv;
vfloat epsv = F2V(eps);
vfloat sfabv;
vfloat sfaveabv;
for (coeffloc_ab = 0; coeffloc_ab < H_ab * W_ab - 3; coeffloc_ab += 4) {
sfabv = LVFU(sfaveab[coeffloc_ab]);
sfaveabv = LVFU(sfaveabd[coeffloc_ab]);
//use smoothed shrinkage unless local shrinkage is much less
_mm_storeu_ps(&WavCoeffs_ab[dir][coeffloc_ab], LVFU(WavCoeffs_ab[dir][coeffloc_ab]) * (SQRV(sfaveabv) + SQRV(sfabv)) / (sfaveabv + sfabv + epsv));
STVFU(WavCoeffs_ab[dir][coeffloc_ab], LVFU(WavCoeffs_ab[dir][coeffloc_ab]) * (SQRV(sfaveabv) + SQRV(sfabv)) / (sfaveabv + sfabv + epsv));
}
// few remaining pixels
@ -2919,8 +2870,8 @@ void ImProcFunctions::ShrinkAll_info(float ** WavCoeffs_a, float ** WavCoeffs_b,
}
void ImProcFunctions::WaveletDenoiseAll_info(int levwav, wavelet_decomposition &WaveletCoeffs_a,
wavelet_decomposition &WaveletCoeffs_b, float **noisevarlum, float **noisevarchrom, float **noisevarhue, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, int schoice,
void ImProcFunctions::WaveletDenoiseAll_info(int levwav, const wavelet_decomposition &WaveletCoeffs_a,
const wavelet_decomposition &WaveletCoeffs_b, float **noisevarlum, float **noisevarchrom, float **noisevarhue, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, int schoice,
float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb)
{
@ -3106,7 +3057,7 @@ void ImProcFunctions::calcautodn_info(float &chaut, float &delta, int Nb, int le
}
void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc, const bool isRAW, LUTf &gamcurve, float gam, float gamthresh, float gamslope, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, bool multiThread)
void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc, const bool isRAW, const LUTf &gamcurve, float gam, float gamthresh, float gamslope, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, bool multiThread)
{
if ((settings->leveldnautsimpl == 1 && dnparams.Cmethod == "MAN") || (settings->leveldnautsimpl == 0 && dnparams.C2method == "MANU")) {
//nothing to do
@ -3173,8 +3124,8 @@ void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc,
const float gain = pow(2.0f, float(expcomp));
int tilesize;
int overlap;
int tilesize = 0;
int overlap = 0;
if (settings->leveldnti == 0) {
tilesize = 1024;
@ -3275,16 +3226,16 @@ void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc,
for (int i = tiletop; i < tilebottom; i += 2) {
int i1 = i - tiletop;
#ifdef __SSE2__
__m128 aNv, bNv;
__m128 c100v = _mm_set1_ps(100.f);
vfloat aNv, bNv;
vfloat c100v = F2V(100.f);
int j;
for (j = tileleft; j < tileright - 7; j += 8) {
int j1 = j - tileleft;
aNv = LVFU(acalc[i >> 1][j >> 1]);
bNv = LVFU(bcalc[i >> 1][j >> 1]);
_mm_storeu_ps(&noisevarhue[i1 >> 1][j1 >> 1], xatan2f(bNv, aNv));
_mm_storeu_ps(&noisevarchrom[i1 >> 1][j1 >> 1], vmaxf(vsqrtf(SQRV(aNv) + SQRV(bNv)),c100v));
STVFU(noisevarhue[i1 >> 1][j1 >> 1], xatan2f(bNv, aNv));
STVFU(noisevarchrom[i1 >> 1][j1 >> 1], vmaxf(vsqrtf(SQRV(aNv) + SQRV(bNv)),c100v));
}
for (; j < tileright; j += 2) {

View File

@ -56,21 +56,18 @@
* LUTuc stands for LUT<unsigned char>
*/
#ifndef LUT_H_
#define LUT_H_
#pragma once
#include <cstring>
#include <cstdint>
#include <cassert>
#ifndef NDEBUG
#include <glibmm.h>
#include <fstream>
#endif
#include "opthelper.h"
#include "rt_math.h"
#include "noncopyable.h"
// Bit representations of flags
enum {
@ -485,26 +482,6 @@ public:
return (p1 + p2 * diff);
}
#ifndef NDEBUG
// Debug facility ; dump the content of the LUT in a file. No control of the filename is done
void dump(Glib::ustring fname)
{
if (size) {
Glib::ustring fname_ = fname + ".xyz"; // TopSolid'Design "plot" file format
std::ofstream f (fname_.c_str());
f << "$" << std::endl;
for (unsigned int iter = 0; iter < size; iter++) {
f << iter << ", " << data[iter] << ", 0." << std::endl;
}
f << "$" << std::endl;
f.close ();
}
}
#endif
operator bool (void) const
{
return size > 0;
@ -649,5 +626,3 @@ public:
};
#endif /* LUT_H_ */

View File

@ -29,8 +29,12 @@
#include "gauss.h"
#include "improcfun.h"
#include "sleef.c"
#include "../rtgui/myflatcurve.h"
#include "cieimage.h"
#include "color.h"
#include "curves.h"
#include "labimage.h"
#include "sleef.h"
#include "curves.h"
#include "rt_math.h"
#include "opthelper.h"
#include "median.h"

View File

@ -27,12 +27,17 @@
#include "rtengine.h"
#include "rawimagesource.h"
#include "rt_math.h"
#include "procparams.h"
#include "../rtgui/multilangmgr.h"
#include "median.h"
//#define BENCHMARK
#include "StopWatch.h"
namespace
{
unsigned fc(const unsigned int cfa[2][2], int r, int c) {
return cfa[r & 1][c & 1];
}
}
namespace rtengine
{
#define TS 144
@ -40,6 +45,7 @@ void RawImageSource::ahd_demosaic()
{
BENCHFUN
const unsigned int cfa[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}};
constexpr int dirs[4] = { -1, 1, -TS, TS };
float xyz_cam[3][3];
LUTf cbrt(65536);
@ -74,7 +80,7 @@ void RawImageSource::ahd_demosaic()
}
}
}
border_interpolate2(W, H, 5, rawData, red, green, blue);
border_interpolate(W, H, 5, rawData, red, green, blue);
#ifdef _OPENMP
@ -94,7 +100,7 @@ void RawImageSource::ahd_demosaic()
for (int left = 2; left < width - 5; left += TS - 6) {
// Interpolate green horizontally and vertically:
for (int row = top; row < top + TS && row < height - 2; row++) {
for (int col = left + (FC(row, left) & 1); col < std::min(left + TS, width - 2); col += 2) {
for (int col = left + (fc(cfa, row, left) & 1); col < std::min(left + TS, width - 2); col += 2) {
auto pix = &rawData[row][col];
float val0 = 0.25f * ((pix[-1] + pix[0] + pix[1]) * 2
- pix[-2] - pix[2]) ;
@ -108,12 +114,12 @@ void RawImageSource::ahd_demosaic()
// Interpolate red and blue, and convert to CIELab:
for (int d = 0; d < 2; d++)
for (int row = top + 1; row < top + TS - 1 && row < height - 3; row++) {
int cng = FC(row + 1, FC(row + 1, 0) & 1);
int cng = fc(cfa, row + 1, fc(cfa, row + 1, 0) & 1);
for (int col = left + 1; col < std::min(left + TS - 1, width - 3); col++) {
auto pix = &rawData[row][col];
auto rix = &rgb[d][row - top][col - left];
auto lix = lab[d][row - top][col - left];
if (FC(row, col) == 1) {
if (fc(cfa, row, col) == 1) {
rix[0][2 - cng] = CLIP(pix[0] + (0.5f * (pix[-1] + pix[1]
- rix[-1][1] - rix[1][1] ) ));
rix[0][cng] = CLIP(pix[0] + (0.5f * (pix[-width] + pix[width]

View File

@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _ALIGNEDBUFFER_
#define _ALIGNEDBUFFER_
#pragma once
#include <cstdint>
#include <cstdlib>
@ -142,5 +141,3 @@ public:
return unitSize ? allocatedSize / unitSize : 0;
}
};
#endif

View File

@ -30,12 +30,18 @@
#include "rawimagesource.h"
#include "rt_math.h"
#include "../rtgui/multilangmgr.h"
#include "sleef.c"
#include "sleef.h"
#include "opthelper.h"
#include "median.h"
#include "procparams.h"
#include "StopWatch.h"
namespace
{
unsigned fc(const unsigned int cfa[2][2], int r, int c) {
return cfa[r & 1][c & 1];
}
}
namespace rtengine
{
@ -56,6 +62,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
plistener->setProgress(progress);
}
const unsigned int cfarray[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}};
const int width = winw, height = winh;
const float clip_pt = 1.0 / initialGain;
const float clip_pt8 = 0.8 / initialGain;
@ -74,8 +81,8 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
int ex, ey;
//determine GRBG coset; (ey,ex) is the offset of the R subarray
if (FC(0, 0) == 1) { //first pixel is G
if (FC(0, 1) == 0) {
if (fc(cfarray, 0, 0) == 1) { //first pixel is G
if (fc(cfarray, 0, 1) == 0) {
ey = 0;
ex = 1;
} else {
@ -83,7 +90,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
ex = 0;
}
} else {//first pixel is R or B
if (FC(0, 0) == 0) {
if (fc(cfarray, 0, 0) == 0) {
ey = 0;
ex = 0;
} else {
@ -373,7 +380,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#ifdef __SSE2__
vfloat sgnv;
if( !(FC(4, 4) & 1) ) {
if( !(fc(cfarray, 4, 4) & 1) ) {
sgnv = _mm_set_ps( 1.f, -1.f, 1.f, -1.f );
} else {
sgnv = _mm_set_ps( -1.f, 1.f, -1.f, 1.f );
@ -440,7 +447,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int rr = 4; rr < rr1 - 4; rr++) {
bool fcswitch = FC(rr, 4) & 1;
bool fcswitch = fc(cfarray, rr, 4) & 1;
for (int cc = 4, indx = rr * ts + cc; cc < cc1 - 4; cc++, indx++) {
@ -532,7 +539,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
vfloat clip_ptv = F2V( clip_pt );
vfloat sgn3v;
if( !(FC(4, 4) & 1) ) {
if( !(fc(cfarray, 4, 4) & 1) ) {
sgnv = _mm_set_ps( 1.f, -1.f, 1.f, -1.f );
} else {
sgnv = _mm_set_ps( -1.f, 1.f, -1.f, 1.f );
@ -590,7 +597,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int rr = 4; rr < rr1 - 4; rr++) {
for (int cc = 4, indx = rr * ts + cc, c = FC(rr, cc) & 1; cc < cc1 - 4; cc++, indx++) {
for (int cc = 4, indx = rr * ts + cc, c = fc(cfarray, rr, cc) & 1; cc < cc1 - 4; cc++, indx++) {
float hcdvar = 3.f * (SQR(hcd[indx - 2]) + SQR(hcd[indx]) + SQR(hcd[indx + 2])) - SQR(hcd[indx - 2] + hcd[indx] + hcd[indx + 2]);
float hcdaltvar = 3.f * (SQR(hcdalt[indx - 2]) + SQR(hcdalt[indx]) + SQR(hcdalt[indx + 2])) - SQR(hcdalt[indx - 2] + hcdalt[indx] + hcdalt[indx + 2]);
float vcdvar = 3.f * (SQR(vcd[indx - v2]) + SQR(vcd[indx]) + SQR(vcd[indx + v2])) - SQR(vcd[indx - v2] + vcd[indx] + vcd[indx + v2]);
@ -686,7 +693,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
vfloat epssqv = F2V( epssq );
for (int rr = 6; rr < rr1 - 6; rr++) {
for (int indx = rr * ts + 6 + (FC(rr, 2) & 1); indx < rr * ts + cc1 - 6; indx += 8) {
for (int indx = rr * ts + 6 + (fc(cfarray, rr, 2) & 1); indx < rr * ts + cc1 - 6; indx += 8) {
//compute colour difference variances in cardinal directions
vfloat tempv = LC2VFU(vcd[indx]);
vfloat uavev = tempv + LC2VFU(vcd[indx - v1]) + LC2VFU(vcd[indx - v2]) + LC2VFU(vcd[indx - v3]);
@ -732,7 +739,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int rr = 6; rr < rr1 - 6; rr++) {
for (int cc = 6 + (FC(rr, 2) & 1), indx = rr * ts + cc; cc < cc1 - 6; cc += 2, indx += 2) {
for (int cc = 6 + (fc(cfarray, rr, 2) & 1), indx = rr * ts + cc; cc < cc1 - 6; cc += 2, indx += 2) {
//compute colour difference variances in cardinal directions
@ -794,7 +801,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
// precompute nyquist
for (int rr = 6; rr < rr1 - 6; rr++) {
int cc = 6 + (FC(rr, 2) & 1);
int cc = 6 + (fc(cfarray, rr, 2) & 1);
int indx = rr * ts + cc;
#ifdef __SSE2__
@ -857,7 +864,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
int nyendcol = 0;
for (int rr = 6; rr < rr1 - 6; rr++) {
for (int cc = 6 + (FC(rr, 2) & 1), indx = rr * ts + cc; cc < cc1 - 6; cc += 2, indx += 2) {
for (int cc = 6 + (fc(cfarray, rr, 2) & 1), indx = rr * ts + cc; cc < cc1 - 6; cc += 2, indx += 2) {
//nyquist texture test: ask if difference of vcd compared to hcd is larger or smaller than RGGB gradients
if(nyqutest[indx >> 1] > 0.f) {
@ -908,7 +915,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int indx = rr * ts + nystartcol + (FC(rr, 2) & 1); indx < rr * ts + nyendcol; indx += 2) {
for (int indx = rr * ts + nystartcol + (fc(cfarray, rr, 2) & 1); indx < rr * ts + nyendcol; indx += 2) {
unsigned int nyquisttemp = (nyquist[(indx - v2) >> 1] + nyquist[(indx - m1) >> 1] + nyquist[(indx + p1) >> 1] +
nyquist[(indx - 2) >> 1] + nyquist[(indx + 2) >> 1] +
nyquist[(indx - p1) >> 1] + nyquist[(indx + m1) >> 1] + nyquist[(indx + v2) >> 1]);
@ -923,7 +930,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
// in areas of Nyquist texture, do area interpolation
for (int rr = nystartrow; rr < nyendrow; rr++)
for (int indx = rr * ts + nystartcol + (FC(rr, 2) & 1); indx < rr * ts + nyendcol; indx += 2) {
for (int indx = rr * ts + nystartcol + (fc(cfarray, rr, 2) & 1); indx < rr * ts + nyendcol; indx += 2) {
if (nyquist2[indx >> 1]) {
// area interpolation
@ -963,7 +970,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
//populate G at R/B sites
for (int rr = 8; rr < rr1 - 8; rr++)
for (int indx = rr * ts + 8 + (FC(rr, 2) & 1); indx < rr * ts + cc1 - 8; indx += 2) {
for (int indx = rr * ts + 8 + (fc(cfarray, rr, 2) & 1); indx < rr * ts + cc1 - 8; indx += 2) {
//first ask if one gets more directional discrimination from nearby B/R sites
float hvwtalt = xdivf(hvwt[(indx - m1) >> 1] + hvwt[(indx + p1) >> 1] + hvwt[(indx - p1) >> 1] + hvwt[(indx + m1) >> 1], 2);
@ -986,7 +993,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
// refine Nyquist areas using G curvatures
if(doNyquist) {
for (int rr = nystartrow; rr < nyendrow; rr++)
for (int indx = rr * ts + nystartcol + (FC(rr, 2) & 1); indx < rr * ts + nyendcol; indx += 2) {
for (int indx = rr * ts + nystartcol + (fc(cfarray, rr, 2) & 1); indx < rr * ts + nyendcol; indx += 2) {
if (nyquist2[indx >> 1]) {
//local averages (over Nyquist pixels only) of G curvature squared
@ -1009,7 +1016,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#ifdef __SSE2__
for (int rr = 6; rr < rr1 - 6; rr++) {
if((FC(rr, 2) & 1) == 0) {
if((fc(cfarray, rr, 2) & 1) == 0) {
for (int cc = 6, indx = rr * ts + cc; cc < cc1 - 6; cc += 8, indx += 8) {
vfloat tempv = LC2VFU(cfa[indx + 1]);
vfloat Dgrbsq1pv = (SQRV(tempv - LC2VFU(cfa[indx + 1 - p1])) + SQRV(tempv - LC2VFU(cfa[indx + 1 + p1])));
@ -1035,7 +1042,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int rr = 6; rr < rr1 - 6; rr++) {
if((FC(rr, 2) & 1) == 0) {
if((fc(cfarray, rr, 2) & 1) == 0) {
for (int cc = 6, indx = rr * ts + cc; cc < cc1 - 6; cc += 2, indx += 2) {
delp[indx >> 1] = fabsf(cfa[indx + p1] - cfa[indx - p1]);
delm[indx >> 1] = fabsf(cfa[indx + m1] - cfa[indx - m1]);
@ -1064,7 +1071,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
for (int rr = 8; rr < rr1 - 8; rr++) {
#ifdef __SSE2__
for (int indx = rr * ts + 8 + (FC(rr, 2) & 1), indx1 = indx >> 1; indx < rr * ts + cc1 - 8; indx += 8, indx1 += 4) {
for (int indx = rr * ts + 8 + (fc(cfarray, rr, 2) & 1), indx1 = indx >> 1; indx < rr * ts + cc1 - 8; indx += 8, indx1 += 4) {
//diagonal colour ratios
vfloat cfav = LC2VFU(cfa[indx]);
@ -1129,7 +1136,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int cc = 8 + (FC(rr, 2) & 1), indx = rr * ts + cc, indx1 = indx >> 1; cc < cc1 - 8; cc += 2, indx += 2, indx1++) {
for (int cc = 8 + (fc(cfarray, rr, 2) & 1), indx = rr * ts + cc, indx1 = indx >> 1; cc < cc1 - 8; cc += 2, indx += 2, indx1++) {
//diagonal colour ratios
float crse = xmul2f(cfa[indx + m1]) / (eps + cfa[indx] + (cfa[indx + m2]));
@ -1219,7 +1226,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
for (int rr = 10; rr < rr1 - 10; rr++)
#ifdef __SSE2__
for (int indx = rr * ts + 10 + (FC(rr, 2) & 1), indx1 = indx >> 1; indx < rr * ts + cc1 - 10; indx += 8, indx1 += 4) {
for (int indx = rr * ts + 10 + (fc(cfarray, rr, 2) & 1), indx1 = indx >> 1; indx < rr * ts + cc1 - 10; indx += 8, indx1 += 4) {
//first ask if one gets more directional discrimination from nearby B/R sites
vfloat pmwtaltv = zd25v * (LVFU(pmwt[(indx - m1) >> 1]) + LVFU(pmwt[(indx + p1) >> 1]) + LVFU(pmwt[(indx - p1) >> 1]) + LVFU(pmwt[(indx + m1) >> 1]));
@ -1231,7 +1238,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int cc = 10 + (FC(rr, 2) & 1), indx = rr * ts + cc, indx1 = indx >> 1; cc < cc1 - 10; cc += 2, indx += 2, indx1++) {
for (int cc = 10 + (fc(cfarray, rr, 2) & 1), indx = rr * ts + cc, indx1 = indx >> 1; cc < cc1 - 10; cc += 2, indx += 2, indx1++) {
//first ask if one gets more directional discrimination from nearby B/R sites
float pmwtalt = xdivf(pmwt[(indx - m1) >> 1] + pmwt[(indx + p1) >> 1] + pmwt[(indx - p1) >> 1] + pmwt[(indx + m1) >> 1], 2);
@ -1247,7 +1254,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
for (int rr = 12; rr < rr1 - 12; rr++)
#ifdef __SSE2__
for (int indx = rr * ts + 12 + (FC(rr, 2) & 1), indx1 = indx >> 1; indx < rr * ts + cc1 - 12; indx += 8, indx1 += 4) {
for (int indx = rr * ts + 12 + (fc(cfarray, rr, 2) & 1), indx1 = indx >> 1; indx < rr * ts + cc1 - 12; indx += 8, indx1 += 4) {
vmask copymask = vmaskf_ge(vabsf(zd5v - LVFU(pmwt[indx1])), vabsf(zd5v - LVFU(hvwt[indx1])));
if(_mm_movemask_ps((vfloat)copymask)) { // if for any of the 4 pixels the condition is true, do the maths for all 4 pixels and mask the unused out at the end
@ -1302,7 +1309,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int cc = 12 + (FC(rr, 2) & 1), indx = rr * ts + cc, indx1 = indx >> 1; cc < cc1 - 12; cc += 2, indx += 2, indx1++) {
for (int cc = 12 + (fc(cfarray, rr, 2) & 1), indx = rr * ts + cc, indx1 = indx >> 1; cc < cc1 - 12; cc += 2, indx += 2, indx1++) {
if (fabsf(0.5f - pmwt[indx >> 1]) < fabsf(0.5f - hvwt[indx >> 1]) ) {
continue;
@ -1400,7 +1407,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
for (int rr = 14; rr < rr1 - 14; rr++)
#ifdef __SSE2__
for (int cc = 14 + (FC(rr, 2) & 1), indx = rr * ts + cc, c = 1 - FC(rr, cc) / 2; cc < cc1 - 14; cc += 8, indx += 8) {
for (int cc = 14 + (fc(cfarray, rr, 2) & 1), indx = rr * ts + cc, c = 1 - fc(cfarray, rr, cc) / 2; cc < cc1 - 14; cc += 8, indx += 8) {
vfloat tempv = epsv + vabsf(LVFU(Dgrb[c][(indx - m1) >> 1]) - LVFU(Dgrb[c][(indx + m1) >> 1]));
vfloat temp2v = epsv + vabsf(LVFU(Dgrb[c][(indx + p1) >> 1]) - LVFU(Dgrb[c][(indx - p1) >> 1]));
vfloat wtnwv = onev / (tempv + vabsf(LVFU(Dgrb[c][(indx - m1) >> 1]) - LVFU(Dgrb[c][(indx - m3) >> 1])) + vabsf(LVFU(Dgrb[c][(indx + m1) >> 1]) - LVFU(Dgrb[c][(indx - m3) >> 1])));
@ -1416,7 +1423,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
for (int cc = 14 + (FC(rr, 2) & 1), indx = rr * ts + cc, c = 1 - FC(rr, cc) / 2; cc < cc1 - 14; cc += 2, indx += 2) {
for (int cc = 14 + (fc(cfarray, rr, 2) & 1), indx = rr * ts + cc, c = 1 - fc(cfarray, rr, cc) / 2; cc < cc1 - 14; cc += 2, indx += 2) {
float wtnw = 1.f / (eps + fabsf(Dgrb[c][(indx - m1) >> 1] - Dgrb[c][(indx + m1) >> 1]) + fabsf(Dgrb[c][(indx - m1) >> 1] - Dgrb[c][(indx - m3) >> 1]) + fabsf(Dgrb[c][(indx + m1) >> 1] - Dgrb[c][(indx - m3) >> 1]));
float wtne = 1.f / (eps + fabsf(Dgrb[c][(indx + p1) >> 1] - Dgrb[c][(indx - p1) >> 1]) + fabsf(Dgrb[c][(indx + p1) >> 1] - Dgrb[c][(indx + p3) >> 1]) + fabsf(Dgrb[c][(indx - p1) >> 1] - Dgrb[c][(indx + p3) >> 1]));
float wtsw = 1.f / (eps + fabsf(Dgrb[c][(indx - p1) >> 1] - Dgrb[c][(indx + p1) >> 1]) + fabsf(Dgrb[c][(indx - p1) >> 1] - Dgrb[c][(indx + m3) >> 1]) + fabsf(Dgrb[c][(indx + p1) >> 1] - Dgrb[c][(indx - p3) >> 1]));
@ -1435,7 +1442,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
vfloat twov = F2V(2.f);
vmask selmask;
if((FC(16, 2) & 1) == 1) {
if((fc(cfarray, 16, 2) & 1) == 1) {
selmask = _mm_set_epi32(0xffffffff, 0, 0xffffffff, 0);
offset = 1;
} else {
@ -1510,7 +1517,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
#else
if((FC(rr, 2) & 1) == 1) {
if((fc(cfarray, rr, 2) & 1) == 1) {
for (; indx < rr * ts + cc1 - 16 - (cc1 & 1); indx++, col++) {
float temp = 1.f / (hvwt[(indx - v1) >> 1] + 2.f - hvwt[(indx + 1) >> 1] - hvwt[(indx - 1) >> 1] + hvwt[(indx + v1) >> 1]);
red[row][col] = 65535.f * (rgbgreen[indx] - ((hvwt[(indx - v1) >> 1]) * Dgrb[0][(indx - v1) >> 1] + (1.f - hvwt[(indx + 1) >> 1]) * Dgrb[0][(indx + 1) >> 1] + (1.f - hvwt[(indx - 1) >> 1]) * Dgrb[0][(indx - 1) >> 1] + (hvwt[(indx + v1) >> 1]) * Dgrb[0][(indx + v1) >> 1]) *
@ -1592,7 +1599,7 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh, c
free(buffer);
}
if(border < 4) {
border_interpolate2(W, H, 3, rawData, red, green, blue);
border_interpolate(W, H, 3, rawData, red, green, blue);
}
if(plistener) {

View File

@ -52,8 +52,8 @@
*
* !! locked arrays cannot be resized and cannot be unlocked again !!
*/
#ifndef ARRAY2D_H_
#define ARRAY2D_H_
#pragma once
#include <csignal> // for raise()
#include <cassert>
@ -249,7 +249,7 @@ public:
ar_realloc(w, h, offset);
if (flags & ARRAY2D_CLEAR_DATA) {
memset(data + offset, 0, w * h * sizeof(T));
memset(data + offset, 0, static_cast<unsigned long>(w) * h * sizeof(T));
}
}
@ -313,4 +313,3 @@ public:
return list[index];
}
};
#endif /* array2D_H_ */

View File

@ -20,8 +20,16 @@
#include "array2D.h"
#include "median.h"
#include "pixelsmap.h"
#include "rawimage.h"
#include "rawimagesource.h"
namespace
{
unsigned fc(const unsigned int cfa[2][2], int r, int c) {
return cfa[r & 1][c & 1];
}
}
namespace rtengine
{
@ -30,6 +38,7 @@ namespace rtengine
*/
int RawImageSource::interpolateBadPixelsBayer(const PixelsMap &bitmapBads, array2D<float> &rawData)
{
const unsigned int cfarray[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}};
constexpr float eps = 1.f;
int counter = 0;
@ -53,7 +62,7 @@ int RawImageSource::interpolateBadPixelsBayer(const PixelsMap &bitmapBads, array
float wtdsum = 0.f, norm = 0.f;
// diagonal interpolation
if (FC(row, col) == 1) {
if (fc(cfarray, row, col) == 1) {
// green channel. We can use closer pixels than for red or blue channel. Distance to center pixel is sqrt(2) => weighting is 0.70710678
// For green channel following pixels will be used for interpolation. Pixel to be interpolated is in center.
// 1 means that pixel is used in this step, if itself and his counterpart are not marked bad

View File

@ -16,22 +16,16 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _BILATERAL2_
#define _BILATERAL2_
#pragma once
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <glibmm.h>
#include "rtengine.h"
#include "rt_math.h"
#include "mytime.h"
#include <cstring>
#include "array2D.h"
#ifdef _OPENMP
#include <omp.h>
#endif
#include "LUT.h"
#include "rt_math.h"
using namespace rtengine;
@ -573,7 +567,7 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
// calculate histogram at the beginning of the row
rhist.clear();
for (int x = MAX(0, row_from - r); x <= MIN(H, row_from + r); x++)
for (int x = std::max(0, row_from - r); x <= std::min(H, row_from + r); x++)
for (int y = 0; y < r + 1; y++) {
rhist[((int)src[x][y]) >> TRANSBIT]++;
}
@ -584,12 +578,12 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
// calculate histogram at the beginning of the row
if (i > r)
for (int x = 0; x <= MIN(H, r); x++) {
for (int x = 0; x <= std::min(H, r); x++) {
rhist[((int)src[i - r - 1][x]) >> TRANSBIT]--;
}
if (i < H - r)
for (int x = 0; x <= MIN(H, r); x++) {
for (int x = 0; x <= std::min(H, r); x++) {
rhist[((int)src[i + r][x]) >> TRANSBIT]++;
}
@ -599,12 +593,12 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
// subtract pixels at the left and add pixels at the right
if (j > r)
for (int x = MAX(0, i - r); x <= MIN(i + r, H - 1); x++) {
for (int x = std::max(0, i - r); x <= std::min(i + r, H - 1); x++) {
hist[(int)(src[x][j - r - 1]) >> TRANSBIT]--;
}
if (j < W - r)
for (int x = MAX(0, i - r); x <= MIN(i + r, H - 1); x++) {
for (int x = std::max(0, i - r); x <= std::min(i + r, H - 1); x++) {
hist[((int)src[x][j + r]) >> TRANSBIT]++;
}
@ -643,5 +637,3 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
}
#undef BINBIT
#undef TRANSBIT
#endif

420
rtengine/boxblur.cc Normal file
View File

@ -0,0 +1,420 @@
/*
* This file is part of RawTherapee.
*
* Copyright (C) 2010 Emil Martinec <ejmartin@uchicago.edu>
* Copyright (C) 2019 Ingo Weyrich <heckflosse67@gmx.de>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <memory>
#include <cmath>
#include "boxblur.h"
#include "rt_math.h"
#include "opthelper.h"
namespace rtengine
{
void boxblur(float** src, float** dst, int radius, int W, int H, bool multiThread)
{
//box blur using rowbuffers and linebuffers instead of a full size buffer
if (radius == 0) {
if (src != dst) {
#ifdef _OPENMP
#pragma omp parallel for if (multiThread)
#endif
for (int row = 0; row < H; ++row) {
for (int col = 0; col < W; ++col) {
dst[row][col] = src[row][col];
}
}
}
return;
}
constexpr int numCols = 8; // process numCols columns at once for better usage of L1 cpu cache
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
{
std::unique_ptr<float[]> buffer(new float[numCols * (radius + 1)]);
//horizontal blur
float* const lineBuffer = buffer.get();
#ifdef _OPENMP
#pragma omp for
#endif
for (int row = 0; row < H; ++row) {
float len = radius + 1;
float tempval = src[row][0];
lineBuffer[0] = tempval;
for (int j = 1; j <= radius; j++) {
tempval += src[row][j];
}
tempval /= len;
dst[row][0] = tempval;
for (int col = 1; col <= radius; ++col) {
lineBuffer[col] = src[row][col];
tempval = (tempval * len + src[row][col + radius]) / (len + 1);
dst[row][col] = tempval;
++len;
}
int pos = 0;
for (int col = radius + 1; col < W - radius; ++col) {
const float oldVal = lineBuffer[pos];
lineBuffer[pos] = src[row][col];
tempval = tempval + (src[row][col + radius] - oldVal) / len;
dst[row][col] = tempval;
++pos;
pos = pos <= radius ? pos : 0;
}
for (int col = W - radius; col < W; ++col) {
tempval = (tempval * len - lineBuffer[pos]) / (len - 1);
dst[row][col] = tempval;
--len;
++pos;
pos = pos <= radius ? pos : 0;
}
}
//vertical blur
#ifdef __SSE2__
vfloat (* const rowBuffer)[2] = (vfloat(*)[2]) buffer.get();
const vfloat leninitv = F2V(radius + 1);
const vfloat onev = F2V(1.f);
vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv;
#ifdef _OPENMP
#pragma omp for nowait
#endif
for (int col = 0; col < W - 7; col += 8) {
lenv = leninitv;
tempv = LVFU(dst[0][col]);
temp1v = LVFU(dst[0][col + 4]);
rowBuffer[0][0] = tempv;
rowBuffer[0][1] = temp1v;
for (int i = 1; i <= radius; ++i) {
tempv = tempv + LVFU(dst[i][col]);
temp1v = temp1v + LVFU(dst[i][col + 4]);
}
tempv = tempv / lenv;
temp1v = temp1v / lenv;
STVFU(dst[0][col], tempv);
STVFU(dst[0][col + 4], temp1v);
for (int row = 1; row <= radius; ++row) {
rowBuffer[row][0] = LVFU(dst[row][col]);
rowBuffer[row][1] = LVFU(dst[row][col + 4]);
lenp1v = lenv + onev;
tempv = (tempv * lenv + LVFU(dst[row + radius][col])) / lenp1v;
temp1v = (temp1v * lenv + LVFU(dst[row + radius][col + 4])) / lenp1v;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
lenv = lenp1v;
}
rlenv = onev / lenv;
int pos = 0;
for (int row = radius + 1; row < H - radius; ++row) {
vfloat oldVal0 = rowBuffer[pos][0];
vfloat oldVal1 = rowBuffer[pos][1];
rowBuffer[pos][0] = LVFU(dst[row][col]);
rowBuffer[pos][1] = LVFU(dst[row][col + 4]);
tempv = tempv + (LVFU(dst[row + radius][col]) - oldVal0) * rlenv ;
temp1v = temp1v + (LVFU(dst[row + radius][col + 4]) - oldVal1) * rlenv ;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
++pos;
pos = pos <= radius ? pos : 0;
}
for (int row = H - radius; row < H; ++row) {
lenm1v = lenv - onev;
tempv = (tempv * lenv - rowBuffer[pos][0]) / lenm1v;
temp1v = (temp1v * lenv - rowBuffer[pos][1]) / lenm1v;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
lenv = lenm1v;
++pos;
pos = pos <= radius ? pos : 0;
}
}
#else
float (* const rowBuffer)[8] = (float(*)[8]) buffer.get();
#ifdef _OPENMP
#pragma omp for nowait
#endif
for (int col = 0; col < W - numCols + 1; col += 8) {
float len = radius + 1;
for (int k = 0; k < numCols; ++k) {
rowBuffer[0][k] = dst[0][col + k];
}
for (int i = 1; i <= radius; ++i) {
for (int k = 0; k < numCols; ++k) {
dst[0][col + k] += dst[i][col + k];
}
}
for(int k = 0; k < numCols; ++k) {
dst[0][col + k] /= len;
}
for (int row = 1; row <= radius; ++row) {
for(int k = 0; k < numCols; ++k) {
rowBuffer[row][k] = dst[row][col + k];
dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1);
}
len ++;
}
int pos = 0;
for (int row = radius + 1; row < H - radius; ++row) {
for(int k = 0; k < numCols; ++k) {
float oldVal = rowBuffer[pos][k];
rowBuffer[pos][k] = dst[row][col + k];
dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) / len;
}
++pos;
pos = pos <= radius ? pos : 0;
}
for (int row = H - radius; row < H; ++row) {
for(int k = 0; k < numCols; ++k) {
dst[row][col + k] = (dst[row - 1][col + k] * len - rowBuffer[pos][k]) / (len - 1);
}
len --;
++pos;
pos = pos <= radius ? pos : 0;
}
}
#endif
//vertical blur, remaining columns
#ifdef _OPENMP
#pragma omp single
#endif
{
const int remaining = W % numCols;
if (remaining > 0) {
float (* const rowBuffer)[8] = (float(*)[8]) buffer.get();
const int col = W - remaining;
float len = radius + 1;
for(int k = 0; k < remaining; ++k) {
rowBuffer[0][k] = dst[0][col + k];
}
for (int row = 1; row <= radius; ++row) {
for(int k = 0; k < remaining; ++k) {
dst[0][col + k] += dst[row][col + k];
}
}
for(int k = 0; k < remaining; ++k) {
dst[0][col + k] /= len;
}
for (int row = 1; row <= radius; ++row) {
for(int k = 0; k < remaining; ++k) {
rowBuffer[row][k] = dst[row][col + k];
dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1);
}
len ++;
}
const float rlen = 1.f / len;
int pos = 0;
for (int row = radius + 1; row < H - radius; ++row) {
for(int k = 0; k < remaining; ++k) {
float oldVal = rowBuffer[pos][k];
rowBuffer[pos][k] = dst[row][col + k];
dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) * rlen;
}
++pos;
pos = pos <= radius ? pos : 0;
}
for (int row = H - radius; row < H; ++row) {
for(int k = 0; k < remaining; ++k) {
dst[row][col + k] = (dst[(row - 1)][col + k] * len - rowBuffer[pos][k]) / (len - 1);
}
len --;
++pos;
pos = pos <= radius ? pos : 0;
}
}
}
}
}
void boxabsblur(float** src, float** dst, int radius, int W, int H, bool multiThread)
{
//abs box blur using rowbuffers and linebuffers instead of a full size buffer, W should be a multiple of 16
if (radius == 0) {
if (src != dst) {
#ifdef _OPENMP
#pragma omp parallel for if (multiThread)
#endif
for (int row = 0; row < H; ++row) {
for (int col = 0; col < W; ++col) {
dst[row][col] = std::fabs(src[row][col]);
}
}
}
return;
}
constexpr int numCols = 16; // process numCols columns at once for better usage of L1 cpu cache
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
{
float buffer[numCols * (radius + 1)] ALIGNED64;
//horizontal blur
float* const lineBuffer = buffer;
#ifdef _OPENMP
#pragma omp for
#endif
for (int row = 0; row < H; ++row) {
float len = radius + 1;
float tempval = std::fabs(src[row][0]);
lineBuffer[0] = tempval;
for (int j = 1; j <= radius; j++) {
tempval += std::fabs(src[row][j]);
}
tempval /= len;
dst[row][0] = tempval;
for (int col = 1; col <= radius; ++col) {
lineBuffer[col] = std::fabs(src[row][col]);
tempval = (tempval * len + std::fabs(src[row][col + radius])) / (len + 1);
dst[row][col] = tempval;
++len;
}
const float rlen = 1.f / len;
int pos = 0;
for (int col = radius + 1; col < W - radius; ++col) {
const float oldVal = lineBuffer[pos];
lineBuffer[pos] = std::fabs(src[row][col]);
tempval = tempval + (std::fabs(src[row][col + radius]) - oldVal) * rlen;
dst[row][col] = tempval;
++pos;
pos = pos <= radius ? pos : 0;
}
for (int col = W - radius; col < W; ++col) {
tempval = (tempval * len - lineBuffer[pos]) / (len - 1);
dst[row][col] = tempval;
--len;
++pos;
pos = pos <= radius ? pos : 0;
}
}
//vertical blur
float (* const rowBuffer)[numCols] = (float(*)[numCols]) buffer;
#ifdef _OPENMP
#pragma omp for
#endif
for (int col = 0; col < W; col += numCols) {
float len = radius + 1;
for (int k = 0; k < numCols; ++k) {
rowBuffer[0][k] = dst[0][col + k];
}
for (int i = 1; i <= radius; ++i) {
for (int k = 0; k < numCols; ++k) {
dst[0][col + k] += dst[i][col + k];
}
}
for(int k = 0; k < numCols; ++k) {
dst[0][col + k] /= len;
}
for (int row = 1; row <= radius; ++row) {
for(int k = 0; k < numCols; ++k) {
rowBuffer[row][k] = dst[row][col + k];
dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1);
}
++len;
}
const float rlen = 1.f / len;
int pos = 0;
for (int row = radius + 1; row < H - radius; ++row) {
for(int k = 0; k < numCols; ++k) {
float oldVal = rowBuffer[pos][k];
rowBuffer[pos][k] = dst[row][col + k];
dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) * rlen;
}
++pos;
pos = pos <= radius ? pos : 0;
}
for (int row = H - radius; row < H; ++row) {
for(int k = 0; k < numCols; ++k) {
dst[row][col + k] = (dst[row - 1][col + k] * len - rowBuffer[pos][k]) / (len - 1);
}
--len;
++pos;
pos = pos <= radius ? pos : 0;
}
}
}
}
void boxblur(float* src, float* dst, int radius, int W, int H, bool multiThread)
{
float* srcp[H];
float* dstp[H];
for (int i = 0; i < H; ++i) {
srcp[i] = src + i * W;
dstp[i] = dst + i * W;
}
boxblur(srcp, dstp, radius, W, H, multiThread);
}
void boxabsblur(float* src, float* dst, int radius, int W, int H, bool multiThread)
{
float* srcp[H];
float* dstp[H];
for (int i = 0; i < H; ++i) {
srcp[i] = src + i * W;
dstp[i] = dst + i * W;
}
boxabsblur(srcp, dstp, radius, W, H, multiThread);
}
}

View File

@ -1,7 +1,7 @@
/*
* This file is part of RawTherapee.
*
* Copyright (C) 2010 Emil Martinec <ejmartin@uchicago.edu>
* Copyright (C) 2019 Ingo Weyrich <heckflosse67@gmx.de>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,873 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _BOXBLUR_H_
#define _BOXBLUR_H_
#include <assert.h>
#include <memory>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "alignedbuffer.h"
#include "rt_math.h"
#include "opthelper.h"
*/
#pragma once
namespace rtengine
{
// classical filtering if the support window is small:
template<class T, class A> void boxblur (T** src, A** dst, int radx, int rady, int W, int H)
{
//box blur image; box range = (radx,rady)
assert(2*radx+1 < W);
assert(2*rady+1 < H);
AlignedBuffer<float>* buffer = new AlignedBuffer<float> (W * H);
float* temp = buffer->data;
if (radx == 0) {
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
temp[row * W + col] = (float)src[row][col];
}
} else {
//horizontal blur
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int row = 0; row < H; row++) {
int len = radx + 1;
temp[row * W + 0] = (float)src[row][0] / len;
for (int j = 1; j <= radx; j++) {
temp[row * W + 0] += (float)src[row][j] / len;
}
for (int col = 1; col <= radx; col++) {
temp[row * W + col] = (temp[row * W + col - 1] * len + (float)src[row][col + radx]) / (len + 1);
len ++;
}
for (int col = radx + 1; col < W - radx; col++) {
temp[row * W + col] = temp[row * W + col - 1] + ((float)(src[row][col + radx] - src[row][col - radx - 1])) / len;
}
for (int col = W - radx; col < W; col++) {
temp[row * W + col] = (temp[row * W + col - 1] * len - src[row][col - radx - 1]) / (len - 1);
len --;
}
}
}
if (rady == 0) {
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
dst[row][col] = temp[row * W + col];
}
} else {
//vertical blur
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int col = 0; col < W; col++) {
int len = rady + 1;
dst[0][col] = temp[0 * W + col] / len;
for (int i = 1; i <= rady; i++) {
dst[0][col] += temp[i * W + col] / len;
}
for (int row = 1; row <= rady; row++) {
dst[row][col] = (dst[(row - 1)][col] * len + temp[(row + rady) * W + col]) / (len + 1);
len ++;
}
for (int row = rady + 1; row < H - rady; row++) {
dst[row][col] = dst[(row - 1)][col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len;
}
for (int row = H - rady; row < H; row++) {
dst[row][col] = (dst[(row - 1)][col] * len - temp[(row - rady - 1) * W + col]) / (len - 1);
len --;
}
}
}
delete buffer;
void boxblur(float** src, float** dst, int radius, int W, int H, bool multiThread);
void boxblur(float* src, float* dst, int radius, int W, int H, bool multiThread);
void boxabsblur(float** src, float** dst, int radius, int W, int H, bool multiThread);
void boxabsblur(float* src, float* dst, int radius, int W, int H, bool multiThread);
}
template<class T, class A> void boxblur (T** src, A** dst, T* buffer, int radx, int rady, int W, int H)
{
//box blur image; box range = (radx,rady)
float* temp = buffer;
if (radx == 0) {
#ifdef _OPENMP
#pragma omp for
#endif
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
temp[row * W + col] = (float)src[row][col];
}
} else {
//horizontal blur
#ifdef _OPENMP
#pragma omp for
#endif
for (int row = 0; row < H; row++) {
float len = radx + 1;
float tempval = (float)src[row][0];
for (int j = 1; j <= radx; j++) {
tempval += (float)src[row][j];
}
tempval /= len;
temp[row * W + 0] = tempval;
for (int col = 1; col <= radx; col++) {
temp[row * W + col] = tempval = (tempval * len + (float)src[row][col + radx]) / (len + 1);
len ++;
}
for (int col = radx + 1; col < W - radx; col++) {
temp[row * W + col] = tempval = tempval + ((float)(src[row][col + radx] - src[row][col - radx - 1])) / len;
}
for (int col = W - radx; col < W; col++) {
temp[row * W + col] = tempval = (tempval * len - src[row][col - radx - 1]) / (len - 1);
len --;
}
}
}
if (rady == 0) {
#ifdef _OPENMP
#pragma omp for
#endif
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
dst[row][col] = temp[row * W + col];
}
} else {
const int numCols = 8; // process numCols columns at once for better usage of L1 cpu cache
#ifdef __SSE2__
vfloat leninitv = F2V( (float)(rady + 1));
vfloat onev = F2V( 1.f );
vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv;
#ifdef _OPENMP
#pragma omp for
#endif
for (int col = 0; col < W - 7; col += 8) {
lenv = leninitv;
tempv = LVFU(temp[0 * W + col]);
temp1v = LVFU(temp[0 * W + col + 4]);
for (int i = 1; i <= rady; i++) {
tempv = tempv + LVFU(temp[i * W + col]);
temp1v = temp1v + LVFU(temp[i * W + col + 4]);
}
tempv = tempv / lenv;
temp1v = temp1v / lenv;
STVFU(dst[0][col], tempv);
STVFU(dst[0][col + 4], temp1v);
for (int row = 1; row <= rady; row++) {
lenp1v = lenv + onev;
tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v;
temp1v = (temp1v * lenv + LVFU(temp[(row + rady) * W + col + 4])) / lenp1v;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
lenv = lenp1v;
}
rlenv = onev / lenv;
for (int row = rady + 1; row < H - rady; row++) {
tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ;
temp1v = temp1v + (LVFU(temp[(row + rady) * W + col + 4]) - LVFU(temp[(row - rady - 1) * W + col + 4])) * rlenv ;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
}
for (int row = H - rady; row < H; row++) {
lenm1v = lenv - onev;
tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v;
temp1v = (temp1v * lenv - LVFU(temp[(row - rady - 1) * W + col + 4])) / lenm1v;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
lenv = lenm1v;
}
}
#else
//vertical blur
#ifdef _OPENMP
#pragma omp for
#endif
for (int col = 0; col < W - numCols + 1; col += 8) {
float len = rady + 1;
for(int k = 0; k < numCols; k++) {
dst[0][col + k] = temp[0 * W + col + k];
}
for (int i = 1; i <= rady; i++) {
for(int k = 0; k < numCols; k++) {
dst[0][col + k] += temp[i * W + col + k];
}
}
for(int k = 0; k < numCols; k++) {
dst[0][col + k] /= len;
}
for (int row = 1; row <= rady; row++) {
for(int k = 0; k < numCols; k++) {
dst[row][col + k] = (dst[(row - 1)][col + k] * len + temp[(row + rady) * W + col + k]) / (len + 1);
}
len ++;
}
for (int row = rady + 1; row < H - rady; row++) {
for(int k = 0; k < numCols; k++) {
dst[row][col + k] = dst[(row - 1)][col + k] + (temp[(row + rady) * W + col + k] - temp[(row - rady - 1) * W + col + k]) / len;
}
}
for (int row = H - rady; row < H; row++) {
for(int k = 0; k < numCols; k++) {
dst[row][col + k] = (dst[(row - 1)][col + k] * len - temp[(row - rady - 1) * W + col + k]) / (len - 1);
}
len --;
}
}
#endif
#ifdef _OPENMP
#pragma omp single
#endif
for (int col = W - (W % numCols); col < W; col++) {
float len = rady + 1;
dst[0][col] = temp[0 * W + col] / len;
for (int i = 1; i <= rady; i++) {
dst[0][col] += temp[i * W + col] / len;
}
for (int row = 1; row <= rady; row++) {
dst[row][col] = (dst[(row - 1)][col] * len + temp[(row + rady) * W + col]) / (len + 1);
len ++;
}
for (int row = rady + 1; row < H - rady; row++) {
dst[row][col] = dst[(row - 1)][col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len;
}
for (int row = H - rady; row < H; row++) {
dst[row][col] = (dst[(row - 1)][col] * len - temp[(row - rady - 1) * W + col]) / (len - 1);
len --;
}
}
}
}
inline void boxblur (float** src, float** dst, int radius, int W, int H, bool multiThread)
{
//box blur using rowbuffers and linebuffers instead of a full size buffer
if (radius == 0) {
if (src != dst) {
#ifdef _OPENMP
#pragma omp parallel for if (multiThread)
#endif
for (int row = 0; row < H; row++) {
for (int col = 0; col < W; col++) {
dst[row][col] = src[row][col];
}
}
}
return;
}
constexpr int numCols = 8; // process numCols columns at once for better usage of L1 cpu cache
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
{
std::unique_ptr<float[]> buffer(new float[numCols * (radius + 1)]);
//horizontal blur
float* const lineBuffer = buffer.get();
#ifdef _OPENMP
#pragma omp for
#endif
for (int row = 0; row < H; row++) {
float len = radius + 1;
float tempval = src[row][0];
lineBuffer[0] = tempval;
for (int j = 1; j <= radius; j++) {
tempval += src[row][j];
}
tempval /= len;
dst[row][0] = tempval;
for (int col = 1; col <= radius; col++) {
lineBuffer[col] = src[row][col];
tempval = (tempval * len + src[row][col + radius]) / (len + 1);
dst[row][col] = tempval;
++len;
}
int pos = 0;
for (int col = radius + 1; col < W - radius; col++) {
const float oldVal = lineBuffer[pos];
lineBuffer[pos] = src[row][col];
tempval = tempval + (src[row][col + radius] - oldVal) / len;
dst[row][col] = tempval;
++pos;
pos = pos <= radius ? pos : 0;
}
for (int col = W - radius; col < W; col++) {
tempval = (tempval * len - lineBuffer[pos]) / (len - 1);
dst[row][col] = tempval;
--len;
++pos;
pos = pos <= radius ? pos : 0;
}
}
//vertical blur
#ifdef __SSE2__
vfloat (* const rowBuffer)[2] = (vfloat(*)[2]) buffer.get();
const vfloat leninitv = F2V(radius + 1);
const vfloat onev = F2V(1.f);
vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv;
#ifdef _OPENMP
#pragma omp for nowait
#endif
for (int col = 0; col < W - 7; col += 8) {
lenv = leninitv;
tempv = LVFU(dst[0][col]);
temp1v = LVFU(dst[0][col + 4]);
rowBuffer[0][0] = tempv;
rowBuffer[0][1] = temp1v;
for (int i = 1; i <= radius; i++) {
tempv = tempv + LVFU(dst[i][col]);
temp1v = temp1v + LVFU(dst[i][col + 4]);
}
tempv = tempv / lenv;
temp1v = temp1v / lenv;
STVFU(dst[0][col], tempv);
STVFU(dst[0][col + 4], temp1v);
for (int row = 1; row <= radius; row++) {
rowBuffer[row][0] = LVFU(dst[row][col]);
rowBuffer[row][1] = LVFU(dst[row][col + 4]);
lenp1v = lenv + onev;
tempv = (tempv * lenv + LVFU(dst[row + radius][col])) / lenp1v;
temp1v = (temp1v * lenv + LVFU(dst[row + radius][col + 4])) / lenp1v;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
lenv = lenp1v;
}
rlenv = onev / lenv;
int pos = 0;
for (int row = radius + 1; row < H - radius; row++) {
vfloat oldVal0 = rowBuffer[pos][0];
vfloat oldVal1 = rowBuffer[pos][1];
rowBuffer[pos][0] = LVFU(dst[row][col]);
rowBuffer[pos][1] = LVFU(dst[row][col + 4]);
tempv = tempv + (LVFU(dst[row + radius][col]) - oldVal0) * rlenv ;
temp1v = temp1v + (LVFU(dst[row + radius][col + 4]) - oldVal1) * rlenv ;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
++pos;
pos = pos <= radius ? pos : 0;
}
for (int row = H - radius; row < H; row++) {
lenm1v = lenv - onev;
tempv = (tempv * lenv - rowBuffer[pos][0]) / lenm1v;
temp1v = (temp1v * lenv - rowBuffer[pos][1]) / lenm1v;
STVFU(dst[row][col], tempv);
STVFU(dst[row][col + 4], temp1v);
lenv = lenm1v;
++pos;
pos = pos <= radius ? pos : 0;
}
}
#else
float (* const rowBuffer)[8] = (float(*)[8]) buffer.get();
#ifdef _OPENMP
#pragma omp for nowait
#endif
for (int col = 0; col < W - numCols + 1; col += 8) {
float len = radius + 1;
for (int k = 0; k < numCols; k++) {
rowBuffer[0][k] = dst[0][col + k];
}
for (int i = 1; i <= radius; i++) {
for (int k = 0; k < numCols; k++) {
dst[0][col + k] += dst[i][col + k];
}
}
for(int k = 0; k < numCols; k++) {
dst[0][col + k] /= len;
}
for (int row = 1; row <= radius; row++) {
for(int k = 0; k < numCols; k++) {
rowBuffer[row][k] = dst[row][col + k];
dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1);
}
len ++;
}
int pos = 0;
for (int row = radius + 1; row < H - radius; row++) {
for(int k = 0; k < numCols; k++) {
float oldVal = rowBuffer[pos][k];
rowBuffer[pos][k] = dst[row][col + k];
dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) / len;
}
++pos;
pos = pos <= radius ? pos : 0;
}
for (int row = H - radius; row < H; row++) {
for(int k = 0; k < numCols; k++) {
dst[row][col + k] = (dst[row - 1][col + k] * len - rowBuffer[pos][k]) / (len - 1);
}
len --;
++pos;
pos = pos <= radius ? pos : 0;
}
}
#endif
//vertical blur, remaining columns
#ifdef _OPENMP
#pragma omp single
#endif
{
const int remaining = W % numCols;
if (remaining > 0) {
float (* const rowBuffer)[8] = (float(*)[8]) buffer.get();
const int col = W - remaining;
float len = radius + 1;
for(int k = 0; k < remaining; ++k) {
rowBuffer[0][k] = dst[0][col + k];
}
for (int row = 1; row <= radius; ++row) {
for(int k = 0; k < remaining; ++k) {
dst[0][col + k] += dst[row][col + k];
}
}
for(int k = 0; k < remaining; ++k) {
dst[0][col + k] /= len;
}
for (int row = 1; row <= radius; ++row) {
for(int k = 0; k < remaining; ++k) {
rowBuffer[row][k] = dst[row][col + k];
dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1);
}
len ++;
}
const float rlen = 1.f / len;
int pos = 0;
for (int row = radius + 1; row < H - radius; ++row) {
for(int k = 0; k < remaining; ++k) {
float oldVal = rowBuffer[pos][k];
rowBuffer[pos][k] = dst[row][col + k];
dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) * rlen;
}
++pos;
pos = pos <= radius ? pos : 0;
}
for (int row = H - radius; row < H; ++row) {
for(int k = 0; k < remaining; ++k) {
dst[row][col + k] = (dst[(row - 1)][col + k] * len - rowBuffer[pos][k]) / (len - 1);
}
len --;
++pos;
pos = pos <= radius ? pos : 0;
}
}
}
}
}
template<class T, class A> void boxblur (T* src, A* dst, A* buffer, int radx, int rady, int W, int H)
{
//box blur image; box range = (radx,rady) i.e. box size is (2*radx+1)x(2*rady+1)
float* temp = buffer;
if (radx == 0) {
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
temp[row * W + col] = src[row * W + col];
}
} else {
//horizontal blur
for (int row = H - 1; row >= 0; row--) {
int len = radx + 1;
float tempval = (float)src[row * W];
for (int j = 1; j <= radx; j++) {
tempval += (float)src[row * W + j];
}
tempval = tempval / len;
temp[row * W] = tempval;
for (int col = 1; col <= radx; col++) {
tempval = (tempval * len + src[row * W + col + radx]) / (len + 1);
temp[row * W + col] = tempval;
len ++;
}
float reclen = 1.f / len;
for (int col = radx + 1; col < W - radx; col++) {
tempval = tempval + ((float)(src[row * W + col + radx] - src[row * W + col - radx - 1])) * reclen;
temp[row * W + col] = tempval;
}
for (int col = W - radx; col < W; col++) {
tempval = (tempval * len - src[row * W + col - radx - 1]) / (len - 1);
temp[row * W + col] = tempval;
len --;
}
}
}
if (rady == 0) {
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
dst[row * W + col] = temp[row * W + col];
}
} else {
//vertical blur
#ifdef __SSE2__
vfloat leninitv = F2V( (float)(rady + 1));
vfloat onev = F2V( 1.f );
vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv;
int col;
for (col = 0; col < W - 7; col += 8) {
lenv = leninitv;
tempv = LVFU(temp[0 * W + col]);
temp1v = LVFU(temp[0 * W + col + 4]);
for (int i = 1; i <= rady; i++) {
tempv = tempv + LVFU(temp[i * W + col]);
temp1v = temp1v + LVFU(temp[i * W + col + 4]);
}
tempv = tempv / lenv;
temp1v = temp1v / lenv;
STVFU(dst[0 * W + col], tempv);
STVFU(dst[0 * W + col + 4], temp1v);
for (int row = 1; row <= rady; row++) {
lenp1v = lenv + onev;
tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v;
temp1v = (temp1v * lenv + LVFU(temp[(row + rady) * W + col + 4])) / lenp1v;
STVFU(dst[row * W + col], tempv);
STVFU(dst[row * W + col + 4], temp1v);
lenv = lenp1v;
}
rlenv = onev / lenv;
for (int row = rady + 1; row < H - rady; row++) {
tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ;
temp1v = temp1v + (LVFU(temp[(row + rady) * W + col + 4]) - LVFU(temp[(row - rady - 1) * W + col + 4])) * rlenv ;
STVFU(dst[row * W + col], tempv);
STVFU(dst[row * W + col + 4], temp1v);
}
for (int row = H - rady; row < H; row++) {
lenm1v = lenv - onev;
tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v;
temp1v = (temp1v * lenv - LVFU(temp[(row - rady - 1) * W + col + 4])) / lenm1v;
STVFU(dst[row * W + col], tempv);
STVFU(dst[row * W + col + 4], temp1v);
lenv = lenm1v;
}
}
for (; col < W - 3; col += 4) {
lenv = leninitv;
tempv = LVFU(temp[0 * W + col]);
for (int i = 1; i <= rady; i++) {
tempv = tempv + LVFU(temp[i * W + col]);
}
tempv = tempv / lenv;
STVFU(dst[0 * W + col], tempv);
for (int row = 1; row <= rady; row++) {
lenp1v = lenv + onev;
tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v;
STVFU(dst[row * W + col], tempv);
lenv = lenp1v;
}
rlenv = onev / lenv;
for (int row = rady + 1; row < H - rady; row++) {
tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ;
STVFU(dst[row * W + col], tempv);
}
for (int row = H - rady; row < H; row++) {
lenm1v = lenv - onev;
tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v;
STVFU(dst[row * W + col], tempv);
lenv = lenm1v;
}
}
for (; col < W; col++) {
int len = rady + 1;
dst[0 * W + col] = temp[0 * W + col] / len;
for (int i = 1; i <= rady; i++) {
dst[0 * W + col] += temp[i * W + col] / len;
}
for (int row = 1; row <= rady; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1);
len ++;
}
for (int row = rady + 1; row < H - rady; row++) {
dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len;
}
for (int row = H - rady; row < H; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1);
len --;
}
}
#else
for (int col = 0; col < W; col++) {
int len = rady + 1;
dst[0 * W + col] = temp[0 * W + col] / len;
for (int i = 1; i <= rady; i++) {
dst[0 * W + col] += temp[i * W + col] / len;
}
for (int row = 1; row <= rady; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1);
len ++;
}
for (int row = rady + 1; row < H - rady; row++) {
dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len;
}
for (int row = H - rady; row < H; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1);
len --;
}
}
#endif
}
}
template<class T, class A> void boxabsblur (T* src, A* dst, int radx, int rady, int W, int H, float * temp)
{
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//box blur image; box range = (radx,rady) i.e. box size is (2*radx+1)x(2*rady+1)
if (radx == 0) {
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
temp[row * W + col] = fabs(src[row * W + col]);
}
} else {
//horizontal blur
for (int row = 0; row < H; row++) {
int len = radx + 1;
float tempval = fabsf((float)src[row * W + 0]);
for (int j = 1; j <= radx; j++) {
tempval += fabsf((float)src[row * W + j]);
}
tempval /= len;
temp[row * W + 0] = tempval;
for (int col = 1; col <= radx; col++) {
tempval = (tempval * len + fabsf(src[row * W + col + radx])) / (len + 1);
temp[row * W + col] = tempval;
len ++;
}
float rlen = 1.f / (float)len;
for (int col = radx + 1; col < W - radx; col++) {
tempval = tempval + ((float)(fabsf(src[row * W + col + radx]) - fabsf(src[row * W + col - radx - 1]))) * rlen;
temp[row * W + col] = tempval;
}
for (int col = W - radx; col < W; col++) {
tempval = (tempval * len - fabsf(src[row * W + col - radx - 1])) / (len - 1);
temp[row * W + col] = tempval;
len --;
}
}
}
if (rady == 0) {
for (int row = 0; row < H; row++)
for (int col = 0; col < W; col++) {
dst[row * W + col] = temp[row * W + col];
}
} else {
//vertical blur
#ifdef __SSE2__
vfloat leninitv = F2V( (float)(rady + 1));
vfloat onev = F2V( 1.f );
vfloat tempv, lenv, lenp1v, lenm1v, rlenv;
for (int col = 0; col < W - 3; col += 4) {
lenv = leninitv;
tempv = LVF(temp[0 * W + col]);
for (int i = 1; i <= rady; i++) {
tempv = tempv + LVF(temp[i * W + col]);
}
tempv = tempv / lenv;
STVF(dst[0 * W + col], tempv);
for (int row = 1; row <= rady; row++) {
lenp1v = lenv + onev;
tempv = (tempv * lenv + LVF(temp[(row + rady) * W + col])) / lenp1v;
STVF(dst[row * W + col], tempv);
lenv = lenp1v;
}
rlenv = onev / lenv;
for (int row = rady + 1; row < H - rady; row++) {
tempv = tempv + (LVF(temp[(row + rady) * W + col]) - LVF(temp[(row - rady - 1) * W + col])) * rlenv;
STVF(dst[row * W + col], tempv);
}
for (int row = H - rady; row < H; row++) {
lenm1v = lenv - onev;
tempv = (tempv * lenv - LVF(temp[(row - rady - 1) * W + col])) / lenm1v;
STVF(dst[row * W + col], tempv);
lenv = lenm1v;
}
}
for (int col = W - (W % 4); col < W; col++) {
int len = rady + 1;
dst[0 * W + col] = temp[0 * W + col] / len;
for (int i = 1; i <= rady; i++) {
dst[0 * W + col] += temp[i * W + col] / len;
}
for (int row = 1; row <= rady; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1);
len ++;
}
for (int row = rady + 1; row < H - rady; row++) {
dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len;
}
for (int row = H - rady; row < H; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1);
len --;
}
}
#else
for (int col = 0; col < W; col++) {
int len = rady + 1;
dst[0 * W + col] = temp[0 * W + col] / len;
for (int i = 1; i <= rady; i++) {
dst[0 * W + col] += temp[i * W + col] / len;
}
for (int row = 1; row <= rady; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1);
len ++;
}
for (int row = rady + 1; row < H - rady; row++) {
dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len;
}
for (int row = H - rady; row < H; row++) {
dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1);
len --;
}
}
#endif
}
}
}
#endif /* _BOXBLUR_H_ */

View File

@ -1,4 +1,3 @@
#ifndef CALC_DISTORTION__H
#define CALC_DISTORTION__H
#pragma once
int calcDistortion (unsigned char* img1, unsigned char* img2, int ncols, int nrows, int nfactor, double &distortion);
#endif

View File

@ -2,6 +2,9 @@
* This file is part of RawTherapee.
*/
#include "camconst.h"
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include <glibmm/ustring.h>
#include "settings.h"
#include "rt_math.h"
#include <cstdio>
@ -17,8 +20,6 @@
namespace rtengine
{
extern const Settings* settings;
CameraConst::CameraConst() : pdafOffset(0)
{
memset(dcraw_matrix, 0, sizeof(dcraw_matrix));

View File

@ -1,11 +1,11 @@
/*
* This file is part of RawTherapee.
*/
#ifndef __CAMCONST__
#define __CAMCONST__
#pragma once
#include <glibmm.h>
#include <glibmm/ustring.h>
#include <map>
#include <vector>
namespace rtengine
{
@ -72,5 +72,3 @@ public:
};
}
#endif

View File

@ -20,18 +20,14 @@
#include <iostream>
#include "rtengine.h"
#include "rawimage.h"
#include "rawimagesource.h"
#include "rt_math.h"
#include "improcfun.h"
#include "procparams.h"
#include "color.h"
#include "gauss.h"
#include "rt_algo.h"
//#define BENCHMARK
#include "StopWatch.h"
#ifdef _OPENMP
#include <omp.h>
#endif
#include "opthelper.h"
#include "../rtgui/multilangmgr.h"
@ -513,6 +509,7 @@ float calcRadiusXtrans(const float * const *rawData, int W, int H, float lowerLi
}
return std::sqrt((1.f / (std::log(1.f / maxRatio))) / -2.f);
}
void CaptureDeconvSharpening (float** luminance, float** oldLuminance, const float * const * blend, int W, int H, double sigma, double sigmaCornerOffset, int iterations, rtengine::ProgressListener* plistener, double startVal, double endVal)
{
BENCHFUN
@ -583,10 +580,10 @@ BENCHFUN
} else {
if (sigmaCornerOffset != 0.0) {
const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2));
const float sigmaTile = sigma + distanceFactor * distance;
const float sigmaTile = static_cast<float>(sigma) + distanceFactor * distance;
if (sigmaTile >= 0.4f) {
float lkernel7[7][7];
compute7x7kernel(sigma + distanceFactor * distance, lkernel7);
compute7x7kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations - 1; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, fullTileSize, lkernel7);
@ -605,13 +602,13 @@ BENCHFUN
// special handling for small tiles at end of row or column
for (int k = border, ii = endOfCol ? H - fullTileSize - border : i - border; k < fullTileSize - border; ++k) {
for (int l = border, jj = endOfRow ? W - fullTileSize - border : j - border; l < fullTileSize - border; ++l) {
luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]);
luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], std::max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]);
}
}
} else {
for (int ii = border; ii < fullTileSize - border; ++ii) {
for (int jj = border; jj < fullTileSize - border; ++jj) {
luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], max(tmpIThr[ii][jj], 0.0f), luminance[i + ii - border][j + jj - border]);
luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], std::max(tmpIThr[ii][jj], 0.0f), luminance[i + ii - border][j + jj - border]);
}
}
}
@ -654,13 +651,13 @@ BENCHFUN
const float clipVal = (ri->get_white(1) - ri->get_cblack(1)) * scale_mul[1];
array2D<float>& redVals = redCache ? *redCache : red;
array2D<float>& greenVals = greenCache ? *greenCache : green;
array2D<float>& blueVals = blueCache ? *blueCache : blue;
const array2D<float>& redVals = redCache ? *redCache : red;
const array2D<float>& greenVals = greenCache ? *greenCache : green;
const array2D<float>& blueVals = blueCache ? *blueCache : blue;
array2D<float> clipMask(W, H);
constexpr float clipLimit = 0.95f;
if (ri->getSensorType() == ST_BAYER) {
if (getSensorType() == ST_BAYER) {
const float whites[2][2] = {
{(ri->get_white(FC(0,0)) - c_black[FC(0,0)]) * scale_mul[FC(0,0)] * clipLimit, (ri->get_white(FC(0,1)) - c_black[FC(0,1)]) * scale_mul[FC(0,1)] * clipLimit},
{(ri->get_white(FC(1,0)) - c_black[FC(1,0)]) * scale_mul[FC(1,0)] * clipLimit, (ri->get_white(FC(1,1)) - c_black[FC(1,1)]) * scale_mul[FC(1,1)] * clipLimit}
@ -668,9 +665,9 @@ BENCHFUN
buildClipMaskBayer(rawData, W, H, clipMask, whites);
const unsigned int fc[2] = {FC(0,0), FC(1,0)};
if (sharpeningParams.autoRadius) {
radius = calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc);
radius = std::min(calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc), 1.15f);
}
} else if (ri->getSensorType() == ST_FUJI_XTRANS) {
} else if (getSensorType() == ST_FUJI_XTRANS) {
float whites[6][6];
for (int i = 0; i < 6; ++i) {
for (int j = 0; j < 6; ++j) {
@ -696,14 +693,14 @@ BENCHFUN
}
}
if (sharpeningParams.autoRadius) {
radius = calcRadiusXtrans(rawData, W, H, 1000.f, clipVal, i, j);
radius = std::min(calcRadiusXtrans(rawData, W, H, 1000.f, clipVal, i, j), 1.15f);
}
} else if (ri->get_colors() == 1) {
buildClipMaskMono(rawData, W, H, clipMask, (ri->get_white(0) - c_black[0]) * scale_mul[0] * clipLimit);
if (sharpeningParams.autoRadius) {
const unsigned int fc[2] = {0, 0};
radius = calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc);
radius = std::min(calcRadiusBayer(rawData, W, H, 1000.f, clipVal, fc), 1.15f);
}
}
@ -810,6 +807,7 @@ BENCHFUN
if (plistener) {
plistener->setProgress(1.0);
}
rgbSourceModified = false;
}
} /* namespace */

View File

@ -24,7 +24,6 @@
#include <cmath>
#include "rtengine.h"
#include "rawimagesource.h"
#include "rt_math.h"
@ -63,7 +62,7 @@ void RawImageSource::CLASS cfa_linedn(float noise, bool horizontal, bool vertica
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
float noisevar = SQR(3 * noise * 65535); // _noise_ (as a fraction of saturation) is input to the algorithm
float noisevarm4 = 4.0f * noisevar;
float* RawDataTmp = (float*)malloc( width * height * sizeof(float));
float* RawDataTmp = (float*)malloc(static_cast<unsigned long>(width) * height * sizeof(float));
#ifdef _OPENMP
#pragma omp parallel
#endif

View File

@ -17,10 +17,10 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ciecam02.h"
#include "rtengine.h"
#include "rt_math.h"
#include "curves.h"
#include <math.h>
#include "sleef.c"
#include "sleef.h"
#ifdef _DEBUG
#include "settings.h"
@ -34,10 +34,6 @@
namespace rtengine
{
#ifdef _DEBUG
extern const Settings* settings;
#endif
void Ciecam02::curvecolorfloat (float satind, float satval, float &sres, float parsat)
{
if (satind > 0.f) {

View File

@ -16,12 +16,19 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _CIECAM02_
#define _CIECAM02_
#pragma once
#include <cmath>
#include "LUT.h"
#include <cstdint>
#include "opthelper.h"
template<typename T>
class LUT;
using LUTu = LUT<uint32_t>;
using LUTf = LUT<float>;
namespace rtengine
{
@ -106,4 +113,3 @@ public:
};
}
#endif

View File

@ -1,5 +1,7 @@
#include "cieimage.h"
#include <memory.h>
#include <new>
#include <cstring>
namespace rtengine
{
@ -10,7 +12,6 @@ CieImage::CieImage (int w, int h) : fromImage(false), W(w), H(h)
M_p = new float*[H];
C_p = new float*[H];
sh_p = new float*[H];
// ch_p = new float*[H];
h_p = new float*[H];
// Initialize the pointers to zero
@ -98,9 +99,6 @@ CieImage::CieImage (int w, int h) : fromImage(false), W(w), H(h)
++c;
// for (int i=0; i<H; i++)
// ch_p[i] = data[c] + i*W;
// ++c;
for (int i = 0; i < H; i++) {
h_p[i] = data[c] + i * W;
}

View File

@ -16,10 +16,8 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _CIEIMAGE_H_
#define _CIEIMAGE_H_
#pragma once
#include "image16.h"
#include "noncopyable.h"
namespace rtengine
@ -39,7 +37,6 @@ public:
float** M_p;
float** C_p;
float** sh_p;
// float** ch_p;
float** h_p;
CieImage (int w, int h);
@ -50,4 +47,3 @@ public:
};
}
#endif

View File

@ -1,7 +1,11 @@
#include <algorithm>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include "clutstore.h"
#include "colortemp.h"
#include "iccstore.h"
#include "imagefloat.h"
#include "opthelper.h"

View File

@ -3,8 +3,6 @@
#include <memory>
#include <cstdint>
#include <gtkmm.h>
#include "cache.h"
#include "alignedbuffer.h"
#include "noncopyable.h"

View File

@ -20,18 +20,19 @@
#include "rtengine.h"
#include "color.h"
#include "iccmatrices.h"
#include "mytime.h"
#include "sleef.c"
#include "sleef.h"
#include "opthelper.h"
#include "iccstore.h"
#ifdef _DEBUG
#include "mytime.h"
#endif
using namespace std;
namespace rtengine
{
extern const Settings* settings;
cmsToneCurve* Color::linearGammaTRC;
LUTf Color::cachef;
LUTf Color::cachefy;

View File

@ -20,14 +20,13 @@
#pragma once
#include <array>
#include <glibmm.h>
#include <glibmm/ustring.h>
#include "rt_math.h"
#include "LUT.h"
#include "labimage.h"
#include "iccmatrices.h"
#include "lcms2.h"
#include "sleef.c"
#include "sleef.h"
#define SAT(a,b,c) ((float)max(a,b,c)-(float)min(a,b,c))/(float)max(a,b,c)

View File

@ -16,19 +16,21 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <glibmm/ustring.h>
#include "colortemp.h"
#include "rtengine.h"
#include "iccmatrices.h"
#include "rt_math.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "sleef.c"
#include "sleef.h"
#include "settings.h"
namespace rtengine
{
extern const Settings* settings;
static const double cie_colour_match_jd[97][3] = {//350nm to 830nm 5 nm J.Desmis 2° Standard Observer.
{0.0000000, 0.000000, 0.000000}, {0.0000000, 0.000000, 0.000000}, {0.0001299, 0.0003917, 0.0006061},
{0.0002321, 0.000006965, 0.001086}, {0.0004149, 0.00001239, 0.001946}, {0.0007416, 0.00002202, 0.003846},

View File

@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _COLORTEMP_
#define _COLORTEMP_
#pragma once
#include <cmath>
#include <map>
@ -207,4 +206,3 @@ public:
};
}
#endif

View File

@ -17,8 +17,7 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __COORD__
#define __COORD__
#pragma once
namespace rtengine
{
@ -253,5 +252,3 @@ inline const PolarCoord operator* (const double lhs, const PolarCoord& rhs)
}
}
#endif

View File

@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __COORD2D__
#define __COORD2D__
#pragma once
namespace rtengine
{
@ -35,5 +34,5 @@ public:
y = y_;
}
};
}
#endif

View File

@ -17,9 +17,7 @@
* 2010 Ilya Popov <ilia_popov@rambler.ru>
* 2012 Emil Martinec <ejmartin@uchicago.edu>
*/
#ifndef CPLX_WAVELET_DEC_H_INCLUDED
#define CPLX_WAVELET_DEC_H_INCLUDED
#pragma once
#include <cstddef>
#include <cmath>
@ -266,5 +264,3 @@ void wavelet_decomposition::reconstruct(E * dst, const float blend)
}
}
#endif

View File

@ -17,7 +17,7 @@
* 2012 Emil Martinec <ejmartin@uchicago.edu>
* 2014 Jacques Desmis <jdesmis@gmail.com>
*/
#pragma once
namespace rtengine
{

View File

@ -17,10 +17,8 @@
* 2010 Ilya Popov <ilia_popov@rambler.ru>
* 2012 Emil Martinec <ejmartin@uchicago.edu>
* 2014 Ingo Weyrich <heckflosse@i-weyrich.de>
*/
#ifndef CPLX_WAVELET_LEVEL_H_INCLUDED
#define CPLX_WAVELET_LEVEL_H_INCLUDED
*/
#pragma once
#include <cstddef>
#include "rt_math.h"
@ -759,5 +757,3 @@ template<typename T> template<typename E> void wavelet_level<T>::reconstruct_lev
}
#endif
}
#endif

View File

@ -23,9 +23,6 @@
#include <cstring>
#include <glib.h>
#include <glib/gstdio.h>
#ifdef _OPENMP
#include <omp.h>
#endif
#include "rt_math.h"
@ -514,7 +511,7 @@ void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, dou
double shcompr, double br, double contr,
const std::vector<double>& curvePoints,
const std::vector<double>& curvePoints2,
LUTu & histogram,
const LUTu & histogram,
LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve,
LUTu & outBeforeCCurveHistogram,
ToneCurve & customToneCurve1,

View File

@ -16,24 +16,21 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __CURVES_H__
#define __CURVES_H__
#pragma once
#include <map>
#include <string>
#include <vector>
#include <glibmm.h>
#include <glibmm/ustring.h>
#include "rt_math.h"
#include "../rtgui/mycurve.h"
#include "../rtgui/myflatcurve.h"
#include "../rtgui/mydiagonalcurve.h"
#include "color.h"
#include "flatcurvetypes.h"
#include "diagonalcurvetypes.h"
#include "pipettebuffer.h"
#include "noncopyable.h"
#include "LUT.h"
#include "sleef.h"
#define CURVES_MIN_POLY_POINTS 1000
#include "rt_math.h"
@ -354,7 +351,7 @@ public:
public:
static void complexCurve (double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double contr,
const std::vector<double>& curvePoints, const std::vector<double>& curvePoints2,
LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2,
const LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2,
int skip = 1);
static void curveBW (const std::vector<double>& curvePointsbw, const std::vector<double>& curvePointsbw2, const LUTu & histogrambw, LUTu & outBeforeCCurveHistogrambw,
@ -896,12 +893,6 @@ public:
float *r, float *g, float *b) const;
};
class SatAndValueBlendingToneCurve : public ToneCurve
{
public:
void Apply(float& r, float& g, float& b) const;
};
class WeightedStdToneCurve : public ToneCurve
{
private:
@ -1271,45 +1262,6 @@ inline void WeightedStdToneCurve::BatchApply(const size_t start, const size_t en
#endif
}
// Tone curve modifying the value channel only, preserving hue and saturation
// values in 0xffff space
inline void SatAndValueBlendingToneCurve::Apply (float& ir, float& ig, float& ib) const
{
assert (lutToneCurve);
float r = CLIP(ir);
float g = CLIP(ig);
float b = CLIP(ib);
const float lum = (r + g + b) / 3.f;
const float newLum = lutToneCurve[lum];
if (newLum == lum) {
return;
}
float h, s, v;
Color::rgb2hsvtc(r, g, b, h, s, v);
float dV;
if (newLum > lum) {
// Linearly targeting Value = 1 and Saturation = 0
const float coef = (newLum - lum) / (65535.f - lum);
dV = (1.f - v) * coef;
s *= 1.f - coef;
} else {
// Linearly targeting Value = 0
const float coef = (newLum - lum) / lum ;
dV = v * coef;
}
Color::hsv2rgbdcp(h, s, v + dV, r, g, b);
setUnlessOOG(ir, ig, ib, r, g, b);
}
}
#undef CLIPI
#endif

View File

@ -21,22 +21,22 @@
#include <cstdio>
#include <cstring>
#include <functional>
#include <glib/gstdio.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include "dcp.h"
#include "cJSON.h"
#include "color.h"
#include "iccmatrices.h"
#include "iccstore.h"
#include "improcfun.h"
#include "imagefloat.h"
#include "rawimagesource.h"
#include "rt_math.h"
namespace rtengine
{
extern const Settings* settings;
}
#include "utils.h"
#include "../rtexif/rtexif.h"
#include "../rtgui/options.h"
using namespace rtengine;
using namespace rtexif;
@ -432,7 +432,7 @@ std::map<std::string, std::string> getAliases(const Glib::ustring& profile_dir)
}
struct DCPProfile::ApplyState::Data {
struct DCPProfileApplyState::Data {
float pro_photo[3][3];
float work[3][3];
bool already_pro_photo;
@ -441,14 +441,12 @@ struct DCPProfile::ApplyState::Data {
float bl_scale;
};
DCPProfile::ApplyState::ApplyState() :
DCPProfileApplyState::DCPProfileApplyState() :
data(new Data{})
{
}
DCPProfile::ApplyState::~ApplyState()
{
}
DCPProfileApplyState::~DCPProfileApplyState() = default;
DCPProfile::DCPProfile(const Glib::ustring& filename) :
has_color_matrix_1(false),
@ -1148,7 +1146,7 @@ void DCPProfile::apply(
}
}
void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, ApplyState& as_out)
void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, DCPProfileApplyState& as_out)
{
as_out.data->use_tone_curve = use_tone_curve;
as_out.data->apply_look_table = apply_look_table;
@ -1192,7 +1190,7 @@ void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use
}
}
void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int height, int tile_width, const ApplyState& as_in) const
void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const
{
#define FCLIP(a) ((a)>0.0?((a)<65535.5?(a):65535.5):0.0)
@ -1868,7 +1866,7 @@ DCPProfile* DCPStore::getProfile(const Glib::ustring& filename) const
if (res->isValid()) {
// Add profile
profile_cache[key] = res;
if (options.rtSettings.verbose) {
if (settings->verbose) {
printf("DCP profile '%s' loaded from disk\n", filename.c_str());
}
return res;

View File

@ -24,35 +24,23 @@
#include <array>
#include <memory>
#include <glibmm.h>
#include <glibmm/ustring.h>
#include "../rtgui/threadutils.h"
#include "imagefloat.h"
#include "curves.h"
#include "colortemp.h"
#include "noncopyable.h"
namespace rtengine
{
class ColorTemp;
class Imagefloat;
class DCPProfileApplyState;
class DCPProfile final
{
public:
class ApplyState final
{
public:
ApplyState();
~ApplyState();
private:
struct Data;
const std::unique_ptr<Data> data;
friend class DCPProfile;
};
struct Illuminants {
short light_source_1;
short light_source_2;
@ -86,8 +74,8 @@ public:
const Matrix& cam_wb_matrix,
bool apply_hue_sat_map = true
) const;
void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, ApplyState& as_out);
void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const ApplyState& as_in) const;
void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, DCPProfileApplyState& as_out);
void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const;
private:
struct HsbModify {
@ -148,6 +136,20 @@ private:
AdobeToneCurve tone_curve;
};
class DCPProfileApplyState final
{
public:
DCPProfileApplyState();
~DCPProfileApplyState();
private:
struct Data;
const std::unique_ptr<Data> data;
friend class DCPProfile;
};
class DCPStore final :
public NonCopyable
{

View File

@ -26,12 +26,13 @@
/*RT*/#include <omp.h>
/*RT*/#endif
#include <memory>
#include <utility>
#include <vector>
#include "opthelper.h"
//#define BENCHMARK
#include "StopWatch.h"
#include "utils.h"
#include <zlib.h>
#include <stdint.h>
@ -2418,7 +2419,7 @@ void CLASS hasselblad_correct()
void CLASS hasselblad_load_raw()
{
struct jhead jh;
int *back[5], diff[12];
int diff[12];
if (!ljpeg_start (&jh, 0)) {
return;
@ -2426,18 +2427,10 @@ void CLASS hasselblad_load_raw()
order = 0x4949;
ph1_bithuff_t ph1_bithuff(this, ifp, order);
hb_bits(-1);
back[4] = (int *) calloc(raw_width, 3 * sizeof **back);
merror(back[4], "hasselblad_load_raw()");
for (int c = 0; c < 3; ++c) {
back[c] = back[4] + c * raw_width;
}
const int sh = tiff_samples > 1;
cblack[6] >>= sh;
const int shot = LIM(shot_select, 1, tiff_samples) - 1;
const int predictor_init = static_cast<int>(0x8000 + load_flags);
for (int row = 0; row < raw_height; ++row) {
for (int c = 0; c < 4; ++c) {
back[(c + 3) & 3] = back[c];
}
int stashed_predictors[2] = {predictor_init, predictor_init};
for (int col = 0; col < raw_width; col += 2) {
for (int s = 0; s < tiff_samples * 2; s += 2) {
const int len[2]= {
@ -2455,18 +2448,10 @@ void CLASS hasselblad_load_raw()
}
}
for (int s = col; s < col + 2; ++s) {
int pred;
if (col) {
pred = back[2][s - 2];
if (row > 1 && jh.psv == 11) {
pred += back[0][s] / 2 - back[0][s - 2] / 2;
}
} else {
pred = 0x8000 + load_flags;
}
int pred = stashed_predictors[s & 1];
for (int c = 0; c < tiff_samples; ++c) {
pred += diff[(s & 1) * tiff_samples + c];
const unsigned upix = pred >> sh & 0xffff;
const unsigned upix = pred & 0xffff;
if (raw_image && c == shot) {
RAW(row, s) = upix;
}
@ -2479,12 +2464,13 @@ void CLASS hasselblad_load_raw()
*ip = c < 4 ? upix : (*ip + upix) >> 1;
}
}
if (c == (tiff_samples-1)) {
stashed_predictors[s & 1] = pred;
}
}
back[2][s] = pred;
}
}
}
free(back[4]);
ljpeg_end(&jh);
if (image) {
mix_green = 1;

View File

@ -17,8 +17,7 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef DCRAW_H
#define DCRAW_H
#pragma once
#include "myfile.h"
#include <csetjmp>
@ -168,8 +167,7 @@ protected:
float cam_mul[4], pre_mul[4], cmatrix[3][4], rgb_cam[3][4];
int histogram[4][0x2000];
void (DCraw::*write_thumb)(), (DCraw::*write_fun)();
void (DCraw::*write_thumb)();
void (DCraw::*load_raw)(), (DCraw::*thumb_load_raw)();
jmp_buf failure;
@ -529,6 +527,3 @@ void shiftXtransMatrix( const int offsy, const int offsx) {
void nikon_14bit_load_raw(); // ported from LibRaw
};
#endif //DCRAW_H

View File

@ -17,12 +17,19 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "cieimage.h"
#include "curves.h"
#include "dcp.h"
#include "dcrop.h"
#include "image8.h"
#include "imagefloat.h"
#include "labimage.h"
#include "mytime.h"
#include "procparams.h"
#include "refreshmap.h"
#include "rt_math.h"
#include "color.h"
#include "../rtgui/editcallbacks.h"
#include "guidedfilter.h"
@ -41,8 +48,6 @@ constexpr T skips(T a, T b)
namespace rtengine
{
extern const Settings* settings;
Crop::Crop(ImProcCoordinator* parent, EditDataProvider *editDataProvider, bool isDetailWindow)
: PipetteBuffer(editDataProvider), origCrop(nullptr), laboCrop(nullptr), labnCrop(nullptr),
cropImg(nullptr), transCrop(nullptr), cieCrop(nullptr),
@ -826,7 +831,7 @@ void Crop::update(int todo)
}
double rrm, ggm, bbm;
DCPProfile::ApplyState as;
DCPProfileApplyState as;
DCPProfile *dcpProf = parent->imgsrc->getDCP(params.icm, as);
LUTu histToneCurve;

View File

@ -21,8 +21,6 @@
#include "improccoordinator.h"
#include "rtengine.h"
#include "improcfun.h"
#include "image8.h"
#include "image16.h"
#include "imagesource.h"
#include "procevents.h"
#include "pipettebuffer.h"
@ -31,6 +29,8 @@
namespace rtengine
{
class Image8;
using namespace procparams;
class ImProcCoordinator;

View File

@ -22,12 +22,10 @@
#include "rawimagesource.h"
#include "rawimage.h"
#include "mytime.h"
#include "image8.h"
#include "rt_math.h"
#include "color.h"
#include "../rtgui/multilangmgr.h"
#include "procparams.h"
#include "sleef.c"
#include "sleef.h"
#include "opthelper.h"
#include "median.h"
//#define BENCHMARK
@ -41,8 +39,6 @@ using namespace std;
namespace rtengine
{
extern const Settings* settings;
#undef ABS
#define ABS(a) ((a)<0?-(a):(a))
@ -59,158 +55,7 @@ extern const Settings* settings;
#define FORCC for (unsigned int c=0; c < colors; c++)
/*
Patterned Pixel Grouping Interpolation by Alain Desbiolles
*/
void RawImageSource::ppg_demosaic()
{
int width = W, height = H;
int dir[5] = { 1, width, -1, -width, 1 };
int row, col, diff[2] = {}, guess[2], c, d, i;
float (*pix)[4];
float (*image)[4];
if (plistener) {
// looks like ppg isn't supported anymore
//plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::ppg)));
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), M("GENERAL_NA")));
plistener->setProgress (0.0);
}
image = (float (*)[4]) calloc (H * W, sizeof * image);
for (int ii = 0; ii < H; ii++)
for (int jj = 0; jj < W; jj++) {
image[ii * W + jj][fc(ii, jj)] = rawData[ii][jj];
}
border_interpolate(3, image);
/* Fill in the green layer with gradients and pattern recognition: */
for (row = 3; row < height - 3; row++) {
for (col = 3 + (FC(row, 3) & 1), c = FC(row, col); col < width - 3; col += 2) {
pix = image + row * width + col;
for (i = 0; (d = dir[i]) > 0; i++) {
guess[i] = (pix[-d][1] + pix[0][c] + pix[d][1]) * 2
- pix[-2 * d][c] - pix[2 * d][c];
diff[i] = ( ABS(pix[-2 * d][c] - pix[ 0][c]) +
ABS(pix[ 2 * d][c] - pix[ 0][c]) +
ABS(pix[ -d][1] - pix[ d][1]) ) * 3 +
( ABS(pix[ 3 * d][1] - pix[ d][1]) +
ABS(pix[-3 * d][1] - pix[-d][1]) ) * 2;
}
d = dir[i = diff[0] > diff[1]];
pix[0][1] = median(static_cast<float>(guess[i] >> 2), pix[d][1], pix[-d][1]);
}
if(plistener) {
plistener->setProgress(0.33 * row / (height - 3));
}
}
/* Calculate red and blue for each green pixel: */
for (row = 1; row < height - 1; row++) {
for (col = 1 + (FC(row, 2) & 1), c = FC(row, col + 1); col < width - 1; col += 2) {
pix = image + row * width + col;
for (i = 0; (d = dir[i]) > 0; c = 2 - c, i++)
pix[0][c] = CLIP(0.5 * (pix[-d][c] + pix[d][c] + 2 * pix[0][1]
- pix[-d][1] - pix[d][1]) );
}
if(plistener) {
plistener->setProgress(0.33 + 0.33 * row / (height - 1));
}
}
/* Calculate blue for red pixels and vice versa: */
for (row = 1; row < height - 1; row++) {
for (col = 1 + (FC(row, 1) & 1), c = 2 - FC(row, col); col < width - 1; col += 2) {
pix = image + row * width + col;
for (i = 0; (d = dir[i] + dir[i + 1]) > 0; i++) {
diff[i] = ABS(pix[-d][c] - pix[d][c]) +
ABS(pix[-d][1] - pix[0][1]) +
ABS(pix[ d][1] - pix[0][1]);
guess[i] = pix[-d][c] + pix[d][c] + 2 * pix[0][1]
- pix[-d][1] - pix[d][1];
}
if (diff[0] != diff[1]) {
pix[0][c] = CLIP(guess[diff[0] > diff[1]] / 2);
} else {
pix[0][c] = CLIP((guess[0] + guess[1]) / 4);
}
}
if(plistener) {
plistener->setProgress(0.67 + 0.33 * row / (height - 1));
}
}
red(W, H);
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++) {
red[i][j] = image[i * W + j][0];
}
green(W, H);
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++) {
green[i][j] = image[i * W + j][1];
}
blue(W, H);
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++) {
blue[i][j] = image[i * W + j][2];
}
free (image);
}
void RawImageSource::border_interpolate(unsigned int border, float (*image)[4], unsigned int start, unsigned int end)
{
unsigned row, col, y, x, f;
float sum[8];
unsigned int width = W, height = H;
unsigned int colors = 3;
if (end == 0 ) {
end = H;
}
for (row = start; row < end; row++)
for (col = 0; col < width; col++) {
if (col == border && row >= border && row < height - border) {
col = width - border;
}
memset (sum, 0, sizeof sum);
for (y = row - 1; y != row + 2; y++)
for (x = col - 1; x != col + 2; x++)
if (y < height && x < width) {
f = fc(y, x);
sum[f] += image[y * width + x][f];
sum[f + 4]++;
}
f = fc(row, col);
FORCC if (c != f && sum[c + 4]) {
image[row * width + col][c] = sum[c] / sum[c + 4];
}
}
}
void RawImageSource::border_interpolate2( int winw, int winh, int lborders, const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue)
void RawImageSource::border_interpolate( int winw, int winh, int lborders, const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue)
{
int bord = lborders;
int width = winw;
@ -365,129 +210,6 @@ void RawImageSource::border_interpolate2( int winw, int winh, int lborders, cons
}
// Joint Demosaicing and Denoising using High Order Interpolation Techniques
// Revision 0.9.1a - 09/02/2010 - Contact info: luis.sanz.rodriguez@gmail.com
// Copyright Luis Sanz Rodriguez 2010
// Adapted to RawTherapee by Jacques Desmis 3/2013
void RawImageSource::jdl_interpolate_omp() // from "Lassus"
{
int width = W, height = H;
int row, col, c, d, i, u = width, v = 2 * u, w = 3 * u, x = 4 * u, y = 5 * u, z = 6 * u, indx, (*dif)[2], (*chr)[2];
float f[4], g[4];
float (*image)[4];
image = (float (*)[4]) calloc (width * height, sizeof * image);
dif = (int (*)[2]) calloc(width * height, sizeof * dif);
chr = (int (*)[2]) calloc(width * height, sizeof * chr);
if (plistener) {
// this function seems to be unused
//plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::jdl)));
plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), M("GENERAL_NA")));
plistener->setProgress (0.0);
}
#ifdef _OPENMP
#pragma omp parallel shared(image,width,height,u,w,v,y,x,z,dif,chr) private(row,col,f,g,indx,c,d,i)
#endif
{
#ifdef _OPENMP
#pragma omp for
#endif
for (int ii = 0; ii < height; ii++)
for (int jj = 0; jj < width; jj++) {
image[ii * width + jj][fc(ii, jj)] = rawData[ii][jj];
}
border_interpolate(6, image);
#ifdef _OPENMP
#pragma omp for
#endif
for (row = 5; row < height - 5; row++)
for (col = 5 + (FC(row, 1) & 1), indx = row * width + col, c = FC(row, col); col < u - 5; col += 2, indx += 2) {
f[0] = 1.f + abs(image[indx - u][1] - image[indx - w][1]) + abs(image[indx - u][1] - image[indx + u][1]) + abs(image[indx][c] - image[indx - v][c]) + abs(image[indx - v][c] - image[indx - x][c]);
f[1] = 1.f + abs(image[indx + 1][1] - image[indx + 3][1]) + abs(image[indx + 1][1] - image[indx - 1][1]) + abs(image[indx][c] - image[indx + 2][c]) + abs(image[indx + 2][c] - image[indx + 4][c]);
f[2] = 1.f + abs(image[indx - 1][1] - image[indx - 3][1]) + abs(image[indx - 1][1] - image[indx + 1][1]) + abs(image[indx][c] - image[indx - 2][c]) + abs(image[indx - 2][c] - image[indx - 4][c]);
f[3] = 1.f + abs(image[indx + u][1] - image[indx + w][1]) + abs(image[indx + u][1] - image[indx - u][1]) + abs(image[indx][c] - image[indx + v][c]) + abs(image[indx + v][c] - image[indx + x][c]);
g[0] = CLIP((22.f * image[indx - u][1] + 22.f * image[indx - w][1] + 2.f * image[indx - y][1] + 2.f * image[indx + u][1] + 40.f * image[indx][c] - 32.f * image[indx - v][c] - 8.f * image[indx - x][c]) / 48.f);
g[1] = CLIP((22.f * image[indx + 1][1] + 22.f * image[indx + 3][1] + 2.f * image[indx + 5][1] + 2.f * image[indx - 1][1] + 40.f * image[indx][c] - 32.f * image[indx + 2][c] - 8.f * image[indx + 4][c]) / 48.f);
g[2] = CLIP((22.f * image[indx - 1][1] + 22.f * image[indx - 3][1] + 2.f * image[indx - 5][1] + 2.f * image[indx + 1][1] + 40.f * image[indx][c] - 32.f * image[indx - 2][c] - 8.f * image[indx - 4][c]) / 48.f);
g[3] = CLIP((22.f * image[indx + u][1] + 22.f * image[indx + w][1] + 2.f * image[indx + y][1] + 2.f * image[indx - u][1] + 40.f * image[indx][c] - 32.f * image[indx + v][c] - 8.f * image[indx + x][c]) / 48.f);
dif[indx][0] = CLIP((f[3] * g[0] + f[0] * g[3]) / (f[0] + f[3])) - image[indx][c];
dif[indx][1] = CLIP((f[2] * g[1] + f[1] * g[2]) / (f[1] + f[2])) - image[indx][c];
}
#ifdef _OPENMP
#pragma omp for
#endif
for (row = 6; row < height - 6; row++)
for (col = 6 + (FC(row, 2) & 1), indx = row * width + col, c = FC(row, col) / 2; col < u - 6; col += 2, indx += 2) {
f[0] = 1.f + 78.f * SQR((float)dif[indx][0]) + 69.f * (SQR((float) dif[indx - v][0]) + SQR((float)dif[indx + v][0])) + 51.f * (SQR((float)dif[indx - x][0]) + SQR((float)dif[indx + x][0])) + 21.f * (SQR((float)dif[indx - z][0]) + SQR((float)dif[indx + z][0])) - 6.f * SQR((float)dif[indx - v][0] + dif[indx][0] + dif[indx + v][0]) - 10.f * (SQR((float)dif[indx - x][0] + dif[indx - v][0] + dif[indx][0]) + SQR((float)dif[indx][0] + dif[indx + v][0] + dif[indx + x][0])) - 7.f * (SQR((float)dif[indx - z][0] + dif[indx - x][0] + dif[indx - v][0]) + SQR((float)dif[indx + v][0] + dif[indx + x][0] + dif[indx + z][0]));
f[1] = 1.f + 78.f * SQR((float)dif[indx][1]) + 69.f * (SQR((float)dif[indx - 2][1]) + SQR((float)dif[indx + 2][1])) + 51.f * (SQR((float)dif[indx - 4][1]) + SQR((float)dif[indx + 4][1])) + 21.f * (SQR((float)dif[indx - 6][1]) + SQR((float)dif[indx + 6][1])) - 6.f * SQR((float)dif[indx - 2][1] + dif[indx][1] + dif[indx + 2][1]) - 10.f * (SQR((float)dif[indx - 4][1] + dif[indx - 2][1] + dif[indx][1]) + SQR((float)dif[indx][1] + dif[indx + 2][1] + dif[indx + 4][1])) - 7.f * (SQR((float)dif[indx - 6][1] + dif[indx - 4][1] + dif[indx - 2][1]) + SQR((float)dif[indx + 2][1] + dif[indx + 4][1] + dif[indx + 6][1]));
g[0] = median(0.725f * dif[indx][0] + 0.1375f * dif[indx - v][0] + 0.1375f * dif[indx + v][0], static_cast<float>(dif[indx - v][0]), static_cast<float>(dif[indx + v][0]));
g[1] = median(0.725f * dif[indx][1] + 0.1375f * dif[indx - 2][1] + 0.1375f * dif[indx + 2][1], static_cast<float>(dif[indx - 2][1]), static_cast<float>(dif[indx + 2][1]));
chr[indx][c] = (f[1] * g[0] + f[0] * g[1]) / (f[0] + f[1]);
}
#ifdef _OPENMP
#pragma omp for
#endif
for (row = 6; row < height - 6; row++)
for (col = 6 + (FC(row, 2) & 1), indx = row * width + col, c = 1 - FC(row, col) / 2, d = 2 * c; col < u - 6; col += 2, indx += 2) {
f[0] = 1.f / (float)(1.f + fabs((float)chr[indx - u - 1][c] - chr[indx + u + 1][c]) + fabs((float)chr[indx - u - 1][c] - chr[indx - w - 3][c]) + fabs((float)chr[indx + u + 1][c] - chr[indx - w - 3][c]));
f[1] = 1.f / (float)(1.f + fabs((float)chr[indx - u + 1][c] - chr[indx + u - 1][c]) + fabs((float)chr[indx - u + 1][c] - chr[indx - w + 3][c]) + fabs((float)chr[indx + u - 1][c] - chr[indx - w + 3][c]));
f[2] = 1.f / (float)(1.f + fabs((float)chr[indx + u - 1][c] - chr[indx - u + 1][c]) + fabs((float)chr[indx + u - 1][c] - chr[indx + w + 3][c]) + fabs((float)chr[indx - u + 1][c] - chr[indx + w - 3][c]));
f[3] = 1.f / (float)(1.f + fabs((float)chr[indx + u + 1][c] - chr[indx - u - 1][c]) + fabs((float)chr[indx + u + 1][c] - chr[indx + w - 3][c]) + fabs((float)chr[indx - u - 1][c] - chr[indx + w + 3][c]));
g[0] = median(chr[indx - u - 1][c], chr[indx - w - 1][c], chr[indx - u - 3][c]);
g[1] = median(chr[indx - u + 1][c], chr[indx - w + 1][c], chr[indx - u + 3][c]);
g[2] = median(chr[indx + u - 1][c], chr[indx + w - 1][c], chr[indx + u - 3][c]);
g[3] = median(chr[indx + u + 1][c], chr[indx + w + 1][c], chr[indx + u + 3][c]);
chr[indx][c] = (f[0] * g[0] + f[1] * g[1] + f[2] * g[2] + f[3] * g[3]) / (f[0] + f[1] + f[2] + f[3]);
image[indx][1] = CLIP(image[indx][2 - d] + chr[indx][1 - c]);
image[indx][d] = CLIP(image[indx][1] - chr[indx][c]);
}
#ifdef _OPENMP
#pragma omp for
#endif
for (row = 6; row < height - 6; row++)
for (col = 6 + (FC(row, 1) & 1), indx = row * width + col, c = FC(row, col + 1) / 2, d = 2 * c; col < u - 6; col += 2, indx += 2)
for(i = 0; i <= 1; c = 1 - c, d = 2 * c, i++) {
f[0] = 1.f / (float)(1.f + fabs((float)chr[indx - u][c] - chr[indx + u][c]) + fabs((float)chr[indx - u][c] - chr[indx - w][c]) + fabs((float)chr[indx + u][c] - chr[indx - w][c]));
f[1] = 1.f / (float)(1.f + fabs((float)chr[indx + 1][c] - chr[indx - 1][c]) + fabs((float)chr[indx + 1][c] - chr[indx + 3][c]) + fabs((float)chr[indx - 1][c] - chr[indx + 3][c]));
f[2] = 1.f / (float)(1.f + fabs((float)chr[indx - 1][c] - chr[indx + 1][c]) + fabs((float)chr[indx - 1][c] - chr[indx - 3][c]) + fabs((float)chr[indx + 1][c] - chr[indx - 3][c]));
f[3] = 1.f / (float)(1.f + fabs((float)chr[indx + u][c] - chr[indx - u][c]) + fabs((float)chr[indx + u][c] - chr[indx + w][c]) + fabs((float)chr[indx - u][c] - chr[indx + w][c]));
g[0] = 0.875f * chr[indx - u][c] + 0.125f * chr[indx - w][c];
g[1] = 0.875f * chr[indx + 1][c] + 0.125f * chr[indx + 3][c];
g[2] = 0.875f * chr[indx - 1][c] + 0.125f * chr[indx - 3][c];
g[3] = 0.875f * chr[indx + u][c] + 0.125f * chr[indx + w][c];
image[indx][d] = CLIP(image[indx][1] - (f[0] * g[0] + f[1] * g[1] + f[2] * g[2] + f[3] * g[3]) / (f[0] + f[1] + f[2] + f[3]));
}
#ifdef _OPENMP
#pragma omp for
#endif
for (int ii = 0; ii < height; ii++) {
for (int jj = 0; jj < width; jj++) {
red[ii][jj] = CLIP(image[ii * width + jj][0]);
green[ii][jj] = CLIP(image[ii * width + jj][1]);
blue[ii][jj] = CLIP(image[ii * width + jj][2]);
}
}
} // End of parallelization
free (image);
free(dif);
free(chr);
//RawImageSource::refinement_lassus();
}
// LSMME demosaicing algorithm
// L. Zhang and X. Wu,
// Color demozaicing via directional Linear Minimum Mean Square-error Estimation,
@ -543,14 +265,14 @@ void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array2D<float> &r
float *rix[5];
float *qix[5];
float *buffer = (float *)calloc(rr1 * cc1 * 5 * sizeof(float), 1);
float *buffer = (float *)calloc(static_cast<size_t>(rr1) * cc1 * 5 * sizeof(float), 1);
if(buffer == nullptr) { // allocation of big block of memory failed, try to get 5 smaller ones
printf("lmmse_interpolate_omp: allocation of big memory block failed, try to get 5 smaller ones now...\n");
bool allocationFailed = false;
for(int i = 0; i < 5; i++) {
qix[i] = (float *)calloc(rr1 * cc1 * sizeof(float), 1);
qix[i] = (float *)calloc(static_cast<size_t>(rr1) * cc1 * sizeof(float), 1);
if(!qix[i]) { // allocation of at least one small block failed
allocationFailed = true;
@ -1145,7 +867,7 @@ void RawImageSource::igv_interpolate(int winw, int winh)
vdif = (float (*)) calloc( width * height / 2, sizeof * vdif );
hdif = (float (*)) calloc( width * height / 2, sizeof * hdif );
chrarray = (float (*)) calloc( width * height, sizeof( float ) );
chrarray = (float (*)) calloc(static_cast<size_t>(width) * height, sizeof( float ) );
chr[0] = chrarray;
chr[1] = chrarray + (width * height) / 2;
@ -1507,7 +1229,7 @@ void RawImageSource::igv_interpolate(int winw, int winh)
}
}
}// End of parallelization
border_interpolate2(winw, winh, 8, rawData, red, green, blue);
border_interpolate(winw, winh, 8, rawData, red, green, blue);
if (plistener) {
plistener->setProgress (1.0);
@ -1564,8 +1286,6 @@ void RawImageSource::igv_interpolate(int winw, int winh)
rgb[c][indx] = CLIP(rawData[row][col]); //rawData = RT data
}
// border_interpolate2(7, rgb);
#ifdef _OPENMP
#pragma omp single
#endif
@ -1740,9 +1460,6 @@ void RawImageSource::igv_interpolate(int winw, int winh)
if (plistener) {
plistener->setProgress (0.91);
}
//Interpolate borders
// border_interpolate2(7, rgb);
}
/*
#ifdef _OPENMP
@ -1770,7 +1487,7 @@ void RawImageSource::igv_interpolate(int winw, int winh)
blue [row][col] = CLIP(rgb[1][indx] - 65535.f * chr[1][indx]);
}
}// End of parallelization
border_interpolate2(winw, winh, 8, rawData, red, green, blue);
border_interpolate(winw, winh, 8, rawData, red, green, blue);
if (plistener) {
@ -2040,7 +1757,7 @@ void RawImageSource::refinement_lassus(int PassCount)
t1e.set();
int u = W, v = 2 * u, w = 3 * u, x = 4 * u, y = 5 * u;
float (*image)[3];
image = (float(*)[3]) calloc(W * H, sizeof * image);
image = (float(*)[3]) calloc(static_cast<size_t>(W) * H, sizeof * image);
#ifdef _OPENMP
#pragma omp parallel shared(image)
#endif
@ -2813,7 +2530,7 @@ BENCHFUN
free(buffer0);
}
border_interpolate2(W, H, 1, rawData, red, green, blue);
border_interpolate(W, H, 1, rawData, red, green, blue);
if(plistener) {
plistener->setProgress (1.0);
}

View File

@ -16,23 +16,27 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "dfmanager.h"
#include "../rtgui/options.h"
#include <giomm.h>
#include "../rtgui/guiutils.h"
#include "rawimage.h"
#include <sstream>
#include <iostream>
#include <cstdio>
#include "imagedata.h"
#include <giomm.h>
#include <glibmm/ustring.h>
#include "dfmanager.h"
#include "../rtgui/options.h"
#include "rawimage.h"
#include "imagedata.h"
#include "utils.h"
namespace rtengine
{
extern const Settings* settings;
// *********************** class dfInfo **************************************
dfInfo::~dfInfo()
{
delete ri;
}
inline dfInfo& dfInfo::operator =(const dfInfo &o)
{

View File

@ -19,17 +19,18 @@
#pragma once
#include <cmath>
#include <list>
#include <map>
#include <string>
#include <glibmm/ustring.h>
#include "pixelsmap.h"
#include "rawimage.h"
namespace rtengine
{
class RawImage;
class dfInfo
{
public:
@ -48,13 +49,7 @@ public:
dfInfo( const dfInfo &o)
: pathname(o.pathname), maker(o.maker), model(o.model), iso(o.iso), shutter(o.shutter), timestamp(o.timestamp), ri(nullptr) {}
~dfInfo()
{
if( ri ) {
delete ri;
}
}
~dfInfo();
dfInfo &operator =(const dfInfo &o);
bool operator <(const dfInfo &e2) const;

View File

@ -0,0 +1,31 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2019 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget
enum DiagonalCurveType {
DCT_Empty = -1, // Also used for identity curves
DCT_Linear, // 0
DCT_Spline, // 1
DCT_Parametric, // 2
DCT_NURBS, // 3
DCT_CatumullRom, // 4
// Insert new curve type above this line
DCT_Unchanged // Must remain the last of the enum
};

View File

@ -18,12 +18,18 @@
*
*/
#include <cstddef>
#include <algorithm>
#include <cmath>
#include "improcfun.h"
#include <cstddef>
#include "array2D.h"
#include "rt_math.h"
#include "cieimage.h"
#include "color.h"
#include "improcfun.h"
#include "LUT.h"
#include "opthelper.h"
#include "rt_math.h"
#include "settings.h"
namespace {
@ -71,8 +77,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
float val = 0.f;
float norm = 0.f;
for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) {
for (int jnbr = max(0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) {
for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) {
for (int jnbr = std::max(0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) {
const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
val += dirwt * data_fine[inbr][jnbr];
norm += dirwt;
@ -105,7 +111,7 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
float val = 0.f;
float norm = 0.f;
for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) {
for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) {
for (int jnbr = j - scalewin; jnbr <= j + scalewin; jnbr += scale) {
const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
val += dirwt * data_fine[inbr][jnbr];
@ -119,8 +125,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
float val = 0.f;
float norm = 0.f;
for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) {
for (int jnbr = j - scalewin; jnbr <= min(width - 1, j + scalewin); jnbr += scale) {
for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) {
for (int jnbr = j - scalewin; jnbr <= std::min(width - 1, j + scalewin); jnbr += scale) {
const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
val += dirwt * data_fine[inbr][jnbr];
norm += dirwt;
@ -149,8 +155,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
float val = 0.f;
float norm = 0.f;
for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) {
for (int jnbr = max(0, j - scale); jnbr <= j + scale; jnbr += scale) {
for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) {
for (int jnbr = std::max(0, j - scale); jnbr <= j + scale; jnbr += scale) {
const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
val += dirwt * data_fine[inbr][jnbr];
norm += dirwt;
@ -182,7 +188,7 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
float val = 0.f;
float norm = 0.f;
for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) {
for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) {
for (int jnbr = j - scale; jnbr <= j + scale; jnbr += scale) {
const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
val += dirwt * data_fine[inbr][jnbr];
@ -196,8 +202,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
float val = 0.f;
float norm = 0.f;
for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) {
for (int jnbr = j - scale; jnbr <= min(width - 1, j + scale); jnbr += scale) {
for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) {
for (int jnbr = j - scale; jnbr <= std::min(width - 1, j + scale); jnbr += scale) {
const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
val += dirwt * data_fine[inbr][jnbr];
norm += dirwt;
@ -346,8 +352,6 @@ void idirpyr_eq_channelcam(const float * const * data_coarse, const float * cons
namespace rtengine
{
extern const Settings* settings;
void ImProcFunctions::dirpyr_equalizer(const float * const * src, float ** dst, int srcwidth, int srcheight, const float * const * l_a, const float * const * l_b, const double * mult, const double dirpyrThreshold, const double skinprot, float b_l, float t_l, float t_r, int scaleprev)
{
//sequence of scales

View File

@ -23,36 +23,40 @@
//
////////////////////////////////////////////////////////////////
#include "color.h"
#include "jaggedarray.h"
#include "rtengine.h"
#include "rawimagesource.h"
#include "rt_math.h"
#include "procparams.h"
#include "rawimagesource.h"
#include "rt_algo.h"
#include "rt_math.h"
#include "rtengine.h"
#include "../rtgui/options.h"
//#define BENCHMARK
#include "StopWatch.h"
#include "rt_algo.h"
using namespace std;
namespace rtengine
{
void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue, double &contrast, bool autoContrast)
void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams &raw, int winw, int winh, const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue, double &contrast, bool autoContrast)
{
BENCHFUN
if (contrast == 0.f && !autoContrast) {
// contrast == 0.0 means only first demosaicer will be used
if(isBayer) {
if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) ) {
if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) ) {
amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCBVNG4) ) {
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) {
dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCDVNG4) ) {
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4) ) {
rcd_demosaic(options.chunkSizeRCD, options.measure);
}
} else {
if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FOUR_PASS) ) {
if (raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS) ) {
xtrans_interpolate (3, true, options.chunkSizeXT, options.measure);
} else {
xtrans_interpolate (1, false, options.chunkSizeXT, options.measure);
@ -70,15 +74,15 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int wi
if (isBayer) {
vng4_demosaic(rawData, redTmp, greenTmp, blueTmp);
if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) {
if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT)) {
amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCBVNG4) ) {
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) {
dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCDVNG4) ) {
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4) ) {
rcd_demosaic(options.chunkSizeRCD, options.measure);
}
} else {
if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FOUR_PASS) ) {
if (raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS) ) {
xtrans_interpolate (3, true, options.chunkSizeXT, options.measure);
} else {
xtrans_interpolate (1, false, options.chunkSizeXT, options.measure);

View File

@ -17,10 +17,15 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "../rtengine/dynamicprofile.h"
#include "dynamicprofile.h"
#include <stdlib.h>
#include <glibmm/regex.h>
#include <glibmm/miscutils.h>
#include <glibmm/keyfile.h>
#include "rtengine.h"
#include "../rtgui/options.h"
using namespace rtengine;
using namespace rtengine::procparams;
@ -176,7 +181,7 @@ bool DynamicProfileRules::loadRules()
return false;
}
if (options.rtSettings.verbose) {
if (settings->verbose) {
printf ("loading dynamic profiles...\n");
}
@ -195,7 +200,7 @@ bool DynamicProfileRules::loadRules()
return false;
}
if (options.rtSettings.verbose) {
if (settings->verbose) {
printf (" loading rule %d\n", serial);
}
@ -225,7 +230,7 @@ bool DynamicProfileRules::loadRules()
bool DynamicProfileRules::storeRules()
{
if (options.rtSettings.verbose) {
if (settings->verbose) {
printf ("saving dynamic profiles...\n");
}

View File

@ -16,12 +16,15 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _DYNAMICPROFILE_H_
#define _DYNAMICPROFILE_H_
#pragma once
#include <glibmm.h>
#include <glibmm/ustring.h>
#include <vector>
#include "../rtgui/options.h"
namespace rtengine
{
class FramesMetaData;
}
class DynamicProfileRule
{
@ -76,5 +79,3 @@ public:
const std::vector<DynamicProfileRule> &getRules();
void setRules (const std::vector<DynamicProfileRule> &r);
};
#endif // _DYNAMICPROFILE_H_

View File

@ -20,14 +20,13 @@
#include <cmath>
#include "color.h"
#include "rawimage.h"
#include "rawimagesource.h"
#include "rawimagesource_i.h"
#include "jaggedarray.h"
#include "rawimage.h"
#include "iccmatrices.h"
#include "rt_math.h"
#include "../rtgui/multilangmgr.h"
#include "procparams.h"
//#define BENCHMARK
#include "StopWatch.h"

View File

@ -25,12 +25,18 @@
#include <cmath>
#include "rawimagesource.h"
#include "../rtgui/multilangmgr.h"
#include "procparams.h"
#include "opthelper.h"
using namespace std;
using namespace rtengine;
namespace
{
unsigned fc(const unsigned int cfa[2][2], int r, int c) {
return cfa[r & 1][c & 1];
}
}
#define TS 224
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -67,6 +73,7 @@ void RawImageSource::fast_demosaic()
}
const unsigned int cfarray[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}};
const int bord = 5;
float clip_pt = 4 * 65535 * initialGain;
@ -117,12 +124,12 @@ void RawImageSource::fast_demosaic()
for (int i1 = imin; i1 < imax; i1++)
for (int j1 = jmin; j1 < j + 2; j1++) {
int c = FC(i1, j1);
int c = fc(cfarray, i1, j1);
sum[c] += rawData[i1][j1];
sum[c + 3]++;
}
int c = FC(i, j);
int c = fc(cfarray, i, j);
if (c == 1) {
red[i][j] = sum[0] / sum[3];
@ -150,12 +157,12 @@ void RawImageSource::fast_demosaic()
for (int i1 = imin; i1 < imax; i1++)
for (int j1 = j - 1; j1 < jmax; j1++) {
int c = FC(i1, j1);
int c = fc(cfarray, i1, j1);
sum[c] += rawData[i1][j1];
sum[c + 3]++;
}
int c = FC(i, j);
int c = fc(cfarray, i, j);
if (c == 1) {
red[i][j] = sum[0] / sum[3];
@ -193,12 +200,12 @@ void RawImageSource::fast_demosaic()
for (int i1 = max(0, i - 1); i1 < i + 2; i1++)
for (int j1 = j - 1; j1 < j + 2; j1++) {
int c = FC(i1, j1);
int c = fc(cfarray, i1, j1);
sum[c] += rawData[i1][j1];
sum[c + 3]++;
}
int c = FC(i, j);
int c = fc(cfarray, i, j);
if (c == 1) {
red[i][j] = sum[0] / sum[3];
@ -224,12 +231,12 @@ void RawImageSource::fast_demosaic()
for (int i1 = i - 1; i1 < min(i + 2, H); i1++)
for (int j1 = j - 1; j1 < j + 2; j1++) {
int c = FC(i1, j1);
int c = fc(cfarray, i1, j1);
sum[c] += rawData[i1][j1];
sum[c + 3]++;
}
int c = FC(i, j);
int c = fc(cfarray, i, j);
if (c == 1) {
red[i][j] = sum[0] / sum[3];
@ -282,7 +289,7 @@ void RawImageSource::fast_demosaic()
vmask selmask;
vmask andmask = _mm_set_epi32( 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff );
if(FC(top, left) == 1) {
if(fc(cfarray, top, left) == 1) {
selmask = _mm_set_epi32( 0, 0xffffffff, 0, 0xffffffff );
} else {
selmask = _mm_set_epi32( 0xffffffff, 0, 0xffffffff, 0 );
@ -312,7 +319,7 @@ void RawImageSource::fast_demosaic()
for (; j < right; j++, cc++) {
if (FC(i, j) == 1) {
if (fc(cfarray, i, j) == 1) {
greentile[rr * TS + cc] = rawData[i][j];
} else {
@ -333,7 +340,7 @@ void RawImageSource::fast_demosaic()
#else
for (int j = left, cc = 0; j < right; j++, cc++) {
if (FC(i, j) == 1) {
if (fc(cfarray, i, j) == 1) {
greentile[rr * TS + cc] = rawData[i][j];
} else {
//compute directional weights using image gradients
@ -359,7 +366,7 @@ void RawImageSource::fast_demosaic()
#endif
for (int i = top + 1, rr = 1; i < bottom - 1; i++, rr++) {
if (FC(i, left + (FC(i, 2) & 1) + 1) == 0)
if (fc(cfarray, i, left + (fc(cfarray, i, 2) & 1) + 1) == 0)
#ifdef __SSE2__
for (int j = left + 1, cc = 1; j < right - 1; j += 4, cc += 4) {
//interpolate B/R colors at R/B sites
@ -369,7 +376,7 @@ void RawImageSource::fast_demosaic()
#else
for (int cc = (FC(i, 2) & 1) + 1, j = left + cc; j < right - 1; j += 2, cc += 2) {
for (int cc = (fc(cfarray, i, 2) & 1) + 1, j = left + cc; j < right - 1; j += 2, cc += 2) {
//interpolate B/R colors at R/B sites
bluetile[rr * TS + cc] = greentile[rr * TS + cc] - 0.25f * ((greentile[(rr - 1) * TS + (cc - 1)] + greentile[(rr - 1) * TS + (cc + 1)] + greentile[(rr + 1) * TS + cc + 1] + greentile[(rr + 1) * TS + cc - 1]) -
min(clip_pt, rawData[i - 1][j - 1] + rawData[i - 1][j + 1] + rawData[i + 1][j + 1] + rawData[i + 1][j - 1]));
@ -386,7 +393,7 @@ void RawImageSource::fast_demosaic()
#else
for (int cc = (FC(i, 2) & 1) + 1, j = left + cc; j < right - 1; j += 2, cc += 2) {
for (int cc = (fc(cfarray, i, 2) & 1) + 1, j = left + cc; j < right - 1; j += 2, cc += 2) {
//interpolate B/R colors at R/B sites
redtile[rr * TS + cc] = greentile[rr * TS + cc] - 0.25f * ((greentile[(rr - 1) * TS + cc - 1] + greentile[(rr - 1) * TS + cc + 1] + greentile[(rr + 1) * TS + cc + 1] + greentile[(rr + 1) * TS + cc - 1]) -
min(clip_pt, rawData[i - 1][j - 1] + rawData[i - 1][j + 1] + rawData[i + 1][j + 1] + rawData[i + 1][j - 1]));
@ -405,7 +412,7 @@ void RawImageSource::fast_demosaic()
for (int i = top + 2, rr = 2; i < bottom - 2; i++, rr++) {
#ifdef __SSE2__
for (int cc = 2 + (FC(i, 2) & 1), j = left + cc; j < right - 2; j += 4, cc += 4) {
for (int cc = 2 + (fc(cfarray, i, 2) & 1), j = left + cc; j < right - 2; j += 4, cc += 4) {
// no need to take care about the borders of the tile. There's enough free space.
//interpolate R and B colors at G sites
greenv = LVFU(greentile[rr * TS + cc]);
@ -429,7 +436,7 @@ void RawImageSource::fast_demosaic()
#else
for (int cc = 2 + (FC(i, 2) & 1), j = left + cc; j < right - 2; j += 2, cc += 2) {
for (int cc = 2 + (fc(cfarray, i, 2) & 1), j = left + cc; j < right - 2; j += 2, cc += 2) {
//interpolate R and B colors at G sites
redtile[rr * TS + cc] = greentile[rr * TS + cc] - 0.25f * ((greentile[(rr - 1) * TS + cc] - redtile[(rr - 1) * TS + cc]) + (greentile[(rr + 1) * TS + cc] - redtile[(rr + 1) * TS + cc]) +
(greentile[rr * TS + cc - 1] - redtile[rr * TS + cc - 1]) + (greentile[rr * TS + cc + 1] - redtile[rr * TS + cc + 1]));

View File

@ -16,6 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <giomm/file.h>
#include <glibmm/miscutils.h>
#include "ffmanager.h"
#include "../rtgui/options.h"
#include "rawimage.h"
@ -26,8 +30,6 @@
namespace rtengine
{
extern const Settings* settings;
// *********************** class ffInfo **************************************
inline ffInfo& ffInfo::operator =(const ffInfo &o)
@ -50,6 +52,11 @@ inline ffInfo& ffInfo::operator =(const ffInfo &o)
return *this;
}
ffInfo::~ffInfo()
{
delete ri;
}
bool ffInfo::operator <(const ffInfo &e2) const
{
if( this->maker.compare( e2.maker) >= 0 ) {

View File

@ -19,16 +19,16 @@
#pragma once
#include <cmath>
#include <list>
#include <map>
#include <string>
#include <glibmm/ustring.h>
#include "rawimage.h"
namespace rtengine
{
class RawImage;
class ffInfo
{
public:
@ -48,13 +48,8 @@ public:
ffInfo( const ffInfo &o)
: pathname(o.pathname), maker(o.maker), model(o.model), lens(o.lens), aperture(o.aperture), focallength(o.focallength), timestamp(o.timestamp), ri(nullptr) {}
~ffInfo()
{
if( ri ) {
delete ri;
}
}
~ffInfo();
ffInfo &operator =(const ffInfo &o);
bool operator <(const ffInfo &e2) const;

View File

@ -19,28 +19,20 @@
#include <cmath>
#include <iostream>
#ifdef _OPENMP
#include <omp.h>
#endif
#include "rawimage.h"
#include "rawimagesource.h"
#include "coord.h"
#include "mytime.h"
#include "opthelper.h"
#include "pixelsmap.h"
#include "procparams.h"
#include "rt_algo.h"
#include "rtengine.h"
#include "sleef.h"
//#define BENCHMARK
#include "StopWatch.h"
namespace rtengine
{
extern const Settings* settings;
}
namespace
{
@ -98,7 +90,7 @@ bool channelsAvg(
}
bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D spotB, int tran, const FilmNegativeParams &currentParams, std::array<float, 3>& newExps)
bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D spotB, int tran, const procparams::FilmNegativeParams &currentParams, std::array<float, 3>& newExps)
{
newExps = {
static_cast<float>(currentParams.redRatio * currentParams.greenExp),

View File

@ -18,23 +18,17 @@
*/
#include <cmath>
#include "LUT.h"
#include "rtengine.h"
#include "rtthumbnail.h"
#include "opthelper.h"
#include "sleef.h"
#include "rt_algo.h"
#include "rtengine.h"
#include "settings.h"
#include "procparams.h"
#define BENCHMARK
#include "StopWatch.h"
namespace rtengine
{
extern const Settings* settings;
}
void rtengine::Thumbnail::processFilmNegative(
const procparams::ProcParams &params,
const Imagefloat* baseImg,

View File

@ -1,7 +1,7 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
* Copyright (c) 2004-2019 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,23 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _ILABEL_
#define _ILABEL_
*/
#pragma once
#include <gtkmm.h>
class ILabel : public Gtk::DrawingArea
{
Glib::ustring label;
public:
explicit ILabel (const Glib::ustring &lab);
bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) override;
void on_realize() override;
void on_style_updated () override;
// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget
enum FlatCurveType {
FCT_Empty = -1, // Also used for identity curves
FCT_Linear, // 0
FCT_MinMaxCPoints, // 1
//FCT_Parametric, // 2
// Insert new curve type above this line
FCT_Unchanged // Must remain the last of the enum
};
#endif

View File

@ -23,10 +23,14 @@
* also distributed under the GPL V3+
*/
#include "gamutwarning.h"
#include <iostream>
namespace rtengine {
#include "gamutwarning.h"
#include "iccstore.h"
#include "image8.h"
namespace rtengine
{
GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc):
lab2ref(nullptr),
@ -126,5 +130,4 @@ inline void GamutWarning::mark(Image8 *image, int y, int x)
image->b(y, x) = 255;
}
} // namespace rtengine

View File

@ -25,11 +25,14 @@
#pragma once
#include "iccstore.h"
#include "noncopyable.h"
#include "image8.h"
#include <lcms2.h>
namespace rtengine {
#include "noncopyable.h"
namespace rtengine
{
class Image8;
enum RenderingIntent : int;

View File

@ -16,12 +16,16 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "gauss.h"
#include "rt_math.h"
#include <cmath>
#include <cstdlib>
#include "opthelper.h"
#include <cstring>
#include "gauss.h"
#include "boxblur.h"
#include "opthelper.h"
#include "rt_math.h"
namespace
{
@ -1349,7 +1353,7 @@ template<class T> void gaussVerticalmult (T** src, T** dst, const int W, const i
}
#endif
template<class T> void gaussianBlurImpl(T** src, T** dst, const int W, const int H, const double sigma, T *buffer = nullptr, eGaussType gausstype = GAUSS_STANDARD, T** buffer2 = nullptr)
template<class T> void gaussianBlurImpl(T** src, T** dst, const int W, const int H, const double sigma, bool useBoxBlur, eGaussType gausstype = GAUSS_STANDARD, T** buffer2 = nullptr)
{
static constexpr auto GAUSS_SKIP = 0.25;
static constexpr auto GAUSS_3X3_LIMIT = 0.6;
@ -1357,7 +1361,7 @@ template<class T> void gaussianBlurImpl(T** src, T** dst, const int W, const int
static constexpr auto GAUSS_7X7_LIMIT = 1.15;
static constexpr auto GAUSS_DOUBLE = 25.0;
if(buffer) {
if (useBoxBlur) {
// special variant for very large sigma, currently only used by retinex algorithm
// use iterated boxblur to approximate gaussian blur
// Compute ideal averaging filter width and number of iterations
@ -1393,10 +1397,10 @@ template<class T> void gaussianBlurImpl(T** src, T** dst, const int W, const int
sizes[i] = ((i < m ? wl : wu) - 1) / 2;
}
rtengine::boxblur(src, dst, buffer, sizes[0], sizes[0], W, H);
rtengine::boxblur(src, dst, sizes[0], W, H, true);
for(int i = 1; i < n; i++) {
rtengine::boxblur(dst, dst, buffer, sizes[i], sizes[i], W, H);
rtengine::boxblur(dst, dst, sizes[i], W, H, true);
}
} else {
if (sigma < GAUSS_SKIP) {
@ -1532,8 +1536,8 @@ template<class T> void gaussianBlurImpl(T** src, T** dst, const int W, const int
}
}
void gaussianBlur(float** src, float** dst, const int W, const int H, const double sigma, float *buffer, eGaussType gausstype, float** buffer2)
void gaussianBlur(float** src, float** dst, const int W, const int H, const double sigma, bool useBoxBlur, eGaussType gausstype, float** buffer2)
{
gaussianBlurImpl<float>(src, dst, W, H, sigma, buffer, gausstype, buffer2);
gaussianBlurImpl<float>(src, dst, W, H, sigma, useBoxBlur, gausstype, buffer2);
}

View File

@ -16,11 +16,8 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _GAUSS_H_
#define _GAUSS_H_
#pragma once
enum eGaussType {GAUSS_STANDARD, GAUSS_MULT, GAUSS_DIV};
void gaussianBlur(float** src, float** dst, const int W, const int H, const double sigma, float *buffer = nullptr, eGaussType gausstype = GAUSS_STANDARD, float** buffer2 = nullptr);
#endif
void gaussianBlur(float** src, float** dst, const int W, const int H, const double sigma, bool useBoxBlur = false, eGaussType gausstype = GAUSS_STANDARD, float** buffer2 = nullptr);

View File

@ -29,15 +29,19 @@
* available at https://arxiv.org/abs/1505.00996
*/
#include "guidedfilter.h"
#include "boxblur.h"
#include "rescale.h"
#include "guidedfilter.h"
#include "imagefloat.h"
#include "rescale.h"
#define BENCHMARK
#include "StopWatch.h"
namespace rtengine {
namespace {
namespace rtengine
{
namespace
{
int calculate_subsampling(int w, int h, int r)
{
@ -60,13 +64,17 @@ int calculate_subsampling(int w, int h, int r)
} // namespace
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling)
{
enum Op {MUL, DIVEPSILON, SUBMUL};
const auto apply =
#ifdef _OPENMP
[multithread, epsilon](Op op, array2D<float> &res, const array2D<float> &a, const array2D<float> &b, const array2D<float> &c=array2D<float>()) -> void
#else
// removed multithread to fix clang warning on msys2 clang builds, which don't support OpenMp
[epsilon](Op op, array2D<float> &res, const array2D<float> &a, const array2D<float> &b, const array2D<float> &c=array2D<float>()) -> void
#endif
{
const int w = res.width();
const int h = res.height();
@ -105,7 +113,7 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
[multithread](array2D<float> &d, array2D<float> &s, int rad) -> void
{
rad = LIM(rad, 0, (min(s.width(), s.height()) - 1) / 2 - 1);
boxblur(s, d, rad, s.width(), s.height(), multithread);
boxblur(static_cast<float**>(s), static_cast<float**>(d), rad, s.width(), s.height(), multithread);
};
const int W = src.width();

View File

@ -22,7 +22,8 @@
#include "array2D.h"
namespace rtengine {
namespace rtengine
{
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling=0);

View File

@ -288,8 +288,6 @@ void boxblur_resamp(const float* const* src, float** dst, float** temp, int H, i
namespace rtengine
{
extern const Settings* settings;
void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue)
{
double progress = 0.0;

View File

@ -18,23 +18,22 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "rawimagesource.h"
#include "rtthumbnail.h"
#include "curves.h"
#include "color.h"
#include "rt_math.h"
#include "iccstore.h"
#include "procparams.h"
#include "../rtgui/mydiagonalcurve.h"
#include "improcfun.h"
//#define BENCHMARK
#include "StopWatch.h"
#include <iostream>
#include "color.h"
#include "curves.h"
#include "improcfun.h"
#include "procparams.h"
#include "rawimagesource.h"
#include "rt_math.h"
#include "rtthumbnail.h"
#include "settings.h"
namespace rtengine {
//#define BENCHMARK
#include "StopWatch.h"
extern const Settings *settings;
namespace rtengine
{
namespace {

View File

@ -18,12 +18,11 @@
*/
#include <cmath>
#include "rawimage.h"
#include "rawimagesource.h"
#include "rawimagesource_i.h"
#include "jaggedarray.h"
#include "rawimage.h"
#include "rt_math.h"
#include "procparams.h"
#include "../rtgui/multilangmgr.h"
#include "opthelper.h"
//#define BENCHMARK
@ -353,7 +352,7 @@ void RawImageSource::hphd_demosaic ()
interpolate_row_rb_mul_pp(rawData, red[i], blue[i], green[i - 1], green[i], green[i + 1], i, 1.0, 1.0, 1.0, 0, W, 1);
}
border_interpolate2(W, H, 4, rawData, red, green, blue);
border_interpolate(W, H, 4, rawData, red, green, blue);
if (plistener) {
plistener->setProgress(1.0);

View File

@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _ICCMATRICES_
#define _ICCMATRICES_
#pragma once
// Bradford transform between illuminants
constexpr double d65_d50[3][3] = {
@ -296,4 +295,3 @@ constexpr double d50_best[3][3] = {
{-0.253000840399762, 0.0215532098817316,1.22569552576991}
};
*/
#endif

View File

@ -18,7 +18,9 @@
*/
#include <cstring>
#include <glibmm.h>
#include <glibmm/ustring.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include <glib/gstdio.h>
#ifdef WIN32
@ -32,6 +34,7 @@
#include "iccstore.h"
#include "iccmatrices.h"
#include "utils.h"
#include "../rtgui/options.h"
#include "../rtgui/threadutils.h"
@ -41,12 +44,6 @@
#include "cJSON.h"
#define inkc_constant 0x696E6B43
namespace rtengine
{
extern const Settings* settings;
}
namespace
{

View File

@ -19,15 +19,14 @@
#pragma once
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
#include <glibmm.h>
#include <glibmm/ustring.h>
#include <lcms2.h>
#include "color.h"
namespace rtengine
{

View File

@ -17,6 +17,7 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "color.h"
#include "procparams.h"
#include "rtengine.h"
@ -45,3 +46,7 @@ int rtengine::getCoarseBitMask( const procparams::CoarseTransformParams &coarse)
return tr;
}
const LUTf& rtengine::getigammatab() {
return Color::igammatab_srgb;
}

View File

@ -16,17 +16,19 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _IIMAGE_
#define _IIMAGE_
#pragma once
#include <glibmm.h>
#include <vector>
#include "rt_math.h"
#include <glibmm/ustring.h>
#include <lcms2.h>
#include "alignedbuffer.h"
#include "coord2d.h"
#include "imagedimensions.h"
#include "LUT.h"
#include "coord2d.h"
#include "color.h"
#include "rt_math.h"
#include "../rtgui/threadutils.h"
#define TR_NONE 0
@ -57,6 +59,7 @@ extern const char sImage16[];
extern const char sImagefloat[];
int getCoarseBitMask(const procparams::CoarseTransformParams& coarse);
const LUTf& getigammatab();
enum TypeInterpolation { TI_Nearest, TI_Bilinear };
@ -955,17 +958,35 @@ public:
histogram(65536 >> histcompr);
histogram.clear();
const LUTf& igammatab = getigammatab();
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++) {
float r_, g_, b_;
convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_);
histogram[(int)Color::igamma_srgb (r_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (g_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (b_) >> histcompr]++;
#ifdef _OPENMP
#pragma omp parallel
#endif
{
LUTu histThr(histogram.getSize());
histThr.clear();
#ifdef _OPENMP
#pragma omp for schedule(dynamic,16) nowait
#endif
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
float r_, g_, b_;
convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_);
histThr[static_cast<int>(igammatab[r_]) >> histcompr]++;
histThr[static_cast<int>(igammatab[g_]) >> histcompr]++;
histThr[static_cast<int>(igammatab[b_]) >> histcompr]++;
}
}
#ifdef _OPENMP
#pragma omp critical
#endif
{
histogram += histThr;
}
}
}
void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override
@ -973,16 +994,16 @@ public:
histogram.clear();
avg_r = avg_g = avg_b = 0.;
n = 0;
const LUTf& igammatab = getigammatab();
for (unsigned int i = 0; i < (unsigned int)(height); i++)
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
float r_, g_, b_;
convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_);
int rtemp = Color::igamma_srgb (r_);
int gtemp = Color::igamma_srgb (g_);
int btemp = Color::igamma_srgb (b_);
int rtemp = igammatab[r_];
int gtemp = igammatab[g_];
int btemp = igammatab[b_];
histogram[rtemp >> compression]++;
histogram[gtemp >> compression] += 2;
@ -1009,6 +1030,9 @@ public:
int n = 0;
//int p = 6;
#ifdef _OPENMP
#pragma omp parallel for reduction(+:avg_r,avg_g,avg_b,n) schedule(dynamic,16)
#endif
for (unsigned int i = 0; i < (unsigned int)(height); i++)
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
float r_, g_, b_;
@ -1564,17 +1588,35 @@ public:
histogram(65536 >> histcompr);
histogram.clear();
const LUTf& igammatab = getigammatab();
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++) {
float r_, g_, b_;
convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_);
histogram[(int)Color::igamma_srgb (r_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (g_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (b_) >> histcompr]++;
#ifdef _OPENMP
#pragma omp parallel
#endif
{
LUTu histThr(histogram.getSize());
histThr.clear();
#ifdef _OPENMP
#pragma omp for schedule(dynamic,16) nowait
#endif
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
float r_, g_, b_;
convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_);
histThr[static_cast<int>(igammatab[r_]) >> histcompr]++;
histThr[static_cast<int>(igammatab[g_]) >> histcompr]++;
histThr[static_cast<int>(igammatab[b_]) >> histcompr]++;
}
}
#ifdef _OPENMP
#pragma omp critical
#endif
{
histogram += histThr;
}
}
}
void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override
@ -1582,6 +1624,7 @@ public:
histogram.clear();
avg_r = avg_g = avg_b = 0.;
n = 0;
const LUTf& igammatab = getigammatab();
for (unsigned int i = 0; i < (unsigned int)(height); i++)
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
@ -1589,9 +1632,9 @@ public:
convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_);
int rtemp = Color::igamma_srgb (r_);
int gtemp = Color::igamma_srgb (g_);
int btemp = Color::igamma_srgb (b_);
int rtemp = igammatab[r_];
int gtemp = igammatab[g_];
int btemp = igammatab[b_];
histogram[rtemp >> compression]++;
histogram[gtemp >> compression] += 2;
@ -1618,6 +1661,9 @@ public:
int n = 0;
//int p = 6;
#ifdef _OPENMP
#pragma omp parallel for reduction(+:avg_r,avg_g,avg_b,n) schedule(dynamic,16)
#endif
for (unsigned int i = 0; i < (unsigned int)(height); i++)
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
float r_, g_, b_;
@ -1808,5 +1854,3 @@ public:
};
}
#endif

View File

@ -16,11 +16,13 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <cstdio>
#include "colortemp.h"
#include "image16.h"
#include "imagefloat.h"
#include "image8.h"
#include <cstdio>
#include "rtengine.h"
#include "rt_math.h"
namespace
{

View File

@ -19,17 +19,15 @@
//
// A class representing a 16 bit rgb image with separate planes and 16 byte aligned data
//
#ifndef _IMAGE16_
#define _IMAGE16_
#pragma once
#include "imageio.h"
#include "rtengine.h"
#include "imagefloat.h"
namespace rtengine
{
class Image8;
class Imagefloat;
class Image16 : public IImage16, public ImageIO
{
@ -109,4 +107,3 @@ public:
};
}
#endif

View File

@ -18,7 +18,10 @@
*/
#include <cstring>
#include <cstdio>
#include "colortemp.h"
#include "image8.h"
#include "imagefloat.h"
#include "rtengine.h"
using namespace rtengine;

View File

@ -19,15 +19,13 @@
//
// A class representing a 8 bit rgb image without alpha channel
//
#ifndef _IMAGE8_
#define _IMAGE8_
#pragma once
#include "imageio.h"
#include "rtengine.h"
#include "imagefloat.h"
namespace rtengine
{
class Imagefloat;
class Image8 : public IImage8, public ImageIO
{
@ -104,4 +102,3 @@ public:
};
}
#endif

View File

@ -17,15 +17,22 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <functional>
#include <strings.h>
#include <glib/gstdio.h>
#include <tiff.h>
#include <glib/gstdio.h>
#include <glibmm/convert.h>
#include "imagedata.h"
#include "iptcpairs.h"
#include "imagesource.h"
#include "rt_math.h"
#include "iptcpairs.h"
#include "procparams.h"
#include "rt_math.h"
#include "utils.h"
#include "../rtexif/rtexif.h"
#pragma GCC diagnostic warning "-Wextra"
#define PRINT_HDR_PS_DETECTION 0

View File

@ -16,17 +16,24 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __IMAGEDATA_H__
#define __IMAGEDATA_H__
#pragma once
#include <cstdio>
#include <memory>
#include "rawimage.h"
#include <string>
#include <glibmm.h>
#include "../rtexif/rtexif.h"
#include <vector>
#include <glibmm/ustring.h>
#include <libiptcdata/iptc-data.h>
#include "rtengine.h"
#include "imageio.h"
namespace rtexif
{
class TagDirectory;
}
namespace rtengine
{
@ -133,4 +140,3 @@ public:
}
#endif

Some files were not shown because too many files have changed in this diff Show More