Skip to main content

VisibleTile

Struct VisibleTile 

Source
pub struct VisibleTile {
    pub target: TileId,
    pub actual: TileId,
    pub data: Option<TileData>,
    pub fade_opacity: f32,
}
Expand description

A single visible tile, either the exact tile, a parent fallback, or a child fallback (underzoom).

Fields§

§target: TileId

The tile ID that should be displayed at this position.

§actual: TileId

The tile ID whose data is actually available.

§data: Option<TileData>

Decoded pixel data for actual.

§fade_opacity: f32

Per-tile opacity for fade-in transitions (0.0 = fully transparent, 1.0 = fully opaque).

Renderers should multiply the tile fragment alpha by this value. During cross-fade, parent fallback tiles are emitted with a complementary opacity so the overall blending is seamless.

Implementations§

Source§

impl VisibleTile

Source

pub fn is_loaded(&self) -> bool

Whether this tile has data available for rendering.

Source

pub fn is_fallback(&self) -> bool

Whether this tile is using fallback imagery instead of the ideal tile.

Source

pub fn is_overzoomed(&self) -> bool

Whether this tile is overzoomed – i.e. the display zoom exceeds the source’s maximum zoom and the tile is being rendered from a lower-zoom source tile.

Source

pub fn is_child_fallback(&self) -> bool

Whether this tile is using a higher-zoom child as underzoom fallback.

True when the actual tile’s zoom is greater than target’s zoom, meaning a cached child tile is composited into a sub-region of the target’s grid cell while the target itself is still loading.

Source

pub fn texture_region(&self) -> TileTextureRegion

Normalized texture-space region within actual that should be used when rendering this visible tile.

For parent fallback (overzoom), the returned region extracts the relevant sub-tile from the lower-zoom parent texture. For child fallback (underzoom), the full child texture is used — the renderer is responsible for placing the geometry at the child’s grid-cell bounds rather than the target’s.

Source

pub fn pixel_crop_rect(&self, width: u32, height: u32) -> Option<TilePixelRect>

Pixel crop rectangle within an actual image of the given size that should be used when rendering this visible tile.

Trait Implementations§

Source§

impl Clone for VisibleTile

Source§

fn clone(&self) -> VisibleTile

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VisibleTile

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.