fn gray_to_rgba(gray: &[u8]) -> Box<[u8]> {
    let num_pixels = gray.len();
    let mut rgba = Vec::with_capacity(num_pixels * 4);
    for &value in gray {
        rgba.push(value);
        rgba.push(value);
        rgba.push(value);
        rgba.push(std::u8::MAX);
    }
    rgba.into_boxed_slice()
}
/// Converts grayscale image data into RGBA.
Converts grayscale image data into RGBA.
Converts grayscale image data into RGBA .
fn gray_to_rgba(gray: &[u8]) -> Box<[u8]> {
    let num_pixels = gray.len();
    let mut rgba = Vec::with_capacity(num_pixels * 4);
    for &value in gray {
        rgba.push(value);
        rgba.push(value);
        rgba.push(value);
        rgba.push(std::u8::MAX);
    }
    rgba.into_boxed_slice()
}
fn gray_to_rgba ( gray : & [ u8 ] ) -> Box < [ u8 ] > { let num_pixels = gray . len ( ) ; let mut rgba = Vec :: with_capacity ( num_pixels * 4 ) ; for & value in gray { rgba . push ( value ) ; rgba . push ( value ) ; rgba . push ( value ) ; rgba . push ( std :: u8 :: MAX ) ; } rgba . into_boxed_slice ( ) }
Converts grayscale image data into RGBA.
Converts grayscale image data into RGBA .
gray
&[u8]
gray
&[u8]