aboutsummaryrefslogtreecommitdiff
path: root/include/cru
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-02 19:52:24 +0800
committercrupest <crupest@outlook.com>2022-02-02 19:52:24 +0800
commit41623c6ad6f42ca5d6e9a38061f809929641e5c6 (patch)
tree594df8c4450d42eec9d8ef2daab56e3fe7791276 /include/cru
parentf0beab8e5f84ba2c5367f7edadebff0af95d1626 (diff)
downloadcru-41623c6ad6f42ca5d6e9a38061f809929641e5c6.tar.gz
cru-41623c6ad6f42ca5d6e9a38061f809929641e5c6.tar.bz2
cru-41623c6ad6f42ca5d6e9a38061f809929641e5c6.zip
...
Diffstat (limited to 'include/cru')
-rw-r--r--include/cru/osx/graphics/quartz/Image.hpp6
-rw-r--r--include/cru/platform/graphics/Image.hpp6
2 files changed, 11 insertions, 1 deletions
diff --git a/include/cru/osx/graphics/quartz/Image.hpp b/include/cru/osx/graphics/quartz/Image.hpp
index 16b1ca2c..62b7fa8b 100644
--- a/include/cru/osx/graphics/quartz/Image.hpp
+++ b/include/cru/osx/graphics/quartz/Image.hpp
@@ -17,9 +17,15 @@ class QuartzImage : public OsxQuartzResource, public virtual IImage {
~QuartzImage() override;
public:
+ float GetWidth() override;
+ float GetHeight() override;
+
+ std::unique_ptr<IImage> CreateWithRect(const Rect& rect) override;
+
CGImageRef GetCGImage() const { return image_; }
private:
+ IImageFactory* image_factory_;
CGImageRef image_;
bool auto_release_ = false;
};
diff --git a/include/cru/platform/graphics/Image.hpp b/include/cru/platform/graphics/Image.hpp
index bf1e8545..e8bf6671 100644
--- a/include/cru/platform/graphics/Image.hpp
+++ b/include/cru/platform/graphics/Image.hpp
@@ -2,5 +2,9 @@
#include "Resource.hpp"
namespace cru::platform::graphics {
-struct CRU_PLATFORM_GRAPHICS_API IImage : public virtual IGraphicsResource {};
+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;
+};
} // namespace cru::platform::graphics