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.
Sourcepub fn load_from_buffer(
buffer: TextureBuffer,
direction: UVDirection,
) -> Result<Self, ImageError>
pub fn load_from_buffer( buffer: TextureBuffer, direction: UVDirection, ) -> Result<Self, ImageError>
Load te image from a TextureBuffer
from a ShaderPresetPack
.
Auto Trait Implementations§
impl<P> Freeze for Image<P>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more