digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::RawProcessingFilter Class Reference

This is a special filter. More...

+ Inheritance diagram for Digikam::RawProcessingFilter:

Public Member Functions

 RawProcessingFilter (const DRawDecoding &settings, DImgThreadedFilter *const master, const DImg &orgImage, const DImg &destImage, int progressBegin=0, int progressEnd=100, const QString &name=QString())
 For use with a master filter.
 
 RawProcessingFilter (DImg *const orgImage, QObject *const parent, const DRawDecoding &settings, const QString &name=QString())
 Traditional constructor.
 
 RawProcessingFilter (QObject *const parent=nullptr)
 Default constructor.
 
FilterAction filterAction () override
 
QString filterIdentifier () const override
 
void readParameters (const FilterAction &action) override
 
void setObserver (DImgLoaderObserver *const observer, int progressBegin, int progressEnd)
 Normally, filters post progress and are cancelled by DynamicThread facilities.
 
void setOutputProfile (const IccProfile &profile)
 As additional and first post-processing step, convert the image's color space to the specified profile.
 
void setSettings (const DRawDecoding &settings)
 Set the raw decoding settings.
 
DRawDecoding settings () const
 
- Public Member Functions inherited from Digikam::DImgThreadedFilter
 DImgThreadedFilter (DImg *const orgImage, QObject *const parent, const QString &name=QString())
 Constructs a filter with all arguments (ready to use).
 
 DImgThreadedFilter (QObject *const parent=nullptr, const QString &name=QString())
 Constructs a filter without argument.
 
virtual void cancelFilter ()
 Cancel the threaded computation.
 
const QString & filterName ()
 
int filterVersion () const
 
DImg getTargetImage ()
 
QList< int > multithreadedSteps (int stop, int start=0) const
 This method return a list of steps to process parallelized operation in filter using QtConcurrents API.
 
virtual bool parametersSuccessfullyRead () const
 Optional error handling for readParameters.
 
virtual QString readParametersError (const FilterAction &actionThatFailed) const
 
void setFilterName (const QString &name)
 
void setFilterVersion (int version)
 Replaying a filter action: Set the filter version.
 
void setOriginalImage (const DImg &orgImage)
 
void setupAndStartDirectly (const DImg &orgImage, DImgThreadedFilter *const master, int progressBegin=0, int progressEnd=100)
 Initializes the filter for use as a slave and directly starts computation (in-thread)
 
void setupFilter (const DImg &orgImage)
 You need to call this and then start filter of you used the constructor not setting an original image.
 
virtual void startFilter ()
 Start the threaded computation.
 
virtual void startFilterDirectly ()
 Start computation of this filter, directly in this thread.
 
virtual QList< int > supportedVersions () const
 
- Public Member Functions inherited from Digikam::DynamicThread
 DynamicThread (QObject *const parent=nullptr)
 This class extends QRunnable, so you have to reimplement virtual void run().
 
 ~DynamicThread () override
 The destructor calls stop() and wait(), but if you, in your destructor, delete any data that is accessed by your run() method, you must call stop() and wait() before yourself.
 
bool isFinished () const
 
bool isRunning () const
 
QThread::Priority priority () const
 
void setEmitSignals (bool emitThem)
 
void setPriority (QThread::Priority priority)
 Sets the priority for this dynamic thread.
 
State state () const
 

Static Public Member Functions

static int CurrentVersion ()
 
static QString DisplayableName ()
 
static QString FilterIdentifier ()
 
static QList< int > SupportedVersions ()
 

Protected Member Functions

bool continueQuery () const
 
void filterImage () override
 Main image filter method.
 
void postProgress (int) override
 Emit progress info.
 
- Protected Member Functions inherited from Digikam::DImgThreadedFilter
 DImgThreadedFilter (DImgThreadedFilter *const master, const DImg &orgImage, const DImg &destImage, int progressBegin=0, int progressEnd=100, const QString &name=QString())
 Support for chaining two filters as master and thread.
 
virtual void cleanupFilter ()
 Clean up filter data if necessary, called by stopComputation() method.
 
virtual void initFilter ()
 Start filter operation before threaded method.
 
void initMaster ()
 
void initSlave (DImgThreadedFilter *const master, int progressBegin=0, int progressEnd=100)
 Initialize the filter for use as a slave - reroutes progress info to master.
 
virtual int modulateProgress (int progress)
 This method modulates the progress value from the 0..100 span to the span of this slave.
 
virtual void prepareDestImage ()
 
void run () override
 List of threaded operations by filter.
 
void setSlave (DImgThreadedFilter *const slave)
 Inform the master that there is currently a slave.
 
- Protected Member Functions inherited from Digikam::DynamicThread
bool runningFlag () const volatile
 In you run() method, you shall regularly check for runningFlag() and cleanup and return if false.
 
virtual void shutDown ()
 If you are deleting data in your destructor which is accessed from the thread, do one of the following from your destructor to guarantee a safe shutdown: 1) Call this method 2) Call stop() and wait(), knowing that nothing will call start() anymore after this 3) Be sure the thread will never be running at destruction.
 
void start (QMutexLocker< QMutex > &locker)
 Doing the same as start(), stop() and wait above, provide it with a locked QMutexLocker on mutex().
 
void stop (const QMutexLocker< QMutex > &locker)
 
QMutex * threadMutex () const
 This is the non-recursive mutex used to protect state variables and waiting in this class.
 
void wait (QMutexLocker< QMutex > &locker)
 

Protected Attributes

IccProfile m_customOutputProfile
 
DImgLoaderObserverm_observer = nullptr
 
DRawDecoding m_settings
 
- Protected Attributes inherited from Digikam::DImgThreadedFilter
DImg m_destImage
 Output image data.
 
DImgThreadedFilterm_master = nullptr
 The master of this slave filter.
 
QString m_name
 Filter name.
 
DImg m_orgImage
 Copy of original Image data.
 
int m_progressBegin = 0
 The progress span that a slave filter uses in the parent filter's progress.
 
int m_progressCurrent = 0
 To prevent signals bombarding with progress indicator value in postProgress().
 
int m_progressSpan = 0
 
DImgThreadedFilterm_slave = nullptr
 The current slave.
 
int m_version = 1
 
bool m_wasCancelled = false
 

Additional Inherited Members

- Public Types inherited from Digikam::DynamicThread
enum  State { Inactive , Scheduled , Running , Deactivating }
 
- Public Slots inherited from Digikam::DynamicThread
void start ()
 
void stop ()
 Stop computation, sets the running flag to false.
 
void wait ()
 Waits until the thread finishes.
 
- Signals inherited from Digikam::DImgThreadedFilter
void signalFinished (bool success)
 Emitted when the computation has completed.
 
void signalProgress (int progress)
 Emitted when progress info from the calculation is available.
 
void signalStarted ()
 This signal is emitted when image data is available and the computation has started.
 
- Signals inherited from Digikam::DynamicThread
void finished ()
 
void starting ()
 Emitted if emitSignals is enabled.
 

Detailed Description

It implements RAW post processing. Additionally, it provides some facilities for use from the DImg Raw loader.

The original image shall come from RawEngine without further modification.

Constructor & Destructor Documentation

◆ RawProcessingFilter() [1/2]

Digikam::RawProcessingFilter::RawProcessingFilter ( QObject *const  parent = nullptr)
explicit

You need to call setSettings() and setOriginalImage() before starting the filter.

◆ RawProcessingFilter() [2/2]

Digikam::RawProcessingFilter::RawProcessingFilter ( const DRawDecoding settings,
DImgThreadedFilter *const  master,
const DImg orgImage,
const DImg destImage,
int  progressBegin = 0,
int  progressEnd = 100,
const QString &  name = QString() 
)

Computation is started immediately.

Member Function Documentation

◆ filterAction()

FilterAction Digikam::RawProcessingFilter::filterAction ( )
overridevirtual
Returns
The action description corresponding to currently set options.

Implements Digikam::DImgThreadedFilter.

◆ filterIdentifier()

QString Digikam::RawProcessingFilter::filterIdentifier ( ) const
inlineoverridevirtual
Returns
The identifier for this filter in the image history.

Implements Digikam::DImgThreadedFilter.

◆ filterImage()

void Digikam::RawProcessingFilter::filterImage ( )
overrideprotectedvirtual

Override in subclass.

Implements Digikam::DImgThreadedFilter.

◆ postProgress()

void Digikam::RawProcessingFilter::postProgress ( int  progress)
overrideprotectedvirtual

Reimplemented from Digikam::DImgThreadedFilter.

◆ readParameters()

void Digikam::RawProcessingFilter::readParameters ( const FilterAction action)
overridevirtual

◆ setObserver()

void Digikam::RawProcessingFilter::setObserver ( DImgLoaderObserver *const  observer,
int  progressBegin,
int  progressEnd 
)

Here, as an alternative, a DImgLoaderObserver is set. It's continueQuery is called and progress is posted in the given interval.

◆ setSettings()

void Digikam::RawProcessingFilter::setSettings ( const DRawDecoding settings)

The post processing is carried out here, the libraw settings are needed to construct the FilterAction.