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
24typedef 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} ktxFormatSizeFlagBits;
31
32typedef ktx_uint32_t ktxFormatSizeFlags;
33
34/**
35 * @brief Structure for holding size information for a texture format.
36 */
37typedef struct ktxFormatSize {
38 ktxFormatSizeFlags flags;
39 unsigned int paletteSizeInBits; // For KTX1.
40 unsigned int blockSizeInBits;
41 unsigned int blockWidth; // in texels
42 unsigned int blockHeight; // in texels
43 unsigned int blockDepth; // in texels
44 unsigned int minBlocksX; // Minimum required number of blocks
45 unsigned int minBlocksY;
46} ktxFormatSize;
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52bool ktxFormatSize_initFromDfd(ktxFormatSize* This, ktx_uint32_t* pDfd);
53
54#ifdef __cplusplus
55} // extern "C"
56#endif
57
58#endif /* _FORMATSIZE_H_ */
59