[][src]Struct pixel_engine::Sprite

pub struct Sprite {
    pub width: u32,
    pub height: u32,
    // some fields omitted
}

Represent a Sprite

Fields

width: u32

The width (in pixels) of the Sprite

height: u32

The height (in pixels) of the Sprite

Implementations

impl Sprite[src]

pub fn load_from_file(path: &Path) -> Result<Sprite, String>[src]

Load a image file and return a Sprite object representing that image

pub fn new_blank() -> Sprite[src]

Create Sprite with a size of 1x1

pub fn new_with_color(w: u32, h: u32, col: Color) -> Sprite[src]

Create Sprite with given size and Color

pub fn new(w: u32, h: u32) -> Sprite[src]

Create a blank Sprite with given size

pub fn set_pixel(&mut self, x: u32, y: u32, col: Color)[src]

Set pixel's Color on a Sprite

pub fn get_pixel(&self, x: u32, y: u32) -> Color[src]

Return the Color of the pixel at given coordinates, if it exist

pub fn get_sample(&self, x: f64, y: f64) -> Color[src]

Return the Color of the pixel at given sample It needs to be between 0.0 and 1.0 (both included)

pub fn get_raw(&self) -> Box<[u8]>[src]

Return the raw Image of the sprite

Trait Implementations

impl Clone for Sprite[src]

impl Debug for Sprite[src]

Auto Trait Implementations

impl RefUnwindSafe for Sprite

impl Send for Sprite

impl Sync for Sprite

impl Unpin for Sprite

impl UnwindSafe for Sprite

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.