31 : _source_graphic(graphic.rawTarget())
32 , _background_ct(bgdc ? bgdc->raw() : nullptr)
33 , _source_graphic_area(graphic.targetLogicalBounds().roundOutwards())
34 , _background_area(bgdc ? bgdc->targetLogicalBounds().roundOutwards() :
Geom::IntRect())
37 , _blurquality(blurquality)
39 , device_scale(graphic.
surface()->device_scale())
62 for (
auto &_slot :
_slots) {
63 cairo_surface_destroy(_slot.second);
72 SlotMap::iterator s =
_slots.find(slot_nr);
90 cairo_surface_destroy(tr);
97 cairo_surface_destroy(bg);
103 cairo_surface_destroy(alpha);
109 cairo_surface_destroy(ba);
125 cairo_surface_destroy(empty);
129 if (s->second && cairo_surface_status(s->second) == CAIRO_STATUS_NO_MEMORY) {
131 throw std::bad_alloc();
149 cairo_t *tsg_ct = cairo_create(tsg);
155 cairo_set_operator(tsg_ct, CAIRO_OPERATOR_SOURCE);
157 cairo_destroy(tsg_ct);
170 tbg = cairo_surface_create_similar(
171 bg, cairo_surface_get_content(bg),
173 cairo_t *tbg_ct = cairo_create(tbg);
178 cairo_set_source_surface(tbg_ct, bg, 0, 0);
179 cairo_set_operator(tbg_ct, CAIRO_OPERATOR_SOURCE);
181 cairo_destroy(tbg_ct);
195 cairo_surface_reference(
result);
204 cairo_t *r_ct = cairo_create(r);
209 cairo_set_source_surface(r_ct,
result, 0, 0);
210 cairo_set_operator(r_ct, CAIRO_OPERATOR_SOURCE);
221 cairo_surface_reference(
surface);
223 SlotMap::iterator s =
_slots.find(slot_nr);
225 cairo_surface_destroy(s->second);
233 g_return_if_fail(
surface !=
nullptr);
void copy_cairo_surface_ci(cairo_surface_t *in, cairo_surface_t *out)
cairo_surface_t * ink_cairo_extract_alpha(cairo_surface_t *s)
Extract the alpha channel into a new surface.
void ink_cairo_transform(cairo_t *ct, Geom::Affine const &m)
void set_cairo_surface_ci(cairo_surface_t *surface, SPColorInterpolation ci)
Set the color_interpolation_value for a Cairo surface.
Cairo integration helpers.
Cairo::RefPtr< Cairo::ImageSurface > surface
3x3 matrix representing an affine transformation.
bool isIdentity(Coord eps=EPSILON) const
Check whether this matrix is an identity matrix.
bool isTranslation(Coord eps=EPSILON) const
Check whether this matrix represents a pure translation.
static CRect from_xywh(Coord x, Coord y, Coord w, Coord h)
Create rectangle from origin and dimensions.
C top() const
Return top coordinate of the rectangle (+Y is downwards).
C left() const
Return leftmost coordinate of the rectangle (+X is to the right).
C height() const
Get the vertical extent of the rectangle.
C width() const
Get the horizontal extent of the rectangle.
CPoint min() const
Get the corner of the rectangle with smallest coordinate values.
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
Minimal wrapper over Cairo.
Geom::Rect targetLogicalBounds() const
void _set_internal(int slot, cairo_surface_t *s)
void set_primitive_area(int slot, Geom::Rect &area)
cairo_surface_t * getcairo(int slot)
Returns the pixblock in specified slot.
cairo_surface_t * _get_transformed_source_graphic() const
FilterUnits const & _units
void set(int slot, cairo_surface_t *s)
Sets or re-sets the pixblock associated with given slot.
FilterSlot(DrawingContext *bgdc, DrawingContext &graphic, FilterUnits const &units, RenderContext &rc, int blurquality)
Creates a new FilterSlot object.
Geom::IntRect _source_graphic_area
Geom::Rect get_slot_area() const
cairo_surface_t * get_result(int slot_nr)
cairo_surface_t * _get_transformed_background() const
~FilterSlot()
Destroys the FilterSlot object and all its contents.
Geom::Rect get_primitive_area(int slot) const
Geom::IntRect _background_area
needed to extract background
PrimitiveAreaMap _primitiveAreas
cairo_surface_t * _source_graphic
Geom::Affine get_matrix_display2pb() const
Gets the display coordinates to pixblock coordinates transformation matrix.
Geom::Affine get_matrix_pb2display() const
Gets the pixblock coordinates to display coordinates transformation matrix.
Geom::OptRect get_filter_area() const
Gets the filter effects area in user coordinates.
Cairo drawing context with Inkscape extensions.
Cairo surface that remembers its origin.
struct _cairo_surface cairo_surface_t
Various utility functions.
@ NR_FILTER_SOURCEGRAPHIC
@ NR_FILTER_BACKGROUNDALPHA
@ NR_FILTER_BACKGROUNDIMAGE
Helper class to stream background task notifications as a series of messages.
TODO: insert short description here.
@ SP_CSS_COLOR_INTERPOLATION_SRGB