Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/libktx/lib/texture2.h
9906 views
1
/* -*- tab-width: 4; -*- */
2
/* vi: set sw=2 ts=4 expandtab textwidth=70: */
3
4
/*
5
* Copyright 2019-2020 The Khronos Group Inc.
6
* SPDX-License-Identifier: Apache-2.0
7
*/
8
9
/**
10
* @internal
11
* @file
12
* @~English
13
*
14
* @brief Declare internal ktxTexture2 functions for sharing between
15
* compilation units.
16
*
17
* These functions are private and should not be used outside the library.
18
*/
19
20
#ifndef _TEXTURE2_H_
21
#define _TEXTURE2_H_
22
23
#include "texture.h"
24
25
#ifdef __cplusplus
26
extern "C" {
27
#endif
28
29
#define CLASS ktxTexture2
30
#include "texture_funcs.inl"
31
#undef CLASS
32
33
typedef struct ktxTexture2_private {
34
ktx_uint8_t* _supercompressionGlobalData;
35
ktx_uint32_t _requiredLevelAlignment;
36
ktx_uint64_t _sgdByteLength;
37
ktx_uint64_t _firstLevelFileOffset; /*!< Always 0, unless the texture was
38
created from a stream and the image
39
data is not yet loaded. */
40
// Must be last so it can grow.
41
ktxLevelIndexEntry _levelIndex[1]; /*!< Offsets in this index are from the
42
start of the image data. Use
43
ktxTexture_levelStreamOffset() and
44
ktxTexture_levelDataOffset(). The former
45
will add the above file offset to the
46
index offset. */
47
} ktxTexture2_private;
48
49
50
KTX_error_code
51
ktxTexture2_constructCopy(ktxTexture2* This, ktxTexture2* orig);
52
KTX_error_code
53
ktxTexture2_constructFromStreamAndHeader(ktxTexture2* This, ktxStream* pStream,
54
KTX_header2* pHeader,
55
ktxTextureCreateFlags createFlags);
56
57
ktx_uint64_t ktxTexture2_calcDataSizeTexture(ktxTexture2* This);
58
ktx_size_t ktxTexture2_calcLevelOffset(ktxTexture2* This, ktx_uint32_t level);
59
ktx_uint32_t ktxTexture2_calcRequiredLevelAlignment(ktxTexture2* This);
60
ktx_uint64_t ktxTexture2_levelFileOffset(ktxTexture2* This, ktx_uint32_t level);
61
ktx_uint64_t ktxTexture2_levelDataOffset(ktxTexture2* This, ktx_uint32_t level);
62
63
#ifdef __cplusplus
64
}
65
#endif
66
67
#endif /* _TEXTURE2_H_ */
68
69