39 std::vector<SPItem const *>
items,
41 uint32_t
const *checkerboard_color,
43 std::optional<Antialiasing> antialias)
54 int width = std::ceil(scale_factor * area.
width());
64 auto invoke_hide_guard =
scope_exit([&] { document->
getRoot()->invoke_hide(dkey); });
76 drawing.
update(final_area);
90 if (cairo_surface_status(
surface) != CAIRO_STATUS_SUCCESS) {
91 long long size = (
long long)
height * (
long long)cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,
width);
92 g_warning(
"sp_generate_internal_bitmap: not enough memory to create pixel buffer. Need %lld.",
size);
99 if (checkerboard_color) {
107 cairo_pattern_destroy(pattern);
113 if (device_scale != 1.0) {
114 cairo_surface_set_device_scale(
surface, device_scale, device_scale);
cairo_pattern_t * ink_cairo_pattern_create_checkerboard(guint32 rgba, bool use_alpha)
Cairo integration helpers.
Cairo::RefPtr< Cairo::ImageSurface > surface
3x3 matrix representing an affine transformation.
static CRect from_xywh(C x, C y, C w, C h)
Create rectangle from origin and dimensions.
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.
bool hasZeroArea(Coord eps=EPSILON) const
Check whether the rectangle has zero area up to specified tolerance.
Minimal wrapper over Cairo.
void setSource(cairo_pattern_t *source)
void transform(Geom::Affine const &trans)
void paint(double alpha=1.0)
void setOperator(cairo_operator_t op)
void setOpacity(float opacity)
void setTransform(Geom::Affine const &trans)
void setRoot(DrawingItem *root)
void update(Geom::IntRect const &area=Geom::IntRect::infinite(), Geom::Affine const &affine=Geom::identity(), unsigned flags=DrawingItem::STATE_ALL, unsigned reset=0)
void render(DrawingContext &dc, Geom::IntRect const &area, unsigned flags=0) const
void setAntialiasingOverride(std::optional< Antialiasing > antialiasing_override)
Class to hold image data for raster images.
static double convert(double from_dist, Unit const *from, Unit const *to)
Convert distances.
Typed SVG document implementation.
SPRoot * getRoot()
Returns our SPRoot.
int ensureUpToDate(unsigned int object_modified_tag=0)
Repeatedly works on getting the document updated, since sometimes it takes more than one pass to get ...
Inkscape::DrawingItem * invoke_show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags)
Inkscape::DrawingItem * get_arenaitem(unsigned key) const
Return the arenaitem corresponding to the given item in the display with the given key.
static unsigned int display_key_new(unsigned numkeys)
Allocates unique integer keys.
void invoke_hide_except(unsigned key, const std::vector< SPItem const * > &to_keep)
Invoke hide on all non-group items, except for the list of items to keep.
Cairo drawing context with Inkscape extensions.
struct _cairo_surface cairo_surface_t
Inkscape::Pixbuf * sp_generate_internal_bitmap(SPDocument *document, Geom::Rect const &area, double dpi, std::vector< SPItem const * > items, bool opaque, uint32_t const *checkerboard_color, double device_scale, std::optional< Antialiasing > antialias)
Generates a bitmap from given items.
SPRoot: SVG <svg> implementation.