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 <jxl/jxl_export.h>
17#include <stddef.h>
18#include <stdint.h>
19
20#if defined(__cplusplus) || defined(c_plusplus)
21extern "C" {
22#endif
23
30#define JXL_BOOL int
32#define JXL_TRUE 1
34#define JXL_FALSE 0
36#define TO_JXL_BOOL(C) (!!(C) ? JXL_TRUE : JXL_FALSE)
37
40 typedef enum {
45 JXL_TYPE_FLOAT = 0,
46
49 JXL_TYPE_UINT8 = 2,
50
53 JXL_TYPE_UINT16 = 3,
54
56 JXL_TYPE_FLOAT16 = 5,
57} JxlDataType;
58
61 typedef enum {
66 JXL_NATIVE_ENDIAN = 0,
68 JXL_LITTLE_ENDIAN = 1,
70 JXL_BIG_ENDIAN = 2,
71} JxlEndianness;
72
79 typedef struct {
88 uint32_t num_channels;
89
92 JxlDataType data_type;
93
98 JxlEndianness endianness;
99
103 size_t align;
104} JxlPixelFormat;
105
109 typedef enum {
117 JXL_BIT_DEPTH_FROM_PIXEL_FORMAT = 0,
118
124 JXL_BIT_DEPTH_FROM_CODESTREAM = 1,
125
128 JXL_BIT_DEPTH_CUSTOM = 2,
129} JxlBitDepthType;
130
133 typedef struct {
135 JxlBitDepthType type;
136
138 uint32_t bits_per_sample;
139
141 uint32_t exponent_bits_per_sample;
142} JxlBitDepth;
143
146 typedef char JxlBoxType[4];
147
148#if defined(__cplusplus) || defined(c_plusplus)
149}
150#endif
151
152#endif /* JXL_TYPES_H_ */
153
JxlBoxType
char JxlBoxType[4]
Definition types.h:146
JxlBitDepthType
JxlBitDepthType
Definition types.h:109
JxlDataType
JxlDataType
Definition types.h:40
JxlEndianness
JxlEndianness
Definition types.h:61
JXL_BIT_DEPTH_FROM_PIXEL_FORMAT
@ JXL_BIT_DEPTH_FROM_PIXEL_FORMAT
Definition types.h:117
JXL_BIT_DEPTH_FROM_CODESTREAM
@ JXL_BIT_DEPTH_FROM_CODESTREAM
Definition types.h:124
JXL_BIT_DEPTH_CUSTOM
@ JXL_BIT_DEPTH_CUSTOM
Definition types.h:128
JXL_TYPE_UINT16
@ JXL_TYPE_UINT16
Definition types.h:53
JXL_TYPE_FLOAT
@ JXL_TYPE_FLOAT
Definition types.h:45
JXL_TYPE_FLOAT16
@ JXL_TYPE_FLOAT16
Definition types.h:56
JXL_TYPE_UINT8
@ JXL_TYPE_UINT8
Definition types.h:49
JXL_BIG_ENDIAN
@ JXL_BIG_ENDIAN
Definition types.h:70
JXL_LITTLE_ENDIAN
@ JXL_LITTLE_ENDIAN
Definition types.h:68
JXL_NATIVE_ENDIAN
@ JXL_NATIVE_ENDIAN
Definition types.h:66
JxlBitDepth
Definition types.h:133
JxlBitDepth::bits_per_sample
uint32_t bits_per_sample
Definition types.h:138
JxlBitDepth::type
JxlBitDepthType type
Definition types.h:135
JxlBitDepth::exponent_bits_per_sample
uint32_t exponent_bits_per_sample
Definition types.h:141
JxlPixelFormat
Definition types.h:79
JxlPixelFormat::align
size_t align
Definition types.h:103
JxlPixelFormat::num_channels
uint32_t num_channels
Definition types.h:88
JxlPixelFormat::data_type
JxlDataType data_type
Definition types.h:92
JxlPixelFormat::endianness
JxlEndianness endianness
Definition types.h:98