Trait simple_blit::Buffer

source ·
pub trait Buffer<T> {
    // Required methods
    fn width(&self) -> u32;
    fn height(&self) -> u32;
    fn get(&self, x: u32, y: u32) -> &T;
}
Expand description

2D immutable buffer trait.

Required Methods§

source

fn width(&self) -> u32

Buffer width

source

fn height(&self) -> u32

Buffer height

source

fn get(&self, x: u32, y: u32) -> &T

Get a value at (x, y). This function must not panic when x < self.width() && y < self.height() (unless you want blit functions to panic). It will not be called with values outside of that range.

Implementors§

source§

impl<Slice, Item> Buffer<Item> for GenericBuffer<Slice, Item>
where Slice: AsRef<[Item]>,