Example #1
0
 public CzDecoder(IBinaryStream input, CzMetaData info)
 {
     m_input  = input;
     m_info   = info;
     m_output = new byte[m_info.iWidth * m_info.iHeight * m_info.BPP / 8];
     Format   = 8 == m_info.BPP ? PixelFormats.Indexed8 : PixelFormats.Bgra32;
 }
Example #2
0
        public override ImageMetaData ReadMetaData(IBinaryStream file)
        {
            var header = file.ReadHeader(0x10);
            var info   = new CzMetaData {
                Width        = header.ToUInt16(8),
                Height       = header.ToUInt16(10),
                BPP          = header.ToUInt16(12),
                HeaderLength = header.ToUInt32(4),
                Version      = header[2] - '0',
            };

            if (info.HeaderLength > 0x18)
            {
                info.OffsetX = file.ReadInt16();
                info.OffsetY = file.ReadInt16();
            }
            return(info);
        }