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.).
Implementors§
Source§impl Render for OpenClProgram
Available on crate feature opencl_backend only.
impl Render for OpenClProgram
opencl_backend only.Source§impl Render for VulkanProgram
Available on crate feature vulkan_backend only.
impl Render for VulkanProgram
vulkan_backend only.Source§impl<F: ComputePoint> Render for CpuProgram<F>
Available on crate feature cpu_backend only.
impl<F: ComputePoint> Render for CpuProgram<F>
cpu_backend only.