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

Classes

class  DistantLight
 
struct  DistantLightData
 
class  Filter
 
class  FilterBlend
 
class  FilterColorMatrix
 
class  FilterComponentTransfer
 
class  FilterComposite
 
class  FilterConvolveMatrix
 
class  FilterDiffuseLighting
 
class  FilterDisplacementMap
 
class  FilterFlood
 
class  FilterGaussian
 
class  FilterImage
 
class  FilterMerge
 
class  FilterMorphology
 
class  FilterOffset
 
class  FilterPrimitive
 
class  FilterSkeleton
 
class  FilterSlot
 
class  FilterSpecularLighting
 
class  FilterTile
 
class  FilterTurbulence
 
class  FilterUnits
 
class  PointLight
 
struct  PointLightData
 
class  SpotLight
 
struct  SpotLightData
 

Enumerations

enum  FilterColorMatrixType {
  COLORMATRIX_MATRIX , COLORMATRIX_SATURATE , COLORMATRIX_HUEROTATE , COLORMATRIX_LUMINANCETOALPHA ,
  COLORMATRIX_ENDTYPE
}
 
enum  FilterComponentTransferType {
  COMPONENTTRANSFER_TYPE_IDENTITY , COMPONENTTRANSFER_TYPE_TABLE , COMPONENTTRANSFER_TYPE_DISCRETE , COMPONENTTRANSFER_TYPE_LINEAR ,
  COMPONENTTRANSFER_TYPE_GAMMA , COMPONENTTRANSFER_TYPE_ERROR
}
 
enum  PreserveAlphaMode { PRESERVE_ALPHA , NO_PRESERVE_ALPHA }
 
enum  FilterConvolveMatrixEdgeMode { CONVOLVEMATRIX_EDGEMODE_DUPLICATE , CONVOLVEMATRIX_EDGEMODE_WRAP , CONVOLVEMATRIX_EDGEMODE_NONE , CONVOLVEMATRIX_EDGEMODE_ENDTYPE }
 
enum  MorphologyOp { ERODE , DILATE }
 
enum  FilterMorphologyOperator { MORPHOLOGY_OPERATOR_ERODE , MORPHOLOGY_OPERATOR_DILATE , MORPHOLOGY_OPERATOR_END }
 
enum  FilterTurbulenceType { TURBULENCE_FRACTALNOISE , TURBULENCE_TURBULENCE , TURBULENCE_ENDTYPE }
 
enum  FilterPrimitiveType {
  NR_FILTER_BLEND , NR_FILTER_COLORMATRIX , NR_FILTER_COMPONENTTRANSFER , NR_FILTER_COMPOSITE ,
  NR_FILTER_CONVOLVEMATRIX , NR_FILTER_DIFFUSELIGHTING , NR_FILTER_DISPLACEMENTMAP , NR_FILTER_FLOOD ,
  NR_FILTER_GAUSSIANBLUR , NR_FILTER_IMAGE , NR_FILTER_MERGE , NR_FILTER_MORPHOLOGY ,
  NR_FILTER_OFFSET , NR_FILTER_SPECULARLIGHTING , NR_FILTER_TILE , NR_FILTER_TURBULENCE ,
  NR_FILTER_ENDPRIMITIVETYPE
}
 
enum  FilterSlotType {
  NR_FILTER_SLOT_NOT_SET = -1 , NR_FILTER_SOURCEGRAPHIC = -2 , NR_FILTER_SOURCEALPHA = -3 , NR_FILTER_BACKGROUNDIMAGE = -4 ,
  NR_FILTER_BACKGROUNDALPHA = -5 , NR_FILTER_FILLPAINT = -6 , NR_FILTER_STROKEPAINT = -7 , NR_FILTER_UNNAMED_SLOT = -8
}
 
enum  FilterQuality {
  FILTER_QUALITY_BEST = 2 , FILTER_QUALITY_BETTER = 1 , FILTER_QUALITY_NORMAL = 0 , FILTER_QUALITY_WORSE = -1 ,
  FILTER_QUALITY_WORST = -2
}
 
enum  LightType { NO_LIGHT = 0 , DISTANT_LIGHT , POINT_LIGHT , SPOT_LIGHT }
 
enum  LightComponent { LIGHT_RED = 0 , LIGHT_GREEN , LIGHT_BLUE }
 

Functions

static cairo_operator_t get_cairo_op (SPBlendMode _blend_mode)
 
static int _effect_area_scr (double const deviation)
 
static void _make_kernel (FIRValue *const kernel, double const deviation)
 
static int _effect_subsample_step_log2 (double const deviation, int const quality)
 
static void calcFilter (double const sigma, double b[N])
 
static void calcTriggsSdikaM (double const b[N], double M[N *N])
 
template<unsigned int SIZE>
static void calcTriggsSdikaInitialization (double const M[N *N], IIRValue const uold[N][SIZE], IIRValue const uplus[SIZE], IIRValue const vplus[SIZE], IIRValue const alpha, IIRValue vold[N][SIZE])
 
template<typename PT , unsigned int PC, bool PREMULTIPLIED_ALPHA>
static void filter2D_IIR (PT *const dest, int const dstr1, int const dstr2, PT const *const src, int const sstr1, int const sstr2, int const n1, int const n2, IIRValue const b[N+1], double const M[N *N], IIRValue *const tmpdata[], dispatch_pool &pool)
 
template<typename PT , unsigned int PC>
static void filter2D_FIR (PT *const dst, int const dstr1, int const dstr2, PT const *const src, int const sstr1, int const sstr2, int const n1, int const n2, FIRValue const *const kernel, int const scr_len, dispatch_pool &pool)
 
static void gaussian_pass_IIR (Geom::Dim2 d, double deviation, cairo_surface_t *src, cairo_surface_t *dest, IIRValue **tmpdata, dispatch_pool &pool)
 
static void gaussian_pass_FIR (Geom::Dim2 d, double deviation, cairo_surface_t *src, cairo_surface_t *dest, dispatch_pool &pool)
 
int clamp (int const val)
 Clamps an integer value to a value between 0 and 255.
 
int clamp3 (int const val)
 Clamps an integer value to a value between 0 and 255^3.
 
int clamp_alpha (int const val, int const alpha)
 Clamps an integer to a value between 0 and alpha.
 

Enumeration Type Documentation

◆ FilterColorMatrixType

Enumerator
COLORMATRIX_MATRIX 
COLORMATRIX_SATURATE 
COLORMATRIX_HUEROTATE 
COLORMATRIX_LUMINANCETOALPHA 
COLORMATRIX_ENDTYPE 

Definition at line 28 of file nr-filter-colormatrix.h.

◆ FilterComponentTransferType

Enumerator
COMPONENTTRANSFER_TYPE_IDENTITY 
COMPONENTTRANSFER_TYPE_TABLE 
COMPONENTTRANSFER_TYPE_DISCRETE 
COMPONENTTRANSFER_TYPE_LINEAR 
COMPONENTTRANSFER_TYPE_GAMMA 
COMPONENTTRANSFER_TYPE_ERROR 

Definition at line 24 of file nr-filter-component-transfer.h.

◆ FilterConvolveMatrixEdgeMode

Enumerator
CONVOLVEMATRIX_EDGEMODE_DUPLICATE 
CONVOLVEMATRIX_EDGEMODE_WRAP 
CONVOLVEMATRIX_EDGEMODE_NONE 
CONVOLVEMATRIX_EDGEMODE_ENDTYPE 

Definition at line 24 of file nr-filter-convolve-matrix.h.

◆ FilterMorphologyOperator

Enumerator
MORPHOLOGY_OPERATOR_ERODE 
MORPHOLOGY_OPERATOR_DILATE 
MORPHOLOGY_OPERATOR_END 

Definition at line 23 of file nr-filter-morphology.h.

◆ FilterPrimitiveType

Enumerator
NR_FILTER_BLEND 
NR_FILTER_COLORMATRIX 
NR_FILTER_COMPONENTTRANSFER 
NR_FILTER_COMPOSITE 
NR_FILTER_CONVOLVEMATRIX 
NR_FILTER_DIFFUSELIGHTING 
NR_FILTER_DISPLACEMENTMAP 
NR_FILTER_FLOOD 
NR_FILTER_GAUSSIANBLUR 
NR_FILTER_IMAGE 
NR_FILTER_MERGE 
NR_FILTER_MORPHOLOGY 
NR_FILTER_OFFSET 
NR_FILTER_SPECULARLIGHTING 
NR_FILTER_TILE 
NR_FILTER_TURBULENCE 
NR_FILTER_ENDPRIMITIVETYPE 

Definition at line 16 of file nr-filter-types.h.

◆ FilterQuality

Enumerator
FILTER_QUALITY_BEST 
FILTER_QUALITY_BETTER 
FILTER_QUALITY_NORMAL 
FILTER_QUALITY_WORSE 
FILTER_QUALITY_WORST 

Definition at line 51 of file nr-filter-types.h.

◆ FilterSlotType

Enumerator
NR_FILTER_SLOT_NOT_SET 
NR_FILTER_SOURCEGRAPHIC 
NR_FILTER_SOURCEALPHA 
NR_FILTER_BACKGROUNDIMAGE 
NR_FILTER_BACKGROUNDALPHA 
NR_FILTER_FILLPAINT 
NR_FILTER_STROKEPAINT 
NR_FILTER_UNNAMED_SLOT 

Definition at line 37 of file nr-filter-types.h.

◆ FilterTurbulenceType

Enumerator
TURBULENCE_FRACTALNOISE 
TURBULENCE_TURBULENCE 
TURBULENCE_ENDTYPE 

Definition at line 35 of file nr-filter-turbulence.h.

◆ LightComponent

Enumerator
LIGHT_RED 
LIGHT_GREEN 
LIGHT_BLUE 

Definition at line 34 of file nr-light.h.

◆ LightType

Enumerator
NO_LIGHT 
DISTANT_LIGHT 
POINT_LIGHT 
SPOT_LIGHT 

Definition at line 16 of file nr-light-types.h.

◆ MorphologyOp

Enumerator
ERODE 
DILATE 

Definition at line 30 of file nr-filter-morphology.cpp.

◆ PreserveAlphaMode

Enumerator
PRESERVE_ALPHA 
NO_PRESERVE_ALPHA 

Definition at line 29 of file nr-filter-convolve-matrix.cpp.

Function Documentation

◆ _effect_area_scr()

static int Inkscape::Filters::_effect_area_scr ( double const  deviation)
static

◆ _effect_subsample_step_log2()

static int Inkscape::Filters::_effect_subsample_step_log2 ( double const  deviation,
int const  quality 
)
static

◆ _make_kernel()

static void Inkscape::Filters::_make_kernel ( FIRValue *const  kernel,
double const  deviation 
)
static

Definition at line 132 of file nr-filter-gaussian.cpp.

References _effect_area_scr(), sqr(), and sum().

Referenced by gaussian_pass_FIR().

◆ calcFilter()

static void Inkscape::Filters::calcFilter ( double const  sigma,
double  b[N] 
)
static

Definition at line 210 of file nr-filter-gaussian.cpp.

References N, real, and sqr().

Referenced by gaussian_pass_IIR().

◆ calcTriggsSdikaInitialization()

template<unsigned int SIZE>
static void Inkscape::Filters::calcTriggsSdikaInitialization ( double const  M[N *N],
IIRValue const  uold[N][SIZE],
IIRValue const  uplus[SIZE],
IIRValue const  vplus[SIZE],
IIRValue const  alpha,
IIRValue  vold[N][SIZE] 
)
static

Definition at line 259 of file nr-filter-gaussian.cpp.

References c, N, and SIZE.

◆ calcTriggsSdikaM()

static void Inkscape::Filters::calcTriggsSdikaM ( double const  b[N],
double  M[N *N] 
)
static

Definition at line 242 of file nr-filter-gaussian.cpp.

References N, and sqr().

Referenced by gaussian_pass_IIR().

◆ clamp()

int Inkscape::Filters::clamp ( int const  val)
inline

Clamps an integer value to a value between 0 and 255.

Needed by filters where rendering computations can lead to component values out of bound.

Returns
0 if the value is smaller than 0, 255 if it is greater 255, else v
Parameters
vthe value to clamp

Definition at line 28 of file nr-filter-utils.h.

Referenced by Inkscape::Extension::Internal::svgConvertRGBToText().

◆ clamp3()

int Inkscape::Filters::clamp3 ( int const  val)
inline

Clamps an integer value to a value between 0 and 255^3.

Returns
0 if the value is smaller than 0, 255^3 (16581375) if it is greater than 255^3, else v
Parameters
vthe value to clamp

Definition at line 40 of file nr-filter-utils.h.

◆ clamp_alpha()

int Inkscape::Filters::clamp_alpha ( int const  val,
int const  alpha 
)
inline

Clamps an integer to a value between 0 and alpha.

Useful when handling images with premultiplied alpha, as setting some of RGB channels to a value bigger than alpha confuses the alpha blending in Inkscape

Returns
0 if val is negative, alpha if val is bigger than alpha, val otherwise
Parameters
valthe value to clamp
alphathe maximum value to clamp to

Definition at line 59 of file nr-filter-utils.h.

◆ filter2D_FIR()

template<typename PT , unsigned int PC>
static void Inkscape::Filters::filter2D_FIR ( PT *const  dst,
int const  dstr1,
int const  dstr2,
PT const *const  src,
int const  sstr1,
int const  sstr2,
int const  n1,
int const  n2,
FIRValue const *const  kernel,
int const  scr_len,
dispatch_pool pool 
)
static

Definition at line 349 of file nr-filter-gaussian.cpp.

References copy_n(), Inkscape::dispatch_pool::dispatch(), n1, n2, and sum().

◆ filter2D_IIR()

template<typename PT , unsigned int PC, bool PREMULTIPLIED_ALPHA>
static void Inkscape::Filters::filter2D_IIR ( PT *const  dest,
int const  dstr1,
int const  dstr2,
PT const *const  src,
int const  sstr1,
int const  sstr2,
int const  n1,
int const  n2,
IIRValue const  b[N+1],
double const  M[N *N],
IIRValue *const  tmpdata[],
dispatch_pool pool 
)
static

Definition at line 280 of file nr-filter-gaussian.cpp.

References c, copy_n(), Inkscape::dispatch_pool::dispatch(), N, n1, and n2.

◆ gaussian_pass_FIR()

static void Inkscape::Filters::gaussian_pass_FIR ( Geom::Dim2  d,
double  deviation,
cairo_surface_t src,
cairo_surface_t dest,
dispatch_pool pool 
)
static

< Grayscale

< Premultiplied 8 bit RGBA

Definition at line 493 of file nr-filter-gaussian.cpp.

References _effect_area_scr(), _make_kernel(), stride, w, and Geom::X.

Referenced by Inkscape::Filters::FilterGaussian::render_cairo().

◆ gaussian_pass_IIR()

static void Inkscape::Filters::gaussian_pass_IIR ( Geom::Dim2  d,
double  deviation,
cairo_surface_t src,
cairo_surface_t dest,
IIRValue **  tmpdata,
dispatch_pool pool 
)
static

< Grayscale

< Premultiplied 8 bit RGBA

Definition at line 448 of file nr-filter-gaussian.cpp.

References calcFilter(), calcTriggsSdikaM(), N, stride, w, and Geom::X.

Referenced by Inkscape::Filters::FilterGaussian::render_cairo().

◆ get_cairo_op()