public DescriptorStructure(PsdReader reader, bool hasVersion) { if (hasVersion == true) { this.version = reader.ReadInt32(); } this.Add("Name", reader.ReadString()); this.Add("ClassID", reader.ReadKey()); int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { string key = reader.ReadKey(); string osType = reader.ReadType(); if (key == "EngineData") { this.Add(key.Trim(), new StructureEngineData(reader)); } else { object value = StructureReader.Read(osType, reader); this.Add(key.Trim(), value); } } }
public void ReadHeader(PsdReader reader, CompressionType compressionType) { if (compressionType != CompressionType.RLE) { return; } this.rlePackLengths = new int[this.height]; if (reader.Version == 1) { for (int i = 0; i < this.height; i++) { this.rlePackLengths[i] = reader.ReadInt16(); } } else { for (int i = 0; i < this.height; i++) { this.rlePackLengths[i] = reader.ReadInt32(); } } }