pub struct AtlasUpload {
pub page: u32,
pub x: u32,
pub y: u32,
pub w: u32,
pub h: u32,
pub rgba: Vec<u8>,
}Expand description
One pending atlas upload: blit rgba (tight w*h*4 bytes) into
page at (x, y). Built from a repame-atlas drain by the game.
Fields§
§page: u32§x: u32§y: u32§w: u32§h: u32§rgba: Vec<u8>Implementations§
Source§impl AtlasUpload
impl AtlasUpload
Sourcepub fn from_write(write: &AtlasWrite, rgba: Vec<u8>) -> AtlasUpload
pub fn from_write(write: &AtlasWrite, rgba: Vec<u8>) -> AtlasUpload
Bridge an atlas placement to a GPU upload. rgba must hold the
sprite’s pixels row-major, w*h*4 bytes; mismatches are dropped
with a warning at prepare time.
Sourcepub fn white(page: u32, x: u32, y: u32) -> AtlasUpload
pub fn white(page: u32, x: u32, y: u32) -> AtlasUpload
1x1 white texel upload for repame_atlas::Atlas::ensure_white:
pair with the drained write for the white key (usually 1x1 at the
returned x/y/page). Sampling it gives solid tint (particles,
untextured quads) instead of random atlas art.
Sourcepub fn white_for(write: &AtlasWrite) -> AtlasUpload
pub fn white_for(write: &AtlasWrite) -> AtlasUpload
White upload built straight from the drained repame_atlas::AtlasWrite
for the white key.
Trait Implementations§
Source§impl Clone for AtlasUpload
impl Clone for AtlasUpload
Source§fn clone(&self) -> AtlasUpload
fn clone(&self) -> AtlasUpload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AtlasUpload
impl RefUnwindSafe for AtlasUpload
impl Send for AtlasUpload
impl Sync for AtlasUpload
impl Unpin for AtlasUpload
impl UnsafeUnpin for AtlasUpload
impl UnwindSafe for AtlasUpload
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.