pub struct DynamicImageOverlayLayer { /* private fields */ }Expand description
A georeferenced overlay with dynamic frame content.
This is the Rustial equivalent of MapLibre / Mapbox video and
canvas source types. A FrameProvider supplies RGBA8 frames
which are rendered as a textured quad at the specified geographic
coordinates.
The layer caches the most recent frame and tracks a generation
counter for change detection. Renderers see this layer through
the same ImageOverlayData path as ImageOverlayLayer,
so no renderer changes are required.
Implementations§
Source§impl DynamicImageOverlayLayer
impl DynamicImageOverlayLayer
Sourcepub fn new(
name: impl Into<String>,
coordinates: [GeoCoord; 4],
provider: Box<dyn FrameProvider>,
) -> Self
pub fn new( name: impl Into<String>, coordinates: [GeoCoord; 4], provider: Box<dyn FrameProvider>, ) -> Self
Create a new dynamic image overlay layer.
coordinates must be in TL → TR → BR → BL order.
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 generation(&self) -> u64
pub fn generation(&self) -> u64
Monotonic generation counter, bumped on coordinate or frame changes.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Cached frame dimensions (width, height).
Sourcepub fn poll_frame(&mut self) -> bool
pub fn poll_frame(&mut self) -> bool
Poll the frame provider for new data.
Returns true if a new frame was received and the cached data
was updated.
Sourcepub fn to_overlay_data(
&self,
projection: CameraProjection,
) -> Option<ImageOverlayData>
pub fn to_overlay_data( &self, projection: CameraProjection, ) -> Option<ImageOverlayData>
Produce renderer-ready overlay data by projecting geographic corners into the active world-space coordinate system.
Returns None if no frame has been received yet.
Sourcepub fn provider(&self) -> &dyn FrameProvider
pub fn provider(&self) -> &dyn FrameProvider
Access the underlying frame provider.
Sourcepub fn provider_mut(&mut self) -> &mut dyn FrameProvider
pub fn provider_mut(&mut self) -> &mut dyn FrameProvider
Access the underlying frame provider mutably.
Trait Implementations§
Source§impl Debug for DynamicImageOverlayLayer
impl Debug for DynamicImageOverlayLayer
Source§impl Layer for DynamicImageOverlayLayer
impl Layer for DynamicImageOverlayLayer
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.