aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graphics/Image.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-05-05 20:05:35 +0800
committercrupest <crupest@outlook.com>2022-05-05 20:05:35 +0800
commit56a8047c4093c928b8551bbacda796382984512e (patch)
tree8891fef971686184511af6b98d111f1b68c13fd0 /include/cru/platform/graphics/Image.h
parent7b4b334e777e573040569801d3b4ab28a606a127 (diff)
downloadcru-56a8047c4093c928b8551bbacda796382984512e.tar.gz
cru-56a8047c4093c928b8551bbacda796382984512e.tar.bz2
cru-56a8047c4093c928b8551bbacda796382984512e.zip
...
Diffstat (limited to 'include/cru/platform/graphics/Image.h')
-rw-r--r--include/cru/platform/graphics/Image.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/cru/platform/graphics/Image.h b/include/cru/platform/graphics/Image.h
index 51e27678..17d2170e 100644
--- a/include/cru/platform/graphics/Image.h
+++ b/include/cru/platform/graphics/Image.h
@@ -6,5 +6,20 @@ struct CRU_PLATFORM_GRAPHICS_API IImage : public virtual IGraphicsResource {
virtual float GetWidth() = 0;
virtual float GetHeight() = 0;
virtual std::unique_ptr<IImage> CreateWithRect(const Rect& rect) = 0;
+
+ /**
+ * \brief Create a painter for this image.
+ * \remarks Not all image could create a painter. If not this method will
+ * throw. Currently we only ensure images returned by
+ * IImageFactory::CreateBitmap or CloneToBitmap can create a painter.
+ */
+ virtual std::unique_ptr<IPainter> CreatePainter() = 0;
+
+ /**
+ * \brief Create a bitmap image with the same pixels as this image's.
+ * \remarks This method can be used to create a bitmap image, so you can draw
+ * on the new bitmap, if the original image can't be directly painted.
+ */
+ virtual std::unique_ptr<IImage> CloneToBitmap();
};
} // namespace cru::platform::graphics