Ejemplo n.º 1
0
        }                                                               // 'CHD'

        public override ImageMetaData ReadMetaData(IBinaryStream file)
        {
            file.Position = 4;
            int count = file.ReadInt32();

            if (count < 0 || count > 0xFFFFF)
            {
                return(null);
            }
            file.ReadInt32();
            uint first_offset = 0;

            for (int i = 0; i < count && 0 == first_offset; ++i)
            {
                first_offset = file.ReadUInt32();
            }
            if (0 == first_offset)
            {
                return(null);
            }
            file.Position = first_offset;
            var info = new ChdMetaData();

            info.Width       = file.ReadUInt32();
            info.Height      = file.ReadUInt32();
            info.OffsetX     = file.ReadInt32();
            info.OffsetY     = file.ReadInt32();
            info.FirstOffset = first_offset + 0x10;
            info.BPP         = 32;
            return(info);
        }
Ejemplo n.º 2
0
 public ChdReader(IBinaryStream input, ChdMetaData info)
 {
     m_input  = input;
     m_width  = (int)info.Width;
     m_height = (int)info.Height;
     m_origin = info.FirstOffset;
 }