Trait hyperion::image::Image

source ·
pub trait Image: Sized {
    // Required methods
    fn width(&self) -> u16;
    fn height(&self) -> u16;
    fn color_at(&self, x: u16, y: u16) -> Option<Color>;
    unsafe fn color_at_unchecked(&self, x: u16, y: u16) -> Color;
    fn to_raw_image(&self) -> RawImage;
}

Required Methods§

source

fn width(&self) -> u16

Get the width of the image, in pixels

source

fn height(&self) -> u16

Get the height of the image, in pixels

source

fn color_at(&self, x: u16, y: u16) -> Option<Color>

Get the color at the given coordinates

source

unsafe fn color_at_unchecked(&self, x: u16, y: u16) -> Color

Get the color at the given coordinates skipping bound checks

Safety

The caller is responsible to ensure that 0 <= x < width and 0 <= y < height.

source

fn to_raw_image(&self) -> RawImage

Convert this image trait object to a raw image

Implementors§

source§

impl Image for RawImage

source§

impl<'i, T: Image> Image for ImageView<'i, T>