[−][src]Struct pixel_engine::Sprite
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]
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]
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,