pub struct ImageOverlayLayer { /* private fields */ }Expand description
A georeferenced raster image rendered as a textured quadrilateral.
This is the Rustial equivalent of MapLibre / Mapbox’s image source.
The image is pinned to four geographic corner coordinates and rendered
as a textured quad in the active camera projection.
§Coordinate order
Corners are specified in TL → TR → BR → BL (clockwise) order,
matching the MapLibre coordinates array convention.
Implementations§
Source§impl ImageOverlayLayer
impl ImageOverlayLayer
Sourcepub fn new(
name: impl Into<String>,
coordinates: [GeoCoord; 4],
width: u32,
height: u32,
data: Vec<u8>,
) -> Self
pub fn new( name: impl Into<String>, coordinates: [GeoCoord; 4], width: u32, height: u32, data: Vec<u8>, ) -> Self
Create a new image overlay layer.
corners must be in TL → TR → BR → BL order.
data must be RGBA8 pixel data of length width * height * 4.
Sourcepub fn coordinates(&self) -> &[GeoCoord; 4]
pub fn coordinates(&self) -> &[GeoCoord; 4]
Geographic corners (TL, TR, BR, BL).
Sourcepub fn set_coordinates(&mut self, coordinates: [GeoCoord; 4])
pub fn set_coordinates(&mut self, coordinates: [GeoCoord; 4])
Update the geographic corners.
Sourcepub fn update_image(&mut self, width: u32, height: u32, data: Vec<u8>)
pub fn update_image(&mut self, width: u32, height: u32, data: Vec<u8>)
Replace the image pixel data.
data must be RGBA8 of length width * height * 4.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Monotonic generation counter, bumped on coordinate or image changes.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Image dimensions (width, height).
Sourcepub fn to_overlay_data(&self, projection: CameraProjection) -> ImageOverlayData
pub fn to_overlay_data(&self, projection: CameraProjection) -> ImageOverlayData
Produce renderer-ready overlay data by projecting geographic corners into the active world-space coordinate system.
Trait Implementations§
Source§impl Clone for ImageOverlayLayer
impl Clone for ImageOverlayLayer
Source§fn clone(&self) -> ImageOverlayLayer
fn clone(&self) -> ImageOverlayLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImageOverlayLayer
impl Debug for ImageOverlayLayer
Source§impl Layer for ImageOverlayLayer
impl Layer for ImageOverlayLayer
Source§fn set_visible(&mut self, visible: bool)
fn set_visible(&mut self, visible: bool)
Source§fn set_opacity(&mut self, opacity: f32)
fn set_opacity(&mut self, opacity: f32)
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any for mutable concrete type access.