fn to_rgba(image: DynamicImage) -> DynamicImage {
  match image {
    DynamicImage::ImageRgba8(_) => image, // No need to modify channels
    DynamicImage::ImageLuma8(_) => DynamicImage::ImageRgba8(image.to_rgba()),
    DynamicImage::ImageLumaA8(_) => DynamicImage::ImageRgba8(image.to_rgba()),
    DynamicImage::ImageRgb8(_) => DynamicImage::ImageRgba8(image.to_rgba()),
  }
}
/// Convert an image buffer into RGBA if it isn't already rgba.
Convert an image buffer into RGBA if it isn't already rgba.
Convert an image buffer into RGBA if it isn ' t already rgba .
fn to_rgba(image: DynamicImage) -> DynamicImage {
  match image {
    DynamicImage::ImageRgba8(_) => image, // No need to modify channels
    DynamicImage::ImageLuma8(_) => DynamicImage::ImageRgba8(image.to_rgba()),
    DynamicImage::ImageLumaA8(_) => DynamicImage::ImageRgba8(image.to_rgba()),
    DynamicImage::ImageRgb8(_) => DynamicImage::ImageRgba8(image.to_rgba()),
  }
}
fn to_rgba ( image : DynamicImage ) -> DynamicImage { match image { DynamicImage :: ImageRgba8 ( _ ) => image , // No need to modify channels DynamicImage :: ImageLuma8 ( _ ) => DynamicImage :: ImageRgba8 ( image . to_rgba ( ) ) , DynamicImage :: ImageLumaA8 ( _ ) => DynamicImage :: ImageRgba8 ( image . to_rgba ( ) ) , DynamicImage :: ImageRgb8 ( _ ) => DynamicImage :: ImageRgba8 ( image . to_rgba ( ) ) , } }
Convert an image buffer into RGBA if it isn't already rgba.
Convert an image buffer into RGBA if it isn ' t already rgba .
image
DynamicImage
image
DynamicImage