digiKam
Digikam::DImgThreadedFilter::DefaultFilterAction< Filter > Class Template Reference
+ Inheritance diagram for Digikam::DImgThreadedFilter::DefaultFilterAction< Filter >:

Public Types

enum  Category {
  ReproducibleFilter = 0 , ComplexFilter = 1 , DocumentedHistory = 2 , CategoryFirst = ReproducibleFilter ,
  CategoryLast = DocumentedHistory
}
 
enum  Flag { ExplicitBranch = 1 << 0 }
 

Public Member Functions

void addFlag (Flags flags)
 
void addParameter (const QString &key, const QVariant &value)
 Sets parameter, removing all other values for the same key. More...
 
Category category () const
 
void clearParameters ()
 Clear all parameters. More...
 
 DefaultFilterAction (bool isReproducible)
 
 DefaultFilterAction (FilterAction::Category category=FilterAction::ReproducibleFilter)
 
QString description () const
 
QString displayableName () const
 
Flags flags () const
 
bool hasParameter (const QString &key) const
 
bool hasParameters () const
 
QString identifier () const
 
bool isNull () const
 
bool operator== (const FilterAction &other) const
 
QVariant & parameter (const QString &key)
 
const QVariant parameter (const QString &key) const
 
template<typename T >
T parameter (const QString &key) const
 
template<typename T >
T parameter (const QString &key, const T &defaultValue) const
 
QHash< QString, QVariant > & parameters ()
 
const QHash< QString, QVariant > & parameters () const
 
void removeFlag (Flags flags)
 
void removeParameters (const QString &key)
 Removes all parameters for key. More...
 
void setDescription (const QString &description)
 
void setDisplayableName (const QString &displayableName)
 
void setFlags (Flags flags)
 
void setParameters (const QHash< QString, QVariant > &params)
 Replaces parameters. More...
 
void supportOlderVersionIf (int version, bool condition)
 
int version () const
 

Protected Attributes

Category m_category
 NOTE: Value class, do not create a d-pointer. More...
 
QString m_description
 
QString m_displayableName
 
Flags m_flags
 
QString m_identifier
 
QHash< QString, QVariant > m_params
 
int m_version
 

Detailed Description

template<class Filter>
class Digikam::DImgThreadedFilter::DefaultFilterAction< Filter >

Convenience class to spare the few repeating lines of code

Member Enumeration Documentation

◆ Category

Enumerator
ReproducibleFilter 

NOTE: Do not change existing values, they are written to XML in files! When given the set of stored parameters and the original data, an identical result will be produced.

ComplexFilter 

The operation is documented and a number of parameters may be known, but the identical result cannot be reproduced. It may be possible to produce a sufficiently similar result.

DocumentedHistory 

The source images are known, a textual description may be added, but there is no way to automatically replay

CategoryFirst 
CategoryLast 

◆ Flag

Enumerator
ExplicitBranch 

The editing step of this filter action explicitly branches from the parent. This is an optional hint that the result is meant as a new version.

Constructor & Destructor Documentation

◆ DefaultFilterAction() [1/2]

◆ DefaultFilterAction() [2/2]

template<class Filter >
Digikam::DImgThreadedFilter::DefaultFilterAction< Filter >::DefaultFilterAction ( bool  isReproducible)
inlineexplicit

Member Function Documentation

◆ addFlag()

void Digikam::FilterAction::addFlag ( Flags  flags)
inherited

◆ addParameter()

void Digikam::FilterAction::addParameter ( const QString &  key,
const QVariant &  value 
)
inherited

Sets parameter, removing all other values for the same key.

References Digikam::FilterAction::m_params, and value.

Referenced by DigikamEditorPerspectiveToolPlugin::PerspectiveWidget::applyPerspectiveAdjustment(), Digikam::DImgBuiltinFilter::filterAction(), Digikam::BWSepiaFilter::filterAction(), Digikam::InfraredFilter::filterAction(), Digikam::MixerFilter::filterAction(), Digikam::TonalityFilter::filterAction(), Digikam::CBFilter::filterAction(), Digikam::BorderFilter::filterAction(), Digikam::TextureFilter::filterAction(), Digikam::FilmFilter::filterAction(), Digikam::BlurFilter::filterAction(), Digikam::BlurFXFilter::filterAction(), Digikam::CharcoalFilter::filterAction(), Digikam::ColorFXFilter::filterAction(), Digikam::DistortionFXFilter::filterAction(), Digikam::EmbossFilter::filterAction(), Digikam::FilmGrainFilter::filterAction(), Digikam::OilPaintFilter::filterAction(), Digikam::RainDropFilter::filterAction(), Digikam::GreycstorationFilter::filterAction(), Digikam::HotPixelFixer::filterAction(), Digikam::HSLFilter::filterAction(), Digikam::IccTransformFilter::filterAction(), Digikam::LocalContrastFilter::filterAction(), Digikam::AntiVignettingFilter::filterAction(), Digikam::LensDistortionFilter::filterAction(), Digikam::LensFunFilter::filterAction(), Digikam::LevelsFilter::filterAction(), Digikam::NRFilter::filterAction(), Digikam::RefocusFilter::filterAction(), Digikam::SharpenFilter::filterAction(), Digikam::UnsharpMaskFilter::filterAction(), Digikam::ContentAwareFilter::filterAction(), Digikam::FreeRotationFilter::filterAction(), Digikam::ShearFilter::filterAction(), Digikam::DImageHistory::fromXml(), Digikam::BCGContainer::writeToFilterAction(), Digikam::CurvesContainer::writeToFilterAction(), Digikam::HotPixelContainer::writeToFilterAction(), Digikam::RedEyeCorrectionContainer::writeToFilterAction(), and Digikam::WBContainer::writeToFilterAction().

◆ category()

◆ clearParameters()

void Digikam::FilterAction::clearParameters ( )
inherited

Clear all parameters.

References Digikam::FilterAction::m_params.

◆ description()

QString Digikam::FilterAction::description ( ) const
inherited

Returns a description / comment for this action. In the case of DocumentedHistory, this may be the most useful value.

References Digikam::FilterAction::m_description.

Referenced by Digikam::ToolTipFiller::filterActionTipContents(), and Digikam::FilterAction::setDescription().

◆ displayableName()

◆ flags()

FilterAction::Flags Digikam::FilterAction::flags ( ) const
inherited

◆ hasParameter()

bool Digikam::FilterAction::hasParameter ( const QString &  key) const
inherited

◆ hasParameters()

bool Digikam::FilterAction::hasParameters ( ) const
inherited

Access parameters. A parameters is a key -> value pair. Keys need to be unique.

References Digikam::FilterAction::m_params.

Referenced by Digikam::ToolTipFiller::filterActionTipContents().

◆ identifier()

QString Digikam::FilterAction::identifier ( ) const
inherited

◆ isNull()

◆ operator==()

◆ parameter() [1/4]

QVariant & Digikam::FilterAction::parameter ( const QString &  key)
inherited

◆ parameter() [2/4]

const QVariant Digikam::FilterAction::parameter ( const QString &  key) const
inherited

References Digikam::FilterAction::m_params.

Referenced by Digikam::BCGContainer::fromFilterAction(), Digikam::CurvesContainer::fromFilterAction(), Digikam::HotPixelContainer::fromFilterAction(), Digikam::RedEyeCorrectionContainer::fromFilterAction(), Digikam::WBContainer::fromFilterAction(), Digikam::BWSepiaFilter::readParameters(), Digikam::InfraredFilter::readParameters(), Digikam::MixerFilter::readParameters(), Digikam::TonalityFilter::readParameters(), Digikam::CBFilter::readParameters(), Digikam::BorderFilter::readParameters(), Digikam::TextureFilter::readParameters(), Digikam::FilmFilter::readParameters(), Digikam::BlurFilter::readParameters(), Digikam::BlurFXFilter::readParameters(), Digikam::CharcoalFilter::readParameters(), Digikam::ColorFXFilter::readParameters(), Digikam::DistortionFXFilter::readParameters(), Digikam::EmbossFilter::readParameters(), Digikam::FilmGrainFilter::readParameters(), Digikam::OilPaintFilter::readParameters(), Digikam::RainDropFilter::readParameters(), Digikam::GreycstorationFilter::readParameters(), Digikam::HotPixelFixer::readParameters(), Digikam::HSLFilter::readParameters(), Digikam::IccTransformFilter::readParameters(), Digikam::LocalContrastFilter::readParameters(), Digikam::AntiVignettingFilter::readParameters(), Digikam::LensDistortionFilter::readParameters(), Digikam::LensFunFilter::readParameters(), Digikam::LevelsFilter::readParameters(), Digikam::NRFilter::readParameters(), Digikam::RefocusFilter::readParameters(), Digikam::SharpenFilter::readParameters(), Digikam::UnsharpMaskFilter::readParameters(), Digikam::ContentAwareFilter::readParameters(), Digikam::FreeRotationFilter::readParameters(), Digikam::ShearFilter::readParameters(), Digikam::IccTransformFilter::readParametersError(), and Digikam::DImgBuiltinFilter::setAction().

◆ parameter() [3/4]

template<typename T >
T Digikam::FilterAction::parameter ( const QString &  key) const
inlineinherited

Returns parameter converted from QVariant to given type

References T.

◆ parameter() [4/4]

template<typename T >
T Digikam::FilterAction::parameter ( const QString &  key,
const T defaultValue 
) const
inlineinherited

Read parameter with a default value: If there is a parameter for the given key, return it converted from QVariant to the template type. If there is no parameter, return the given default value.

References T.

◆ parameters() [1/2]

QHash< QString, QVariant > & Digikam::FilterAction::parameters ( )
inherited

◆ parameters() [2/2]

const QHash< QString, QVariant > & Digikam::FilterAction::parameters ( ) const
inherited

◆ removeFlag()

void Digikam::FilterAction::removeFlag ( Flags  flags)
inherited

◆ removeParameters()

void Digikam::FilterAction::removeParameters ( const QString &  key)
inherited

Removes all parameters for key.

References Digikam::FilterAction::m_params.

◆ setDescription()

void Digikam::FilterAction::setDescription ( const QString &  description)
inherited

◆ setDisplayableName()

void Digikam::FilterAction::setDisplayableName ( const QString &  displayableName)
inherited

References Digikam::FilterAction::displayableName(), and Digikam::FilterAction::m_displayableName.

Referenced by DigikamEditorPerspectiveToolPlugin::PerspectiveWidget::applyPerspectiveAdjustment(), Digikam::DImgBuiltinFilter::filterAction(), Digikam::BWSepiaFilter::filterAction(), Digikam::InfraredFilter::filterAction(), Digikam::MixerFilter::filterAction(), Digikam::TonalityFilter::filterAction(), Digikam::CBFilter::filterAction(), Digikam::BorderFilter::filterAction(), Digikam::TextureFilter::filterAction(), Digikam::FilmFilter::filterAction(), Digikam::BlurFilter::filterAction(), Digikam::BlurFXFilter::filterAction(), Digikam::CharcoalFilter::filterAction(), Digikam::ColorFXFilter::filterAction(), Digikam::DistortionFXFilter::filterAction(), Digikam::EmbossFilter::filterAction(), Digikam::FilmGrainFilter::filterAction(), Digikam::InvertFilter::filterAction(), Digikam::OilPaintFilter::filterAction(), Digikam::RainDropFilter::filterAction(), Digikam::GreycstorationFilter::filterAction(), Digikam::HSLFilter::filterAction(), Digikam::IccTransformFilter::filterAction(), Digikam::LocalContrastFilter::filterAction(), Digikam::AntiVignettingFilter::filterAction(), Digikam::LensDistortionFilter::filterAction(), Digikam::LensFunFilter::filterAction(), Digikam::LevelsFilter::filterAction(), Digikam::NRFilter::filterAction(), Digikam::RefocusFilter::filterAction(), Digikam::SharpenFilter::filterAction(), Digikam::UnsharpMaskFilter::filterAction(), Digikam::FreeRotationFilter::filterAction(), Digikam::ShearFilter::filterAction(), Digikam::WBFilter::filterAction(), and Digikam::DImageHistory::fromXml().

◆ setFlags()

void Digikam::FilterAction::setFlags ( Flags  flags)
inherited

◆ setParameters()

void Digikam::FilterAction::setParameters ( const QHash< QString, QVariant > &  params)
inherited

Replaces parameters.

References Digikam::FilterAction::m_params.

◆ supportOlderVersionIf()

template<class Filter >
void Digikam::DImgThreadedFilter::DefaultFilterAction< Filter >::supportOlderVersionIf ( int  version,
bool  condition 
)
inline

Preserve backwards compatibility: If a given condition (some new feature is not used) is true, decrease the version so that older digikam versions can still replay the action

Referenced by Digikam::BWSepiaFilter::filterAction().

◆ version()

int Digikam::FilterAction::version ( ) const
inherited

Returns the version (>= 1) of the filter used to produce this action. When a filter / tool is found by the identifier, it can decide by the version if it supports this action and which parameters it expects.

References Digikam::FilterAction::m_version.

Referenced by Digikam::ToolTipFiller::filterActionTipContents(), Digikam::FilterActionFilter::filterImage(), Digikam::FilterActionFilter::isSupported(), Digikam::DImgBuiltinFilter::setAction(), and Digikam::DImageHistory::toXml().

Member Data Documentation

◆ m_category

Category Digikam::FilterAction::m_category
protectedinherited

NOTE: Value class, do not create a d-pointer.

Referenced by Digikam::FilterAction::category(), and Digikam::FilterAction::operator==().

◆ m_description

QString Digikam::FilterAction::m_description
protectedinherited

◆ m_displayableName

QString Digikam::FilterAction::m_displayableName
protectedinherited

◆ m_flags

◆ m_identifier

QString Digikam::FilterAction::m_identifier
protectedinherited

◆ m_params

◆ m_version

int Digikam::FilterAction::m_version
protectedinherited

The documentation for this class was generated from the following file: