Example #1
0
        private GLTexture Read()
        {
            switch (_header.BytesPerPixel)
            {
            case 0:
            case 1:
                return(GLTextureFactory.FromStream(_input, _imageHeader.Width, _imageHeader.Height, PixelFormat.Format8bppIndexed));

            case 2:
                return(GLTextureFactory.FromStream(_input, _imageHeader.Width, _imageHeader.Height, PixelFormat.Format16bppArgb1555));

            case 3:
                return(GLTextureFactory.FromStream(_input, _imageHeader.Width, _imageHeader.Height, PixelFormat.Format24bppRgb));

            case 4:
                return(GLTextureFactory.FromStream(_input, _imageHeader.Width, _imageHeader.Height, PixelFormat.Format32bppArgb));

            default:
                throw new NotSupportedException();
            }
        }
Example #2
0
 public GLTexture TryReadData(Stream input)
 {
     return(GLTextureFactory.FromStream(input, ImageWidth, ImageHeight, PixelFormat.Format8bppIndexed));
 }
Example #3
0
        private GLTexture ReadIndexedImage()
        {
            int size = Header.ImageWidth * Header.ImageHeight * Header.BytesPerPixel;

            return(GLTextureFactory.FromStream(IOStream, Header.ImageWidth, Header.ImageHeight, PixelFormat.Format8bppIndexed));
        }
Example #4
0
 private GLTexture ReadTexture(Stream input, PixelFormat format)
 {
     return(GLTextureFactory.FromStream(input, _header.ImageWidth, _header.ImageHeight, format));
 }