From 7b4b334e777e573040569801d3b4ab28a606a127 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 5 May 2022 19:31:18 +0800 Subject: ... --- include/cru/osx/graphics/quartz/ImageFactory.h | 1 + include/cru/platform/graphics/ImageFactory.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/cru/osx/graphics/quartz/ImageFactory.h b/include/cru/osx/graphics/quartz/ImageFactory.h index e9854738..19e9c8c1 100644 --- a/include/cru/osx/graphics/quartz/ImageFactory.h +++ b/include/cru/osx/graphics/quartz/ImageFactory.h @@ -15,5 +15,6 @@ class QuartzImageFactory : public OsxQuartzResource, public: std::unique_ptr DecodeFromStream(io::Stream* stream) override; + std::unique_ptr CreateBitmap(int width, int height) override; }; } // namespace cru::platform::graphics::osx::quartz diff --git a/include/cru/platform/graphics/ImageFactory.h b/include/cru/platform/graphics/ImageFactory.h index 2a7902b2..e74f57e0 100644 --- a/include/cru/platform/graphics/ImageFactory.h +++ b/include/cru/platform/graphics/ImageFactory.h @@ -7,5 +7,12 @@ namespace cru::platform::graphics { struct CRU_PLATFORM_GRAPHICS_API IImageFactory : public virtual IGraphicsResource { virtual std::unique_ptr DecodeFromStream(io::Stream* stream) = 0; + + /** + * \brief Create an empty bitmap with given width and height. + * \remarks Implementation should ensure that the bitmap supports alpha + * channel. It had better be in 32-bit rgba format. + */ + virtual std::unique_ptr CreateBitmap(int width, int height) = 0; }; } // namespace cru::platform::graphics -- cgit v1.2.3