use std::fmt::Write as _;
pub use box_header::BoxHeader;
mod box_header;
pub mod ftyp;
pub mod heif;
pub mod search;
pub const XMP_UUID: [u8; 16] = [
0xBE, 0x7A, 0xCF, 0xCB, 0x97, 0xA9, 0x42, 0xE8, 0x9C, 0x71, 0x99, 0x94, 0x91, 0xE3, 0xAF, 0xAC,
];
pub const XMP_BOX_ID: [u8; 4] = *b"XMP_";
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
pub enum BoxType {
Id([u8; 4]),
Uuid([u8; 16]),
}
impl core::fmt::Debug for BoxType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Id(id) => {
f.write_str("Id(\"")?;
for u in id {
f.write_char(*u as char)?;
}
f.write_char('"')?;
f.write_char(')')
}
Self::Uuid(uuid) => {
f.write_str("Id(\"")?;
for u in uuid {
f.write_char(*u as char)?;
}
f.write_char('"')?;
f.write_char(')')
}
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
pub enum BoxSize {
Small(u32),
Large(u64),
Eof,
}