Ejemplo n.º 1
0
 private static Bitmap ReadCompressed(BinaryReader reader, DdsHeader header)
 {
     if (magic_dxt1.Equals(header.pixel_format.four_cc))
     {
         return(DecodeDXT1(reader, header.width, header.height));
     }
     else if (magic_dxt5.Equals(header.pixel_format.four_cc))
     {
         return(DecodeDXT5(reader, header.width, header.height));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
        private static bool ReadAllHeader(BinaryReader reader, ref DdsHeader header)
        {
            if (!magic.Equals(reader.ReadBytes(magic.Length)))
            {
                return(false);
            }

            ReadHeader(reader, ref header);
            if (magic_dx10.Equals(header.pixel_format.four_cc))
            {
                var header10 = new DdsHeaderDx10();
                ReadHeaderDx10(reader, ref header10);
            }

            return(true);
        }