LIBJXL
codestream_header.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
15#ifndef JXL_CODESTREAM_HEADER_H_
16#define JXL_CODESTREAM_HEADER_H_
17
18#include <stddef.h>
19#include <stdint.h>
20
21#include "jxl/types.h"
22
23#if defined(__cplusplus) || defined(c_plusplus)
24extern "C" {
25#endif
26
32typedef enum {
33 JXL_ORIENT_IDENTITY = 1,
34 JXL_ORIENT_FLIP_HORIZONTAL = 2,
35 JXL_ORIENT_ROTATE_180 = 3,
36 JXL_ORIENT_FLIP_VERTICAL = 4,
37 JXL_ORIENT_TRANSPOSE = 5,
38 JXL_ORIENT_ROTATE_90_CW = 6,
39 JXL_ORIENT_ANTI_TRANSPOSE = 7,
40 JXL_ORIENT_ROTATE_90_CCW = 8,
42
45typedef enum {
46 JXL_CHANNEL_ALPHA,
47 JXL_CHANNEL_DEPTH,
48 JXL_CHANNEL_SPOT_COLOR,
49 JXL_CHANNEL_SELECTION_MASK,
50 JXL_CHANNEL_BLACK,
51 JXL_CHANNEL_CFA,
52 JXL_CHANNEL_THERMAL,
53 JXL_CHANNEL_RESERVED0,
54 JXL_CHANNEL_RESERVED1,
55 JXL_CHANNEL_RESERVED2,
56 JXL_CHANNEL_RESERVED3,
57 JXL_CHANNEL_RESERVED4,
58 JXL_CHANNEL_RESERVED5,
59 JXL_CHANNEL_RESERVED6,
60 JXL_CHANNEL_RESERVED7,
61 JXL_CHANNEL_UNKNOWN,
62 JXL_CHANNEL_OPTIONAL
64
66typedef struct {
68 uint32_t xsize;
69
71 uint32_t ysize;
73
75typedef struct {
77 uint32_t xsize;
78
80 uint32_t ysize;
82
87typedef struct {
89 uint32_t tps_numerator;
90
93
95 uint32_t num_loops;
96
101
105typedef struct {
106 /* TODO(lode): need additional fields for (transcoded) JPEG? For reusable
107 * fields orientation must be read from Exif APP1. For has_icc_profile: must
108 * look up where ICC profile is guaranteed to be in a JPEG file to be able to
109 * indicate this. */
110
111 /* TODO(lode): make struct packed, and/or make this opaque struct with getter
112 * functions (still separate struct from opaque decoder) */
113
119
122 uint32_t xsize;
123
126 uint32_t ysize;
127
131
139
149
154 float min_nits;
155
159
166
187
192
197
202
211
220
225 uint32_t alpha_bits;
226
232
238
243
248
256
264
268 uint8_t padding[100];
270
273typedef struct {
277
281
286
292 uint32_t dim_shift;
293
297 uint32_t name_length;
298
303
307 float spot_color[4];
308
312 uint32_t cfa_channel;
314
315/* TODO(lode): add API to get the codestream header extensions. */
317typedef struct {
319 uint64_t extensions;
321
325typedef enum {
326 JXL_BLEND_REPLACE = 0,
327 JXL_BLEND_ADD = 1,
328 JXL_BLEND_BLEND = 2,
329 JXL_BLEND_MULADD = 3,
330 JXL_BLEND_MUL = 4,
332
338typedef struct {
344 uint32_t source;
348 uint32_t alpha;
353
359typedef struct {
367
370 int32_t crop_x0;
371
374 int32_t crop_y0;
375
378 uint32_t xsize;
379
382 uint32_t ysize;
383
388
395
397typedef struct {
401 uint32_t duration;
402
411 uint32_t timecode;
412
418 uint32_t name_length;
419
426
431
432#if defined(__cplusplus) || defined(c_plusplus)
433}
434#endif
435
436#endif /* JXL_CODESTREAM_HEADER_H_ */
437
JxlExtraChannelType
Definition: codestream_header.h:45
#define JXL_BOOL
Definition: types.h:31
JxlBlendMode
Definition: codestream_header.h:325
JxlOrientation
Definition: codestream_header.h:32
Definition: codestream_header.h:87
JXL_BOOL have_timecodes
Definition: codestream_header.h:99
uint32_t tps_denominator
Definition: codestream_header.h:92
uint32_t num_loops
Definition: codestream_header.h:95
uint32_t tps_numerator
Definition: codestream_header.h:89
Definition: codestream_header.h:105
JXL_BOOL uses_original_profile
Definition: codestream_header.h:186
uint32_t alpha_bits
Definition: codestream_header.h:225
uint32_t ysize
Definition: codestream_header.h:126
uint32_t intrinsic_ysize
Definition: codestream_header.h:263
float min_nits
Definition: codestream_header.h:154
JXL_BOOL alpha_premultiplied
Definition: codestream_header.h:237
JXL_BOOL relative_to_max_display
Definition: codestream_header.h:158
JXL_BOOL have_animation
Definition: codestream_header.h:196
JxlOrientation orientation
Definition: codestream_header.h:201
uint32_t alpha_exponent_bits
Definition: codestream_header.h:231
uint32_t bits_per_sample
Definition: codestream_header.h:130
uint32_t exponent_bits_per_sample
Definition: codestream_header.h:138
uint32_t num_color_channels
Definition: codestream_header.h:210
uint32_t intrinsic_xsize
Definition: codestream_header.h:255
uint32_t xsize
Definition: codestream_header.h:122
uint32_t num_extra_channels
Definition: codestream_header.h:219
JXL_BOOL have_preview
Definition: codestream_header.h:191
JxlPreviewHeader preview
Definition: codestream_header.h:242
float linear_below
Definition: codestream_header.h:165
JxlAnimationHeader animation
Definition: codestream_header.h:247
JXL_BOOL have_container
Definition: codestream_header.h:118
float intensity_target
Definition: codestream_header.h:148
Definition: codestream_header.h:338
JxlBlendMode blendmode
Definition: codestream_header.h:341
uint32_t source
Definition: codestream_header.h:344
uint32_t alpha
Definition: codestream_header.h:348
JXL_BOOL clamp
Definition: codestream_header.h:351
Definition: codestream_header.h:273
JxlExtraChannelType type
Definition: codestream_header.h:276
uint32_t cfa_channel
Definition: codestream_header.h:312
uint32_t bits_per_sample
Definition: codestream_header.h:280
uint32_t dim_shift
Definition: codestream_header.h:292
uint32_t name_length
Definition: codestream_header.h:297
uint32_t exponent_bits_per_sample
Definition: codestream_header.h:285
JXL_BOOL alpha_premultiplied
Definition: codestream_header.h:302
Definition: codestream_header.h:397
JxlLayerInfo layer_info
Definition: codestream_header.h:429
JXL_BOOL is_last
Definition: codestream_header.h:425
uint32_t name_length
Definition: codestream_header.h:418
uint32_t duration
Definition: codestream_header.h:401
uint32_t timecode
Definition: codestream_header.h:411
Definition: codestream_header.h:317
uint64_t extensions
Definition: codestream_header.h:319
Definition: codestream_header.h:75
uint32_t ysize
Definition: codestream_header.h:80
uint32_t xsize
Definition: codestream_header.h:77
Definition: codestream_header.h:359
uint32_t xsize
Definition: codestream_header.h:378
uint32_t save_as_reference
Definition: codestream_header.h:393
JxlBlendInfo blend_info
Definition: codestream_header.h:387
JXL_BOOL have_crop
Definition: codestream_header.h:366
uint32_t ysize
Definition: codestream_header.h:382
int32_t crop_x0
Definition: codestream_header.h:370
int32_t crop_y0
Definition: codestream_header.h:374
Definition: codestream_header.h:66
uint32_t xsize
Definition: codestream_header.h:68
uint32_t ysize
Definition: codestream_header.h:71
Data types for the JPEG XL API, for both encoding and decoding.