public override ImageMetaData ReadMetaData(IBinaryStream file) { var header = file.ReadHeader(0x14); int version = header.ToUInt16(4); if (version != 101 && version != 102) { return(null); } var info = new PrtMetaData { Width = header.ToUInt16(0xC), Height = header.ToUInt16(0xE), BPP = header.ToUInt16(6), Version = version, PaletteOffset = header.ToUInt16(8), DataOffset = header.ToUInt16(0xA), HasAlpha = header.ToInt32(0x10) != 0, }; if (102 == version) { info.OffsetX = file.ReadInt32(); info.OffsetY = file.ReadInt32(); } return(info); }
public PrtReader(IBinaryStream input, PrtMetaData info) { m_input = input; m_info = info; m_stride = ((int)info.Width * (info.BPP / 8) + 3) & ~3; }