Ejemplo n.º 1
0
 public PmsReader(IBinaryStream input, PmsMetaData info)
 {
     m_input  = input;
     m_info   = info;
     m_width  = (int)m_info.Width;
     m_height = (int)m_info.Height;
 }
Ejemplo n.º 2
0
        public override ImageMetaData ReadMetaData(IBinaryStream file)
        {
            var header = file.ReadHeader(0x30);
            var info   = new PmsMetaData {
                BPP         = header[6],
                OffsetX     = header.ToInt32(0x10),
                OffsetY     = header.ToInt32(0x14),
                Width       = header.ToUInt32(0x18),
                Height      = header.ToUInt32(0x1C),
                DataOffset  = header.ToUInt32(0x20),
                AlphaOffset = header.ToUInt32(0x24),
            };

            if ((info.BPP != 16 && info.BPP != 8) || info.DataOffset < 0x30 || info.DataOffset >= file.Length)
            {
                return(null);
            }
            return(info);
        }