pub struct Tilemap { /* private fields */ }Implementations§
Source§impl Tilemap
impl Tilemap
Sourcepub fn new(nametable_data: &[u8]) -> Self
pub fn new(nametable_data: &[u8]) -> Self
Loads and parses a SNES-nametable from little-endian byte data. It also associates it with a tileset and palette.
pub fn tile_iter(&self) -> impl Iterator<Item = &NametableEntry>
Sourcepub fn generate_image(
&self,
tiles_wide: u32,
tileset: &Tileset,
palette: &Palette,
) -> ImageBuffer<Rgba<u8>, Vec<u8>>
pub fn generate_image( &self, tiles_wide: u32, tileset: &Tileset, palette: &Palette, ) -> ImageBuffer<Rgba<u8>, Vec<u8>>
Generates an image from the tilemap given a width in tiles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tilemap
impl RefUnwindSafe for Tilemap
impl Send for Tilemap
impl Sync for Tilemap
impl Unpin for Tilemap
impl UnwindSafe for Tilemap
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