Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
/* Copyright (c) the JPEG XL Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
#ifndef JXL_TYPES_H_
#define JXL_TYPES_H_
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define JXL_BOOL int
#define JXL_TRUE 1
#define JXL_FALSE 0
#define TO_JXL_BOOL(C) (!!(C) ? JXL_TRUE : JXL_FALSE)
#define FROM_JXL_BOOL(C) (static_cast<bool>(C))
typedef enum {
JXL_TYPE_FLOAT = 0,
JXL_TYPE_UINT8 = 2,
JXL_TYPE_UINT16 = 3,
JXL_TYPE_FLOAT16 = 5,
} JxlDataType;
typedef enum {
JXL_NATIVE_ENDIAN = 0,
JXL_LITTLE_ENDIAN = 1,
JXL_BIG_ENDIAN = 2,
} JxlEndianness;
typedef struct {
uint32_t num_channels;
JxlDataType data_type;
JxlEndianness endianness;
size_t align;
} JxlPixelFormat;
typedef enum {
JXL_BIT_DEPTH_FROM_PIXEL_FORMAT = 0,
JXL_BIT_DEPTH_FROM_CODESTREAM = 1,
JXL_BIT_DEPTH_CUSTOM = 2,
} JxlBitDepthType;
typedef struct {
JxlBitDepthType type;
uint32_t bits_per_sample;
uint32_t exponent_bits_per_sample;
} JxlBitDepth;
typedef char JxlBoxType[4];
#ifdef __cplusplus
}
#endif
#endif /* JXL_TYPES_H_ */
JxlBoxType
char JxlBoxType[4]
Definition types.h:146
JxlBitDepthType
JxlBitDepthType
Definition types.h:109
JxlDataType
JxlDataType
Definition types.h:41
JxlEndianness
JxlEndianness
Definition types.h:62
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:54
JXL_TYPE_FLOAT
@ JXL_TYPE_FLOAT
Definition types.h:46
JXL_TYPE_FLOAT16
@ JXL_TYPE_FLOAT16
Definition types.h:57
JXL_TYPE_UINT8
@ JXL_TYPE_UINT8
Definition types.h:50
JXL_BIG_ENDIAN
@ JXL_BIG_ENDIAN
Definition types.h:71
JXL_LITTLE_ENDIAN
@ JXL_LITTLE_ENDIAN
Definition types.h:69
JXL_NATIVE_ENDIAN
@ JXL_NATIVE_ENDIAN
Definition types.h:67
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:80
JxlPixelFormat::align
size_t align
Definition types.h:103
JxlPixelFormat::num_channels
uint32_t num_channels
Definition types.h:89
JxlPixelFormat::data_type
JxlDataType data_type
Definition types.h:93
JxlPixelFormat::endianness
JxlEndianness endianness
Definition types.h:98