MCPcopy Create free account
hub / github.com/DISTRHO/DPF / CairoImage

Class CairoImage

dgl/Cairo.hpp:44–120  ·  view source on GitHub ↗

Cairo Image class. TODO ... */

Source from the content-addressed store, hash-verified

42 TODO ...
43 */
44class CairoImage : public ImageBase
45{
46public:
47 /**
48 Constructor for a null Image.
49 */
50 CairoImage();
51
52 /**
53 Constructor using raw image data.
54 @note @a rawData must remain valid for the lifetime of this Image.
55 */
56 CairoImage(const char* rawData, uint width, uint height, ImageFormat format);
57
58 /**
59 Constructor using raw image data.
60 @note @a rawData must remain valid for the lifetime of this Image.
61 */
62 CairoImage(const char* rawData, const Size<uint>& size, ImageFormat format);
63
64 /**
65 Constructor using another image data.
66 */
67 CairoImage(const CairoImage& image);
68
69 /**
70 Destructor.
71 */
72 ~CairoImage() override;
73
74 /**
75 Load raw image data from memory.
76 @note @a rawData must remain valid for the lifetime of this Image.
77 */
78 void loadFromMemory(const char* rawData,
79 const Size<uint>& size,
80 ImageFormat format = kImageFormatBGRA) noexcept override;
81
82 /**
83 Load PNG image from memory.
84 Image size is read from PNG contents.
85 @note @a pngData must remain valid for the lifetime of this Image.
86 */
87 void loadFromPNG(const char* pngData, uint dataSize) noexcept;
88
89 /**
90 Draw this image at position @a pos using the graphics context @a context.
91 */
92 void drawAt(const GraphicsContext& context, const Point<int>& pos) override;
93
94 /**
95 Get the cairo surface currently associated with this image.
96 FIXME might be removed
97 */
98 inline cairo_surface_t* getSurface() const noexcept
99 {
100 return surface;
101 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected