fn render(
    pixels: &mut [u8],
    bounds: (usize, usize),
    upper_left: Complex<f64>,
    lower_right: Complex<f64>,
) {
    assert_eq!(pixels.len(), bounds.0 * bounds.1);

    for row in 0..bounds.1 {
        for column in 0..bounds.0 {
            let point = pixel_to_point(bounds, (column, row), upper_left, lower_right);

            // use of 255 because of max of u8 is 255
            pixels[row * bounds.0 + column] = match escape_time(point, 255) {
                None => 0,
                Some(count) => 255 - count as u8,
            };
        }
    }
}
// render a rectangle of Mandelbrot set into a buffer of pixels
//
// the 'bounds' argument gives the width and height of the buffer 'pixels', which holds one
// greyscale pixel per byte
render a rectangle of Mandelbrot set into a buffer of pixels
the 'bounds' argument gives the width and height of the buffer 'pixels', which holds one
greyscale pixel per byte
render a rectangle of Mandelbrot set into a buffer of pixels the ' bounds ' argument gives the width and height of the buffer ' pixels ' which holds one greyscale pixel per byte
fn render(
    pixels: &mut [u8],
    bounds: (usize, usize),
    upper_left: Complex<f64>,
    lower_right: Complex<f64>,
) {
    assert_eq!(pixels.len(), bounds.0 * bounds.1);
    for row in 0..bounds.1 {
        for column in 0..bounds.0 {
            let point = pixel_to_point(bounds, (column, row), upper_left, lower_right);
            // use of 255 because of max of u8 is 255
            pixels[row * bounds.0 + column] = match escape_time(point, 255) {
                None => 0,
                Some(count) => 255 - count as u8,
            };
        }
    }
}
fn render ( pixels : & mut [ u8 ] , bounds : ( usize , usize ) , upper_left : Complex < f64 > , lower_right : Complex < f64 > , ) { assert_eq ! ( pixels len ( ) bounds 0 bounds 1 ) ; for row in 0 .. bounds . 1 { for column in 0 .. bounds . 0 { let point = pixel_to_point ( bounds , ( column , row ) , upper_left , lower_right ) ; // use of 255 because of max of u8 is 255 pixels [ row * bounds . 0 + column ] = match escape_time ( point , 255 ) { None => 0 , Some ( count ) => 255 - count as u8 , } ; } } }
render a rectangle of Mandelbrot set into a buffer of pixels
the 'bounds' argument gives the width and height of the buffer 'pixels', which holds one
greyscale pixel per byte
render a rectangle of Mandelbrot set into a buffer of pixels the ' bounds ' argument gives the width and height of the buffer ' pixels ' which holds one greyscale pixel per byte
pixels
&mut [u8]
bounds
(usize, usize)
upper_left
Complex<f64>
lower_right
Complex<f64>
pixels
&mut [u8]
bounds
(usize, usize)
upper_left
Complex<f64>
lower_right
Complex<f64>