pub struct TilePyramid {
pub width: u64,
pub height: u64,
pub tile_width: u32,
pub tile_height: u32,
pub num_levels: u32,
pub tiles_per_level: Vec<(u32, u32)>,
}Expand description
Tile pyramid metadata
Fields§
§width: u64Image width in pixels
height: u64Image height in pixels
tile_width: u32Tile width in pixels
tile_height: u32Tile height in pixels
num_levels: u32Number of pyramid levels
tiles_per_level: Vec<(u32, u32)>Tiles per level (width, height)
Implementations§
Source§impl TilePyramid
impl TilePyramid
Sourcepub fn new(width: u64, height: u64, tile_width: u32, tile_height: u32) -> Self
pub fn new(width: u64, height: u64, tile_width: u32, tile_height: u32) -> Self
Creates a new tile pyramid
Sourcepub fn tiles_at_level(&self, level: u32) -> Option<(u32, u32)>
pub fn tiles_at_level(&self, level: u32) -> Option<(u32, u32)>
Returns the number of tiles at a given level
Sourcepub fn bounds_at_level(&self, level: u32) -> Option<TileBounds>
pub fn bounds_at_level(&self, level: u32) -> Option<TileBounds>
Returns the tile bounds for a given level
Sourcepub fn is_valid_coord(&self, coord: &TileCoord) -> bool
pub fn is_valid_coord(&self, coord: &TileCoord) -> bool
Checks if a tile coordinate is valid
Sourcepub fn total_tiles(&self) -> u64
pub fn total_tiles(&self) -> u64
Returns the total number of tiles in the pyramid
Trait Implementations§
Source§impl Clone for TilePyramid
impl Clone for TilePyramid
Source§fn clone(&self) -> TilePyramid
fn clone(&self) -> TilePyramid
Returns a duplicate of the value. Read more
1.0.0 · 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 TilePyramid
impl RefUnwindSafe for TilePyramid
impl Send for TilePyramid
impl Sync for TilePyramid
impl Unpin for TilePyramid
impl UnsafeUnpin for TilePyramid
impl UnwindSafe for TilePyramid
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