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