LIBJXL: jxl/types.h Source File

LIBJXL

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 */
60static const int JXL_DEPRECATED JXL_TYPE_BOOLEAN = 1;
61
62/* DEPRECATED: uint32_t data type. Use JXL_TYPE_FLOAT instead.
63 */
64static const int JXL_DEPRECATED 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
87 typedef struct {
96 uint32_t num_channels;
97
100 JxlDataType data_type;
101
106 JxlEndianness endianness;
107
111 size_t align;
112} JxlPixelFormat;
113
116 typedef char JxlBoxType[4];
117
126 typedef enum {
127 // after completed kRegularFrames
128 kFrames = 0,
129 // after completed DC (1:8)
130 kDC = 1,
131 // after completed AC passes that are the last pass for their resolution
132 // target.
133 kLastPasses = 2,
134 // after completed AC passes that are not the last pass for their resolution
135 // target.
136 kPasses = 3,
137 // during DC frame when lower resolution are completed (1:32, 1:16)
138 kDCProgressive = 4,
139 // after completed groups
140 kDCGroups = 5,
141 // after completed groups
142 kGroups = 6,
143} JxlProgressiveDetail;
144
145#if defined(__cplusplus) || defined(c_plusplus)
146}
147#endif
148
149#endif /* JXL_TYPES_H_ */
150
JxlBoxType
char JxlBoxType[4]
Definition: types.h:116
JxlDataType
JxlDataType
Definition: types.h:39
JxlEndianness
JxlEndianness
Definition: types.h:68
JxlProgressiveDetail
JxlProgressiveDetail
Definition: types.h:126
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
JxlPixelFormat
Definition: types.h:87
JxlPixelFormat::align
size_t align
Definition: types.h:111
JxlPixelFormat::num_channels
uint32_t num_channels
Definition: types.h:96
JxlPixelFormat::data_type
JxlDataType data_type
Definition: types.h:100
JxlPixelFormat::endianness
JxlEndianness endianness
Definition: types.h:106