Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Filters::FilterPrimitive Class Reference

#include <nr-filter-primitive.h>

Inheritance diagram for Inkscape::Filters::FilterPrimitive:
Inkscape::Filters::FilterBlend Inkscape::Filters::FilterColorMatrix Inkscape::Filters::FilterComponentTransfer Inkscape::Filters::FilterComposite Inkscape::Filters::FilterConvolveMatrix Inkscape::Filters::FilterDiffuseLighting Inkscape::Filters::FilterDisplacementMap Inkscape::Filters::FilterFlood Inkscape::Filters::FilterGaussian Inkscape::Filters::FilterImage Inkscape::Filters::FilterMerge Inkscape::Filters::FilterMorphology Inkscape::Filters::FilterOffset Inkscape::Filters::FilterSkeleton Inkscape::Filters::FilterSpecularLighting Inkscape::Filters::FilterTile Inkscape::Filters::FilterTurbulence

Public Member Functions

 FilterPrimitive ()
 
virtual ~FilterPrimitive ()
 
virtual void update ()
 
virtual void render_cairo (FilterSlot &slot) const
 
virtual void area_enlarge (Geom::IntRect &area, Geom::Affine const &m) const
 
virtual void set_input (int slot)
 Sets the input slot number 'slot' to be used as input in rendering filter primitive 'primitive' For filter primitive types accepting more than one input, this sets the first input.
 
virtual void set_input (int input, int slot)
 Sets the input slot number 'slot' to be user as input number 'input' in rendering filter primitive 'primitive' First input for a filter primitive is number 0.
 
virtual void set_output (int slot)
 Sets the slot number 'slot' to be used as output from filter primitive 'primitive' If output slot for a filter element is not set, one of the unused image slots is used.
 
virtual double complexity (Geom::Affine const &) const
 
virtual bool uses_background () const
 
void set_x (SVGLength const &length)
 Sets the filter primitive subregion.
 
void set_y (SVGLength const &length)
 
void set_width (SVGLength const &length)
 
void set_height (SVGLength const &length)
 
void set_subregion (SVGLength const &x, SVGLength const &y, SVGLength const &width, SVGLength const &height)
 
Geom::Rect filter_primitive_area (FilterUnits const &units) const
 Returns the filter primitive area in user coordinate system.
 
virtual bool can_handle_affine (Geom::Affine const &) const
 Indicate whether the filter primitive can handle the given affine.
 
void setStyle (SPStyle const *style)
 Sets style for access to properties used by filter primitives.
 
virtual Glib::ustring name () const
 

Protected Attributes

int _input
 
int _output
 
SVGLength _subregion_x
 
SVGLength _subregion_y
 
SVGLength _subregion_width
 
SVGLength _subregion_height
 
SPColorInterpolation color_interpolation
 

Detailed Description

Definition at line 33 of file nr-filter-primitive.h.

Constructor & Destructor Documentation

◆ FilterPrimitive()

◆ ~FilterPrimitive()

Inkscape::Filters::FilterPrimitive::~FilterPrimitive ( )
virtualdefault

Member Function Documentation

◆ area_enlarge()

◆ can_handle_affine()

virtual bool Inkscape::Filters::FilterPrimitive::can_handle_affine ( Geom::Affine const &  ) const
inlinevirtual

Indicate whether the filter primitive can handle the given affine.

Results of some filter primitives depend on the coordinate system used when rendering. A gaussian blur with equal x and y deviation will remain unchanged by rotations. Per-pixel filters like color matrix and blend will not change regardless of the transformation.

When any filter returns false, filter rendering is performed on an intermediate surface with edges parallel to the axes of the user coordinate system. This means the matrices from FilterUnits will contain at most a (possibly non-uniform) scale and a translation. When all primitives of the filter return true, the rendering is performed in display coordinate space and no intermediate surface is used.

Reimplemented in Inkscape::Filters::FilterBlend, Inkscape::Filters::FilterColorMatrix, Inkscape::Filters::FilterComponentTransfer, Inkscape::Filters::FilterComposite, Inkscape::Filters::FilterFlood, Inkscape::Filters::FilterImage, Inkscape::Filters::FilterMerge, Inkscape::Filters::FilterOffset, and Inkscape::Filters::FilterGaussian.

Definition at line 115 of file nr-filter-primitive.h.

◆ complexity()

◆ filter_primitive_area()

◆ name()

◆ render_cairo()

◆ set_height()

void Inkscape::Filters::FilterPrimitive::set_height ( SVGLength const &  length)

Definition at line 89 of file nr-filter-primitive.cpp.

References _subregion_height.

◆ set_input() [1/2]

void Inkscape::Filters::FilterPrimitive::set_input ( int  input,
int  slot 
)
virtual

Sets the input slot number 'slot' to be user as input number 'input' in rendering filter primitive 'primitive' First input for a filter primitive is number 0.

For primitives with attributes 'in' and 'in2', these are numbered 0 and 1, respectively. If any of required input slots for a filter is not set, the output of previous filter primitive is used, or SourceGraphic if this is the first filter primitive for this filter.

Reimplemented in Inkscape::Filters::FilterBlend, Inkscape::Filters::FilterComposite, Inkscape::Filters::FilterDisplacementMap, and Inkscape::Filters::FilterMerge.

Definition at line 62 of file nr-filter-primitive.cpp.

References _input.

◆ set_input() [2/2]

void Inkscape::Filters::FilterPrimitive::set_input ( int  slot)
virtual

Sets the input slot number 'slot' to be used as input in rendering filter primitive 'primitive' For filter primitive types accepting more than one input, this sets the first input.

If any of the required input slots is not set, the output of previous filter primitive is used, or SourceGraphic if this is the first primitive for this filter.

Reimplemented in Inkscape::Filters::FilterComposite, Inkscape::Filters::FilterMerge, Inkscape::Filters::FilterBlend, and Inkscape::Filters::FilterDisplacementMap.

Definition at line 57 of file nr-filter-primitive.cpp.

References set_input().

Referenced by SPFilterPrimitive::build_renderer_common(), and set_input().

◆ set_output()

void Inkscape::Filters::FilterPrimitive::set_output ( int  slot)
virtual

Sets the slot number 'slot' to be used as output from filter primitive 'primitive' If output slot for a filter element is not set, one of the unused image slots is used.

It is an error to specify a pre-defined slot as 'slot'. Such call does not have any effect to the state of filter or its primitives.

Definition at line 67 of file nr-filter-primitive.cpp.

References _output.

Referenced by SPFilterPrimitive::build_renderer_common().

◆ set_subregion()

void Inkscape::Filters::FilterPrimitive::set_subregion ( SVGLength const &  x,
SVGLength const &  y,
SVGLength const &  width,
SVGLength const &  height 
)

◆ set_width()

void Inkscape::Filters::FilterPrimitive::set_width ( SVGLength const &  length)

Definition at line 84 of file nr-filter-primitive.cpp.

References _subregion_width.

◆ set_x()

void Inkscape::Filters::FilterPrimitive::set_x ( SVGLength const &  length)

Sets the filter primitive subregion.

Passing an unset length (length._set == false) WILL change the parameter as it is important to know if a parameter is unset.

Definition at line 74 of file nr-filter-primitive.cpp.

References _subregion_x.

◆ set_y()

void Inkscape::Filters::FilterPrimitive::set_y ( SVGLength const &  length)

Definition at line 79 of file nr-filter-primitive.cpp.

References _subregion_y.

◆ setStyle()

void Inkscape::Filters::FilterPrimitive::setStyle ( SPStyle const *  style)

Sets style for access to properties used by filter primitives.

Definition at line 172 of file nr-filter-primitive.cpp.

References color_interpolation, SPStyle::color_interpolation_filters, and SP_CSS_COLOR_INTERPOLATION_AUTO.

Referenced by SPFilterPrimitive::build_renderer_common().

◆ update()

virtual void Inkscape::Filters::FilterPrimitive::update ( )
inlinevirtual

Reimplemented in Inkscape::Filters::FilterImage.

Definition at line 39 of file nr-filter-primitive.h.

◆ uses_background()

virtual bool Inkscape::Filters::FilterPrimitive::uses_background ( ) const
inlinevirtual

Member Data Documentation

◆ _input

◆ _output

◆ _subregion_height

SVGLength Inkscape::Filters::FilterPrimitive::_subregion_height
protected

◆ _subregion_width

SVGLength Inkscape::Filters::FilterPrimitive::_subregion_width
protected

◆ _subregion_x

SVGLength Inkscape::Filters::FilterPrimitive::_subregion_x
protected

◆ _subregion_y

SVGLength Inkscape::Filters::FilterPrimitive::_subregion_y
protected

◆ color_interpolation


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