42 if (tile_area.
width() == 0.0 || tile_area.
height() == 0.0) {
45 std::cerr <<
"FileTile::render_cairo: tile has zero width or height" << std::endl;
52 cairo_t *ct = cairo_create(out);
68 cairo_surface_t *tile = cairo_surface_create_similar(in, cairo_surface_get_content(in),
70 cairo_t *ct_tile = cairo_create(tile);
83 int tile_cols = std::ceil(pr.
width() / tile_area.
width());
84 int tile_rows = std::ceil(pr.
height() / tile_area.
height());
87 for (
int col = 0; col < tile_cols; ++col) {
88 for (
int row = 0; row < tile_rows; ++row) {
102 cairo_surface_destroy(out);
103 cairo_destroy(ct_tile);
104 cairo_surface_destroy(tile);
113 Geom::IntCoord max = std::numeric_limits<Geom::IntCoord>::max() / 4;
void copy_cairo_surface_ci(cairo_surface_t *in, cairo_surface_t *out)
cairo_surface_t * ink_cairo_surface_create_identical(cairo_surface_t *s)
Create a surface that differs only in pixel content.
Cairo integration helpers.
3x3 matrix representing an affine transformation.
Axis aligned, non-empty, generic rectangle.
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.
Geom::Rect filter_primitive_area(FilterUnits const &units) const
Returns the filter primitive area in user coordinate system.
cairo_surface_t * getcairo(int slot)
Returns the pixblock in specified slot.
void set(int slot, cairo_surface_t *s)
Sets or re-sets the pixblock associated with given slot.
Geom::Rect get_slot_area() const
Geom::Rect get_primitive_area(int slot) const
FilterUnits const & get_units() const
void render_cairo(FilterSlot &slot) const override
double complexity(Geom::Affine const &ctm) const override
void area_enlarge(Geom::IntRect &area, Geom::Affine const &trans) const override
Geom::Affine get_matrix_user2pb() const
Gets the user coordinates to pixblock coordinates transformation matrix.
struct _cairo_surface cairo_surface_t
int IntCoord
Type used for integral coordinates.
void shift(T &a, T &b, T const &c)
GenericRect< IntCoord > IntRect
Helper class to stream background task notifications as a series of messages.