Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
cairo-templates.h File Reference

Cairo software blending templates. More...

Go to the source code of this file.

Classes

struct  surface_accessor< T >
 
struct  SurfaceSynth
 

Functions

template<typename AccOut , typename Acc1 , typename Acc2 , typename Blend >
void ink_cairo_surface_blend_internal (cairo_surface_t *out, cairo_surface_t *in1, cairo_surface_t *in2, int w, int h, Blend &blend)
 
template<typename AccOut , typename AccIn , typename Filter >
void ink_cairo_surface_filter_internal (cairo_surface_t *out, cairo_surface_t *in, int w, int h, Filter &filter)
 
template<typename AccOut , typename Synth >
void ink_cairo_surface_synthesize_internal (cairo_surface_t *out, int x0, int y0, int x1, int y1, Synth &synth)
 
template<typename Blend >
void ink_cairo_surface_blend (cairo_surface_t *in1, cairo_surface_t *in2, cairo_surface_t *out, Blend &&blend)
 Blend two surfaces using the supplied functor.
 
template<typename Filter >
void ink_cairo_surface_filter (cairo_surface_t *in, cairo_surface_t *out, Filter &&filter)
 
template<typename Synth >
void ink_cairo_surface_synthesize (cairo_surface_t *out, cairo_rectangle_t const &out_area, Synth &&synth)
 Synthesize surface pixels based on their position.
 
template<typename Synth >
void ink_cairo_surface_synthesize (cairo_surface_t *out, Synth synth)
 
G_GNUC_CONST gint32 pxclamp (gint32 v, gint32 low, gint32 high)
 

Variables

static const int POOL_THRESHOLD = 2048
 

Detailed Description

Cairo software blending templates.

Definition in file cairo-templates.h.

Function Documentation

◆ ink_cairo_surface_blend()

template<typename Blend >
void ink_cairo_surface_blend ( cairo_surface_t in1,
cairo_surface_t in2,
cairo_surface_t out,
Blend &&  blend 
)

Blend two surfaces using the supplied functor.

This template blends two Cairo image surfaces using a blending functor that takes two 32-bit ARGB pixel values and returns a modified 32-bit pixel value. Differences in input surface formats are handled transparently. In future, this template will also handle software fallback for GL surfaces.

Definition at line 122 of file cairo-templates.h.

References w.

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

◆ ink_cairo_surface_blend_internal()

template<typename AccOut , typename Acc1 , typename Acc2 , typename Blend >
void ink_cairo_surface_blend_internal ( cairo_surface_t out,
cairo_surface_t in1,
cairo_surface_t in2,
int  w,
int  h,
Blend &  blend 
)

◆ ink_cairo_surface_filter()

◆ ink_cairo_surface_filter_internal()

template<typename AccOut , typename AccIn , typename Filter >
void ink_cairo_surface_filter_internal ( cairo_surface_t out,
cairo_surface_t in,
int  w,
int  h,
Filter &  filter 
)

◆ ink_cairo_surface_synthesize() [1/2]

template<typename Synth >
void ink_cairo_surface_synthesize ( cairo_surface_t out,
cairo_rectangle_t const &  out_area,
Synth &&  synth 
)

Synthesize surface pixels based on their position.

This template accepts a functor that gets called with the x and y coordinates of the pixels, given as integers.

Parameters
outOutput surface
out_areaThe region of the output surface that should be synthesized
synthSynthesis functor

Definition at line 190 of file cairo-templates.h.

Referenced by ink_cairo_surface_synthesize(), Inkscape::Filters::FilterConvolveMatrix::render_cairo(), Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), and Inkscape::Filters::FilterTurbulence::render_cairo().

◆ ink_cairo_surface_synthesize() [2/2]

template<typename Synth >
void ink_cairo_surface_synthesize ( cairo_surface_t out,
Synth  synth 
)

Definition at line 210 of file cairo-templates.h.

References ink_cairo_surface_synthesize(), and w.

◆ ink_cairo_surface_synthesize_internal()

template<typename AccOut , typename Synth >
void ink_cairo_surface_synthesize_internal ( cairo_surface_t out,
int  x0,
int  y0,
int  x1,
int  y1,
Synth &  synth 
)

Definition at line 96 of file cairo-templates.h.

References limit, POOL_THRESHOLD, and surface_accessor< T >::set().

◆ pxclamp()

G_GNUC_CONST gint32 pxclamp ( gint32  v,
gint32  low,
gint32  high 
)
inline

Variable Documentation

◆ POOL_THRESHOLD

const int POOL_THRESHOLD = 2048
static