use std::ffi::c_char;
#[cfg(doc)]
use crate::metadata::codestream_header::JxlBasicInfo;
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum JxlBool {
True = 1,
False = 0,
}
impl From<bool> for JxlBool {
fn from(b: bool) -> Self {
if b {
JxlBool::True
} else {
JxlBool::False
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum JxlDataType {
Float = 0,
Uint8 = 2,
Uint16 = 3,
Float16 = 5,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum JxlEndianness {
Native = 0,
Little = 1,
Big = 2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct JxlPixelFormat {
pub num_channels: u32,
pub data_type: JxlDataType,
pub endianness: JxlEndianness,
pub align: usize,
}
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum JxlBitDepthType {
FromPixelFormat = 0,
FromCodestream = 1,
Custom = 2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct JxlBitDepth {
pub r#type: JxlBitDepthType,
pub bits_per_sample: u32,
pub exponent_bits_per_sample: u32,
}
#[repr(transparent)]
pub struct JxlBoxType(pub [c_char; 4]);