fn letter_to_rgba(v: &str, color: Rgba<u8>) -> RgbaImage {
        let lines = v
            .lines()
            .map(|x| x.trim())
            .filter(|x| !x.is_empty())
            .collect::<Vec<&str>>();
        let mut image = RgbaImage::new(lines[0].len() as u32, lines.len() as u32);
        for (y, row) in lines.iter().enumerate() {
            for (x, v) in (**row).chars().enumerate() {
                match v {
                    'x' => {
                        *image.get_pixel_mut(x as u32, y as u32) = color;
                    }
                    _ => {}
                }
            }
        }
        image
    }
/// Helper function to convert letters from the ascii format below to an rgba image.
Helper function to convert letters from the ascii format below to an rgba image.
Helper function to convert letters from the ascii format below to an rgba image .
fn letter_to_rgba(v: &str, color: Rgba<u8>) -> RgbaImage {
        let lines = v
            .lines()
            .map(|x| x.trim())
            .filter(|x| !x.is_empty())
            .collect::<Vec<&str>>();
        let mut image = RgbaImage::new(lines[0].len() as u32, lines.len() as u32);
        for (y, row) in lines.iter().enumerate() {
            for (x, v) in (**row).chars().enumerate() {
                match v {
                    'x' => {
                        *image.get_pixel_mut(x as u32, y as u32) = color;
                    }
                    _ => {}
                }
            }
        }
        image
    }
fn letter_to_rgba ( v : & str , color : Rgba < u8 > ) -> RgbaImage { let lines = v . lines ( ) . map ( | x | x . trim ( ) ) . filter ( | x | ! x . is_empty ( ) ) . collect :: < Vec < & str > > ( ) ; let mut image = RgbaImage :: new ( lines [ 0 ] . len ( ) as u32 , lines . len ( ) as u32 ) ; for ( y , row ) in lines . iter ( ) . enumerate ( ) { for ( x , v ) in ( * * row ) . chars ( ) . enumerate ( ) { match v { 'x' => { * image . get_pixel_mut ( x as u32 , y as u32 ) = color ; } _ => { } } } } image }
Helper function to convert letters from the ascii format below to an rgba image.
Helper function to convert letters from the ascii format below to an rgba image .
v
&str
color
Rgba<u8>