[Kde-imaging] [Bug 148561] Missing options in RAW conversion; terrible conversion of dark photos

Gilles Caulier caulier.gilles at gmail.com
Wed Aug 22 16:02:34 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=148561         




------- Additional Comments From caulier.gilles gmail com  2007-08-22 16:02 -------
SVN commit 703434 by cgilles:

libkdcraw from trunk (KDE4) : backport patch from Guillaume Castagnino about to support new chromatic aberration reduction options provided by dcraw 8.77
CCBUGS: 148561
CCMAIL: casta xwing info


 M  +91 -0     dcrawsettingswidget.cpp  
 M  +7 -0      dcrawsettingswidget.h  
 M  +8 -0      kdcraw.cpp  
 M  +21 -0     rawdecodingsettings.h  


--- trunk/extragear/libs/libkdcraw/libkdcraw/dcrawsettingswidget.cpp #703433:703434
 @ -70,6 +70,11  @
         enableNoiseReduction      = 0;
         NRThresholdSpinBox        = 0;
         NRThresholdLabel          = 0;
+        enableCACorrection        = 0;
+        caRedMultSpinBox          = 0;
+        caBlueMultSpinBox         = 0;
+        caRedMultLabel            = 0;
+        caBlueMultLabel           = 0;
         unclipColorComboBox       = 0;
         reconstructLabel          = 0;
         reconstructSpinBox        = 0;
 @ -90,6 +95,8  @
     QLabel          *brightnessLabel;
     QLabel          *RAWQualityLabel;
     QLabel          *NRThresholdLabel;
+    QLabel          *caRedMultLabel;
+    QLabel          *caBlueMultLabel;
     QLabel          *unclipColorLabel;
     QLabel          *reconstructLabel;
     QLabel          *outputColorSpaceLabel;
 @ -110,11 +117,14  @
     QCheckBox       *autoColorBalanceCheckBox;
     QCheckBox       *dontStretchPixelsCheckBox;
     QCheckBox       *enableNoiseReduction;
+    QCheckBox       *enableCACorrection;
 
     KIntNumInput    *reconstructSpinBox;
     KIntNumInput    *blackPointSpinBox;
     KIntNumInput    *NRThresholdSpinBox;
 
+    KDoubleNumInput *caRedMultSpinBox;
+    KDoubleNumInput *caBlueMultSpinBox;
     KDoubleNumInput *colorMult1SpinBox;
     KDoubleNumInput *colorMult2SpinBox;
     KDoubleNumInput *colorMult3SpinBox;
 @ -297,6 +307,36  @
 
     // ---------------------------------------------------------------
 
+    d->enableCACorrection = new QCheckBox(i18n("Enable Chromatic Aberration correction"), d->stdSettings);
+    d->enableCACorrection->setWhatsThis(i18n("<p><b>Enable Chromatic Aberration correction</b><p>"
+                     "Enlarge the raw red and blue layers by the given factors, "
+                     "typically 0.999 to 1.001, to correct chromatic aberration.<p>"));
+    settingsBoxLayout->addWidget(d->enableCACorrection, line, 0, 1, 3);
+    line++;
+
+    d->caRedMultLabel   = new QLabel(i18n("Red multiplier:"), d->stdSettings);
+    d->caRedMultSpinBox = new KDoubleNumInput(d->stdSettings);
+    d->caRedMultSpinBox->setPrecision(5);
+    d->caRedMultSpinBox->setRange(0.00001, 2.0, 0.001, true);
+    d->caRedMultSpinBox->setWhatsThis(i18n("<p><b>Red multiplier</b><p>"
+                     "Set here the magnification factor of the red layer"));
+
+    d->caBlueMultLabel   = new QLabel(i18n("Blue multiplier:"), d->stdSettings);
+    d->caBlueMultSpinBox = new KDoubleNumInput(d->stdSettings);
+    d->caBlueMultSpinBox->setPrecision(5);
+    d->caBlueMultSpinBox->setRange(0.00001, 2.0, 0.001, true);
+    d->caBlueMultSpinBox->setWhatsThis(i18n("<p><b>Blue multiplier</b><p>"
+                     "Set here the magnification factor of the blue layer"));
+    
+    settingsBoxLayout->addWidget(d->caRedMultLabel, line, 0, 1, 1);
+    settingsBoxLayout->addWidget(d->caRedMultSpinBox, line, 1, 1, 2);
+    line++;
+    settingsBoxLayout->addWidget(d->caBlueMultLabel, line, 0, 1, 1);
+    settingsBoxLayout->addWidget(d->caBlueMultSpinBox, line, 1, 1, 2);
+    line++;
+
+    // ---------------------------------------------------------------
+
     d->outputColorSpaceLabel    = new QLabel(i18n("Color space:"), d->stdSettings);
     d->outputColorSpaceComboBox = new QComboBox( d->stdSettings );
     d->outputColorSpaceComboBox->insertItem(0, i18n("Raw (linear)"));
 @ -419,6 +459,9  @
     connect(d->enableNoiseReduction, SIGNAL(toggled(bool)),
             this, SLOT(slotNoiseReductionToggled(bool)));
 
+    connect(d->enableCACorrection, SIGNAL(toggled(bool)),
+            this, SLOT(slotCACorrectionToggled(bool)));
+
     connect(d->blackPointCheckBox, SIGNAL(toggled(bool)),
             d->blackPointSpinBox, SLOT(setEnabled(bool)));
 
 @ -450,6 +493,9  @
     setUnclipColor(0);
     setDontStretchPixels(false);
     setNoiseReduction(false);
+    setUseCACorrection(false);
+    setcaRedMultiplier(1.0);
+    setcaBlueMultiplier(1.0);
     setBrightness(1.0);
     setUseBlackPoint(false);
     setBlackPoint(0);
 @ -490,6 +536,14  @
     d->NRThresholdLabel->setEnabled(b);
 }
 
+void DcrawSettingsWidget::slotCACorrectionToggled(bool b)
+{
+    d->caRedMultSpinBox->setEnabled(b);
+    d->caBlueMultSpinBox->setEnabled(b);
+    d->caRedMultLabel->setEnabled(b);
+    d->caBlueMultLabel->setEnabled(b);
+}
+
 void DcrawSettingsWidget::slotColorMultToggled(bool b)
 {
     d->colorMult1SpinBox->setEnabled(b);
 @ -721,6 +775,43  @
 
 // ---------------------------------------------------------------
 
+bool DcrawSettingsWidget::useCACorrection()
+{
+    return d->enableCACorrection->isChecked();
+}
+
+void DcrawSettingsWidget::setUseCACorrection(bool b)
+{
+    d->enableCACorrection->setChecked(b);
+    slotCACorrectionToggled(b);
+}
+
+// ---------------------------------------------------------------
+
+double DcrawSettingsWidget::caRedMultiplier()
+{
+    return d->caRedMultSpinBox->value();
+}
+
+void DcrawSettingsWidget::setcaRedMultiplier(double b)
+{
+    d->caRedMultSpinBox->setValue(b);
+}
+
+// ---------------------------------------------------------------
+
+double DcrawSettingsWidget::caBlueMultiplier()
+{
+    return d->caBlueMultSpinBox->value();
+}
+
+void DcrawSettingsWidget::setcaBlueMultiplier(double b)
+{
+    d->caBlueMultSpinBox->setValue(b);
+}
+
+// ---------------------------------------------------------------
+
 bool DcrawSettingsWidget::useColorMultipliers()
 {
     return d->colorMultCheckBox->isChecked();
--- trunk/extragear/libs/libkdcraw/libkdcraw/dcrawsettingswidget.h #703433:703434
 @ -55,11 +55,14  @
     bool   useFourColor();
     bool   useDontStretchPixels();
     bool   useNoiseReduction();
+    bool   useCACorrection();
     bool   useBlackPoint();
     int    unclipColor();
     double brightness();
     int    blackPoint();
     int    NRThreshold();
+    double caRedMultiplier();
+    double caBlueMultiplier();
     bool   useColorMultipliers();
     double colorMultiplier1();
     double colorMultiplier2();
 @ -75,11 +78,14  @
     void   setFourColor(bool b);
     void   setDontStretchPixels(bool b);
     void   setNoiseReduction(bool b);
+    void   setUseCACorrection(bool b);
     void   setUseBlackPoint(bool b);
     void   setUnclipColor(int v);
     void   setBrightness(double b);
     void   setBlackPoint(int b);
     void   setNRThreshold(int b);
+    void   setcaRedMultiplier(double b);
+    void   setcaBlueMultiplier(double b);
     void   setQuality(RawDecodingSettings::DecodingQuality q);
     void   setOutputColorSpace(RawDecodingSettings::OutputColorSpace c);
     void   setUseColorMultipliers(bool b);
 @ -100,6 +106,7  @
     void slotColorMultToggled(bool);
     void slotUnclipColorActivated(int);
     void slotNoiseReductionToggled(bool);
+    void slotCACorrectionToggled(bool);
     void processDcrawUrl(const QString&);
 
 private:
--- trunk/extragear/libs/libkdcraw/libkdcraw/kdcraw.cpp #703433:703434
 @ -651,6 +651,7  @
     // -b : set Brightness value.
     // -k : set Black Point value.
     // -r : set Raw Color Balance Multipliers.
+    // -C : set Correct chromatic aberration correction.
 
     QStringList args;
     args << "-c";
 @ -704,6 +705,13  @
         args << QString::number(m_rawDecodingSettings.NRThreshold);
     }
 
+    if (m_rawDecodingSettings.enableCACorrection)
+    {
+        args << "-C";
+        args << QString::number(m_rawDecodingSettings.caMultiplier[0], 'f', 5);
+        args << QString::number(m_rawDecodingSettings.caMultiplier[1], 'f', 5);
+    }
+
     args << "-o";
     args << QString::number(m_rawDecodingSettings.outputColorSpace);
 
--- trunk/extragear/libs/libkdcraw/libkdcraw/rawdecodingsettings.h #703433:703434
 @ -91,6 +91,10  @
         enableNoiseReduction       = false;
         NRThreshold                = 100;
 
+        enableCACorrection         = false;
+        caMultiplier[0]            = 1.0;
+        caMultiplier[1]            = 1.0;
+
         enableColorMultipliers     = false;
         colorBalanceMultipliers[0] = 0.0;
         colorBalanceMultipliers[1] = 0.0;
 @ -115,6 +119,9  @
             && blackPoint == o.blackPoint  
             && enableNoiseReduction == o.enableNoiseReduction  
             && NRThreshold == o.NRThreshold  
+            && enableCACorrection == o.enableCACorrection
+            && caMultiplier[0] == o.caMultiplier[0]
+            && caMultiplier[1] == o.caMultiplier[1]
             && enableColorMultipliers == o.enableColorMultipliers  
             && colorBalanceMultipliers[0] == o.colorBalanceMultipliers[0]  
             && colorBalanceMultipliers[1] == o.colorBalanceMultipliers[1]  
 @ -146,6 +153,10  @
         enableNoiseReduction       = false;
         NRThreshold                = 100;
 
+        enableCACorrection         = false;
+        caMultiplier[0]            = 1.0;
+        caMultiplier[1]            = 1.0;
+
         enableColorMultipliers     = false;
         colorBalanceMultipliers[0] = 0.0;
         colorBalanceMultipliers[1] = 0.0;
 @ -209,6 +220,16  @
     */
     int NRThreshold;
 
+    /** Use red and blue layer magnification to reduce chromatic aberrations
+    */
+    bool enableCACorrection;
+
+    /** Magnification factor for Red and Blue layers
+        - caMultiplier[0] = red multiplier
+        - caMultiplier[1] = blue multiplier
+    */
+    double caMultiplier[2];
+
     /** Brightness of output image. 
     */
     float brightness;


More information about the Kde-imaging mailing list