iced_wgpu/image/atlas/
entry.rs

1use crate::core::Size;
2use crate::image::atlas;
3
4#[derive(Debug)]
5pub enum Entry {
6    Contiguous(atlas::Allocation),
7    Fragmented {
8        size: Size<u32>,
9        fragments: Vec<Fragment>,
10    },
11}
12
13impl Entry {
14    #[cfg(feature = "image")]
15    pub fn size(&self) -> Size<u32> {
16        match self {
17            Entry::Contiguous(allocation) => allocation.size(),
18            Entry::Fragmented { size, .. } => *size,
19        }
20    }
21}
22
23#[derive(Debug)]
24pub struct Fragment {
25    pub position: (u32, u32),
26    pub allocation: atlas::Allocation,
27}