LIBJXL_DOC
Loading...
Searching...
No Matches
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
14
15#ifndef JXL_CODESTREAM_HEADER_H_
16#define JXL_CODESTREAM_HEADER_H_
17
18#include <jxl/types.h>
19#include <stddef.h>
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
31typedef enum {
32 JXL_ORIENT_IDENTITY = 1,
33 JXL_ORIENT_FLIP_HORIZONTAL = 2,
34 JXL_ORIENT_ROTATE_180 = 3,
35 JXL_ORIENT_FLIP_VERTICAL = 4,
36 JXL_ORIENT_TRANSPOSE = 5,
37 JXL_ORIENT_ROTATE_90_CW = 6,
38 JXL_ORIENT_ANTI_TRANSPOSE = 7,
39 JXL_ORIENT_ROTATE_90_CCW = 8,
41
44typedef enum {
45 JXL_CHANNEL_ALPHA,
46 JXL_CHANNEL_DEPTH,
47 JXL_CHANNEL_SPOT_COLOR,
48 JXL_CHANNEL_SELECTION_MASK,
49 JXL_CHANNEL_BLACK,
50 JXL_CHANNEL_CFA,
51 JXL_CHANNEL_THERMAL,
52 JXL_CHANNEL_RESERVED0,
53 JXL_CHANNEL_RESERVED1,
54 JXL_CHANNEL_RESERVED2,
55 JXL_CHANNEL_RESERVED3,
56 JXL_CHANNEL_RESERVED4,
57 JXL_CHANNEL_RESERVED5,
58 JXL_CHANNEL_RESERVED6,
59 JXL_CHANNEL_RESERVED7,
60 JXL_CHANNEL_UNKNOWN,
61 JXL_CHANNEL_OPTIONAL
63
65typedef struct {
67 uint32_t xsize;
68
70 uint32_t ysize;
72
77typedef struct {
79 uint32_t tps_numerator;
80
83
85 uint32_t num_loops;
86
91
95typedef struct {
96 /* TODO(lode): need additional fields for (transcoded) JPEG? For reusable
97 * fields orientation must be read from Exif APP1. For has_icc_profile: must
98 * look up where ICC profile is guaranteed to be in a JPEG file to be able to
99 * indicate this. */
100
101 /* TODO(lode): make struct packed, and/or make this opaque struct with getter
102 * functions (still separate struct from opaque decoder) */
103
109
112 uint32_t xsize;
113
116 uint32_t ysize;
117
121
129
139
144 float min_nits;
145
149
156
176
181
186
191
201
211
216 uint32_t alpha_bits;
217
223
229
234
239
247
255
259 uint8_t padding[100];
261
264typedef struct {
268
272
277
283 uint32_t dim_shift;
284
288 uint32_t name_length;
289
294
298 float spot_color[4];
299
303 uint32_t cfa_channel;
305
306/* TODO(lode): add API to get the codestream header extensions. */
308typedef struct {
310 uint64_t extensions;
312
316typedef enum {
317 JXL_BLEND_REPLACE = 0,
318 JXL_BLEND_ADD = 1,
319 JXL_BLEND_BLEND = 2,
320 JXL_BLEND_MULADD = 3,
321 JXL_BLEND_MUL = 4,
323
329typedef struct {
335 uint32_t source;
339 uint32_t alpha;
344
350typedef struct {
358
361 int32_t crop_x0;
362
365 int32_t crop_y0;
366
369 uint32_t xsize;
370
373 uint32_t ysize;
374
379
388
390typedef struct {
395 uint32_t duration;
396
405 uint32_t timecode;
406
412 uint32_t name_length;
413
420
425
426#ifdef __cplusplus
427}
428#endif
429
430#endif /* JXL_CODESTREAM_HEADER_H_ */
431
#define JXL_BOOL
Definition types.h:29
JxlExtraChannelType
Definition codestream_header.h:44
JxlBlendMode
Definition codestream_header.h:316
JxlOrientation
Definition codestream_header.h:31
Definition codestream_header.h:77
JXL_BOOL have_timecodes
Definition codestream_header.h:89
uint32_t tps_denominator
Definition codestream_header.h:82
uint32_t num_loops
Definition codestream_header.h:85
uint32_t tps_numerator
Definition codestream_header.h:79
Definition codestream_header.h:95
JXL_BOOL uses_original_profile
Definition codestream_header.h:175
uint32_t alpha_bits
Definition codestream_header.h:216
uint32_t ysize
Definition codestream_header.h:116
uint32_t intrinsic_ysize
Definition codestream_header.h:254
float min_nits
Definition codestream_header.h:144
JXL_BOOL alpha_premultiplied
Definition codestream_header.h:228
JXL_BOOL relative_to_max_display
Definition codestream_header.h:148
JXL_BOOL have_animation
Definition codestream_header.h:185
JxlOrientation orientation
Definition codestream_header.h:190
uint32_t alpha_exponent_bits
Definition codestream_header.h:222
uint32_t bits_per_sample
Definition codestream_header.h:120
uint32_t exponent_bits_per_sample
Definition codestream_header.h:128
uint32_t num_color_channels
Definition codestream_header.h:200
uint8_t padding[100]
Definition codestream_header.h:259
uint32_t intrinsic_xsize
Definition codestream_header.h:246
uint32_t xsize
Definition codestream_header.h:112
uint32_t num_extra_channels
Definition codestream_header.h:210
JXL_BOOL have_preview
Definition codestream_header.h:180
JxlPreviewHeader preview
Definition codestream_header.h:233
float linear_below
Definition codestream_header.h:155
JxlAnimationHeader animation
Definition codestream_header.h:238
JXL_BOOL have_container
Definition codestream_header.h:108
float intensity_target
Definition codestream_header.h:138
Definition codestream_header.h:329
JxlBlendMode blendmode
Definition codestream_header.h:332
uint32_t source
Definition codestream_header.h:335
uint32_t alpha
Definition codestream_header.h:339
JXL_BOOL clamp
Definition codestream_header.h:342
Definition codestream_header.h:264
JxlExtraChannelType type
Definition codestream_header.h:267
uint32_t cfa_channel
Definition codestream_header.h:303
float spot_color[4]
Definition codestream_header.h:298
uint32_t bits_per_sample
Definition codestream_header.h:271
uint32_t dim_shift
Definition codestream_header.h:283
uint32_t name_length
Definition codestream_header.h:288
uint32_t exponent_bits_per_sample
Definition codestream_header.h:276
JXL_BOOL alpha_premultiplied
Definition codestream_header.h:293
Definition codestream_header.h:390
JxlLayerInfo layer_info
Definition codestream_header.h:423
JXL_BOOL is_last
Definition codestream_header.h:419
uint32_t name_length
Definition codestream_header.h:412
uint32_t duration
Definition codestream_header.h:395
uint32_t timecode
Definition codestream_header.h:405
Definition codestream_header.h:308
uint64_t extensions
Definition codestream_header.h:310
Definition codestream_header.h:350
uint32_t xsize
Definition codestream_header.h:369
uint32_t save_as_reference
Definition codestream_header.h:386
JxlBlendInfo blend_info
Definition codestream_header.h:378
JXL_BOOL have_crop
Definition codestream_header.h:357
uint32_t ysize
Definition codestream_header.h:373
int32_t crop_x0
Definition codestream_header.h:361
int32_t crop_y0
Definition codestream_header.h:365
Definition codestream_header.h:65
uint32_t xsize
Definition codestream_header.h:67
uint32_t ysize
Definition codestream_header.h:70
Data types for the JPEG XL API, for both encoding and decoding.