pub struct RenderResult { /* private fields */ }Expand description
The result of a render operation.
Bundles the rendered RGBA image with metadata describing the pixel-to-coordinate mapping, enabling a consuming application to accurately place the image on a map, draw overlays, and query data values.
Implementations§
Source§impl RenderResult
impl RenderResult
Sourcepub fn new(image: RgbaImage, metadata: RenderMetadata) -> Self
pub fn new(image: RgbaImage, metadata: RenderMetadata) -> Self
Create a new render result from an image and metadata.
Sourcepub fn into_image(self) -> RgbaImage
pub fn into_image(self) -> RgbaImage
Consume the result and return the image.
Sourcepub fn metadata(&self) -> &RenderMetadata
pub fn metadata(&self) -> &RenderMetadata
Metadata describing the pixel-to-coordinate mapping.
Sourcepub fn save<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save the rendered image to a file.
The output format is inferred from the file extension (e.g., .png, .jpg).
This is a convenience wrapper around image::RgbaImage::save.
§Errors
Returns an error if the file cannot be written or the format is unsupported.
Sourcepub fn query_pixel(
&self,
field: &SweepField,
x: f64,
y: f64,
) -> Option<PointQuery>
pub fn query_pixel( &self, field: &SweepField, x: f64, y: f64, ) -> Option<PointQuery>
Query the data value at a pixel coordinate.
Uses the metadata’s pixel-to-polar conversion and then looks up the value
in the provided field. Returns None if the pixel is outside the rendered area.
Sourcepub fn query_polar(
&self,
field: &SweepField,
azimuth_degrees: f32,
range_km: f64,
) -> Option<PointQuery>
pub fn query_polar( &self, field: &SweepField, azimuth_degrees: f32, range_km: f64, ) -> Option<PointQuery>
Query the data value at a polar coordinate.
Sourcepub fn query_geo(
&self,
field: &SweepField,
point: &GeoPoint,
) -> Option<PointQuery>
pub fn query_geo( &self, field: &SweepField, point: &GeoPoint, ) -> Option<PointQuery>
Query the data value at a geographic coordinate.
Requires a coordinate system in the metadata. Returns None if no coordinate
system is available or the point is outside the rendered area.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RenderResult
impl RefUnwindSafe for RenderResult
impl Send for RenderResult
impl Sync for RenderResult
impl Unpin for RenderResult
impl UnsafeUnpin for RenderResult
impl UnwindSafe for RenderResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more