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

Gilles Caulier caulier.gilles at gmail.com
Wed Aug 22 15:23:43 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 15:23 -------
SVN commit 703414 by cgilles:

libkdcraw from KDE3 branch : 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  +7 -0      kdcraw.cpp  
 M  +21 -0     rawdecodingsettings.h  


--- branches/extragear/kde3/libs/libkdcraw/libkdcraw/dcrawsettingswidget.cpp #703413:703414
 @ -69,6 +69,11  @
         enableNoiseReduction      = 0;
         NRThresholdSpinBox        = 0;
         NRThresholdLabel          = 0;
+        enableCACorrection        = 0;
+        caRedMultSpinBox          = 0;
+        caBlueMultSpinBox         = 0;
+        caRedMultLabel            = 0;
+        caBlueMultLabel           = 0;
         unclipColorComboBox       = 0;
         reconstructLabel          = 0;
         reconstructSpinBox        = 0;
 @ -89,6 +94,8  @
     QLabel          *brightnessLabel;
     QLabel          *RAWQualityLabel;
     QLabel          *NRThresholdLabel;
+    QLabel          *caRedMultLabel;
+    QLabel          *caBlueMultLabel;
     QLabel          *unclipColorLabel;
     QLabel          *reconstructLabel;
     QLabel          *outputColorSpaceLabel;
 @ -109,11 +116,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;
 @ -294,6 +304,36  @
 
     // ---------------------------------------------------------------
 
+    d->enableCACorrection = new QCheckBox(i18n("Enable Chromatic Aberration correction"), d->stdSettings);
+    QWhatsThis::add( d->enableCACorrection, 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->addMultiCellWidget(d->enableCACorrection, line, line, 0, 2);
+    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);
+    QWhatsThis::add( d->caRedMultSpinBox, 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);
+    QWhatsThis::add( d->caBlueMultSpinBox, i18n("<p><b>Blue multiplier</b><p>"
+                     "Set here the magnification factor of the blue layer"));
+    
+    settingsBoxLayout->addMultiCellWidget(d->caRedMultLabel, line, line, 0, 0);
+    settingsBoxLayout->addMultiCellWidget(d->caRedMultSpinBox, line, line, 1, 2);
+    line++;
+    settingsBoxLayout->addMultiCellWidget(d->caBlueMultLabel, line, line, 0, 0);
+    settingsBoxLayout->addMultiCellWidget(d->caBlueMultSpinBox, line, line, 1, 2);
+    line++;
+
+    // ---------------------------------------------------------------
+
     d->outputColorSpaceLabel    = new QLabel(i18n("Color space:"), d->stdSettings);
     d->outputColorSpaceComboBox = new QComboBox( false, d->stdSettings );
     d->outputColorSpaceComboBox->insertItem( i18n("Raw (linear)"), 0 );
 @ -412,6 +452,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)));
 
 @ -443,6 +486,9  @
     setUnclipColor(0);
     setDontStretchPixels(false);
     setNoiseReduction(false);
+    setUseCACorrection(false);
+    setcaRedMultiplier(1.0);
+    setcaBlueMultiplier(1.0);
     setBrightness(1.0);
     setUseBlackPoint(false);
     setBlackPoint(0);
 @ -483,6 +529,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);
 @ -714,6 +768,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();
--- branches/extragear/kde3/libs/libkdcraw/libkdcraw/dcrawsettingswidget.h #703413:703414
 @ -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:
--- branches/extragear/kde3/libs/libkdcraw/libkdcraw/kdcraw.cpp #703413:703414
 @ -766,6 +766,13  @
         *d->process << QString::number(m_rawDecodingSettings.NRThreshold);
     }
 
+    if (m_rawDecodingSettings.enableCACorrection)
+    {
+        *d->process << "-C";
+        *d->process << QString::number(m_rawDecodingSettings.caMultiplier[0], 'f', 5);
+        *d->process << QString::number(m_rawDecodingSettings.caMultiplier[1], 'f', 5);
+    }
+
     *d->process << "-o";
     *d->process << QString::number(m_rawDecodingSettings.outputColorSpace);
 
--- branches/extragear/kde3/libs/libkdcraw/libkdcraw/rawdecodingsettings.h #703413:703414
 @ -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