pub struct TileGeometry {
pub width: u32,
pub height: u32,
pub tile_width: u32,
pub tile_height: u32,
}Expand description
How a grid is cut into tiles: derived arithmetic over the metadata grid and the index header, stored nowhere.
Tiles start at the grid’s first cell and are laid out row-major; the last column and the last row are clipped to the grid, so a tile size need not divide the grid. A tile is cells, never degrees — its geographic footprint follows from the grid block, and the horizontal wrap of a global grid is a property of the grid, not of any tile.
Fields§
§width: u32§height: u32§tile_width: u32§tile_height: u32Implementations§
Source§impl TileGeometry
impl TileGeometry
pub fn new( width: u32, height: u32, tile_width: u32, tile_height: u32, ) -> Result<Self, DecodeError>
pub fn columns(&self) -> u32
pub fn rows(&self) -> u32
pub fn count(&self) -> u32
Sourcepub fn origin(&self, tile: u32) -> (u32, u32)
pub fn origin(&self, tile: u32) -> (u32, u32)
The (row, column) of a tile’s north-west cell in the grid.
Trait Implementations§
Source§impl Clone for TileGeometry
impl Clone for TileGeometry
impl Copy for TileGeometry
Source§impl Debug for TileGeometry
impl Debug for TileGeometry
impl Eq for TileGeometry
Source§impl PartialEq for TileGeometry
impl PartialEq for TileGeometry
impl StructuralPartialEq for TileGeometry
Auto Trait Implementations§
impl Forget for TileGeometry
impl Freeze for TileGeometry
impl Move for TileGeometry
impl RefUnwindSafe for TileGeometry
impl Send for TileGeometry
impl Sync for TileGeometry
impl Unpin for TileGeometry
impl UnsafeUnpin for TileGeometry
impl UnwindSafe for TileGeometry
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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