summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/ImageConversion.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Graphics/ImageConversion.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/Graphics/ImageConversion.h')
-rw-r--r--Runtime/Graphics/ImageConversion.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Runtime/Graphics/ImageConversion.h b/Runtime/Graphics/ImageConversion.h
new file mode 100644
index 0000000..31ed2e0
--- /dev/null
+++ b/Runtime/Graphics/ImageConversion.h
@@ -0,0 +1,28 @@
+#ifndef _IMAGECONVERSION_H
+#define _IMAGECONVERSION_H
+
+#include "Runtime/Utilities/dynamic_array.h"
+
+class ImageReference;
+class Texture2D;
+typedef dynamic_array<UInt8> MemoryBuffer;
+
+bool ConvertImageToPNGBuffer( const ImageReference& image, MemoryBuffer& buffer );
+
+enum LoadImageCompression {
+ kLoadImageUncompressed = 0,
+ kLoadImageDXTCompress,
+ kLoadImageDXTCompressDithered,
+};
+bool LoadMemoryBufferIntoTexture( Texture2D& tex, const UInt8* data, size_t size, LoadImageCompression compression, bool markNonReadable=false );
+
+
+// hack: this is used only by capture screenshot. Compile code out if it's not
+// available
+#include "Runtime/Misc/CaptureScreenshot.h"
+#if CAPTURE_SCREENSHOT_AVAILABLE
+bool ConvertImageToPNGFile( const ImageReference& image, const std::string& path );
+#endif
+
+
+#endif