aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/graphics/direct/ImageFactory.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-01 18:49:55 +0800
committercrupest <crupest@outlook.com>2022-02-01 18:49:55 +0800
commitd1c14725443399f7145e314d79597ec35b639eeb (patch)
tree50c6743d6766cdc6fd04921d305380143b42d3dc /include/cru/win/graphics/direct/ImageFactory.hpp
parentb9a553d4acc15ec981636b30db537be280d593e5 (diff)
downloadcru-d1c14725443399f7145e314d79597ec35b639eeb.tar.gz
cru-d1c14725443399f7145e314d79597ec35b639eeb.tar.bz2
cru-d1c14725443399f7145e314d79597ec35b639eeb.zip
...
Diffstat (limited to 'include/cru/win/graphics/direct/ImageFactory.hpp')
-rw-r--r--include/cru/win/graphics/direct/ImageFactory.hpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/cru/win/graphics/direct/ImageFactory.hpp b/include/cru/win/graphics/direct/ImageFactory.hpp
new file mode 100644
index 00000000..fa450039
--- /dev/null
+++ b/include/cru/win/graphics/direct/ImageFactory.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "Resource.hpp"
+#include "cru/platform/graphics/Image.hpp"
+#include "cru/platform/graphics/ImageFactory.hpp"
+
+namespace cru::platform::graphics::win::direct {
+class CRU_WIN_GRAPHICS_DIRECT_API WinImageFactory
+ : public DirectGraphicsResource,
+ public virtual IImageFactory {
+ public:
+ explicit WinImageFactory(DirectGraphicsFactory* graphics_factory);
+
+ CRU_DELETE_COPY(WinImageFactory)
+ CRU_DELETE_MOVE(WinImageFactory)
+
+ ~WinImageFactory() override;
+
+ public:
+ std::unique_ptr<IImage> DecodeFromStream(io::Stream* stream) override;
+
+ private:
+ DirectGraphicsFactory* graphics_factory_;
+
+ Microsoft::WRL::ComPtr<IWICImagingFactory> wic_imaging_factory_;
+};
+} // namespace cru::platform::graphics::win::direct