diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Graphics/DXTCompression.h |
Diffstat (limited to 'Runtime/Graphics/DXTCompression.h')
-rw-r--r-- | Runtime/Graphics/DXTCompression.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Runtime/Graphics/DXTCompression.h b/Runtime/Graphics/DXTCompression.h new file mode 100644 index 0000000..414c23e --- /dev/null +++ b/Runtime/Graphics/DXTCompression.h @@ -0,0 +1,13 @@ +// Fast DXT compression code adapted from +// stb_dxt by Sean Barrett: http://nothings.org/stb/stb_dxt.h +// which is in turn adapted from code by +// Fabian "ryg" Giesen: http://www.farbrausch.de/~fg/code/dxt/ + +#ifndef __DXT_COMPRESSION__ +#define __DXT_COMPRESSION__ + +// src: 32 bit/pixel width*height image, R,G,B,A bytes in pixel. +// dest must be (width+3)/4*(height+3)/4 bytes if dxt5=true, and half of that if dxt5=false (dxt1 is used then). +void FastCompressImage (int width, int height, const UInt8* src, UInt8* dest, bool dxt5, bool dither ); + +#endif |