Skip to main content

RenderOptions

Struct RenderOptions 

Source
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

Source

pub fn new(width: usize, height: usize) -> Self

Creates new render options with the specified dimensions and black background.

Source

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.

Source

pub fn with_background(self, rgba: [u8; 4]) -> Self

Sets a custom background color as RGBA bytes.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn bilinear(self) -> Self

Shorthand to enable bilinear interpolation.

Equivalent to .with_interpolation(Interpolation::Bilinear).

Source

pub fn size(&self) -> (usize, usize)

Output image dimensions (width, height) in pixels.

Source

pub fn background(&self) -> Option<[u8; 4]>

Background color as RGBA bytes. None means transparent (all zeros).

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> RenderOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.