pub struct AtlasSession { /* private fields */ }Implementations§
Source§impl AtlasSession
impl AtlasSession
pub fn new(cfg: PackerConfig, strategy: RuntimeStrategy) -> Self
pub fn append( &mut self, key: String, w: u32, h: u32, ) -> Result<(usize, Frame<String>)>
pub fn evict(&mut self, page_id: usize, key: &str) -> bool
pub fn snapshot_atlas(&self) -> Atlas<String>
Sourcepub fn get_frame(&self, key: &str) -> Option<(usize, &Frame<String>)>
pub fn get_frame(&self, key: &str) -> Option<(usize, &Frame<String>)>
Find a frame by its key. Returns the page ID and a reference to the frame if found.
Sourcepub fn get_reserved_slot(&self, key: &str) -> Option<(usize, Rect)>
pub fn get_reserved_slot(&self, key: &str) -> Option<(usize, Rect)>
Find the reserved slot rectangle for a texture key (pre-offset area including padding/extrude).
Sourcepub fn evict_by_key(&mut self, key: &str) -> bool
pub fn evict_by_key(&mut self, key: &str) -> bool
Evict a texture by its key without needing to know the page ID. Returns true if the texture was found and evicted.
Sourcepub fn texture_count(&self) -> usize
pub fn texture_count(&self) -> usize
Get the number of textures currently in the atlas.
Sourcepub fn stats(&self) -> RuntimeStats
pub fn stats(&self) -> RuntimeStats
Get runtime statistics about the atlas session.
Auto Trait Implementations§
impl Freeze for AtlasSession
impl RefUnwindSafe for AtlasSession
impl Send for AtlasSession
impl Sync for AtlasSession
impl Unpin for AtlasSession
impl UnwindSafe for AtlasSession
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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