Exemple #1
0
        public static byte[] AsRgba8888(this IImageRead image)
        {
            switch (image.PixelFormat)
            {
            case PixelFormat.Indexed4: return(image.From4bpp(Rgba));

            case PixelFormat.Indexed8: return(image.From8bpp(Rgba));

            case PixelFormat.Rgba8888: return(image.From32bpp(Bgra));

            default:
                throw new ArgumentException($"The pixel format {image.PixelFormat} is not supported.");
            }
        }