Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/basis_universal/encoder/3rdparty/android_astc_decomp.h
9906 views
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
27
#include <vector>
28
#include <stdint.h>
29
30
namespace basisu_astc
31
{
32
namespace astc
33
{
34
35
// Unpacks a single ASTC block to pDst
36
// If isSRGB is true, the spec requires the decoder to scale the LDR 8-bit endpoints to 16-bit before interpolation slightly differently,
37
// which will lead to different outputs. So be sure to set it correctly (ideally it should match whatever the encoder did).
38
bool decompress_ldr(uint8_t* pDst, const uint8_t* data, bool isSRGB, int blockWidth, int blockHeight);
39
bool decompress_hdr(float* pDstRGBA, const uint8_t* data, int blockWidth, int blockHeight);
40
bool is_hdr(const uint8_t* data, int blockWidth, int blockHeight, bool& is_hdr);
41
42
} // astc
43
} // basisu
44
45
#endif
46
47