Render

Trait 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§

Source§

impl Render for OpenClProgram

Available on crate feature opencl_backend only.
Source§

impl Render for VulkanProgram

Available on crate feature vulkan_backend only.
Source§

impl<F: ComputePoint> Render for CpuProgram<F>

Available on crate feature cpu_backend only.