protected override void ReadData(PsdReader reader, object userData) { LayerRecords records = new LayerRecords(); records.Top = reader.ReadInt32(); records.Left = reader.ReadInt32(); records.Bottom = reader.ReadInt32(); records.Right = reader.ReadInt32(); records.ValidateSize(); int channelCount = reader.ReadUInt16(); records.ChannelCount = channelCount; for (int i = 0; i < channelCount; i++) { records.Channels[i].Type = reader.ReadChannelType(); records.Channels[i].Size = reader.ReadLength(); records.Channels[i].Width = records.Width; records.Channels[i].Height = records.Height; } reader.ValidateSignature(); records.BlendMode = reader.ReadBlendMode(); records.Opacity = reader.ReadByte(); records.Clipping = reader.ReadBoolean(); records.Flags = reader.ReadLayerFlags(); records.Filter = reader.ReadByte(); Records = records; }
protected override void ReadData(PsdReader reader, object userData) { reader.ValidateSignature("liFD"); int version = reader.ReadInt32(); Guid id = new Guid(reader.ReadPascalString(1)); string name = reader.ReadString(); string type = reader.ReadType(); string creator = reader.ReadType(); long length = reader.ReadInt64(); IProperties properties = reader.ReadBoolean() == true ? new StructureDescriptor(reader).Items : null; bool isDocument = this.IsDocument(reader); LinkedDocumentBlock documentReader = null; LinkedDocumnetFileHeaderBlock fileHeaderReader = null; if (length > 0 && isDocument == true) { long position = reader.Position; documentReader = new LinkedDocumentBlock(reader, length); reader.Position = position; fileHeaderReader = new LinkedDocumnetFileHeaderBlock(reader, length); } LinkedLayer = new LinkedLayer(name, id, documentReader, fileHeaderReader); }
protected override void ReadValue(PsdReader reader, Object userData, out LinkedLayer value) { reader.ValidateSignature("liFD"); Int32 version = reader.ReadInt32(); Guid id = new Guid(reader.ReadPascalString(1)); String name = reader.ReadString(); String type = reader.ReadType(); String creator = reader.ReadType(); Int64 length = reader.ReadInt64(); IProperties properties = reader.ReadBoolean() == true ? new DescriptorStructure(reader) : null; Boolean isDocument = this.IsDocument(reader); LinkedDocumentReader documentReader = null; LinkedDocumnetFileHeaderReader fileHeaderReader = null; if (length > 0 && isDocument == true) { Int64 position = reader.Position; documentReader = new LinkedDocumentReader(reader, length); reader.Position = position; fileHeaderReader = new LinkedDocumnetFileHeaderReader(reader, length); } value = new LinkedLayer(name, id, documentReader, fileHeaderReader); }
protected override void ReadData(PsdReader reader, object userData) { version = reader.ReadInt32(); hasCompatibilityImage = reader.ReadBoolean(); writerName = reader.ReadString(); readerName = reader.ReadString(); fileVersion = reader.ReadInt32(); }
protected override void ReadValue(PsdReader reader, Object userData, out IProperties value) { Properties props = new Properties(5); props["Version"] = reader.ReadInt32(); props["HasCompatibilityImage"] = reader.ReadBoolean(); props["WriterName"] = reader.ReadString(); props["ReaderName"] = reader.ReadString(); props["FileVersion"] = reader.ReadInt32(); value = props; }
protected override void ReadValue(PsdReader reader, object userData, out IProperties value) { Properties props = new Properties(5); props["Version"] = reader.ReadInt32(); props["HasCompatibilityImage"] = reader.ReadBoolean(); props["WriterName"] = reader.ReadString(); props["ReaderName"] = reader.ReadString(); props["FileVersion"] = reader.ReadInt32(); value = props; }
protected override void ReadData(PsdReader reader, object userData) { reader.ValidateSignature("liFE"); int version = reader.ReadInt32(); Guid id = new Guid(reader.ReadPascalString(1)); string name = reader.ReadString(); string type = reader.ReadType(); string creator = reader.ReadType(); long length = reader.ReadInt64(); IProperties properties = reader.ReadBoolean() == true ? new StructureDescriptor(reader).Items : null; Uri absoluteUri = this.ReadAboluteUri(reader); EmbeddedLayer = new EmbeddedLayer(id, reader.Resolver, absoluteUri); }
protected override void ReadValue(PsdReader reader, Object userData, out EmbeddedLayer value) { reader.ValidateSignature("liFE"); Int32 version = reader.ReadInt32(); Guid id = new Guid(reader.ReadPascalString(1)); String name = reader.ReadString(); String type = reader.ReadType(); String creator = reader.ReadType(); Int64 length = reader.ReadInt64(); IProperties properties = reader.ReadBoolean() == true ? new DescriptorStructure(reader) : null; Uri absoluteUri = this.ReadAboluteUri(reader); value = new EmbeddedLayer(id, reader.Resolver, absoluteUri); }
private static Properties ReadSliceInfo(PsdReader reader) { Properties props = new Properties(); props["ID"] = reader.ReadInt32(); props["GroupID"] = reader.ReadInt32(); int origin = reader.ReadInt32(); if (origin == 1) { int asso = reader.ReadInt32(); } props["Name"] = reader.ReadString(); int type = reader.ReadInt32(); props["Left"] = reader.ReadInt32(); props["Top"] = reader.ReadInt32(); props["Right"] = reader.ReadInt32(); props["Bottom"] = reader.ReadInt32(); props["Url"] = reader.ReadString(); props["Target"] = reader.ReadString(); props["Message"] = reader.ReadString(); props["AltTag"] = reader.ReadString(); bool b = reader.ReadBoolean(); string cellText = reader.ReadString(); props["HorzAlign"] = reader.ReadInt32(); props["VertAlign"] = reader.ReadInt32(); props["Alpha"] = reader.ReadByte(); props["Red"] = reader.ReadByte(); props["Green"] = reader.ReadByte(); props["Blue"] = reader.ReadByte(); return(props); }
public static object Read(string ostype, PsdReader reader) { switch (ostype) { case "obj ": return(new StructureReference(reader)); case "Objc": return(new DescriptorStructure(reader, false)); case "VlLs": return(new StructureList(reader)); case "doub": return(reader.ReadDouble()); case "UntF": return(new StructureUnitFloat(reader)); case "TEXT": return(reader.ReadString()); case "enum": return(new StructureEnumerate(reader)); case "long": return(reader.ReadInt32()); case "bool": return(reader.ReadBoolean()); case "GlbO": return(new DescriptorStructure(reader, false)); case "type": return(new StructureClass(reader)); case "GlbC": return(new StructureClass(reader)); case "alis": return(new StructureAlias(reader)); case "tdta": return(new StructureUnknownOSType("Cannot read RawData")); case "prop": return(new StructureProperty(reader)); case "Clss": return(new StructureClass(reader)); case "Enmr": return(new StructureEnumerate(reader)); case "rele": return(new StructureOffset(reader)); case "Idnt": return(new StructureUnknownOSType("Cannot read Identifier")); case "indx": return(new StructureUnknownOSType("Cannot read Index")); case "name": return(new StructureUnknownOSType("Cannot read Name")); case "ObAr": return(new StructureObjectArray(reader)); } throw new NotSupportedException(ostype); }
public static object Read(string ostype, PsdReader reader) { switch (ostype) { case "obj ": return new StructureReference(reader); case "Objc": return new DescriptorStructure(reader, false); case "VlLs": return new StructureList(reader); case "doub": return reader.ReadDouble(); case "UntF": return new StructureUnitFloat(reader); case "TEXT": return reader.ReadString(); case "enum": return new StructureEnumerate(reader); case "long": return reader.ReadInt32(); case "bool": return reader.ReadBoolean(); case "GlbO": return new DescriptorStructure(reader, false); case "type": return new StructureClass(reader); case "GlbC": return new StructureClass(reader); case "alis": return new StructureAlias(reader); case "tdta": return new StructureUnknownOSType("Cannot read RawData"); case "prop": return new StructureProperty(reader); case "Clss": return new StructureClass(reader); case "Enmr": return new StructureEnumerate(reader); case "rele": return new StructureOffset(reader); case "Idnt": return new StructureUnknownOSType("Cannot read Identifier"); case "indx": return new StructureUnknownOSType("Cannot read Index"); case "name": return new StructureUnknownOSType("Cannot read Name"); case "ObAr": return new StructureObjectArray(reader); } throw new NotSupportedException(ostype); }
public StructureBool(PsdReader reader) { Value = reader.ReadBoolean(); }
private static Properties ReadSliceInfo(PsdReader reader) { Properties props = new Properties(); props["ID"] = reader.ReadInt32(); props["GroupID"] = reader.ReadInt32(); int origin = reader.ReadInt32(); if (origin == 1) { int asso = reader.ReadInt32(); } props["Name"] = reader.ReadString(); int type = reader.ReadInt32(); props["Left"] = reader.ReadInt32(); props["Top"] = reader.ReadInt32(); props["Right"] = reader.ReadInt32(); props["Bottom"] = reader.ReadInt32(); props["Url"] = reader.ReadString(); props["Target"] = reader.ReadString(); props["Message"] = reader.ReadString(); props["AltTag"] = reader.ReadString(); bool b = reader.ReadBoolean(); string cellText = reader.ReadString(); props["HorzAlign"] = reader.ReadInt32(); props["VertAlign"] = reader.ReadInt32(); props["Alpha"] = reader.ReadByte(); props["Red"] = reader.ReadByte(); props["Green"] = reader.ReadByte(); props["Blue"] = reader.ReadByte(); return props; }