Trait julia_set::Render

source ·
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§

source

type Error: Debug + Display

Error that may be returned during rendering.

Required Methods§

source

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.).

Implementors§