Esempio n. 1
0
        /// <summary>
        /// Loads and reads DDS file
        /// </summary>
        /// <param name="fileName"></param>
        public void Read(string fileName)
        {
            byte[] rawData = File.ReadAllBytes(fileName + EXTENSION);
            imageData = new List <TexelBlock>();
            using (MemoryStream ms = new MemoryStream(rawData))
            {
                using (BinaryReader r = new BinaryReader(ms))
                {
                    fileHeader.Parse(r);

                    TexelBlock t;
                    while (r.BaseStream.Position != r.BaseStream.Length)
                    {
                        t           = new TexelBlock();
                        t.color0    = r.ReadUInt16();
                        t.color1    = r.ReadUInt16();
                        t.blocks    = new byte[4];
                        t.blocks[0] = r.ReadByte();
                        t.blocks[1] = r.ReadByte();
                        t.blocks[2] = r.ReadByte();
                        t.blocks[3] = r.ReadByte();
                        imageData.Add(t);
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Loads and reads DDS file
        /// </summary>
        /// <param name="fileName"></param>
        public void Read(string fileName)
        {
            byte[] rawData = File.ReadAllBytes(fileName+ EXTENSION);
            imageData = new List<TexelBlock>();
            using (MemoryStream ms = new MemoryStream(rawData))
            {
                using (BinaryReader r = new BinaryReader(ms))
                {
                    fileHeader.Parse(r);

                    TexelBlock t;
                    while (r.BaseStream.Position != r.BaseStream.Length)
                    {
                        t = new TexelBlock();
                        t.color0 = r.ReadUInt16();
                        t.color1 = r.ReadUInt16();
                        t.blocks = new byte[4];
                        t.blocks[0] = r.ReadByte();
                        t.blocks[1] = r.ReadByte();
                        t.blocks[2] = r.ReadByte();
                        t.blocks[3] = r.ReadByte();
                        imageData.Add(t);
                    }
                }
            }
        }
Esempio n. 3
0
 public void AddImageData(TexelBlock tb)
 {
     imageData.Add(tb);
 }
Esempio n. 4
0
 public void AddImageData(TexelBlock tb)
 {
     imageData.Add(tb);
 }