public override ImageMetaData ReadMetaData(IBinaryStream file) { var header = file.ReadHeader(0x28); int version = header[3] - '0'; var info = new GhpMetaData { Width = header.ToUInt16(0xC), Height = header.ToUInt16(0xE), BPP = 8, Colors = header.ToUInt16(0x10), Version = version, }; if (2 == version) { info.PaletteOffset = header.ToUInt32(0x14); info.ChunkCount = header.ToInt32(0x18); info.DataOffset = header.ToUInt32(0x1C); } else { info.PaletteOffset = header.ToUInt32(0x18); info.DataOffset = header.ToUInt32(0x24); } return(info); }
public GhpReader(IBinaryStream input, GhpMetaData info) { m_input = input; m_info = info; m_stride = ((int)info.Width + 3) & ~3; m_depth = GetColorDepth(m_info.Colors); m_output = new byte[m_stride * (int)m_info.Height]; }
public Ghp3Reader(IBinaryStream input, GhpMetaData info) { m_input = input; m_info = info; m_stride = ((int)info.Width + 3) & ~3; }