Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        public PsdLayer(PsdReader reader, PsdDocument document)
        {
            this.document = document;
            this.records = LayerRecordsReader.Read(reader);
            this.records = LayerExtraRecordsReader.Read(reader, this.records);

            this.left = this.records.Left;
            this.top = this.records.Top;
            this.right = this.records.Right;
            this.bottom = this.records.Bottom;
        }
        protected override void ReadData(PsdReader reader, object userData)
        {
            LayerRecords             records        = userData as LayerRecords;
            LayerMaskBlock           mask           = LayerMaskBlock.Read(reader);
            LayerBlendingRangesBlock blendingRanges = LayerBlendingRangesBlock.Read(reader);
            string name          = reader.ReadPascalString(4);
            var    layerResource = new LayerResourceBlock(reader, this.EndPosition - reader.Position);

            records.SetExtraRecords(mask, blendingRanges, layerResource.Resources, name);

            LayerRecords = records;
        }
Exemplo n.º 4
0
        protected override void ReadData(PsdReader reader, object userData)
        {
            PsdLayer     layer   = userData as PsdLayer;
            LayerRecords records = layer.Records;

            using (MemoryStream stream = new MemoryStream(reader.ReadBytes((int)this.Length)))
                using (PsdReader r = new PsdReader(stream, reader.Resolver, reader.Uri))
                {
                    r.Version = reader.Version;
                    this.ReadValue(r, layer.Depth, records.Channels);
                }

            Channels = records.Channels;
        }
        public static LayerRecords Read(PsdReader reader, LayerRecords records)
        {
            LayerExtraRecordsBlock instance = new LayerExtraRecordsBlock(reader, records);

            return(instance.LayerRecords);
        }
 private LayerExtraRecordsBlock(PsdReader reader, LayerRecords records)
 {
     Init(reader, true, records);
 }