Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/libktx/lib/formatsize.h
9903 views
1
/* -*- tab-width: 4; -*- */
2
/* vi: set sw=2 ts=4 expandtab: */
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 Struct for returning size information about an image format.
15
*
16
* @author Mark Callow, www.edgewise-consulting.com
17
*/
18
19
#ifndef _FORMATSIZE_H_
20
#define _FORMATSIZE_H_
21
22
#include "ktx.h"
23
24
typedef enum ktxFormatSizeFlagBits {
25
KTX_FORMAT_SIZE_PACKED_BIT = 0x00000001,
26
KTX_FORMAT_SIZE_COMPRESSED_BIT = 0x00000002,
27
KTX_FORMAT_SIZE_PALETTIZED_BIT = 0x00000004,
28
KTX_FORMAT_SIZE_DEPTH_BIT = 0x00000008,
29
KTX_FORMAT_SIZE_STENCIL_BIT = 0x00000010,
30
KTX_FORMAT_SIZE_YUVSDA_BIT = 0x00000020,
31
} ktxFormatSizeFlagBits;
32
33
typedef ktx_uint32_t ktxFormatSizeFlags;
34
35
/**
36
* @brief Structure for holding size information for a texture format.
37
*/
38
typedef struct ktxFormatSize {
39
ktxFormatSizeFlags flags;
40
unsigned int paletteSizeInBits; // For KTX1.
41
unsigned int blockSizeInBits;
42
unsigned int blockWidth; // in texels
43
unsigned int blockHeight; // in texels
44
unsigned int blockDepth; // in texels
45
unsigned int minBlocksX; // Minimum required number of blocks
46
unsigned int minBlocksY;
47
} ktxFormatSize;
48
49
#ifdef __cplusplus
50
extern "C" {
51
#endif
52
53
bool ktxFormatSize_initFromDfd(ktxFormatSize* This, ktx_uint32_t* pDfd);
54
55
#ifdef __cplusplus
56
} // extern "C"
57
#endif
58
59
#endif /* _FORMATSIZE_H_ */
60
61