#[derive(Clone, Debug)]
pub struct META_PLACEABLE {
pub key: u32,
pub hwmf: u16,
pub bounding_box: crate::wmf::parser::Rect,
pub inch: u16,
pub reserved: u32,
pub checksum: [u8; 2],
}
impl META_PLACEABLE {
#[cfg_attr(feature = "tracing", tracing::instrument(
level = tracing::Level::TRACE,
skip_all,
fields(key = %format!("{key:#010X}")),
err(level = tracing::Level::ERROR, Display),
))]
pub(in crate::wmf::parser::records::control) fn parse<R: crate::wmf::Read>(
buf: &mut R,
key: u32,
) -> Result<(Self, usize), crate::wmf::parser::ParseError> {
let (
(hwmf, hwmf_bytes),
(bounding_box, bounding_box_bytes),
(inch, inch_bytes),
(reserved, reserved_bytes),
(checksum, checksum_bytes),
) = (
crate::wmf::parser::read_u16_from_le_bytes(buf)?,
crate::wmf::parser::Rect::parse(buf)?,
crate::wmf::parser::read_u16_from_le_bytes(buf)?,
crate::wmf::parser::read_u32_from_le_bytes(buf)?,
crate::wmf::parser::read::<R, 2>(buf)?,
);
let consumed_bytes =
hwmf_bytes + bounding_box_bytes + inch_bytes + reserved_bytes + checksum_bytes;
Ok((
Self {
key,
hwmf,
bounding_box,
inch,
reserved,
checksum,
},
consumed_bytes,
))
}
}