aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-05-08 18:46:32 +0800
committercrupest <crupest@outlook.com>2022-05-08 18:46:32 +0800
commita7ca9057de3a01d5071406828f134e2e3bcfb49c (patch)
treed5fb0ce03ba86b1cb6db36ad6922a5ed0f0d9810 /include
parent75c8a508acc3388b2c2f624bdf00fb155cd914f9 (diff)
downloadcru-a7ca9057de3a01d5071406828f134e2e3bcfb49c.tar.gz
cru-a7ca9057de3a01d5071406828f134e2e3bcfb49c.tar.bz2
cru-a7ca9057de3a01d5071406828f134e2e3bcfb49c.zip
...
Diffstat (limited to 'include')
-rw-r--r--include/cru/osx/graphics/quartz/Convert.h1
-rw-r--r--include/cru/osx/graphics/quartz/ImageFactory.h2
-rw-r--r--include/cru/platform/graphics/ImageFactory.h4
3 files changed, 5 insertions, 2 deletions
diff --git a/include/cru/osx/graphics/quartz/Convert.h b/include/cru/osx/graphics/quartz/Convert.h
index 8d486069..be56b959 100644
--- a/include/cru/osx/graphics/quartz/Convert.h
+++ b/include/cru/osx/graphics/quartz/Convert.h
@@ -20,4 +20,5 @@ CGRect Convert(const Rect& rect);
Rect Convert(const CGRect& rect);
CGDataProviderRef ConvertStreamToCGDataProvider(io::Stream* stream);
+CGDataConsumerRef ConvertStreamToCGDataConsumer(io::Stream* stream);
} // namespace cru::platform::graphics::osx::quartz
diff --git a/include/cru/osx/graphics/quartz/ImageFactory.h b/include/cru/osx/graphics/quartz/ImageFactory.h
index 19e9c8c1..23d14332 100644
--- a/include/cru/osx/graphics/quartz/ImageFactory.h
+++ b/include/cru/osx/graphics/quartz/ImageFactory.h
@@ -15,6 +15,8 @@ class QuartzImageFactory : public OsxQuartzResource,
public:
std::unique_ptr<IImage> DecodeFromStream(io::Stream* stream) override;
+ void EncodeToStream(IImage* image, io::Stream* stream, ImageFormat format,
+ float quality) override;
std::unique_ptr<IImage> 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 2339a069..cd868087 100644
--- a/include/cru/platform/graphics/ImageFactory.h
+++ b/include/cru/platform/graphics/ImageFactory.h
@@ -3,7 +3,7 @@
#include "cru/common/io/Stream.h"
namespace cru::platform::graphics {
-enum class ImageFormat { Jpeg, Png };
+enum class ImageFormat { Jpeg, Png, Gif };
struct CRU_PLATFORM_GRAPHICS_API IImageFactory
: public virtual IGraphicsResource {
@@ -15,7 +15,7 @@ struct CRU_PLATFORM_GRAPHICS_API IImageFactory
* \param stream The stream to write to.
* \param format The format to encode to.
* \param quality The quality to encode to.
- * \todo Implement on macOS and Windows.
+ * \todo Implement on Windows.
*/
virtual void EncodeToStream(IImage* image, io::Stream* stream,
ImageFormat format, float quality) = 0;