Path: blob/master/thirdparty/basis_universal/encoder/3rdparty/android_astc_decomp.h
9906 views
// File: android_astc_decomp.h1#ifndef _TCUASTCUTIL_HPP2#define _TCUASTCUTIL_HPP3/*-------------------------------------------------------------------------4* drawElements Quality Program Tester Core5* ----------------------------------------6*7* Copyright 2016 The Android Open Source Project8*9* Licensed under the Apache License, Version 2.0 (the "License");10* you may not use this file except in compliance with the License.11* You may obtain a copy of the License at12*13* http://www.apache.org/licenses/LICENSE-2.014*15* Unless required by applicable law or agreed to in writing, software16* distributed under the License is distributed on an "AS IS" BASIS,17* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.18* See the License for the specific language governing permissions and19* limitations under the License.20*21*//*!22* \file23* \brief ASTC Utilities.24*//*--------------------------------------------------------------------*/2526#include <vector>27#include <stdint.h>2829namespace basisu_astc30{31namespace astc32{3334// Unpacks a single ASTC block to pDst35// If isSRGB is true, the spec requires the decoder to scale the LDR 8-bit endpoints to 16-bit before interpolation slightly differently,36// which will lead to different outputs. So be sure to set it correctly (ideally it should match whatever the encoder did).37bool decompress_ldr(uint8_t* pDst, const uint8_t* data, bool isSRGB, int blockWidth, int blockHeight);38bool decompress_hdr(float* pDstRGBA, const uint8_t* data, int blockWidth, int blockHeight);39bool is_hdr(const uint8_t* data, int blockWidth, int blockHeight, bool& is_hdr);4041} // astc42} // basisu4344#endif454647