[][src]Struct coffee::graphics::Image

pub struct Image { /* fields omitted */ }

A loaded image.

You can use this to load your spritesheets and draw your sprites!

Cloning an Image is cheap, it only clones a handle. It does not create a new copy of the image on the GPU.

Implementations

impl Image[src]

pub fn new<P: AsRef<Path>>(gpu: &mut Gpu, path: P) -> Result<Image>[src]

Loads an Image from the given path.

pub fn load<P: Into<PathBuf>>(path: P) -> Task<Image>[src]

Creates a Task that loads an Image from the given path.

pub fn from_image(gpu: &mut Gpu, image: &DynamicImage) -> Result<Image>[src]

Creates an Image from a DynamicImage of the image crate.

pub fn from_colors(gpu: &mut Gpu, colors: &[Color]) -> Result<Image>[src]

Creates an Image representing a color palette.

Each Color will be a pixel of the image, arranged horizontally.

pub fn width(&self) -> u16[src]

Returns the width of the Image.

pub fn height(&self) -> u16[src]

Returns the height of the Image.

pub fn draw<Q: IntoQuad>(&self, quad: Q, target: &mut Target)[src]

Draws the Image on the given Target.

Trait Implementations

impl Clone for Image[src]

impl Debug for Image[src]

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

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> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,