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: TileIdThe tile ID that should be displayed at this position.
actual: TileIdThe tile ID whose data is actually available.
data: Option<TileData>Decoded pixel data for actual.
fade_opacity: f32Per-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
impl VisibleTile
Sourcepub fn is_fallback(&self) -> bool
pub fn is_fallback(&self) -> bool
Whether this tile is using fallback imagery instead of the ideal tile.
Sourcepub fn is_overzoomed(&self) -> bool
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.
Sourcepub fn is_child_fallback(&self) -> bool
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.
Sourcepub fn texture_region(&self) -> TileTextureRegion
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.
Sourcepub fn pixel_crop_rect(&self, width: u32, height: u32) -> Option<TilePixelRect>
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
impl Clone for VisibleTile
Source§fn clone(&self) -> VisibleTile
fn clone(&self) -> VisibleTile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more