55 double feImageX = vp.
left();
56 double feImageY = vp.
top();
57 double feImageWidth = vp.
width();
58 double feImageHeight = vp.
height();
72 if (feImageWidth == 0) feImageWidth = bbox_width;
73 if (feImageHeight == 0) feImageHeight = bbox_height;
79 cairo_surface_set_device_scale(out, device_scale, device_scale);
102 auto image_width = area->width();
103 auto image_height = area->height();
109 double feAspect = feImageHeight / feImageWidth;
110 double aspect = (double)image_height / image_width;
111 bool ratio = feAspect < aspect;
162 feImageY -= ay * (feImageWidth * aspect - feImageHeight);
163 feImageHeight = feImageWidth * aspect;
166 feImageX -= ax * (feImageHeight / aspect - feImageWidth);
167 feImageWidth = feImageHeight / aspect;
175 feImageX += ax * (feImageWidth - feImageHeight / aspect );
176 feImageWidth = feImageHeight / aspect;
179 feImageY += ay * (feImageHeight - feImageWidth * aspect);
180 feImageHeight = feImageWidth * aspect;
185 double scaleX = feImageWidth / image_width;
186 double scaleY = feImageHeight / image_height;
189 dc.
scale(scaleX, scaleY);
194 cairo_surface_destroy(out);
void set_cairo_surface_ci(cairo_surface_t *surface, SPColorInterpolation ci)
Set the color_interpolation_value for a Cairo surface.
Cairo integration helpers.
3x3 matrix representing an affine transformation.
Affine inverse() const
Compute the inverse matrix.
Axis aligned, non-empty, generic rectangle.
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.
Axis-aligned rectangle that can be empty.
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
Minimal wrapper over Cairo.
void scale(Geom::Scale const &s)
void transform(Geom::Affine const &trans)
void translate(Geom::Point const &t)
unsigned render(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags=0, DrawingItem const *stop_at=nullptr) const
Rasterize items.
Geom::OptIntRect const & drawbox() const
void update(Geom::IntRect const &area=Geom::IntRect::infinite(), UpdateContext const &ctx=UpdateContext(), unsigned flags=STATE_ALL, unsigned reset=0)
Update derived data before operations.
bool can_handle_affine(Geom::Affine const &) const override
Indicate whether the filter primitive can handle the given affine.
Inkscape::DrawingItem * item
void set_align(unsigned align)
void set_clip(unsigned clip)
double complexity(Geom::Affine const &ctm) const override
void render_cairo(FilterSlot &slot) const override
Geom::Rect filter_primitive_area(FilterUnits const &units) const
Returns the filter primitive area in user coordinate system.
void set_primitive_area(int slot, Geom::Rect &area)
void set(int slot, cairo_surface_t *s)
Sets or re-sets the pixblock associated with given slot.
int get_device_scale() const
Gets the device scale; for high DPI monitors.
Geom::Rect get_slot_area() const
RenderContext & get_rendercontext() const
FilterUnits const & get_units() const
Geom::Affine get_matrix_user2filterunits() const
Gets the user coordinates to filterUnits transformation matrix.
Geom::Affine get_matrix_user2pb() const
Gets the user coordinates to pixblock coordinates transformation matrix.
Cairo drawing context with Inkscape extensions.
Canvas item belonging to an SVG drawing element.
struct _cairo_surface cairo_surface_t
Angle distance(Angle const &a, Angle const &b)
Helper class to stream background task notifications as a series of messages.
static T clip(T const &v, T const &a, T const &b)
@ SP_CSS_COLOR_INTERPOLATION_SRGB