use crate::core::Size; use crate::image::atlas; #[derive(Debug)] pub enum Entry { Contiguous(atlas::Allocation), Fragmented { size: Size, fragments: Vec, }, } impl Entry { #[cfg(feature = "image")] pub fn size(&self) -> Size { match self { Entry::Contiguous(allocation) => allocation.size(), Entry::Fragmented { size, .. } => *size, } } } #[derive(Debug)] pub struct Fragment { pub position: (u32, u32), pub allocation: atlas::Allocation, }