[−][src]Struct duku::Texture
Image that can be sampled in a shader.
These can be created from bytes of color data, PNGs JPEGs, etc.
Fields
data: Vec<u8>
pixel data as bytes
Implementations
impl Texture
[src]
pub const fn width(&self) -> u32
[src]
Get the width of the texture
pub const fn height(&self) -> u32
[src]
Get the height of the texture
pub fn set_pixel(&mut self, x: u32, y: u32, color: impl Into<Rgb>)
[src]
Set a pixel in the image to a specific color.
Works only if the texture has no mips.
pub fn pixel(&self, x: u32, y: u32) -> Rgb
[src]
Get a pixel's color in the image
pub const fn shader_index(&self) -> u32
[src]
Get index to be used in shader for sampling
Auto Trait Implementations
impl RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl UnwindSafe for Texture
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,
pub 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, 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.
pub 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>,