pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __GLIBC_USE_ISOC2X: u32 = 0;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 200809;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_ISO_10646__: u32 = 201706;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 31;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __glibc_c99_flexarr_available: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const __LONG_DOUBLE_USES_FLOAT128: u32 = 0;
pub const __HAVE_GENERIC_SELECTION: u32 = 1;
pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
pub const _BITS_TYPES_H: u32 = 1;
pub const __TIMESIZE: u32 = 64;
pub const _BITS_TYPESIZES_H: u32 = 1;
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
pub const __INO_T_MATCHES_INO64_T: u32 = 1;
pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
pub const __STATFS_MATCHES_STATFS64: u32 = 1;
pub const __FD_SETSIZE: u32 = 1024;
pub const _BITS_TIME64_H: u32 = 1;
pub const _BITS_WCHAR_H: u32 = 1;
pub const _BITS_STDINT_INTN_H: u32 = 1;
pub const _BITS_STDINT_UINTN_H: u32 = 1;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i64 = -9223372036854775808;
pub const INT_FAST32_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: i32 = -1;
pub const UINT_FAST32_MAX: i32 = -1;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const UINTPTR_MAX: i32 = -1;
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295;
pub const JPEGXL_TRUE: u32 = 1;
pub const JPEGXL_FALSE: u32 = 0;
pub const JPEGXL_PARALLEL_RET_RUNNER_ERROR: i32 = -1;
pub type size_t = ::std::os::raw::c_ulong;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(C)]
#[repr(align(16))]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
pub __bindgen_padding_0: u64,
pub __clang_max_align_nonce2: u128,
}
#[test]
fn bindgen_test_layout_max_align_t() {
assert_eq!(
::std::mem::size_of::<max_align_t>(),
32usize,
concat!("Size of: ", stringify!(max_align_t))
);
assert_eq!(
::std::mem::align_of::<max_align_t>(),
16usize,
concat!("Alignment of ", stringify!(max_align_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce1 as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(max_align_t),
"::",
stringify!(__clang_max_align_nonce1)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce2 as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(max_align_t),
"::",
stringify!(__clang_max_align_nonce2)
)
);
}
pub type __u_char = ::std::os::raw::c_uchar;
pub type __u_short = ::std::os::raw::c_ushort;
pub type __u_int = ::std::os::raw::c_uint;
pub type __u_long = ::std::os::raw::c_ulong;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __int_least8_t = __int8_t;
pub type __uint_least8_t = __uint8_t;
pub type __int_least16_t = __int16_t;
pub type __uint_least16_t = __uint16_t;
pub type __int_least32_t = __int32_t;
pub type __uint_least32_t = __uint32_t;
pub type __int_least64_t = __int64_t;
pub type __uint_least64_t = __uint64_t;
pub type __quad_t = ::std::os::raw::c_long;
pub type __u_quad_t = ::std::os::raw::c_ulong;
pub type __intmax_t = ::std::os::raw::c_long;
pub type __uintmax_t = ::std::os::raw::c_ulong;
pub type __dev_t = ::std::os::raw::c_ulong;
pub type __uid_t = ::std::os::raw::c_uint;
pub type __gid_t = ::std::os::raw::c_uint;
pub type __ino_t = ::std::os::raw::c_ulong;
pub type __ino64_t = ::std::os::raw::c_ulong;
pub type __mode_t = ::std::os::raw::c_uint;
pub type __nlink_t = ::std::os::raw::c_ulong;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type __pid_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __fsid_t {
pub __val: [::std::os::raw::c_int; 2usize],
}
#[test]
fn bindgen_test_layout___fsid_t() {
assert_eq!(
::std::mem::size_of::<__fsid_t>(),
8usize,
concat!("Size of: ", stringify!(__fsid_t))
);
assert_eq!(
::std::mem::align_of::<__fsid_t>(),
4usize,
concat!("Alignment of ", stringify!(__fsid_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__fsid_t),
"::",
stringify!(__val)
)
);
}
pub type __clock_t = ::std::os::raw::c_long;
pub type __rlim_t = ::std::os::raw::c_ulong;
pub type __rlim64_t = ::std::os::raw::c_ulong;
pub type __id_t = ::std::os::raw::c_uint;
pub type __time_t = ::std::os::raw::c_long;
pub type __useconds_t = ::std::os::raw::c_uint;
pub type __suseconds_t = ::std::os::raw::c_long;
pub type __daddr_t = ::std::os::raw::c_int;
pub type __key_t = ::std::os::raw::c_int;
pub type __clockid_t = ::std::os::raw::c_int;
pub type __timer_t = *mut ::std::os::raw::c_void;
pub type __blksize_t = ::std::os::raw::c_long;
pub type __blkcnt_t = ::std::os::raw::c_long;
pub type __blkcnt64_t = ::std::os::raw::c_long;
pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
pub type __fsword_t = ::std::os::raw::c_long;
pub type __ssize_t = ::std::os::raw::c_long;
pub type __syscall_slong_t = ::std::os::raw::c_long;
pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
pub type __loff_t = __off64_t;
pub type __caddr_t = *mut ::std::os::raw::c_char;
pub type __intptr_t = ::std::os::raw::c_long;
pub type __socklen_t = ::std::os::raw::c_uint;
pub type __sig_atomic_t = ::std::os::raw::c_int;
pub type int_least8_t = __int_least8_t;
pub type int_least16_t = __int_least16_t;
pub type int_least32_t = __int_least32_t;
pub type int_least64_t = __int_least64_t;
pub type uint_least8_t = __uint_least8_t;
pub type uint_least16_t = __uint_least16_t;
pub type uint_least32_t = __uint_least32_t;
pub type uint_least64_t = __uint_least64_t;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = __intmax_t;
pub type uintmax_t = __uintmax_t;
#[doc = " Tristimulus RGB"]
pub const JpegxlColorSpace_JPEGXL_COLOR_SPACE_RGB: JpegxlColorSpace = 0;
#[doc = " Luminance based, the primaries in JpegxlColorEncoding must be ignored."]
pub const JpegxlColorSpace_JPEGXL_COLOR_SPACE_GRAY: JpegxlColorSpace = 1;
#[doc = " XYB (opsin) color space"]
pub const JpegxlColorSpace_JPEGXL_COLOR_SPACE_XYB: JpegxlColorSpace = 2;
#[doc = " None of the other table entries describe the colour space appropriately"]
pub const JpegxlColorSpace_JPEGXL_COLOR_SPACE_UNKNOWN: JpegxlColorSpace = 3;
#[doc = " Color space of the image data."]
pub type JpegxlColorSpace = u32;
#[doc = " CIE Standard Illuminant D65: 0.3127, 0.3290"]
pub const JpegxlWhitePoint_JPEGXL_WHITE_POINT_D65: JpegxlWhitePoint = 1;
#[doc = " Custom white point stored in JpegxlColorEncoding white_point."]
pub const JpegxlWhitePoint_JPEGXL_WHITE_POINT_CUSTOM: JpegxlWhitePoint = 2;
#[doc = " CIE Standard Illuminant E (equal-energy): 1/3, 1/3"]
pub const JpegxlWhitePoint_JPEGXL_WHITE_POINT_E: JpegxlWhitePoint = 10;
#[doc = " DCI-P3 from SMPTE RP 431-2: 0.314, 0.351"]
pub const JpegxlWhitePoint_JPEGXL_WHITE_POINT_DCI: JpegxlWhitePoint = 11;
#[doc = " Built-in whitepoints for color encoding. Numeric values match CICP (Rec."]
#[doc = " ITU-T H.273 | ISO/IEC 23091-2:2019(E))."]
pub type JpegxlWhitePoint = u32;
#[doc = " The CIE xy values of the red, green and blue primaries are: 0.639998686,"]
#[doc = "0.330010138; 0.300003784, 0.600003357; 0.150002046, 0.059997204"]
pub const JpegxlPrimaries_JPEGXL_PRIMARIES_SRGB: JpegxlPrimaries = 1;
#[doc = " Custom white point stored in JpegxlColorEncoding primaries_red_xy,"]
#[doc = "primaries_green_xy and primaries_blue_xy."]
pub const JpegxlPrimaries_JPEGXL_PRIMARIES_CUSTOM: JpegxlPrimaries = 2;
#[doc = " As specified in Rec. ITU-R BT.2100-1"]
pub const JpegxlPrimaries_JPEGXL_PRIMARIES_2100: JpegxlPrimaries = 9;
#[doc = " As specified in SMPTE RP 431-2"]
pub const JpegxlPrimaries_JPEGXL_PRIMARIES_P3: JpegxlPrimaries = 11;
#[doc = " Built-in primaries for color encoding. Numeric values match CICP (Rec. ITU-T"]
#[doc = " H.273 | ISO/IEC 23091-2:2019(E))."]
pub type JpegxlPrimaries = u32;
#[doc = " As specified in SMPTE RP 431-2"]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_709: JpegxlTransferFunction = 1;
#[doc = " None of the other table entries describe the transfer function."]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_UNKNOWN: JpegxlTransferFunction = 2;
#[doc = " The gamma exponent is 1"]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_LINEAR: JpegxlTransferFunction = 8;
#[doc = " As specified in IEC 61966-2-1 sRGB"]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_SRGB: JpegxlTransferFunction = 13;
#[doc = " As specified in SMPTE ST 428-1"]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_PQ: JpegxlTransferFunction = 16;
#[doc = " As specified in SMPTE ST 428-1"]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_DCI: JpegxlTransferFunction = 17;
#[doc = " As specified in Rec. ITU-R BT.2100-1 (HLG)"]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_HLG: JpegxlTransferFunction = 18;
#[doc = " Transfer function follows power law given by the gamma value in"]
#[doc = "JpegxlColorEncoding. Not a CICP value."]
pub const JpegxlTransferFunction_JPEGXL_TRANSFER_FUNCTION_GAMMA: JpegxlTransferFunction = 65535;
#[doc = " Built-in transfer functions for color encoding. Numeric values match CICP"]
#[doc = " (Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E)) unless specified otherwise."]
pub type JpegxlTransferFunction = u32;
#[doc = " vendor-specific"]
pub const JpegxlRenderingIntent_JPEGXL_RENDERING_INTENT_PERCEPTUAL: JpegxlRenderingIntent = 0;
#[doc = " media-relative"]
pub const JpegxlRenderingIntent_JPEGXL_RENDERING_INTENT_RELATIVE: JpegxlRenderingIntent = 1;
#[doc = " vendor-specific"]
pub const JpegxlRenderingIntent_JPEGXL_RENDERING_INTENT_SATURATION: JpegxlRenderingIntent = 2;
#[doc = " ICC-absolute"]
pub const JpegxlRenderingIntent_JPEGXL_RENDERING_INTENT_ABSOLUTE: JpegxlRenderingIntent = 3;
#[doc = " Renderig intent for color encoding, as specified in ISO 15076-1:2010"]
pub type JpegxlRenderingIntent = u32;
#[doc = " Color encoding of the image as structured information."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlColorEncoding {
#[doc = " Color space of the image data."]
pub color_space: JpegxlColorSpace,
#[doc = " Built-in white point. If this value is JPEGXL_WHITE_POINT_CUSTOM, must"]
#[doc = " use the numerical whitepoint values from white_point_xy."]
pub white_point: JpegxlWhitePoint,
#[doc = " Numerical whitepoint values in CIE xy space."]
pub white_point_xy: [f64; 2usize],
#[doc = " Built-in RGB primaries. If this value is JPEGXL_PRIMARIES_CUSTOM, must"]
#[doc = " use the numerical primaries values below. This field must be ignored"]
#[doc = " if the color space is grayscale."]
pub primaries: JpegxlPrimaries,
#[doc = " Numerical red primary values in CIE xy space."]
pub primaries_red_xy: [f64; 2usize],
#[doc = " Numerical green primary values in CIE xy space."]
pub primaries_green_xy: [f64; 2usize],
#[doc = " Numerical blue primary values in CIE xy space."]
pub primaries_blue_xy: [f64; 2usize],
#[doc = " Transfer function is have_gamma is 0"]
pub transfer_function: JpegxlTransferFunction,
#[doc = " Gamma value used when transfer_function is JPEGXL_TRANSFER_FUNCTION_GAMMA"]
pub gamma: f64,
#[doc = " Rendering intent defined for the color profile."]
pub rendering_intent: JpegxlRenderingIntent,
}
#[test]
fn bindgen_test_layout_JpegxlColorEncoding() {
assert_eq!(
::std::mem::size_of::<JpegxlColorEncoding>(),
104usize,
concat!("Size of: ", stringify!(JpegxlColorEncoding))
);
assert_eq!(
::std::mem::align_of::<JpegxlColorEncoding>(),
8usize,
concat!("Alignment of ", stringify!(JpegxlColorEncoding))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlColorEncoding>())).color_space as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(color_space)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlColorEncoding>())).white_point as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(white_point)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorEncoding>())).white_point_xy as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(white_point_xy)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlColorEncoding>())).primaries as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(primaries)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorEncoding>())).primaries_red_xy as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(primaries_red_xy)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorEncoding>())).primaries_green_xy as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(primaries_green_xy)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorEncoding>())).primaries_blue_xy as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(primaries_blue_xy)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorEncoding>())).transfer_function as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(transfer_function)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlColorEncoding>())).gamma as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(gamma)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorEncoding>())).rendering_intent as *const _ as usize
},
96usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorEncoding),
"::",
stringify!(rendering_intent)
)
);
}
#[doc = " Color transform used for the XYB encoding. This affects how the internal"]
#[doc = " XYB color format is converted, and is not needed unless XYB color is used."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlInverseOpsinMatrix {
#[doc = " Inverse opsin matrix."]
pub opsin_inv_matrix: [[f32; 3usize]; 3usize],
#[doc = " Opsin bias for opsin matrix. This affects how the internal XYB color"]
#[doc = " format is converted, and is not needed unless XYB color is used."]
pub opsin_biases: [f32; 3usize],
#[doc = " Quantization bias for opsin matrix. This affects how the internal XYB"]
#[doc = " color format is converted, and is not needed unless XYB color is used."]
pub quant_biases: [f32; 3usize],
}
#[test]
fn bindgen_test_layout_JpegxlInverseOpsinMatrix() {
assert_eq!(
::std::mem::size_of::<JpegxlInverseOpsinMatrix>(),
60usize,
concat!("Size of: ", stringify!(JpegxlInverseOpsinMatrix))
);
assert_eq!(
::std::mem::align_of::<JpegxlInverseOpsinMatrix>(),
4usize,
concat!("Alignment of ", stringify!(JpegxlInverseOpsinMatrix))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlInverseOpsinMatrix>())).opsin_inv_matrix as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlInverseOpsinMatrix),
"::",
stringify!(opsin_inv_matrix)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlInverseOpsinMatrix>())).opsin_biases as *const _ as usize
},
36usize,
concat!(
"Offset of field: ",
stringify!(JpegxlInverseOpsinMatrix),
"::",
stringify!(opsin_biases)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlInverseOpsinMatrix>())).quant_biases as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(JpegxlInverseOpsinMatrix),
"::",
stringify!(quant_biases)
)
);
}
#[doc = " JPEG XL codestream."]
pub const JpegxlSignatureType_JPEGXL_SIG_TYPE_JPEGXL: JpegxlSignatureType = 0;
#[doc = " Transcoded JPEG image signature was found. The decoder will be"]
#[doc = " able to transcode back to the JPEG codestream passed to the encoder."]
pub const JpegxlSignatureType_JPEGXL_SIG_TYPE_TRANSCODED_JPEG: JpegxlSignatureType = 1;
#[doc = " JPEG codestream, which would preferably also be decoded using this"]
#[doc = " decoder in case the codestream contains JPEG XL extensions (marker"]
#[doc = " segments)."]
pub const JpegxlSignatureType_JPEGXL_SIG_TYPE_JPEG: JpegxlSignatureType = 2;
#[doc = " Signature type of the codestream."]
pub type JpegxlSignatureType = u32;
pub const JpegxlOrientation_JPEGXL_ORIENT_IDENTITY: JpegxlOrientation = 1;
pub const JpegxlOrientation_JPEGXL_ORIENT_FLIP_HORIZONTAL: JpegxlOrientation = 2;
pub const JpegxlOrientation_JPEGXL_ORIENT_ROTATE_180: JpegxlOrientation = 3;
pub const JpegxlOrientation_JPEGXL_ORIENT_FLIP_VERTICAL: JpegxlOrientation = 4;
pub const JpegxlOrientation_JPEGXL_ORIENT_TRANSPOSE: JpegxlOrientation = 5;
pub const JpegxlOrientation_JPEGXL_ORIENT_ROTATE_90_CW: JpegxlOrientation = 6;
pub const JpegxlOrientation_JPEGXL_ORIENT_ANTI_TRANSPOSE: JpegxlOrientation = 7;
pub const JpegxlOrientation_JPEGXL_ORIENT_ROTATE_90_CCW: JpegxlOrientation = 8;
#[doc = " Image orientation metadata."]
#[doc = " Values 1..8 match the EXIF definitions."]
#[doc = " The name indicates the operation to perform to transform from the encoded"]
#[doc = " image to the display image."]
pub type JpegxlOrientation = u32;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_ALPHA: JpegxlExtraChannelType = 0;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_DEPTH: JpegxlExtraChannelType = 1;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_SPOT_COLOR: JpegxlExtraChannelType = 2;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_SELECTION_MASK: JpegxlExtraChannelType = 3;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_BLACK: JpegxlExtraChannelType = 4;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_CFA: JpegxlExtraChannelType = 5;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_THERMAL: JpegxlExtraChannelType = 6;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED0: JpegxlExtraChannelType = 7;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED1: JpegxlExtraChannelType = 8;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED2: JpegxlExtraChannelType = 9;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED3: JpegxlExtraChannelType = 10;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED4: JpegxlExtraChannelType = 11;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED5: JpegxlExtraChannelType = 12;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED6: JpegxlExtraChannelType = 13;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_RESERVED7: JpegxlExtraChannelType = 14;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_UNKNOWN: JpegxlExtraChannelType = 15;
pub const JpegxlExtraChannelType_JPEGXL_CHANNEL_OPTIONAL: JpegxlExtraChannelType = 16;
#[doc = " Given type of an extra channel."]
pub type JpegxlExtraChannelType = u32;
#[doc = " The next frame will be based on the same frame as the current one."]
pub const JpegxlFrameBase_JPEGXL_FRAME_BASE_EXISTING: JpegxlFrameBase = 0;
#[doc = " The next frame will be based on the current one."]
pub const JpegxlFrameBase_JPEGXL_FRAME_BASE_CURRENT_FRAME: JpegxlFrameBase = 1;
#[doc = " The next frame will be a full frame (have_crop = false) and will not be"]
#[doc = " based on any frame, but start from a value of 0 in main and extra channels."]
pub const JpegxlFrameBase_JPEGXL_FRAME_BASE_NONE: JpegxlFrameBase = 2;
#[doc = " Indicates what the next frame will be \"based\" on."]
#[doc = " A full frame (have_crop = false) can be based on a frame if and only if the"]
#[doc = " frame and the base are lossy. The rendered frame will then be the sum of"]
#[doc = " the two. A cropped frame can be based on any kind of frame. The rendered"]
#[doc = " frame will be obtained by blitting. Stored in FrameHeader and"]
#[doc = " ExtraChannelInfo to allow independent control for main and extra channels."]
pub type JpegxlFrameBase = u32;
#[doc = " The new values (in the crop) replace the old ones"]
pub const JpegxlBlendMode_JPEGXL_BLEND_MODE_REPLACE: JpegxlBlendMode = 0;
#[doc = " The new values (in the crop) get added to the old ones"]
pub const JpegxlBlendMode_JPEGXL_BLEND_MODE_ADD: JpegxlBlendMode = 1;
#[doc = " The new values (in the crop) replace the old ones if alpha>0."]
#[doc = " Not allowed for the first alpha channel."]
pub const JpegxlBlendMode_JPEGXL_BLEND_MODE_BLEND: JpegxlBlendMode = 2;
#[doc = " Indicates how to combine the current frame with the previous \"base\". Stored"]
#[doc = " in FrameHeader and ExtraChannelInfo to allow independent control for main and"]
#[doc = " extra channels."]
pub type JpegxlBlendMode = u32;
#[doc = " Basic image information. This information is available from the file"]
#[doc = " signature and first part of the codestream header."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlBasicInfo {
#[doc = " Whether the codestream is embedded in the container format. If true,"]
#[doc = " metadata information and extensions may be available in addition to the"]
#[doc = " codestream."]
pub have_container: ::std::os::raw::c_int,
#[doc = " Signature of the codestream."]
pub signature_type: JpegxlSignatureType,
#[doc = " Width of the image in pixels, before applying orientation."]
pub xsize: u32,
#[doc = " Height of the image in pixels, before applying orientation."]
pub ysize: u32,
#[doc = " Original image color channel bit depth."]
pub bits_per_sample: u32,
#[doc = " Original image color channel floating point exponent bits, or 0 if they"]
#[doc = " are unsigned integer. For example, if the original data is half-precision"]
#[doc = " (binary16) floating point, bits_per_sample is 16 and"]
#[doc = " exponent_bits_per_sample is 5, and so on for other floating point"]
#[doc = " precisions."]
pub exponent_bits_per_sample: u32,
#[doc = " Upper bound on the intensity level present in the image in nits. For"]
#[doc = " unsigned integer pixel encodings, this is the brightness of the largest"]
#[doc = " representable value. The image does not necessarily contain a pixel"]
#[doc = " actually this bright. An encoder is allowed to set 255 for SDR images"]
#[doc = " without computing a histogram."]
pub intensity_target: f32,
#[doc = " Lower bound on the intensity level present in the image. This may be"]
#[doc = " loose, i.e. lower than the actual darkest pixel. When tone mapping, a"]
#[doc = " decoder will map [min_nits, intensity_target] to the display range."]
pub min_nits: f32,
#[doc = " See the description of relative_to_max_display."]
pub relative_to_max_display: ::std::os::raw::c_int,
#[doc = " The tone mapping will leave unchanged (linear mapping) any pixels whose"]
#[doc = " brightness is strictly below this. The interpretation depends on"]
#[doc = " relative_to_max_display. If true, this is a ratio [0, 1] of the maximum"]
#[doc = " display brightness [nits], otherwise an absolute brightness [nits]."]
pub linear_below: f32,
#[doc = " Indicates a preview image exists near the beginning of the codestream."]
#[doc = " The preview itself or its dimensions are not included in the basic info."]
pub have_preview: ::std::os::raw::c_int,
#[doc = " Indicates animation frames exist in the codestream. The animation"]
#[doc = " information is not included in the basic info."]
pub have_animation: ::std::os::raw::c_int,
#[doc = " Image orientation, value 1-8 matching the values used by JEITA CP-3451C"]
#[doc = " (Exif version 2.3)."]
pub orientation: JpegxlOrientation,
#[doc = " Number of additional image channels. Information of all the individual"]
#[doc = " extra channels is not included in the basic info struct, except for the"]
#[doc = " first alpha channel in the fields below. Information for other extra"]
#[doc = " channels can be queried from the decoder at this point, however."]
#[doc = " TODO(lode): implement that feature"]
pub num_extra_channels: u32,
#[doc = " Bit depth of the encoded alpha channel, or 0 if there is no alpha channel."]
pub alpha_bits: u32,
#[doc = " Alpha channel floating point exponent bits, or 0 if they are unsigned"]
#[doc = " integer."]
pub alpha_exponent_bits: u32,
#[doc = " Whether the alpha channel is premultiplied"]
pub alpha_premultiplied: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_JpegxlBasicInfo() {
assert_eq!(
::std::mem::size_of::<JpegxlBasicInfo>(),
68usize,
concat!("Size of: ", stringify!(JpegxlBasicInfo))
);
assert_eq!(
::std::mem::align_of::<JpegxlBasicInfo>(),
4usize,
concat!("Alignment of ", stringify!(JpegxlBasicInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).have_container as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(have_container)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).signature_type as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(signature_type)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).xsize as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(xsize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).ysize as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(ysize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).bits_per_sample as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(bits_per_sample)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlBasicInfo>())).exponent_bits_per_sample as *const _
as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(exponent_bits_per_sample)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlBasicInfo>())).intensity_target as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(intensity_target)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).min_nits as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(min_nits)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlBasicInfo>())).relative_to_max_display as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(relative_to_max_display)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).linear_below as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(linear_below)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).have_preview as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(have_preview)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).have_animation as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(have_animation)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).orientation as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(orientation)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlBasicInfo>())).num_extra_channels as *const _ as usize
},
52usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(num_extra_channels)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlBasicInfo>())).alpha_bits as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(alpha_bits)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlBasicInfo>())).alpha_exponent_bits as *const _ as usize
},
60usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(alpha_exponent_bits)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlBasicInfo>())).alpha_premultiplied as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(JpegxlBasicInfo),
"::",
stringify!(alpha_premultiplied)
)
);
}
#[doc = " Information for a single extra channel."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlExtraChannelInfo {
#[doc = " Given type of an extra channel."]
pub type_: JpegxlExtraChannelType,
#[doc = " Base for next frame"]
pub next_frame_base: JpegxlFrameBase,
#[doc = " Blend mode for next frame"]
pub blend_mode: JpegxlBlendMode,
#[doc = " Total bits per sample for this channel."]
pub bits_per_sample: u32,
#[doc = " Floating point exponent bits per channel, or 0 if they are unsigned"]
#[doc = " integer."]
pub exponent_bits_per_sample: u32,
#[doc = " The exponent the channel is downsampled by on each axis."]
#[doc = " TODO(lode): expand this comment to match the JPEG XL specification,"]
#[doc = " specify how to upscale, how to round the size computation, and to which"]
#[doc = " extra channels this field applies."]
pub dim_shift: u32,
#[doc = " Length of the extra channel name in bytes, or 0 if no name."]
#[doc = " Excludes null termination character."]
pub name_length: u32,
#[doc = " Whether alpha channel uses premultiplied alpha. Only applicable if"]
#[doc = " type is JPEGXL_CHANNEL_ALPHA."]
pub alpha_associated: ::std::os::raw::c_int,
#[doc = " Spot color of the current spot channel in linear RGBA. Only applicable if"]
#[doc = " type is JPEGXL_CHANNEL_SPOT_COLOR."]
pub spot_color: [f32; 4usize],
#[doc = " Only applicable if type is JPEGXL_CHANNEL_CFA."]
#[doc = " TODO(lode): add comment about the meaning of this field."]
pub cfa_channel: u32,
}
#[test]
fn bindgen_test_layout_JpegxlExtraChannelInfo() {
assert_eq!(
::std::mem::size_of::<JpegxlExtraChannelInfo>(),
52usize,
concat!("Size of: ", stringify!(JpegxlExtraChannelInfo))
);
assert_eq!(
::std::mem::align_of::<JpegxlExtraChannelInfo>(),
4usize,
concat!("Alignment of ", stringify!(JpegxlExtraChannelInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).type_ as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).next_frame_base as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(next_frame_base)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).blend_mode as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(blend_mode)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).bits_per_sample as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(bits_per_sample)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).exponent_bits_per_sample as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(exponent_bits_per_sample)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).dim_shift as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(dim_shift)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).name_length as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(name_length)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).alpha_associated as *const _ as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(alpha_associated)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).spot_color as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(spot_color)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlExtraChannelInfo>())).cfa_channel as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(JpegxlExtraChannelInfo),
"::",
stringify!(cfa_channel)
)
);
}
#[doc = " Extensions in the codestream header."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlHeaderExtensions {
#[doc = " Extension bits."]
pub extensions: u64,
}
#[test]
fn bindgen_test_layout_JpegxlHeaderExtensions() {
assert_eq!(
::std::mem::size_of::<JpegxlHeaderExtensions>(),
8usize,
concat!("Size of: ", stringify!(JpegxlHeaderExtensions))
);
assert_eq!(
::std::mem::align_of::<JpegxlHeaderExtensions>(),
8usize,
concat!("Alignment of ", stringify!(JpegxlHeaderExtensions))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlHeaderExtensions>())).extensions as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlHeaderExtensions),
"::",
stringify!(extensions)
)
);
}
#[doc = " The codestream preview header"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlPreviewHeader {
#[doc = " Preview width in pixels"]
pub xsize: u32,
#[doc = " Preview height in pixels"]
pub ysize: u32,
}
#[test]
fn bindgen_test_layout_JpegxlPreviewHeader() {
assert_eq!(
::std::mem::size_of::<JpegxlPreviewHeader>(),
8usize,
concat!("Size of: ", stringify!(JpegxlPreviewHeader))
);
assert_eq!(
::std::mem::align_of::<JpegxlPreviewHeader>(),
4usize,
concat!("Alignment of ", stringify!(JpegxlPreviewHeader))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlPreviewHeader>())).xsize as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlPreviewHeader),
"::",
stringify!(xsize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlPreviewHeader>())).ysize as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(JpegxlPreviewHeader),
"::",
stringify!(ysize)
)
);
}
#[doc = " The codestream animation header"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlAnimationHeader {
#[doc = " Indicates there is a single frame followed by zero or more frames with"]
#[doc = " animation duration of 0. That means, there are animation frames, but they"]
#[doc = " are laid on top of each other to form a still image, rather than an"]
#[doc = " animation."]
pub composite_still: ::std::os::raw::c_int,
#[doc = " Numerator of ticks per second of a single animation frame time unit"]
pub tps_numerator: u32,
#[doc = " Denominator of ticks per second of a single animation frame time unit"]
pub tps_denominator: u32,
#[doc = " Amount of animation loops, or 0 to repeat infinitely"]
pub num_loops: u32,
#[doc = " Whether animation time codes are present at animation frames in the"]
#[doc = " codestream"]
pub have_timecodes: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_JpegxlAnimationHeader() {
assert_eq!(
::std::mem::size_of::<JpegxlAnimationHeader>(),
20usize,
concat!("Size of: ", stringify!(JpegxlAnimationHeader))
);
assert_eq!(
::std::mem::align_of::<JpegxlAnimationHeader>(),
4usize,
concat!("Alignment of ", stringify!(JpegxlAnimationHeader))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlAnimationHeader>())).composite_still as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlAnimationHeader),
"::",
stringify!(composite_still)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlAnimationHeader>())).tps_numerator as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(JpegxlAnimationHeader),
"::",
stringify!(tps_numerator)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlAnimationHeader>())).tps_denominator as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JpegxlAnimationHeader),
"::",
stringify!(tps_denominator)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlAnimationHeader>())).num_loops as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(JpegxlAnimationHeader),
"::",
stringify!(num_loops)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlAnimationHeader>())).have_timecodes as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(JpegxlAnimationHeader),
"::",
stringify!(have_timecodes)
)
);
}
#[doc = " Allocating function for a memory region of a given size."]
#[doc = ""]
#[doc = " Allocates a contiguous memory region of size @p size bytes. The returned"]
#[doc = " memory may not be aligned to a specific size or initialized at all."]
#[doc = ""]
#[doc = " @param opaque custom memory manager handle provided by the caller."]
#[doc = " @param size in bytes of the requested memory region."]
#[doc = " @returns @c 0 if the memory can not be allocated,"]
#[doc = " @returns pointer to the memory otherwise."]
pub type jpegxl_alloc_func = ::std::option::Option<
unsafe extern "C" fn(
opaque: *mut ::std::os::raw::c_void,
size: size_t,
) -> *mut ::std::os::raw::c_void,
>;
#[doc = " Deallocating function pointer type."]
#[doc = ""]
#[doc = " This function @b MUST do nothing if @p address is @c 0."]
#[doc = ""]
#[doc = " @param opaque custom memory manager handle provided by the caller."]
#[doc = " @param address memory region pointer returned by ::jpegxl_alloc_func, or @c 0"]
pub type jpegxl_free_func = ::std::option::Option<
unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, address: *mut ::std::os::raw::c_void),
>;
#[doc = " Memory Manager struct."]
#[doc = " These functions, when provided by the caller, will be used to handle memory"]
#[doc = " allocations."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlMemoryManagerStruct {
#[doc = " The opaque pointer that will be passed as the first parameter to all the"]
#[doc = " functions in this struct."]
pub opaque: *mut ::std::os::raw::c_void,
#[doc = " Memory allocation function. This can be NULL if and only if also the"]
#[doc = " free() member in this class is NULL. All dynamic memory will be allocated"]
#[doc = " and freed with these functions if they are not NULL."]
pub alloc: jpegxl_alloc_func,
#[doc = " Free function matching the alloc() member."]
pub free: jpegxl_free_func,
}
#[test]
fn bindgen_test_layout_JpegxlMemoryManagerStruct() {
assert_eq!(
::std::mem::size_of::<JpegxlMemoryManagerStruct>(),
24usize,
concat!("Size of: ", stringify!(JpegxlMemoryManagerStruct))
);
assert_eq!(
::std::mem::align_of::<JpegxlMemoryManagerStruct>(),
8usize,
concat!("Alignment of ", stringify!(JpegxlMemoryManagerStruct))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlMemoryManagerStruct>())).opaque as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlMemoryManagerStruct),
"::",
stringify!(opaque)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlMemoryManagerStruct>())).alloc as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(JpegxlMemoryManagerStruct),
"::",
stringify!(alloc)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlMemoryManagerStruct>())).free as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(JpegxlMemoryManagerStruct),
"::",
stringify!(free)
)
);
}
#[doc = " Memory Manager struct."]
#[doc = " These functions, when provided by the caller, will be used to handle memory"]
#[doc = " allocations."]
pub type JpegxlMemoryManager = JpegxlMemoryManagerStruct;
#[doc = " Return code used in the JpegxlParallel* functions as return value. A value"]
#[doc = " of 0 means success and any other value means error. The special value"]
#[doc = " JPEGXL_PARALLEL_RET_RUNNER_ERROR can be used by the runner to indicate any"]
#[doc = " other error."]
pub type JpegxlParallelRetCode = ::std::os::raw::c_int;
#[doc = " Parallel run initialization callback. See JpegxlParallelRunner for details."]
#[doc = ""]
#[doc = " This function MUST be called by the JpegxlParallelRunner only once, on the"]
#[doc = " same thread that called JpegxlParallelRunner, before any parallel execution."]
#[doc = " The purpose of this call is to provide the maximum number of threads that the"]
#[doc = " JpegxlParallelRunner will use, which can be used by JPEG XL to allocate"]
#[doc = " per-thread storage if needed."]
#[doc = ""]
#[doc = " @param jpegxl_opaque the @p jpegxl_opaque handle provided to"]
#[doc = " JpegxlParallelRunner() must be passed here."]
#[doc = " @param num_threads the maximum number of threads. This value must be"]
#[doc = " positive."]
#[doc = " @returns 0 if the initialization process was successful."]
#[doc = " @returns an error code if there was an error, which should be returned by"]
#[doc = " JpegxlParallelRunner()."]
pub type JpegxlParallelRunInit = ::std::option::Option<
unsafe extern "C" fn(
jpegxl_opaque: *mut ::std::os::raw::c_void,
num_threads: size_t,
) -> JpegxlParallelRetCode,
>;
#[doc = " Parallel run data processing callback. See JpegxlParallelRunner for details."]
#[doc = ""]
#[doc = " This function MUST be called once for every number in the range [start_range,"]
#[doc = " end_range) (including start_range but not including end_range) passing this"]
#[doc = " number as the @p value. Calls for different value may be executed from"]
#[doc = " different threads in parallel."]
#[doc = ""]
#[doc = " @param jpegxl_opaque the @p jpegxl_opaque handle provided to"]
#[doc = " JpegxlParallelRunner() must be passed here."]
#[doc = " @param value the number in the range [start_range, end_range) of the call."]
#[doc = " @param thread_id the thread number where this function is being called from."]
#[doc = " This must be lower than the @p num_threads value passed to"]
#[doc = " JpegxlParallelRunInit."]
pub type JpegxlParallelRunFunction = ::std::option::Option<
unsafe extern "C" fn(jpegxl_opaque: *mut ::std::os::raw::c_void, value: u32, thread_id: size_t),
>;
#[doc = " JpegxlParallelRunner function type. A parallel runner implementation can be"]
#[doc = " provided by a JPEG XL caller to allow running computations in multiple"]
#[doc = " threads. This function must call the initialization function @p init in the"]
#[doc = " same thread that called it and then call the passed @p func once for every"]
#[doc = " number in the range [start_range, end_range) (including start_range but not"]
#[doc = " including end_range) possibly from different multiple threads in parallel."]
#[doc = ""]
#[doc = " The JpegxlParallelRunner function does not need to be re-entrant. This means"]
#[doc = " that the same JpegxlParallelRunner function with the same runner_opaque"]
#[doc = " provided parameter will not be called from the library from either @p init or"]
#[doc = " @p func in the same decoder or encoder instance. However, a single decoding"]
#[doc = " or encoding instance may call the provided JpegxlParallelRunner multiple"]
#[doc = " times for different parts of the decoding or encoding process."]
#[doc = ""]
#[doc = " @returns 0 if the @p init call succeeded (returned 0) and no other error"]
#[doc = " occurred in the runner code."]
#[doc = " @returns JPEGXL_PARALLEL_RET_RUNNER_ERROR if an error occurred in the runner"]
#[doc = " code, for example, setting up the threads."]
#[doc = " @return the return value of @p init() if non-zero."]
pub type JpegxlParallelRunner = ::std::option::Option<
unsafe extern "C" fn(
runner_opaque: *mut ::std::os::raw::c_void,
jpegxl_opaque: *mut ::std::os::raw::c_void,
init: JpegxlParallelRunInit,
func: JpegxlParallelRunFunction,
start_range: u32,
end_range: u32,
) -> JpegxlParallelRetCode,
>;
extern "C" {
#[doc = " Decoder library version."]
#[doc = ""]
#[doc = " @return the decoder library version as an integer:"]
#[doc = " MAJOR_VERSION * 1000000 + MINOR_VERSION * 1000 + PATCH_VERSION. For example,"]
#[doc = " version 1.2.3 would return 1002003."]
pub fn JpegxlDecoderVersion() -> u32;
}
#[doc = " Not enough bytes were passed to determine if a valid signature was found."]
pub const JpegxlSignature_JPEGXL_SIG_NOT_ENOUGH_BYTES: JpegxlSignature = 0;
#[doc = " No valid JPEGXL header was found."]
pub const JpegxlSignature_JPEGXL_SIG_INVALID: JpegxlSignature = 1;
#[doc = " A valid JPEG XL image signature was found, which could be a JPEG XL"]
#[doc = " codestream, a transcoded JPEG image, or a JPEG XL container. This also"]
#[doc = " includes the case of a JPEG codestream, which would preferably also be"]
#[doc = " decoded using this decoder in case the codestream contains JPEG XL"]
#[doc = " extensions (marker segments)."]
pub const JpegxlSignature_JPEGXL_SIG_VALID: JpegxlSignature = 2;
#[doc = " The result of JpegxlSignatureCheck."]
pub type JpegxlSignature = u32;
extern "C" {
#[doc = " JPEG XL signature identification."]
#[doc = ""]
#[doc = " Checks if the passed buffer contains a valid JPEG XL signature. The passed @p"]
#[doc = " buf of size"]
#[doc = " @p size doesn't need to be a full image, only the beginning of the file."]
#[doc = ""]
#[doc = " @return a flag indicating if a JPEG XL signature was found and what type."]
#[doc = " - JPEGXL_SIG_INVALID: no valid signature found for JPEG XL decoding."]
#[doc = " - JPEGXL_SIG_VALID a valid JPEG XL signature was found."]
#[doc = " - JPEGXL_SIG_NOT_ENOUGH_BYTES not enough bytes were passed to determine"]
#[doc = " if a valid signature is there."]
pub fn JpegxlSignatureCheck(buf: *const u8, len: size_t) -> JpegxlSignature;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlDecoderStruct {
_unused: [u8; 0],
}
#[doc = " Opaque structure that holds the JPEGXL decoder."]
#[doc = ""]
#[doc = " Allocated and initialized with JpegxlDecoderCreate()."]
#[doc = " Cleaned up and deallocated with JpegxlDecoderDestroy()."]
pub type JpegxlDecoder = JpegxlDecoderStruct;
extern "C" {
#[doc = " Creates an instance of JpegxlDecoder and initializes it."]
#[doc = ""]
#[doc = " @p memory_manager will be used for all the library dynamic allocations made"]
#[doc = " from this instance. The parameter may be NULL, in which case the default"]
#[doc = " allocator will be used. See jpegxl/memory_manager.h for details."]
#[doc = ""]
#[doc = " @param memory_manager custom allocator function. It may be NULL. The memory"]
#[doc = " manager will be copied internally."]
#[doc = " @return @c NULL if the instance can not be allocated or initialized"]
#[doc = " @return pointer to initialized JpegxlDecoder otherwise"]
pub fn JpegxlDecoderCreate(memory_manager: *const JpegxlMemoryManager) -> *mut JpegxlDecoder;
}
extern "C" {
#[doc = " Deinitializes and frees JpegxlDecoder instance."]
#[doc = ""]
#[doc = " @param dec instance to be cleaned up and deallocated."]
pub fn JpegxlDecoderDestroy(dec: *mut JpegxlDecoder);
}
#[doc = " Function call finished sucessfully, or decoding is finished and there is"]
#[doc = " nothing more to be done."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_SUCCESS: JpegxlDecoderStatus = 0;
#[doc = " An error occured, for example invalid input file or out of memory."]
#[doc = " TODO(lode): add function to get error information from decoder."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_ERROR: JpegxlDecoderStatus = 1;
#[doc = " The decoder needs more input bytes to continue. In the next"]
#[doc = " JpegxlDecoderProcessInput call, next_in and avail_in must point to more"]
#[doc = " bytes to continue. If *avail_in is not 0, the new bytes must be appended to"]
#[doc = " the *avail_in last previous bytes."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_NEED_MORE_INPUT: JpegxlDecoderStatus = 2;
#[doc = " The decoder needs an output buffer to continue. Which output buffers it"]
#[doc = " needs depends on events subscribed to with JpegxlDecoderSubscribeEvents."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_NEED_MORE_OUTPUT: JpegxlDecoderStatus = 3;
#[doc = " Informative event: basic information such as image dimensions and extra"]
#[doc = " channels."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_BASIC_INFO: JpegxlDecoderStatus = 64;
#[doc = " Informative event: user extensions of the codestream header."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_EXTENSIONS: JpegxlDecoderStatus = 128;
#[doc = " Informative event: preview header from the codestream header."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_PREVIEW_HEADER: JpegxlDecoderStatus = 256;
#[doc = " Informative event: animation header from the codestream header."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_ANIMATION_HEADER: JpegxlDecoderStatus = 512;
#[doc = " Informative event: color encoding or ICC profile from the codestream"]
#[doc = " header."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_COLOR_ENCODING: JpegxlDecoderStatus = 1024;
#[doc = " Informative event: DC image, 8x8 sub-sampled image."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_DC: JpegxlDecoderStatus = 2048;
#[doc = " Informative event: full image decoded."]
pub const JpegxlDecoderStatus_JPEGXL_DEC_FULL_IMAGE: JpegxlDecoderStatus = 2048;
#[doc = " Return value for JpegxlDecoderProcessInput."]
#[doc = " The values above 64 are optional informal events that can be subscribed to."]
pub type JpegxlDecoderStatus = u32;
#[doc = " Use 1-bit packed in uint8_t, first pixel in LSB, padded to uint8_t per"]
#[doc = " row."]
#[doc = " TODO(lode): support first in MSB, other padding."]
pub const JpegxlDataType_JPEGXL_TYPE_BOOLEAN: JpegxlDataType = 0;
#[doc = " Use type uint8_t."]
pub const JpegxlDataType_JPEGXL_TYPE_UINT8: JpegxlDataType = 1;
#[doc = " Use type uint16_t."]
pub const JpegxlDataType_JPEGXL_TYPE_UINT16: JpegxlDataType = 2;
#[doc = " Use type uint32_t."]
pub const JpegxlDataType_JPEGXL_TYPE_UINT32: JpegxlDataType = 3;
#[doc = " use type float."]
pub const JpegxlDataType_JPEGXL_TYPE_FLOAT: JpegxlDataType = 4;
#[doc = " Data type for the sample values per channel per pixel."]
pub type JpegxlDataType = u32;
#[doc = " Data type for the sample values per channel per pixel for the output buffer"]
#[doc = " for pixels. This is not necessarily the same as the data type encoded in the"]
#[doc = " codestream. The channels are interleaved per pixel. The pixels are"]
#[doc = " organized row by row, left to right, top to bottom."]
#[doc = " TODO(lode): support padding / alignment (row stride)"]
#[doc = " TODO(lode): support outputting >8-bit data into uint8_t (and endianness)"]
#[doc = " TODO(lode): support non-interleaved (may be a no-op here, involves getting"]
#[doc = " single channels separately instead)"]
#[doc = " TODO(lode): support different channel orders if needed (RGB, BGR, ...)"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlPixelFormat {
#[doc = " Amount of channels available in a pixel buffer."]
#[doc = " 1: single-channel data, e.g. grayscale"]
#[doc = " 2: single-channel + alpha"]
#[doc = " 3: trichromatic, e.g. RGB"]
#[doc = " 4: trichromatic + alpha"]
#[doc = " TODO(lode): this needs finetuning. It is not yet defined how the user"]
#[doc = " chooses output color space. CMYK+alpha needs 5 channels."]
pub num_channels: size_t,
#[doc = " Data type of each channel."]
pub data_type: JpegxlDataType,
}
#[test]
fn bindgen_test_layout_JpegxlPixelFormat() {
assert_eq!(
::std::mem::size_of::<JpegxlPixelFormat>(),
16usize,
concat!("Size of: ", stringify!(JpegxlPixelFormat))
);
assert_eq!(
::std::mem::align_of::<JpegxlPixelFormat>(),
8usize,
concat!("Alignment of ", stringify!(JpegxlPixelFormat))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlPixelFormat>())).num_channels as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlPixelFormat),
"::",
stringify!(num_channels)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JpegxlPixelFormat>())).data_type as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(JpegxlPixelFormat),
"::",
stringify!(data_type)
)
);
}
extern "C" {
#[doc = " Set the parallel runner for multithreading. May only be set before starting"]
#[doc = " decoding."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param parallel_runner function pointer to runner for multithreading. It may"]
#[doc = " be NULL to use the default, single-threaded, runner. A multithreaded"]
#[doc = " runner should be set to reach fast performance."]
#[doc = " @param parallel_runner_opaque opaque pointer for parallel_runner."]
#[doc = " @return JPEGXL_DEC_SUCCESS if the runner was set, JPEGXL_DEC_ERROR"]
#[doc = " otherwise (the previous runner remains set)."]
pub fn JpegxlDecoderSetParallelRunner(
dec: *mut JpegxlDecoder,
parallel_runner: JpegxlParallelRunner,
parallel_runner_opaque: *mut ::std::os::raw::c_void,
) -> JpegxlDecoderStatus;
}
#[doc = " Specifies how the color profile information of the image can be retrieved,"]
#[doc = " Either through ICC profile, or through JpegxlColorEncoding."]
#[doc = ""]
#[doc = " The following scenarios are possible:"]
#[doc = " - The ICC profile is accurate and the color encoding is invalid. Only the"]
#[doc = " ICC profile may be requested."]
#[doc = " - the ICC profile is inaccurate and the color encoding is valid. Both can"]
#[doc = " be requested, but only the color encoding correctly specifies the color, the"]
#[doc = " ICC profile is an approximation that can be used when only ICC profile is"]
#[doc = " supported."]
#[doc = " - Both are valid and accurate, any can be used equally well."]
#[doc = ""]
#[doc = " Example: for PQ or HLG color, JpegxlDecoderGetColorEncoding describes the"]
#[doc = " transfer function more correctly and the ICC profile will not be accurate. On"]
#[doc = " the other hand, there exist transfer functions that can only be described by"]
#[doc = " an ICC profile, in that case icc_profile_accurate is JPEGXL_TRUE and"]
#[doc = " color_encoding_valid is JPEGXL_FALSE."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JpegxlColorProfileSource {
#[doc = " If JPEGXL_TRUE, the ICC profile describes the image color encoding, once"]
#[doc = " the ICC profile has been decoded. If JPEGXL_FALSE, the ICC profile is not"]
#[doc = " accurate and a JpegxlDecoderGetColorEncoding must be used instead to"]
#[doc = " accurately describe the color profile of the image. An ICC profile can"]
#[doc = " still be requested, but it will only be an approximation."]
pub icc_profile_accurate: ::std::os::raw::c_int,
#[doc = " If JPEGXL_TRUE, JpegxlDecoderGetColorEncoding describes the image color"]
#[doc = " encoding, once its information is available. If JPEGXL_FALSE, only the ICC"]
#[doc = " profile can be used."]
pub color_encoding_valid: ::std::os::raw::c_int,
#[doc = " ICC profile size in bytes."]
pub icc_profile_size: size_t,
}
#[test]
fn bindgen_test_layout_JpegxlColorProfileSource() {
assert_eq!(
::std::mem::size_of::<JpegxlColorProfileSource>(),
16usize,
concat!("Size of: ", stringify!(JpegxlColorProfileSource))
);
assert_eq!(
::std::mem::align_of::<JpegxlColorProfileSource>(),
8usize,
concat!("Alignment of ", stringify!(JpegxlColorProfileSource))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorProfileSource>())).icc_profile_accurate as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorProfileSource),
"::",
stringify!(icc_profile_accurate)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorProfileSource>())).color_encoding_valid as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorProfileSource),
"::",
stringify!(color_encoding_valid)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JpegxlColorProfileSource>())).icc_profile_size as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JpegxlColorProfileSource),
"::",
stringify!(icc_profile_size)
)
);
}
extern "C" {
#[doc = " Returns a hint indicating how many more bytes the decoder is expected to"]
#[doc = " need to make JpegxlDecoderGetBasicInfo available after the next"]
#[doc = " JpegxlDecoderProcessInput call. This is a suggested large enough value for"]
#[doc = " the *avail_in parameter, but it is not guaranteed to be an upper bound nor"]
#[doc = " a lower bound."]
#[doc = " Can be used before the first JpegxlDecoderProcessInput call, and is correct"]
#[doc = " the first time in most cases. If not, JpegxlDecoderSizeHintBasicInfo can be"]
#[doc = " called again to get an updated hint."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @return the size hint in bytes if the basic info is not yet fully decoded."]
#[doc = " @return 0 when the basic info is already available."]
pub fn JpegxlDecoderSizeHintBasicInfo(dec: *const JpegxlDecoder) -> size_t;
}
extern "C" {
#[doc = " Select for which informative events (JPEGXL_DEC_BASIC_INFO, etc...) the"]
#[doc = " decoder should return with a status. It is not required to subscribe to any"]
#[doc = " events, data can still be requested from the decoder as soon as it available."]
#[doc = " By default, the decoder is subscribed to no events (events_wanted == 0), and"]
#[doc = " the decoder will then only return when it cannot continue because it needs"]
#[doc = " more input data or more output buffer. This function may only be be called"]
#[doc = " before using JpegxlDecoderProcessInput"]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param events_wanted bitfield of desired events."]
#[doc = " @return JPEGXL_DEC_SUCCESS if no error, JPEGXL_DEC_ERROR otherwise."]
pub fn JpegxlDecoderSubscribeEvents(
dec: *mut JpegxlDecoder,
events_wanted: ::std::os::raw::c_int,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Decodes JPEG XL file using the available bytes. @p *avail_in indicates how"]
#[doc = " many input bytes are available, and @p *next_in points to the input bytes."]
#[doc = " *avail_in will be decremented by the amount of bytes that have been processed"]
#[doc = " by the decoder and *next_in will be incremented by the same amount, so"]
#[doc = " *next_in will now point at the amount of *avail_in unprocessed bytes. For the"]
#[doc = " next call to this function, all unprocessed bytes must be provided again (the"]
#[doc = " address need not match, but the contents must), and more bytes may be"]
#[doc = " concatenated after the unprocessed bytes."]
#[doc = ""]
#[doc = " The returned status indicates whether the decoder needs more input bytes, or"]
#[doc = " more output buffer for a certain type of output data. No matter what the"]
#[doc = " returned status is (other than JPEGXL_DEC_ERROR), new information, such as"]
#[doc = " JpegxlDecoderGetBasicInfo, may have become available after this call. When"]
#[doc = " the return value is not JPEGXL_DEC_ERROR or JPEGXL_DEC_SUCCESS, the decoding"]
#[doc = " requires more JpegxlDecoderProcessInput calls to continue."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param next_in pointer to next bytes to read from"]
#[doc = " @param avail_in amount of bytes available starting from *next_in"]
#[doc = " @return JPEGXL_DEC_SUCCESS when decoding finished and all events handled."]
#[doc = " @return JPEGXL_DEC_ERROR when decoding failed, e.g. invalid codestream."]
#[doc = " TODO(lode) document the input data mechanism"]
#[doc = " @return JPEGXL_DEC_NEED_MORE_INPUT more input data is necessary."]
#[doc = " @return JPEGXL_DEC_BASIC_INFO when basic info such as image dimensions is"]
#[doc = " available and this informative event is subscribed to."]
#[doc = " @return JPEGXL_DEC_EXTENSIONS when JPEG XL codestream user extensions are"]
#[doc = " available and this informative event is subscribed to."]
#[doc = " @return JPEGXL_DEC_PREVIEW_HEADER when preview dimensions are available and"]
#[doc = " this informative event is subscribed to."]
#[doc = " @return JPEGXL_DEC_ANIMATION_HEADER when animation information is available"]
#[doc = " and this informative event is subscribed to."]
#[doc = " @return JPEGXL_DEC_COLOR_ENCODING when color profile information is"]
#[doc = " available and this informative event is subscribed to."]
#[doc = " @return JPEGXL_DEC_DC when DC pixel information is available and output in"]
#[doc = " the DC buffer."]
#[doc = " @return JPEGXL_DEC_FULL_IMAGE when all pixel information at highest detail is"]
#[doc = " available and has been output in the pixel buffer."]
pub fn JpegxlDecoderProcessInput(
dec: *mut JpegxlDecoder,
next_in: *mut *const u8,
avail_in: *mut size_t,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs the basic image information, such as image dimensions, bit depth and"]
#[doc = " all other JpegxlBasicInfo fields, if available."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param info struct to copy the information into, or NULL to only check"]
#[doc = " whether the information is available through the return value."]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
pub fn JpegxlDecoderGetBasicInfo(
dec: *const JpegxlDecoder,
info: *mut JpegxlBasicInfo,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs information for extra channel at the given index. The index must be"]
#[doc = " smaller than num_extra_channels in the associated JpegxlBasicInfo."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param index index of the extra channel to query."]
#[doc = " @param info struct to copy the information into, or NULL to only check"]
#[doc = " whether the information is available through the return value."]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
pub fn JpegxlDecoderGetExtraChannelInfo(
dec: *const JpegxlDecoder,
index: size_t,
info: *mut JpegxlExtraChannelInfo,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs name for extra channel at the given index in UTF-8. The index must be"]
#[doc = " smaller than num_extra_channels in the associated JpegxlBasicInfo. The buffer"]
#[doc = " for name must have at least name_length + 1 bytes allocated, gotten from"]
#[doc = " the associated JpegxlExtraChannelInfo."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param index index of the extra channel to query."]
#[doc = " @param name buffer to copy the name into"]
#[doc = " @param size size of the name buffer in bytes"]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
pub fn JpegxlDecoderGetExtraChannelName(
dec: *const JpegxlDecoder,
index: size_t,
name: *mut ::std::os::raw::c_char,
size: size_t,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs the preview header, if available."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param preview_header struct to copy the information into, or NULL to only"]
#[doc = " check whether the information is available through the return value."]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
pub fn JpegxlDecoderGetPreviewHeader(
dec: *const JpegxlDecoder,
preview_header: *mut JpegxlPreviewHeader,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs the animation header, if available."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param animation_header struct to copy the information into, or NULL to only"]
#[doc = " check whether the information is available through the return value."]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
pub fn JpegxlDecoderGetAnimationHeader(
dec: *const JpegxlDecoder,
animation_header: *mut JpegxlAnimationHeader,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs the color information, if available. The color info tells whether"]
#[doc = " JpegxlDecoderGetColorEncoding and/or JpegxlDecoderGetICCProfile should be"]
#[doc = " used to get the correct image color profile."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param color_info struct to copy the information into, or NULL to only"]
#[doc = " check whether the information is available through the return value."]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
#[doc = ""]
pub fn JpegxlDecoderGetColorProfileSource(
dec: *const JpegxlDecoder,
color_info: *mut JpegxlColorProfileSource,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs the color profile information, if available. Only may be used if"]
#[doc = " JpegxlColorProfileSource.color_encoding_valid."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param color_encoding struct to copy the information into, or NULL to only"]
#[doc = " check whether the information is available through the return value."]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
pub fn JpegxlDecoderGetColorEncoding(
dec: *const JpegxlDecoder,
color_encoding: *mut JpegxlColorEncoding,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Outputs ICC profile. The output buffer should have enough bytes allocated"]
#[doc = " to contain the icc_size given in the JpegxlColorEncoding."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param icc_profile buffer to copy the ICC profile into"]
#[doc = " @param size size of the icc_profile buffer in bytes"]
#[doc = " @return JPEGXL_DEC_SUCCESS if the value is available,"]
#[doc = " JPEGXL_DEC_NEED_MORE_INPUT if not yet available, JPEGXL_DEC_ERROR in case"]
#[doc = " of other error conditions."]
pub fn JpegxlDecoderGetICCProfile(
dec: *const JpegxlDecoder,
icc_profile: *mut u8,
size: size_t,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Returns the size in bytes the DC image output pixel buffer requires at least"]
#[doc = " to contain the DC image pixels in the given format. This is the minumum size"]
#[doc = " of the buffer for JpegxlDecoderSetDCOutBuffer. Requires the basic image"]
#[doc = " information is available in the decoder."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param format format of pixelsformat of pixels."]
#[doc = " @param size output value, buffer size in bytes"]
#[doc = " @return JPEGXL_DEC_SUCCESS on success, JPEGXL_DEC_ERROR on error, such as"]
#[doc = " information not available yet."]
pub fn JpegxlDecoderDCOutBufferSize(
dec: *const JpegxlDecoder,
format: *const JpegxlPixelFormat,
size: *mut size_t,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Sets the buffer to write the lower resolution (8x8 sub-sampled) DC image"]
#[doc = " to. The size of the buffer must be at least as large as given by"]
#[doc = " JpegxlDecoderDCOutBufferSize. The buffer follows the format described by"]
#[doc = " JpegxlPixelFormat. The DC image has dimensions ceil(sizex / 8) * ceil(sizey /"]
#[doc = " 8). The buffer is owned by the caller."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param format format of pixels. Object owned by user and its contents are"]
#[doc = " copied internally."]
#[doc = " @param buffer buffer type to output the pixel data to"]
#[doc = " @param size size of buffer in bytes"]
#[doc = " @return JPEGXL_DEC_SUCCESS on success, JPEGXL_DEC_ERROR on error, such as"]
#[doc = " size too small."]
pub fn JpegxlDecoderSetDCOutBuffer(
dec: *mut JpegxlDecoder,
format: *const JpegxlPixelFormat,
buffer: *mut ::std::os::raw::c_void,
size: size_t,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Returns the size in bytes the image output pixel buffer requires at least to"]
#[doc = " contain all pixels in the given format. This is the minumum size of the"]
#[doc = " buffer for JpegxlDecoderSetImageOutBuffer. Requires the basic image"]
#[doc = " information is available in the decoder."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param format format of pixelsformat of pixels."]
#[doc = " @param size output value, buffer size in bytes"]
#[doc = " @return JPEGXL_DEC_SUCCESS on success, JPEGXL_DEC_ERROR on error, such as"]
#[doc = " information not available yet."]
pub fn JpegxlDecoderImageOutBufferSize(
dec: *const JpegxlDecoder,
format: *const JpegxlPixelFormat,
size: *mut size_t,
) -> JpegxlDecoderStatus;
}
extern "C" {
#[doc = " Sets the buffer to write the full resolution image to. The size of the"]
#[doc = " buffer must be at least as large as given by JpegxlDecoderImageOutBufferSize."]
#[doc = " The buffer follows the format described by JpegxlPixelFormat. The buffer is"]
#[doc = " owned by the caller."]
#[doc = ""]
#[doc = " @param dec decoder object"]
#[doc = " @param format format of pixelsformat of pixels. Object owned by user and its"]
#[doc = " contents are copied internally."]
#[doc = " @param buffer buffer type to output the pixel data to"]
#[doc = " @param size size of buffer in bytes"]
#[doc = " @return JPEGXL_DEC_SUCCESS on success, JPEGXL_DEC_ERROR on error, such as"]
#[doc = " size too small."]
pub fn JpegxlDecoderSetImageOutBuffer(
dec: *mut JpegxlDecoder,
format: *const JpegxlPixelFormat,
buffer: *mut ::std::os::raw::c_void,
size: size_t,
) -> JpegxlDecoderStatus;
}