summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/ImageConversion.h
blob: 31ed2e06fee8fcd3b8cf4bba3480e8a6e2a6bc56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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