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: usizeThe 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.