pub struct Params { /* private fields */ }
Expand description
Julia set rendering parameters.
The parameters are:
- Image dimensions (in pixels)
- View dimensions and view center determining the rendered area. (Only the view height is specified explicitly; the width is inferred from the height and the image dimension ratio.)
- Infinity distance
- Upper bound on the iteration count
See the Julia set theory for more details regarding these parameters.
Implementations§
source§impl Params
impl Params
sourcepub fn new(image_dimensions: [u32; 2], view_height: f32) -> Self
pub fn new(image_dimensions: [u32; 2], view_height: f32) -> Self
Creates a new set of params with the specified image_dimensions
and the view_height
of the rendered area.
The remaining parameters are set as follows:
- The width of the rendered area is inferred from these params.
- The view is centered at
0
. - The infinity distance is set at
3
.
Panics
Panics if any of the following conditions do not hold:
image_dimensions
are positiveview_height
is positive
sourcepub fn with_view_center(self, view_center: [f32; 2]) -> Self
pub fn with_view_center(self, view_center: [f32; 2]) -> Self
Sets the view center.
sourcepub fn with_infinity_distance(self, inf_distance: f32) -> Self
pub fn with_infinity_distance(self, inf_distance: f32) -> Self
sourcepub fn with_max_iterations(self, max_iterations: u8) -> Self
pub fn with_max_iterations(self, max_iterations: u8) -> Self
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
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