Struct librashader_runtime::image::Image
source · pub struct Image<P: PixelFormat = RGBA8> {
pub bytes: Vec<u8>,
pub size: Size<u32>,
pub pitch: usize,
/* private fields */
}
Expand description
An uncompressed raw image ready to upload to GPU buffers.
Fields§
§bytes: Vec<u8>
The raw bytes of the image.
size: Size<u32>
The size dimensions of the image.
pitch: usize
The byte pitch of the image.
Implementations§
source§impl<P: PixelFormat> Image<P>
impl<P: PixelFormat> Image<P>
sourcepub fn load(
path: impl AsRef<Path>,
direction: UVDirection
) -> Result<Self, ImageError>
pub fn load( path: impl AsRef<Path>, direction: UVDirection ) -> Result<Self, ImageError>
Load the image from the path as RGBA8.
Auto Trait Implementations§
impl<P> RefUnwindSafe for Image<P>where
P: RefUnwindSafe,
impl<P> Send for Image<P>where
P: Send,
impl<P> Sync for Image<P>where
P: Sync,
impl<P> Unpin for Image<P>where
P: Unpin,
impl<P> UnwindSafe for Image<P>where
P: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more