18#include <cairomm/surface.h>
19#include <glibmm/ustring.h>
20#include <giomm/file.h>
21#include <gdkmm/pixbuf.h>
22#include <gdkmm/rgba.h>
40 throw std::runtime_error{message};
42 return std::forward<T>(t);
52 , _document{*_optional_storage}
60 for (
auto el : objects) {
63 el->changeCSS(
css,
"style");
67 return objects.size();
79 auto dpi = 96 * device_scale *
_scale;
88 if (!pixbuf)
return {};
91 auto raw = Glib::wrap(pixbuf->getPixbufRaw(),
true);
98 if (!pixbuf)
return Cairo::RefPtr<Cairo::ImageSurface>();
101 auto surface = Cairo::RefPtr<Cairo::ImageSurface>(
new Cairo::ImageSurface(pixbuf->getSurfaceRaw(),
false));
Cairo integration helpers.
Cairo::RefPtr< Cairo::ImageSurface > surface
Class to hold image data for raster images.
double value(Unit const *u) const
Return the quantity's value in the specified unit.
double get_width_px() const
Pixbuf * do_render(double device_scale)
void set_scale(double scale)
double get_height_px() const
std::optional< uint32_t > _checkerboard
size_t set_style(const Glib::ustring &selector, const char *name, const Glib::ustring &value)
Glib::RefPtr< Gdk::Pixbuf > render(double scale)
Cairo::RefPtr< Cairo::ImageSurface > render_surface(double scale)
svg_renderer(char const *path)
Typed SVG document implementation.
Inkscape::Util::Quantity getWidth() const
Geom::OptRect preferredBounds() const
Inkscape::Util::Quantity getHeight() const
std::vector< SPObject * > getObjectsBySelector(Glib::ustring const &selector) const
Inkscape::XML::Node * _root
Reference to the clipboard's root node.
std::shared_ptr< Css const > css
std::unique_ptr< SPDocument > ink_file_open(std::span< char const > buffer)
Open a document from memory.
Helper class to stream background task notifications as a series of messages.
static auto ensure_nonnull(T &&t, char const *message)
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.
void sp_repr_css_attr_unref(SPCSSAttr *css)
Unreferences an SPCSSAttr (will be garbage collected if no references remain).
SPCSSAttr * sp_repr_css_attr(Node const *repr, gchar const *attr)
Creates a new SPCSSAttr with one attribute (i.e.
void sp_repr_css_set_property(SPCSSAttr *css, gchar const *name, gchar const *value)
Set a style property to a new value (e.g.
C facade to Inkscape::XML::Node.
SPRoot: SVG <svg> implementation.