stb_dxt.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-FileCopyrightText: fabian "ryg" giesen
  2. // SPDX-License-Identifier: MIT
  3. // stb_dxt.h - v1.12 - DXT1/DXT5 compressor
  4. #ifndef STB_INCLUDE_STB_DXT_H
  5. #define STB_INCLUDE_STB_DXT_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #ifdef STB_DXT_STATIC
  10. #define STBDDEF static
  11. #else
  12. #define STBDDEF extern
  13. #endif
  14. // compression mode (bitflags)
  15. #define STB_DXT_NORMAL 0
  16. #define STB_DXT_DITHER 1 // use dithering. was always dubious, now deprecated. does nothing!
  17. #define STB_DXT_HIGHQUAL \
  18. 2 // high quality mode, does two refinement steps instead of 1. ~30-40% slower.
  19. STBDDEF void stb_compress_bc1_block(unsigned char* dest,
  20. const unsigned char* src_rgba_four_bytes_per_pixel, int alpha,
  21. int mode);
  22. STBDDEF void stb_compress_bc3_block(unsigned char* dest, const unsigned char* src, int mode);
  23. #define STB_COMPRESS_DXT_BLOCK
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif // STB_INCLUDE_STB_DXT_H