From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Graphics/ImageConversion.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Runtime/Graphics/ImageConversion.h (limited to 'Runtime/Graphics/ImageConversion.h') 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 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 -- cgit v1.1-26-g67d0