Trait Surface

Source
pub trait Surface: for<'a> TexelDesignatorRef<'a> + for<'a> TexelDesignatorMut<'a> {
    type Texel;

    // Required methods
    fn texel(&self, x: u32, y: u32) -> Option<TexelRef<'_, Self>>;
    fn texel_mut(&mut self, x: u32, y: u32) -> Option<TexelMut<'_, Self>>;
    fn clear(&mut self, value: Self::Texel);
    fn width(&self) -> u32;
    fn height(&self) -> u32;
}
Expand description

So-so display surface trait for reuse purposes.

Required Associated Types§

Source

type Texel

Specific texel type.

Required Methods§

Source

fn texel(&self, x: u32, y: u32) -> Option<TexelRef<'_, Self>>

Get texel reference given its coordinates.

Source

fn texel_mut(&mut self, x: u32, y: u32) -> Option<TexelMut<'_, Self>>

Get mutable texel reference given its coordinates.

Source

fn clear(&mut self, value: Self::Texel)

Clear the surface with the given color.

Source

fn width(&self) -> u32

Get surface width.

Source

fn height(&self) -> u32

Get surface height.

Implementors§