pub struct EmbeddedTexture {
pub name: String,
pub pixels: Vec<u8>,
pub width: u32,
pub height: u32,
pub mime_type: String,
}Expand description
An embedded texture.
Fields§
§name: String§pixels: Vec<u8>Raw or encoded bytes (row-major RGBA, TGA, etc.)
width: u32§height: u32§mime_type: StringMIME type hint, e.g. “image/x-raw-rgba” or “image/x-tga”.
Implementations§
Source§impl EmbeddedTexture
impl EmbeddedTexture
Sourcepub fn from_pixel_buffer(name: impl Into<String>, buf: &PixelBuffer) -> Self
pub fn from_pixel_buffer(name: impl Into<String>, buf: &PixelBuffer) -> Self
Create from a raw RGBA PixelBuffer (no encoding).
Sourcepub fn from_tga(name: impl Into<String>, buf: &PixelBuffer) -> Self
pub fn from_tga(name: impl Into<String>, buf: &PixelBuffer) -> Self
Create from a PixelBuffer, encoding the pixels to TGA bytes.
Auto Trait Implementations§
impl Freeze for EmbeddedTexture
impl RefUnwindSafe for EmbeddedTexture
impl Send for EmbeddedTexture
impl Sync for EmbeddedTexture
impl Unpin for EmbeddedTexture
impl UnsafeUnpin for EmbeddedTexture
impl UnwindSafe for EmbeddedTexture
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