krita

KisFilter Class Reference

#include <kis_filter.h>

Inheritance diagram for KisFilter:

KisProgressSubject List of all members.

Detailed Description

Basic interface of a Krita filter.

Definition at line 46 of file kis_filter.h.


Public Member Functions

 KisFilter (const KisID &id, const QString &category, const QString &entry)
virtual ~KisFilter ()
virtual void setProgressDisplay (KisProgressDisplayInterface *progressDisplay)
virtual void process (KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilterConfiguration *, const QRect &)=0
virtual KisFilterConfigurationconfiguration (QWidget *)
virtual KisFilterConfigurationconfiguration ()
virtual bool supportsPainting ()
virtual bool supportsPreview ()
virtual bool supportsAdjustmentLayers ()
virtual std::list< KisFilterConfiguration * > listOfExamplesConfiguration (KisPaintDeviceSP)
virtual bool supportsIncrementalPainting ()
virtual bool supportsThreading ()
virtual int overlapMarginNeeded (KisFilterConfiguration *=0) const
virtual QRect enlargeRect (QRect rect, KisFilterConfiguration *=0) const
virtual ColorSpaceIndependence colorSpaceIndependence ()
virtual bool workWith (KisColorSpace *)
virtual void enableProgress ()
virtual void disableProgress ()
bool autoUpdate ()
const KisID id () const
QString menuCategory () const
QString menuEntry () const
virtual KisFilterConfigWidgetcreateConfigurationWidget (QWidget *parent, KisPaintDeviceSP dev)
virtual void cancel ()
virtual void setAutoUpdate (bool set)
bool progressEnabled () const
bool cancelRequested () const

Protected Slots

void setProgressTotalSteps (Q_INT32 totalSteps)
void setProgress (Q_INT32 progress)
void incProgress ()
void setProgressStage (const QString &stage, Q_INT32 progress)
void setProgressDone ()
Q_INT32 progress ()

Protected Attributes

Q_INT32 m_progressTotalSteps
Q_INT32 m_lastProgressPerCent
Q_INT32 m_progressSteps
KisID m_id
KisProgressDisplayInterfacem_progressDisplay
QString m_category
QString m_entry

Constructor & Destructor Documentation

KisFilter::KisFilter ( const KisID id,
const QString &  category,
const QString &  entry 
)

Construct a Krita filter.

Definition at line 25 of file kis_filter.cc.


Member Function Documentation

KisFilterConfiguration * KisFilter::configuration ( QWidget *   )  [virtual]

Returns:
a new configuration derived from the widget.

If the widget is NULL or not the correct type, a default configuration object will be returned

Definition at line 34 of file kis_filter.cc.

KisFilterConfiguration * KisFilter::configuration (  )  [virtual]

Returns:
a default configuration object Normally this doesn't need to be overriden

Definition at line 39 of file kis_filter.cc.

virtual bool KisFilter::supportsPainting (  )  [inline, virtual]

If true, this filter can be used in painting tools as a paint operation.

Definition at line 78 of file kis_filter.h.

virtual bool KisFilter::supportsPreview (  )  [inline, virtual]

This filter can be displayed in a preview dialog.

Definition at line 81 of file kis_filter.h.

virtual bool KisFilter::supportsAdjustmentLayers (  )  [inline, virtual]

This filter can be used in adjustment layers.

Definition at line 85 of file kis_filter.h.

virtual std::list<KisFilterConfiguration*> KisFilter::listOfExamplesConfiguration ( KisPaintDeviceSP   )  [inline, virtual]

Return a list of default configuration to demonstrates the use of the filter.

Returns:
a list with a null element if the filter do not use a configuration

Definition at line 91 of file kis_filter.h.

virtual bool KisFilter::supportsIncrementalPainting (  )  [inline, virtual]

Can this filter work incrementally when painting, or do we need to work on the state as it was before painting started.

The former is faster.

Definition at line 98 of file kis_filter.h.

virtual bool KisFilter::supportsThreading (  )  [inline, virtual]

This filter supports cutting up the work area and filtering each chunk in a separate thread.

Filters that need access to the whole area for correct computations should return false.

Definition at line 105 of file kis_filter.h.

virtual int KisFilter::overlapMarginNeeded ( KisFilterConfiguration = 0  )  const [inline, virtual]

Used when threading is used -- the overlap margin is passed to the filter to use to compute pixels, but the margin is not pasted into the resulting image.

Definition at line 112 of file kis_filter.h.

QRect KisFilter::enlargeRect ( QRect  rect,
KisFilterConfiguration = 0 
) const [virtual]

Similar to overlapMarginNeeded: some filters will alter a lot of pixels that are near to each other at the same time.

So when you changed a single rectangle in a device, the actual rectangle that will feel the influence of this change might be bigger. Use this function to detirmine that rect. The default implementation makes a guess using overlapMarginNeeded.

Definition at line 124 of file kis_filter.cc.

virtual ColorSpaceIndependence KisFilter::colorSpaceIndependence (  )  [inline, virtual]

Determine the colorspace independence of this filter.

See also:
ColorSpaceIndependence
Returns:
the degree of independence

Definition at line 129 of file kis_filter.h.

virtual bool KisFilter::workWith ( KisColorSpace  )  [inline, virtual]

Determine if this filter can work with this colorSpace.

For instance, some colorspaces don't depend on lcms, and cannot do certain tasks. The colorsfilters are problems here. BSAR: I'm still not convinced that this is the right approach. I think that every colorspace should implement the api fully; and that the filter should simply call that api. After all, you don't need lcms to desaturate.

Parameters:
colorsSpace 

Definition at line 141 of file kis_filter.h.

KisFilterConfigWidget * KisFilter::createConfigurationWidget ( QWidget *  parent,
KisPaintDeviceSP  dev 
) [virtual]

Create the configuration widget for this filter.

Parameters:
parent the Qt owner widget of this widget
dev the paintdevice this filter will act on     *
Returns:
NULL if the filter does not use user-settable configuration settings.     *         else return a pointer to the new configuration widget

Definition at line 44 of file kis_filter.cc.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys