Struct buffer_graphics_lib::image::Image
source · pub struct Image { /* private fields */ }
Expand description
Images are rectangles of pixels that can be manipulated and drawn on screen
Implementations§
source§impl Image
impl Image
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn get_pixel(&self, x: usize, y: usize) -> Color
pub fn set_pixel(&mut self, x: usize, y: usize, value: Color)
sourcepub fn flip_horizontal(&mut self)
pub fn flip_horizontal(&mut self)
Flip image horizontally
sourcepub fn flip_vertical(&mut self)
pub fn flip_vertical(&mut self)
Flip image vertically
sourcepub fn blend(&self, other: &Image) -> Result<Image, GraphicsError>
pub fn blend(&self, other: &Image) -> Result<Image, GraphicsError>
Blend two images making a new one
pub fn to_renderable<P: Into<Coord>>( self, xy: P, draw_offset: DrawOffset ) -> RenderableImage
Trait Implementations§
source§impl<'de> Deserialize<'de> for Image
impl<'de> Deserialize<'de> for Image
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Renderable<Image> for RenderableImage
impl Renderable<Image> for RenderableImage
Auto Trait Implementations§
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more