iced_wgpu/image/atlas/
layer.rs

1use crate::image::atlas::Allocator;
2
3#[derive(Debug)]
4pub enum Layer {
5    Empty,
6    Busy(Allocator),
7    Full,
8}
9
10impl Layer {
11    pub fn is_empty(&self) -> bool {
12        matches!(self, Layer::Empty)
13    }
14
15    pub fn allocations(&self) -> usize {
16        match self {
17            Layer::Empty => 0,
18            Layer::Busy(allocator) => allocator.allocations(),
19            Layer::Full => 1,
20        }
21    }
22}