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#if defined(__cplusplus) || defined(c_plusplus)
20extern "C" {
21#endif
22
29#define JXL_BOOL int
31#define JXL_TRUE 1
33#define JXL_FALSE 0
35#define TO_JXL_BOOL(C) (!!(C) ? JXL_TRUE : JXL_FALSE)
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
60 typedef enum {
65 JXL_NATIVE_ENDIAN = 0,
67 JXL_LITTLE_ENDIAN = 1,
69 JXL_BIG_ENDIAN = 2,
70} JxlEndianness;
71
78 typedef struct {
87 uint32_t num_channels;
88
91 JxlDataType data_type;
92
96 JxlEndianness endianness;
97
101 size_t align;
102} JxlPixelFormat;
103
107 typedef enum {
115 JXL_BIT_DEPTH_FROM_PIXEL_FORMAT = 0,
116
122 JXL_BIT_DEPTH_FROM_CODESTREAM = 1,
123
126 JXL_BIT_DEPTH_CUSTOM = 2,
127} JxlBitDepthType;
128
131 typedef struct {
133 JxlBitDepthType type;
134
136 uint32_t bits_per_sample;
137
139 uint32_t exponent_bits_per_sample;
140} JxlBitDepth;
141
144 typedef char JxlBoxType[4];
145
146#if defined(__cplusplus) || defined(c_plusplus)
147}
148#endif
149
150#endif /* JXL_TYPES_H_ */
151
JxlBoxType
char JxlBoxType[4]
Definition types.h:144
JxlBitDepthType
JxlBitDepthType
Definition types.h:107
JxlDataType
JxlDataType
Definition types.h:39
JxlEndianness
JxlEndianness
Definition types.h:60
JXL_BIT_DEPTH_FROM_PIXEL_FORMAT
@ JXL_BIT_DEPTH_FROM_PIXEL_FORMAT
Definition types.h:115
JXL_BIT_DEPTH_FROM_CODESTREAM
@ JXL_BIT_DEPTH_FROM_CODESTREAM
Definition types.h:122
JXL_BIT_DEPTH_CUSTOM
@ JXL_BIT_DEPTH_CUSTOM
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:69
JXL_LITTLE_ENDIAN
@ JXL_LITTLE_ENDIAN
Definition types.h:67
JXL_NATIVE_ENDIAN
@ JXL_NATIVE_ENDIAN
Definition types.h:65
JxlBitDepth
Definition types.h:131
JxlBitDepth::bits_per_sample
uint32_t bits_per_sample
Definition types.h:136
JxlBitDepth::type
JxlBitDepthType type
Definition types.h:133
JxlBitDepth::exponent_bits_per_sample
uint32_t exponent_bits_per_sample
Definition types.h:139
JxlPixelFormat
Definition types.h:78
JxlPixelFormat::align
size_t align
Definition types.h:101
JxlPixelFormat::num_channels
uint32_t num_channels
Definition types.h:87
JxlPixelFormat::data_type
JxlDataType data_type
Definition types.h:91
JxlPixelFormat::endianness
JxlEndianness endianness
Definition types.h:96