android_astc_decomp.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // File: android_astc_decomp.h
  2. #ifndef _TCUASTCUTIL_HPP
  3. #define _TCUASTCUTIL_HPP
  4. /*-------------------------------------------------------------------------
  5. * drawElements Quality Program Tester Core
  6. * ----------------------------------------
  7. *
  8. * Copyright 2016 The Android Open Source Project
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. *
  22. *//*!
  23. * \file
  24. * \brief ASTC Utilities.
  25. *//*--------------------------------------------------------------------*/
  26. #include <vector>
  27. #include <stdint.h>
  28. namespace basisu_astc
  29. {
  30. namespace astc
  31. {
  32. // Unpacks a single ASTC block to pDst
  33. // If isSRGB is true, the spec requires the decoder to scale the LDR 8-bit endpoints to 16-bit before interpolation slightly differently,
  34. // which will lead to different outputs. So be sure to set it correctly (ideally it should match whatever the encoder did).
  35. bool decompress_ldr(uint8_t* pDst, const uint8_t* data, bool isSRGB, int blockWidth, int blockHeight);
  36. bool decompress_hdr(float* pDstRGBA, const uint8_t* data, int blockWidth, int blockHeight);
  37. bool is_hdr(const uint8_t* data, int blockWidth, int blockHeight, bool& is_hdr);
  38. } // astc
  39. } // basisu
  40. #endif