pub fn render(x: f32, y: f32, max_iterations: u32, mode: Mode) -> ::image::Rgba<u8> {
    match escape(&Complex::new(x, y), max_iterations) {
        None => util::rgba(0.0, 0.0, 0.0, 1.0),
        Some(_) if mode == Mode::Basic => util::rgba(0.0, 0.0, 0.0, 0.0),
        Some(n) if mode == Mode::Fancy => {
            let i = (n as f32 / max_iterations as f32).powf(0.2);
            let hue = ((i + 0.5) % 1.0) * 2.0 * ::std::f32::consts::PI;
            util::hsva(hue, 1.0, 1.0, 1.0)
        },
        Some(_) => panic!("Unexpected case - unknown mode?")
    }
}
/// Render a single pixel of a Mandelbrot visualization
Render a single pixel of a Mandelbrot visualization
Render a single pixel of a Mandelbrot visualization
pub fn render(x: f32, y: f32, max_iterations: u32, mode: Mode) -> ::image::Rgba<u8> {
    match escape(&Complex::new(x, y), max_iterations) {
        None => util::rgba(0.0, 0.0, 0.0, 1.0),
        Some(_) if mode == Mode::Basic => util::rgba(0.0, 0.0, 0.0, 0.0),
        Some(n) if mode == Mode::Fancy => {
            let i = (n as f32 / max_iterations as f32).powf(0.2);
            let hue = ((i + 0.5) % 1.0) * 2.0 * ::std::f32::consts::PI;
            util::hsva(hue, 1.0, 1.0, 1.0)
        },
        Some(_) => panic!("Unexpected case - unknown mode?")
    }
}
pub fn render ( x : f32 , y : f32 , max_iterations : u32 , mode : Mode ) -> :: image :: Rgba < u8 > { match escape ( & Complex :: new ( x , y ) , max_iterations ) { None => util :: rgba ( 0.0 , 0.0 , 0.0 , 1.0 ) , Some ( _ ) if mode == Mode :: Basic => util :: rgba ( 0.0 , 0.0 , 0.0 , 0.0 ) , Some ( n ) if mode == Mode :: Fancy => { let i = ( n as f32 / max_iterations as f32 ) . powf ( 0.2 ) ; let hue = ( ( i + 0.5 ) % 1.0 ) * 2.0 * :: std :: f32 :: consts :: PI ; util :: hsva ( hue , 1.0 , 1.0 , 1.0 ) } , Some ( _ ) => panic ! ( " " ) } }
Render a single pixel of a Mandelbrot visualization
Render a single pixel of a Mandelbrot visualization
x
f32
y
f32
max_iterations
u32
mode
Mode
x
f32
y
f32
max_iterations
u32
mode
Mode