pub struct RenderOptions { /* private fields */ }Expand description
Options for rendering radar radials.
Use the builder methods to configure rendering options, then pass to
render_radials.
§Example
use nexrad_render::RenderOptions;
// Render 800x800 with black background (default)
let options = RenderOptions::new(800, 800);
// Render with transparent background for compositing
let options = RenderOptions::new(800, 800).transparent();
// Render with custom background color (RGBA)
let options = RenderOptions::new(800, 800).with_background([255, 255, 255, 255]);Implementations§
Source§impl RenderOptions
impl RenderOptions
Sourcepub fn new(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize) -> Self
Creates new render options with the specified dimensions and black background.
Sourcepub fn transparent(self) -> Self
pub fn transparent(self) -> Self
Sets the background to transparent for compositing.
When rendering with a transparent background, areas without radar data will be fully transparent, allowing multiple renders to be layered.
Sourcepub fn with_background(self, rgba: [u8; 4]) -> Self
pub fn with_background(self, rgba: [u8; 4]) -> Self
Sets a custom background color as RGBA bytes.
Sourcepub fn with_extent(self, extent: GeoExtent) -> Self
pub fn with_extent(self, extent: GeoExtent) -> Self
Sets a geographic extent for the rendered area.
When set, the image covers exactly this extent. This enables consistent spatial mapping for side-by-side comparison of multiple renders.
Sourcepub fn with_coord_system(self, coord_system: RadarCoordinateSystem) -> Self
pub fn with_coord_system(self, coord_system: RadarCoordinateSystem) -> Self
Sets a radar coordinate system for geographic projection.
This enables geographic metadata in the RenderResult, including
pixel-to-geo and geo-to-pixel coordinate conversions.
Sourcepub fn native_for(field: &SweepField) -> Self
pub fn native_for(field: &SweepField) -> Self
Creates render options sized for native resolution of a sweep field.
Sets both width and height to gate_count * 2, which ensures approximately
one pixel per gate at the outer edge of the sweep. This produces the highest
fidelity rendering without wasting pixels.
Sourcepub fn with_interpolation(self, interpolation: Interpolation) -> Self
pub fn with_interpolation(self, interpolation: Interpolation) -> Self
Sets the interpolation method for rendering.
Default is Interpolation::Nearest. Use Interpolation::Bilinear
for smoother output that blends neighboring data gates.
Sourcepub fn bilinear(self) -> Self
pub fn bilinear(self) -> Self
Shorthand to enable bilinear interpolation.
Equivalent to .with_interpolation(Interpolation::Bilinear).
Sourcepub fn background(&self) -> Option<[u8; 4]>
pub fn background(&self) -> Option<[u8; 4]>
Background color as RGBA bytes. None means transparent (all zeros).
Sourcepub fn extent(&self) -> Option<&GeoExtent>
pub fn extent(&self) -> Option<&GeoExtent>
Geographic extent to render. If None, auto-computed from data range.
When set, the image covers exactly this extent, enabling consistent spatial mapping across multiple renders for side-by-side comparison.
Sourcepub fn coord_system(&self) -> Option<&RadarCoordinateSystem>
pub fn coord_system(&self) -> Option<&RadarCoordinateSystem>
Radar coordinate system for geographic projection.
When provided, the RenderResult will include geographic metadata
enabling pixel-to-geo and geo-to-pixel coordinate conversions.
Sourcepub fn interpolation(&self) -> Interpolation
pub fn interpolation(&self) -> Interpolation
Interpolation method for pixel sampling.
Default is Interpolation::Nearest. Use Interpolation::Bilinear
for smoother output that blends neighboring data gates.
Trait Implementations§
Source§impl Clone for RenderOptions
impl Clone for RenderOptions
Source§fn clone(&self) -> RenderOptions
fn clone(&self) -> RenderOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RenderOptions
impl RefUnwindSafe for RenderOptions
impl Send for RenderOptions
impl Sync for RenderOptions
impl Unpin for RenderOptions
impl UnsafeUnpin for RenderOptions
impl UnwindSafe for RenderOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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