Struct TileCoordinates

pub struct TileCoordinates { pub tile_index: Vec2<usize>, pub level_index: Vec2<usize> }

Indicates the position and resolution level of a TileBlock or DeepTileBlock.

Fields

tile_index: Vec2<usize>

Index of the tile, not pixel position.

level_index: Vec2<usize>

Index of the Mip/Rip level.

Implementations

impl TileCoordinates

fn write<W: Write>(&self, write: &mut W) -> UnitResult

Without validation, write this instance to the byte stream.

fn read(read: &mut impl Read) -> Result<Self>

Read the value without validating.

fn to_data_indices(&self, tile_size: Vec2<usize>, max: Vec2<usize>) -> Result<IntegerBounds>

The indices which can be used to index into the arrays of a data window. These coordinates are only valid inside the corresponding one header. Will start at 0 and always be positive.

fn to_absolute_indices(&self, tile_size: Vec2<usize>, data_window: IntegerBounds) -> Result<IntegerBounds>

Absolute coordinates inside the global 2D space of a file, may be negative.

fn is_largest_resolution_level(&self) -> bool

Returns if this is the original resolution or a smaller copy.

Trait Implementations

impl Clone for TileCoordinates

fn clone(&self) -> Self

impl Copy for TileCoordinates

impl Debug for TileCoordinates

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for TileCoordinates

impl Hash for TileCoordinates

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for TileCoordinates

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for TileCoordinates

Auto Trait Implementations

impl Freeze for TileCoordinates

impl RefUnwindSafe for TileCoordinates

impl Send for TileCoordinates

impl Sync for TileCoordinates

impl Unpin for TileCoordinates

impl UnsafeUnpin for TileCoordinates

impl UnwindSafe for TileCoordinates

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for TileCoordinates where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for TileCoordinates where ST: ?Sized, DT: ?Sized,

impl<T> Any for TileCoordinates where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for TileCoordinates where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for TileCoordinates where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for TileCoordinates where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for TileCoordinates

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for TileCoordinates

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> Read<Exclusive, BecauseExclusive> for TileCoordinates where T: ?Sized,

impl<T> ToOwned for TileCoordinates where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for TileCoordinates where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for TileCoordinates where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for TileCoordinates where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>