/*
6 * Lauris Kaplinski <lauris@kaplinski.com>
9 * Copyright (C) 1999-2005 Authors
10 * Copyright (C) 2000-2001 Ximian, Inc.
12 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
15#ifndef SEEN_INKSCAPE_SP_IMAGE_H
16#define SEEN_INKSCAPE_SP_IMAGE_H
22#include <glibmm/ustring.h>
28#define SP_IMAGE_HREF_MODIFIED_FLAG SP_OBJECT_USER_MODIFIED_FLAG_A
30namespace Inkscape {
class Pixbuf;
class URI; }
35 int tag()
const override {
return tag_of<
decltype(*this)>; }
43 std::optional<Geom::PathVector>
curve;
48 std::shared_ptr<Inkscape::Pixbuf const>
pixbuf;
56 void modified(
unsigned int flags)
override;
60 const char*
typeName()
const override;
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
3x3 matrix representing an affine transformation.
Axis aligned, non-empty, generic rectangle.
Axis-aligned rectangle that can be empty.
Axis aligned, non-empty rectangle.
SVG drawing item for display.
Class to hold image data for raster images.
Storing of snapping preferences.
Represents an URI as per RFC 2396.
Interface for refcounted XML nodes.
Typed SVG document implementation.
static Inkscape::Pixbuf * readImage(gchar const *href, gchar const *absref, gchar const *base, double svgdpi=0)
std::optional< Geom::PathVector > curve
Inkscape::DrawingItem * show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override
Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType type) const override
static Inkscape::Pixbuf * getBrokenImage(double width, double height)
Load a standard broken image svg, used if we fail to load pixbufs from the href.
const char * displayName() const override
The item's type name as a translated human string.
std::shared_ptr< Inkscape::Pixbuf const > pixbuf
bool cropToArea(Geom::Rect area)
Crop the image (remove pixels) based on the area rectangle and translate image to componsate for move...
void print(SPPrintContext *ctx) override
void update(SPCtx *ctx, unsigned int flags) override
const char * typeName() const override
The item's type name, not node tag name.
void apply_profile(Inkscape::Pixbuf *pixbuf)
void modified(unsigned int flags) override
char * description() const override
Geom::Affine set_transform(Geom::Affine const &transform) override
void snappoints(std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const override
Geom::PathVector const * get_curve() const
Return a borrowed pointer to curve (if any exists) or NULL if there is no curve.
Inkscape::URI getURI() const
Return this image's href as a URI object.
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
void build(SPDocument *document, Inkscape::XML::Node *repr) override
void refresh_if_outdated()
Base class for visual SVG elements.
Inkscape::XML::Node * repr
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
PathVector - a sequence of subpaths.
void sp_embed_svg(Inkscape::XML::Node *image_node, std::string const &fn)
void sp_embed_image(Inkscape::XML::Node *imgnode, Inkscape::Pixbuf *pb)
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
Interface for XML documents.