Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
drawing-image.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
6 * Authors:
7 * Krzysztof KosiƄski <tweenk.pl@gmail.com>
8 *
9 * Copyright (C) 2011 Authors
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#ifndef INKSCAPE_DISPLAY_DRAWING_IMAGE_H
14#define INKSCAPE_DISPLAY_DRAWING_IMAGE_H
15
16#include <memory>
17#include <2geom/transforms.h>
18#include <gdk-pixbuf/gdk-pixbuf.h>
19#include <cairo.h>
20
22
23namespace Inkscape {
24class Pixbuf;
25
27 : public DrawingItem
28{
29public:
31 int tag() const override { return tag_of<decltype(*this)>; }
32
33 void setStyle(SPStyle const *style, SPStyle const *context_style = nullptr) override;
34
35 void setPixbuf(std::shared_ptr<Inkscape::Pixbuf const> pb);
36 void setScale(double sx, double sy);
37 void setOrigin(Geom::Point const &o);
38 void setClipbox(Geom::Rect const &box);
39 Geom::Rect bounds() const;
40
41protected:
42 ~DrawingImage() override = default;
43
44 unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx, unsigned flags, unsigned reset) override;
45 unsigned _renderItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const override;
46 DrawingItem *_pickItem(Geom::Point const &p, double delta, unsigned flags) override;
47
48 std::shared_ptr<Inkscape::Pixbuf const> _pixbuf;
49
51
52 // TODO: the following three should probably be merged into a new Geom::Viewbox object
56};
57
58} // namespace Inkscape
59
60#endif // INKSCAPE_DISPLAY_DRAWING_IMAGE_H
61
62/*
63 Local Variables:
64 mode:c++
65 c-file-style:"stroustrup"
66 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
67 indent-tabs-mode:nil
68 fill-column:99
69 End:
70*/
71// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
Axis aligned, non-empty, generic rectangle.
Two-dimensional point that doubles as a vector.
Definition point.h:66
Axis aligned, non-empty rectangle.
Definition rect.h:92
Scaling from the origin.
Definition transforms.h:150
Minimal wrapper over Cairo.
void setClipbox(Geom::Rect const &box)
void setScale(double sx, double sy)
Geom::Rect _clipbox
for preserveAspectRatio
SPImageRendering style_image_rendering
unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx, unsigned flags, unsigned reset) override
~DrawingImage() override=default
unsigned _renderItem(DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const override
void setPixbuf(std::shared_ptr< Inkscape::Pixbuf const > pb)
void setOrigin(Geom::Point const &o)
std::shared_ptr< Inkscape::Pixbuf const > _pixbuf
Geom::Rect bounds() const
int tag() const override
Unlink this node and its subtree from the rendering tree and destroy.
void setStyle(SPStyle const *style, SPStyle const *context_style=nullptr) override
Process information related to the new style.
DrawingItem * _pickItem(Geom::Point const &p, double delta, unsigned flags) override
SVG drawing item for display.
Drawing & drawing() const
An SVG style object.
Definition style.h:45
RectangularCluster rc
Canvas item belonging to an SVG drawing element.
Helper class to stream background task notifications as a series of messages.
SPImageRendering
int delta
Affine transformation classes.