pub struct ClutRowAllocator<const ROWS: usize> { /* private fields */ }Expand description
CLUT-row sub-allocator over a reserved band of ROWS VRAM rows.
Each row holds up to [CLUT_SLOTS_PER_ROW] 16-pixel slots tracked as a
u64 bitmap, so a 4bpp (16-entry) CLUT takes 1 slot and an 8bpp
(256-entry) CLUT takes 16 contiguous slots. ClutRowAllocator::new spans
the whole 1024-pixel row; ClutRowAllocator::with_width narrows the band
to its first width pixels, which is what lets a layout keep the band
clear of every texture page (see VramAllocator::with_clut_band).
Implementations§
Source§impl<const ROWS: usize> ClutRowAllocator<ROWS>
impl<const ROWS: usize> ClutRowAllocator<ROWS>
Sourcepub const fn new(base_y: u16) -> Self
pub const fn new(base_y: u16) -> Self
Build an allocator over rows [base_y, base_y + ROWS), full VRAM width.
Sourcepub const fn with_width(base_y: u16, width: u16) -> Self
pub const fn with_width(base_y: u16, width: u16) -> Self
Build an allocator over rows [base_y, base_y + ROWS) limited to the
first width pixels of each row (a multiple of 16, at most the VRAM
width).
Sourcepub const fn bounds(&self) -> VramRect
pub const fn bounds(&self) -> VramRect
The rectangle every CLUT this allocator can hand out lies inside.
Trait Implementations§
Source§impl<const ROWS: usize> Clone for ClutRowAllocator<ROWS>
impl<const ROWS: usize> Clone for ClutRowAllocator<ROWS>
Source§fn clone(&self) -> ClutRowAllocator<ROWS>
fn clone(&self) -> ClutRowAllocator<ROWS>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const ROWS: usize> Debug for ClutRowAllocator<ROWS>
impl<const ROWS: usize> Debug for ClutRowAllocator<ROWS>
impl<const ROWS: usize> Copy for ClutRowAllocator<ROWS>
Auto Trait Implementations§
impl<const ROWS: usize> Freeze for ClutRowAllocator<ROWS>
impl<const ROWS: usize> RefUnwindSafe for ClutRowAllocator<ROWS>
impl<const ROWS: usize> Send for ClutRowAllocator<ROWS>
impl<const ROWS: usize> Sync for ClutRowAllocator<ROWS>
impl<const ROWS: usize> Unpin for ClutRowAllocator<ROWS>
impl<const ROWS: usize> UnsafeUnpin for ClutRowAllocator<ROWS>
impl<const ROWS: usize> UnwindSafe for ClutRowAllocator<ROWS>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)