pub struct RenderOptions {
pub size: (usize, usize),
pub background: Option<[u8; 4]>,
}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]);Fields§
§size: (usize, usize)Output image dimensions (width, height) in pixels.
background: Option<[u8; 4]>Background color as RGBA bytes. None means transparent (all zeros).
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.
Trait Implementations§
Source§impl Clone for RenderOptions
impl Clone for RenderOptions
Source§fn clone(&self) -> RenderOptions
fn clone(&self) -> RenderOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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 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
Mutably borrows from an owned value. Read more
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>
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 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>
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