Trait pixel_engine_draw::graphics::DrawSpriteTrait
source · pub trait DrawSpriteTrait {
fn get_pixel(&self, pos: Vi2d) -> Option<Color>;
fn set_pixel(&mut self, pos: Vi2d, col: Color);
fn size(&self) -> Vu2d;
unsafe fn get_pixel_unchecked(&self, pos: Vu2d) -> Color;
unsafe fn set_pixel_unchecked(&mut self, pos: Vu2d, col: Color);
}
Required Methods§
fn get_pixel(&self, pos: Vi2d) -> Option<Color>
fn set_pixel(&mut self, pos: Vi2d, col: Color)
fn size(&self) -> Vu2d
sourceunsafe fn get_pixel_unchecked(&self, pos: Vu2d) -> Color
unsafe fn get_pixel_unchecked(&self, pos: Vu2d) -> Color
Get the pixel at the given location, but bypassing any bounds check
Safety
You must ensure that the pos in bounds
sourceunsafe fn set_pixel_unchecked(&mut self, pos: Vu2d, col: Color)
unsafe fn set_pixel_unchecked(&mut self, pos: Vu2d, col: Color)
Set the pixel at the given location, but bypassing any bounds check
Safety
You must ensure that the pos in bounds