pub struct EmbeddedTexture {
pub slot: u32,
pub rgba: Vec<u8>,
pub width: u32,
pub height: u32,
}Expand description
One atlas image decoded out of an embedded .ssab.
The pixels are straight-alpha RGBA8, exactly as the PNG decoded: whoever
takes them decides what to do about premultiplication.
crate::SSRenderer::upload_texture premultiplies on the way to the GPU; an
engine that puts them in its own asset system declares
crate::AlphaMode::Straight instead.
Fields§
§slot: u32The cellmap’s name_hash — what DrawBatch.texture_hash carries.
A slot inside this pack, not an identity for the image: hand it to
crate::SSPlayer::texture_key for what crate::SSRenderer is keyed
by. The two differ whenever two packs could name one atlas alike, which
a tool that names every project’s atlas spritemap1.png does.
rgba: Vec<u8>Straight-alpha RGBA8, width * height * 4 bytes.
width: u32§height: u32Auto 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