LIBJXL: jxl/types.h Source File

LIBJXL

Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1/* Copyright (c) the JPEG XL Project Authors. All rights reserved.
2 *
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file.
5 */
6
13#ifndef JXL_TYPES_H_
14#define JXL_TYPES_H_
15
16#include <stddef.h>
17#include <stdint.h>
18
19#include "jxl/jxl_export.h"
20
21#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
31#define JXL_BOOL int
33#define JXL_TRUE 1
35#define JXL_FALSE 0
36
39 typedef enum {
44 JXL_TYPE_FLOAT = 0,
45
48 JXL_TYPE_UINT8 = 2,
49
52 JXL_TYPE_UINT16 = 3,
53
55 JXL_TYPE_FLOAT16 = 5,
56} JxlDataType;
57
58/* DEPRECATED: bit-packed 1-bit data type. Use JXL_TYPE_UINT8 instead.
59 */
60JXL_DEPRECATED static const int JXL_TYPE_BOOLEAN = 1;
61
62/* DEPRECATED: uint32_t data type. Use JXL_TYPE_FLOAT instead.
63 */
64JXL_DEPRECATED static const int JXL_TYPE_UINT32 = 4;
65
68 typedef enum {
73 JXL_NATIVE_ENDIAN = 0,
75 JXL_LITTLE_ENDIAN = 1,
77 JXL_BIG_ENDIAN = 2,
78} JxlEndianness;
79
86 typedef struct {
95 uint32_t num_channels;
96
99 JxlDataType data_type;
100
105 JxlEndianness endianness;
106
110 size_t align;
111} JxlPixelFormat;
112
115 typedef enum {
123 JXL_BIT_DEPTH_FROM_PIXEL_FORMAT = 0,
124
130 JXL_BIT_DEPTH_FROM_CODESTREAM = 1,
131
134 JXL_BIT_DEPTH_CUSTOM = 2,
135} JxlBitDepthType;
136
139 typedef struct {
141 JxlBitDepthType type;
142
144 uint32_t bits_per_sample;
145
147 uint32_t exponent_bits_per_sample;
148} JxlBitDepth;
149
152 typedef char JxlBoxType[4];
153
162 typedef enum {
163 // after completed kRegularFrames
164 kFrames = 0,
165 // after completed DC (1:8)
166 kDC = 1,
167 // after completed AC passes that are the last pass for their resolution
168 // target.
169 kLastPasses = 2,
170 // after completed AC passes that are not the last pass for their resolution
171 // target.
172 kPasses = 3,
173 // during DC frame when lower resolution are completed (1:32, 1:16)
174 kDCProgressive = 4,
175 // after completed groups
176 kDCGroups = 5,
177 // after completed groups
178 kGroups = 6,
179} JxlProgressiveDetail;
180
181#if defined(__cplusplus) || defined(c_plusplus)
182}
183#endif
184
185#endif /* JXL_TYPES_H_ */
186
JxlBoxType
char JxlBoxType[4]
Definition types.h:152
JxlBitDepthType
JxlBitDepthType
Definition types.h:115
JxlDataType
JxlDataType
Definition types.h:39
JxlEndianness
JxlEndianness
Definition types.h:68
JxlProgressiveDetail
JxlProgressiveDetail
Definition types.h:162
JXL_BIT_DEPTH_FROM_PIXEL_FORMAT
@ JXL_BIT_DEPTH_FROM_PIXEL_FORMAT
Definition types.h:123
JXL_BIT_DEPTH_FROM_CODESTREAM
@ JXL_BIT_DEPTH_FROM_CODESTREAM
Definition types.h:130
JXL_BIT_DEPTH_CUSTOM
@ JXL_BIT_DEPTH_CUSTOM
Definition types.h:134
JXL_TYPE_UINT16
@ JXL_TYPE_UINT16
Definition types.h:52
JXL_TYPE_FLOAT
@ JXL_TYPE_FLOAT
Definition types.h:44
JXL_TYPE_FLOAT16
@ JXL_TYPE_FLOAT16
Definition types.h:55
JXL_TYPE_UINT8
@ JXL_TYPE_UINT8
Definition types.h:48
JXL_BIG_ENDIAN
@ JXL_BIG_ENDIAN
Definition types.h:77
JXL_LITTLE_ENDIAN
@ JXL_LITTLE_ENDIAN
Definition types.h:75
JXL_NATIVE_ENDIAN
@ JXL_NATIVE_ENDIAN
Definition types.h:73
JxlBitDepth
Definition types.h:139
JxlBitDepth::bits_per_sample
uint32_t bits_per_sample
Definition types.h:144
JxlBitDepth::type
JxlBitDepthType type
Definition types.h:141
JxlBitDepth::exponent_bits_per_sample
uint32_t exponent_bits_per_sample
Definition types.h:147
JxlPixelFormat
Definition types.h:86
JxlPixelFormat::align
size_t align
Definition types.h:110
JxlPixelFormat::num_channels
uint32_t num_channels
Definition types.h:95
JxlPixelFormat::data_type
JxlDataType data_type
Definition types.h:99
JxlPixelFormat::endianness
JxlEndianness endianness
Definition types.h:105