pub fn from_rgba_image(image: image::RgbaImage) -> Result<Self, String> {
        let data: Vec<u32> = image
            .pixels()
            .map(|p| {
                ((p[3] as u32) << 24) | ((p[0] as u32) << 16) | ((p[1] as u32) << 8) | (p[2] as u32)
            })
            .collect();
        Self::from_data(image.width(), image.height(), data)
    }
/// Creates a new image from an `RgbaImage`.
Creates a new image from an `RgbaImage`.
Creates a new image from an ` RgbaImage ` .
pub fn from_rgba_image(image: image::RgbaImage) -> Result<Self, String> {
        let data: Vec<u32> = image
            .pixels()
            .map(|p| {
                ((p[3] as u32) << 24) | ((p[0] as u32) << 16) | ((p[1] as u32) << 8) | (p[2] as u32)
            })
            .collect();
        Self::from_data(image.width(), image.height(), data)
    }
pub fn from_rgba_image ( image : image :: RgbaImage ) -> Result < Self , String > { let data : Vec < u32 > = image . pixels ( ) . map ( | p | { ( ( p [ 3 ] as u32 ) << 24 ) | ( ( p [ 0 ] as u32 ) << 16 ) | ( ( p [ 1 ] as u32 ) << 8 ) | ( p [ 2 ] as u32 ) } ) . collect ( ) ; Self :: from_data ( image . width ( ) , image . height ( ) , data ) }
Creates a new image from an `RgbaImage`.
Creates a new image from an ` RgbaImage ` .
image
image::RgbaImage