Commit 2ad23dae authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

Make digiKam ready to use next Lensfun API where CII correction have been removed.

BUGS: 331523
CCBUGS: 319383
CCBUGS: 333540
FIXED-IN: 4.3.0
parent 4c5b8ed0
......@@ -4,7 +4,7 @@
* Description : a plugin to fix automatically camera lens aberrations
*
* Copyright (C) 2008 by Adrian Schroeter <adrian at suse dot de>
* Copyright (C) 2008-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -153,7 +153,6 @@ void LensAutoFixTool::slotLensChanged()
{
d->settingsView->setEnabledCCA(d->cameraSelector->iface()->supportsCCA());
d->settingsView->setEnabledVig(d->cameraSelector->iface()->supportsVig());
d->settingsView->setEnabledCCI(d->cameraSelector->iface()->supportsVig());
d->settingsView->setEnabledDist(d->cameraSelector->iface()->supportsDistortion());
d->settingsView->setEnabledGeom(d->cameraSelector->iface()->supportsDistortion());
slotTimer();
......
......@@ -4,7 +4,7 @@
* Description : a plugin to fix automatically camera lens aberrations
*
* Copyright (C) 2008 by Adrian Schroeter <adrian at suse dot de>
* Copyright (C) 2008-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......
......@@ -4,7 +4,7 @@
* Description : a tool to fix automatically camera lens aberrations
*
* Copyright (C) 2008 by Adrian Schroeter <adrian at suse dot de>
* Copyright (C) 2008-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -123,11 +123,6 @@ void LensFunFilter::filterImage()
modifyFlags |= LF_MODIFY_VIGNETTING;
}
if (d->iface->settings().filterCCI)
{
modifyFlags |= LF_MODIFY_CCI;
}
// Init lensfun lib, we are working on the full image.
lfPixelFormat colorDepth = m_orgImage.bytesDepth() == 4 ? LF_PF_U8 : LF_PF_U16;
......@@ -156,7 +151,7 @@ void LensFunFilter::filterImage()
// Calc necessary steps for progress bar
int steps = ((d->iface->settings().filterCCA) ? 1 : 0) +
((d->iface->settings().filterVIG || d->iface->settings().filterCCI) ? 1 : 0) +
((d->iface->settings().filterVIG) ? 1 : 0) +
((d->iface->settings().filterDST || d->iface->settings().filterGEO) ? 1 : 0);
kDebug() << "LensFun Modifier Flags: " << modflags << " Steps:" << steps;
......@@ -216,7 +211,7 @@ void LensFunFilter::filterImage()
// Stage 2: Color Corrections: Vignetting and Color Contribution Index
if (d->iface->settings().filterVIG || d->iface->settings().filterCCI)
if (d->iface->settings().filterVIG)
{
uchar* data = m_destImage.bits();
loop = 0;
......@@ -318,8 +313,6 @@ bool LensFunFilter::registerSettingsToXmp(KExiv2Data& data) const
str.append("\n");
str.append(i18n("VIG Correction: %1", prm.filterVIG && d->iface->supportsVig() ? i18n("enabled") : i18n("disabled")));
str.append("\n");
str.append(i18n("CCI Correction: %1", prm.filterCCI && d->iface->supportsCCI() ? i18n("enabled") : i18n("disabled")));
str.append("\n");
str.append(i18n("DST Correction: %1", prm.filterDST && d->iface->supportsDistortion() ? i18n("enabled") : i18n("disabled")));
str.append("\n");
str.append(i18n("GEO Correction: %1", prm.filterGEO && d->iface->supportsGeometry() ? i18n("enabled") : i18n("disabled")));
......@@ -340,7 +333,6 @@ FilterAction LensFunFilter::filterAction()
LensFunContainer prm = d->iface->settings();
action.addParameter("ccaCorrection", prm.filterCCA);
action.addParameter("vigCorrection", prm.filterVIG);
action.addParameter("cciCorrection", prm.filterCCI);
action.addParameter("dstCorrection", prm.filterDST);
action.addParameter("geoCorrection", prm.filterGEO);
action.addParameter("cropFactor", prm.cropFactor);
......@@ -359,7 +351,6 @@ void LensFunFilter::readParameters(const Digikam::FilterAction& action)
LensFunContainer prm = d->iface->settings();
prm.filterCCA = action.parameter("ccaCorrection").toBool();
prm.filterVIG = action.parameter("vigCorrection").toBool();
prm.filterCCI = action.parameter("cciCorrection").toBool();
prm.filterDST = action.parameter("dstCorrection").toBool();
prm.filterGEO = action.parameter("geoCorrection").toBool();
prm.cropFactor = action.parameter("cropFactor").toDouble();
......
......@@ -4,7 +4,7 @@
* Description : a tool to fix automatically camera lens aberrations
*
* Copyright (C) 2008 by Adrian Schroeter <adrian at suse dot de>
* Copyright (C) 2008-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -44,7 +44,6 @@ public:
{
filterCCA = true;
filterVIG = true;
filterCCI = true;
filterDST = true;
filterGEO = true;
focalLength = -1.0;
......@@ -64,7 +63,6 @@ public:
bool filterCCA; /// Chromatic Aberation Corrections
bool filterVIG; /// Vigneting Corrections
bool filterCCI; /// Color Contribution Index Corrections
bool filterDST; /// Distortion Corrections
bool filterGEO; /// Geometry Corrections
......@@ -102,12 +100,12 @@ public:
static QList<int> SupportedVersions()
{
return QList<int>() << 1;
return QList<int>() << 1 << 2;
}
static int CurrentVersion()
{
return 1;
return 2;
}
virtual QString filterIdentifier() const
......
......@@ -133,7 +133,6 @@ void LensFunIface::setFilterSettings(const LensFunContainer& other)
{
d->settings.filterCCA = other.filterCCA;
d->settings.filterVIG = other.filterVIG;
d->settings.filterCCI = other.filterCCI;
d->settings.filterDST = other.filterDST;
d->settings.filterGEO = other.filterGEO;
}
......@@ -478,6 +477,7 @@ bool LensFunIface::supportsDistortion() const
}
lfLensCalibDistortion res;
return d->usedLens->InterpolateDistortion(d->settings.focalLength, res);
}
......@@ -489,6 +489,7 @@ bool LensFunIface::supportsCCA() const
}
lfLensCalibTCA res;
return d->usedLens->InterpolateTCA(d->settings.focalLength, res);
}
......@@ -500,6 +501,7 @@ bool LensFunIface::supportsVig() const
}
lfLensCalibVignetting res;
return d->usedLens->InterpolateVignetting(d->settings.focalLength,
d->settings.aperture,
d->settings.subjectDistance, res);
......@@ -510,11 +512,6 @@ bool LensFunIface::supportsGeometry() const
return supportsDistortion();
}
bool LensFunIface::supportsCCI() const
{
return supportsVig();
}
QString LensFunIface::lensFunVersion()
{
return QString("%1.%2.%3-%4").arg(LF_VERSION_MAJOR).arg(LF_VERSION_MINOR).arg(LF_VERSION_MICRO).arg(LF_VERSION_BUGFIX);
......
......@@ -82,7 +82,6 @@ public:
bool supportsCCA() const;
bool supportsVig() const;
bool supportsGeometry() const;
bool supportsCCI() const;
/** Return Camera maker string description found in metadata
*/
......
......@@ -4,7 +4,7 @@
* Description : a tool to fix automatically camera lens aberrations
*
* Copyright (C) 2008 by Adrian Schroeter <adrian at suse dot de>
* Copyright (C) 2008-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -45,27 +45,23 @@ public:
Private() :
filterCCA(0),
filterVIG(0),
filterCCI(0),
filterDST(0),
filterGEO(0)
{}
static const QString configCCAEntry;
static const QString configVignettingEntry;
static const QString configCCIEntry;
static const QString configDistortionEntry;
static const QString configGeometryEntry;
QCheckBox* filterCCA;
QCheckBox* filterVIG;
QCheckBox* filterCCI;
QCheckBox* filterDST;
QCheckBox* filterGEO;
};
const QString LensFunSettings::Private::configCCAEntry("CCA");
const QString LensFunSettings::Private::configVignettingEntry("Vignetting");
const QString LensFunSettings::Private::configCCIEntry("CCI");
const QString LensFunSettings::Private::configDistortionEntry("Distortion");
const QString LensFunSettings::Private::configGeometryEntry("Geometry");
......@@ -86,10 +82,6 @@ LensFunSettings::LensFunSettings(QWidget* const parent)
d->filterVIG->setWhatsThis(i18n("Vignetting refers to an image darkening, mostly in the corners. "
"Optical and natural vignetting can be canceled out with this option, "
"whereas mechanical vignetting will not be cured."));
d->filterCCI = new QCheckBox(i18n("Color"));
d->filterCCI->setWhatsThis(i18n("All lenses have a slight color tinge to them, "
"mostly due to the anti-reflective coating. "
"The tinge can be canceled when the respective data is known for the lens."));
d->filterDST = new QCheckBox(i18n("Distortion"));
d->filterDST->setWhatsThis(i18n("Distortion refers to an image deformation, which is most pronounced "
"towards the corners. These Seidel aberrations are known as pincushion "
......@@ -107,7 +99,6 @@ LensFunSettings::LensFunSettings(QWidget* const parent)
grid->addWidget(title, 0, 0, 1, 2);
grid->addWidget(d->filterCCA, 1, 0, 1, 2);
grid->addWidget(d->filterVIG, 2, 0, 1, 2);
grid->addWidget(d->filterCCI, 3, 0, 1, 2);
grid->addWidget(d->filterDST, 4, 0, 1, 2);
grid->addWidget(d->filterGEO, 5, 0, 1, 2);
grid->addWidget(note, 6, 0, 1, 2);
......@@ -121,9 +112,6 @@ LensFunSettings::LensFunSettings(QWidget* const parent)
connect(d->filterVIG, SIGNAL(toggled(bool)),
this, SIGNAL(signalSettingsChanged()));
connect(d->filterCCI, SIGNAL(toggled(bool)),
this, SIGNAL(signalSettingsChanged()));
connect(d->filterDST, SIGNAL(toggled(bool)),
this, SIGNAL(signalSettingsChanged()));
......@@ -146,11 +134,6 @@ void LensFunSettings::setEnabledVig(bool b)
d->filterVIG->setEnabled(b);
}
void LensFunSettings::setEnabledCCI(bool b)
{
d->filterCCI->setEnabled(b);
}
void LensFunSettings::setEnabledDist(bool b)
{
d->filterDST->setEnabled(b);
......@@ -165,7 +148,6 @@ void LensFunSettings::assignFilterSettings(LensFunContainer& prm)
{
prm.filterCCA = (d->filterCCA->isChecked() && d->filterCCA->isEnabled());
prm.filterVIG = (d->filterVIG->isChecked() && d->filterVIG->isEnabled());
prm.filterCCI = (d->filterCCI->isChecked() && d->filterCCI->isEnabled());
prm.filterDST = (d->filterDST->isChecked() && d->filterDST->isEnabled());
prm.filterGEO = (d->filterGEO->isChecked() && d->filterGEO->isEnabled());
}
......@@ -175,7 +157,6 @@ void LensFunSettings::setFilterSettings(const LensFunContainer& settings)
blockSignals(true);
d->filterCCA->setChecked(settings.filterCCA);
d->filterVIG->setChecked(settings.filterVIG);
d->filterCCI->setChecked(settings.filterCCI);
d->filterDST->setChecked(settings.filterDST);
d->filterGEO->setChecked(settings.filterGEO);
blockSignals(false);
......@@ -198,7 +179,6 @@ void LensFunSettings::readSettings(KConfigGroup& group)
LensFunContainer defaultPrm = defaultSettings();
prm.filterCCA = group.readEntry(d->configCCAEntry, defaultPrm.filterCCA);
prm.filterVIG = group.readEntry(d->configVignettingEntry, defaultPrm.filterVIG);
prm.filterCCI = group.readEntry(d->configCCIEntry, defaultPrm.filterCCI);
prm.filterDST = group.readEntry(d->configDistortionEntry, defaultPrm.filterDST);
prm.filterGEO = group.readEntry(d->configGeometryEntry, defaultPrm.filterGEO);
setFilterSettings(prm);
......@@ -219,11 +199,6 @@ void LensFunSettings::writeSettings(KConfigGroup& group)
group.writeEntry(d->configVignettingEntry, (prm.filterVIG));
}
if (d->filterCCI->isEnabled())
{
group.writeEntry(d->configCCIEntry, (prm.filterCCI));
}
if (d->filterDST->isEnabled())
{
group.writeEntry(d->configDistortionEntry, (prm.filterDST));
......
......@@ -4,7 +4,7 @@
* Description : a tool to fix automatically camera lens aberrations
*
* Copyright (C) 2008 by Adrian Schroeter <adrian at suse dot de>
* Copyright (C) 2008-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -47,7 +47,6 @@ public:
void setEnabledCCA(bool b);
void setEnabledVig(bool b);
void setEnabledCCI(bool b);
void setEnabledDist(bool b);
void setEnabledGeom(bool b);
......
......@@ -6,7 +6,7 @@
* Date : 2010-09-18
* Description : lens auto-fix batch tool.
*
* Copyright (C) 2010-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2010-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -75,19 +75,19 @@ LensAutoFix::~LensAutoFix()
void LensAutoFix::registerSettingsWidget()
{
m_settingsWidget = new QWidget;
QLabel* note = new QLabel(i18n("<b>Use Metadata</b> option will parse images' information at "
"queue run-time to find relevant lens features."));
m_settingsWidget = new QWidget;
QLabel* const note = new QLabel(i18n("<b>Use Metadata</b> option will parse images' information at "
"queue run-time to find relevant lens features."));
note->setWordWrap(true);
note->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
d->cameraSelector = new LensFunCameraSelector();
KSeparator* line = new KSeparator(Qt::Horizontal);
d->settingsView = new LensFunSettings();
d->cameraSelector = new LensFunCameraSelector();
KSeparator* const line = new KSeparator(Qt::Horizontal);
d->settingsView = new LensFunSettings();
d->cameraSelector->setPassiveMetadataUsage(true);
d->cameraSelector->setEnabledUseMetadata(true);
QGridLayout* grid = new QGridLayout(m_settingsWidget);
QGridLayout* const grid = new QGridLayout(m_settingsWidget);
grid->addWidget(note, 0, 0, 1, 2);
grid->addWidget(d->cameraSelector, 1, 0, 1, 2);
grid->addWidget(line, 2, 0, 1, 2);
......@@ -112,7 +112,6 @@ BatchToolSettings LensAutoFix::defaultSettings()
prm.insert("UseMetadata", true);
prm.insert("filterCCA", true);
prm.insert("filterVIG", true);
prm.insert("filterCCI", true);
prm.insert("filterDST", true);
prm.insert("filterGEO", true);
......@@ -134,7 +133,6 @@ void LensAutoFix::slotAssignSettings2Widget()
LensFunContainer lfPrm;
lfPrm.filterCCA = settings()["filterCCA"].toBool();
lfPrm.filterVIG = settings()["filterVIG"].toBool();
lfPrm.filterCCI = settings()["filterCCI"].toBool();
lfPrm.filterDST = settings()["filterDST"].toBool();
lfPrm.filterGEO = settings()["filterGEO"].toBool();
......@@ -155,7 +153,6 @@ void LensAutoFix::slotSettingsChanged()
// Update checkbox options about Lens corrections available.
d->settingsView->setEnabledCCA(d->cameraSelector->useMetadata() ? true : d->cameraSelector->iface()->supportsCCA());
d->settingsView->setEnabledVig(d->cameraSelector->useMetadata() ? true : d->cameraSelector->iface()->supportsVig());
d->settingsView->setEnabledCCI(d->cameraSelector->useMetadata() ? true : d->cameraSelector->iface()->supportsVig());
d->settingsView->setEnabledDist(d->cameraSelector->useMetadata() ? true : d->cameraSelector->iface()->supportsDistortion());
d->settingsView->setEnabledGeom(d->cameraSelector->useMetadata() ? true : d->cameraSelector->iface()->supportsDistortion());
......@@ -166,7 +163,6 @@ void LensAutoFix::slotSettingsChanged()
prm.insert("filterCCA", (bool)settings.filterCCA);
prm.insert("filterVIG", (bool)settings.filterVIG);
prm.insert("filterCCI", (bool)settings.filterCCI);
prm.insert("filterDST", (bool)settings.filterDST);
prm.insert("filterGEO", (bool)settings.filterGEO);
......@@ -210,7 +206,6 @@ bool LensAutoFix::toolOperations()
{
prm.filterCCA = settings()["filterCCA"].toBool();
prm.filterVIG = settings()["filterVIG"].toBool();
prm.filterCCI = settings()["filterCCI"].toBool();
prm.filterDST = settings()["filterDST"].toBool();
prm.filterGEO = settings()["filterGEO"].toBool();
......
......@@ -6,7 +6,7 @@
* Date : 2010-09-18
* Description : lens auto-fix batch tool.
*
* Copyright (C) 2010-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2010-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment