Beispiel #1
0
        public static PixImage ToPixImage(this IPixImage2d image)
        {
            if (image is PixImage pixImage)
            {
                return(pixImage);
            }
            var size      = image.Size;
            var pixFormat = image.PixFormat;

            if (image.Data.GetType().GetElementType() != pixFormat.Type)
            {
                throw new ArgumentException("type mismatch in supplied IPixImage2d");
            }
            return(PixImage.Create(image.Data, pixFormat.Format, size.X, size.Y));
        }
Beispiel #2
0
 public static PixImageMipMap Create(string filename, PixLoadOptions options)
 {
     return(new PixImageMipMap(PixImage.Create(filename, options)));
 }
Beispiel #3
0
 public static IEnumerable <PixImageMipMap> Create(IEnumerable <string> filenames, MipMapOptions options)
 {
     return(Create(from filename in filenames select PixImage.Create(filename), options));
 }