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/DXTCompression.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Runtime/Graphics/DXTCompression.h (limited to 'Runtime/Graphics/DXTCompression.h') 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 -- cgit v1.1-26-g67d0