[−][src]Struct coffee::graphics::Image
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]
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]
Trait Implementations
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]
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> Same<T> for T
type Output = T
Should always be Self
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<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,