pub trait Render {
type Error: Debug + Display;
// Required method
fn render(&self, params: &Params) -> Result<ImageBuffer, Self::Error>;
}
Expand description
Program for a specific Backend
(e.g., OpenCL) corresponding to a specific Julia set.
A single program can be rendered with different parameters (e.g., different output sizes),
but the core settings (e.g., the complex-valued function describing the set) are fixed.
Required Associated Types§
Required Methods§
sourcefn render(&self, params: &Params) -> Result<ImageBuffer, Self::Error>
fn render(&self, params: &Params) -> Result<ImageBuffer, Self::Error>
Renders the Julia set with the specified parameters.
The rendered image is grayscale; each pixel represents the number of iterations to reach
infinity as per the Julia set boundary definition. This number is
normalized to the [0, 255]
range regardless of the maximum iteration count from params
.
You can use the transform
module and/or tools from the image
/ imageproc
crates
to post-process the image.
§Errors
May return an error if the backend does not support rendering with the specified params or due to external reasons (out of memory, etc.).