Exemplo n.º 1
0
 protected override void WriteData(PsdBinaryWriter writer)
 {
     writer.Write(Version);
     writer.Write(HasRealMergedData);
     writer.WriteUnicodeString(ReaderName);
     writer.WriteUnicodeString(WriterName);
     writer.Write(FileVersion);
 }
Exemplo n.º 2
0
        ///////////////////////////////////////////////////////////////////////////

        public void Save(PsdBinaryWriter writer)
        {
            Util.DebugMessage(writer.BaseStream, "Save, Begin, BlendingRanges");

            if (Data == null)
            {
                writer.Write((UInt32)0);
                return;
            }

            writer.Write((UInt32)Data.Length);
            writer.Write(Data);

            Util.DebugMessage(writer.BaseStream, "Save, End, BlendingRanges");
        }
Exemplo n.º 3
0
        internal void Save(PsdBinaryWriter writer)
        {
            Util.DebugMessage(writer.BaseStream, "Save, Begin, Channel");

            writer.Write(ID);
            if (Layer.PsdFile.IsLargeDocument)
            {
                writer.Write(Length);
            }
            else
            {
                writer.Write((Int32)Length);
            }

            Util.DebugMessage(writer.BaseStream, $"Save, End, Channel, {ID}");
        }
Exemplo n.º 4
0
        public void Write()
        {
            var endPosition = writer.BaseStream.Position;

            writer.BaseStream.Position = lengthPosition;
            long length = endPosition - startPosition;

            if (hasLongLength)
            {
                writer.Write(length);
            }
            else
            {
                writer.Write((UInt32)length);
            }

            writer.BaseStream.Position = endPosition;
        }
Exemplo n.º 5
0
        internal void SavePixelData(PsdBinaryWriter writer)
        {
            Util.DebugMessage(writer.BaseStream, "Save, Begin, Channel image");

            writer.Write((short)ImageCompression);
            if (ImageDataRaw == null)
            {
                return;
            }

            if (ImageCompression == PSDFile.ImageCompression.Rle)
            {
                RleRowLengths.Write(writer, Layer.PsdFile.IsLargeDocument);
            }
            writer.Write(ImageDataRaw);

            Util.DebugMessage(writer.BaseStream, $"Save, End, Channel image, {ID}");
        }
Exemplo n.º 6
0
        public PsdBlockLengthWriter(PsdBinaryWriter writer, bool hasLongLength)
        {
            this.writer        = writer;
            this.hasLongLength = hasLongLength;

            // Store position so that we can return to it when the length is known.
            lengthPosition = writer.BaseStream.Position;

            // Write a sentinel value as a placeholder for the length.
            writer.Write((UInt32)0xFEEDFEED);
            if (hasLongLength)
            {
                writer.Write((UInt32)0xFEEDFEED);
            }

            // Store the start position of the data block so that we can calculate
            // its length when we're done writing.
            startPosition = writer.BaseStream.Position;
        }
Exemplo n.º 7
0
        protected override void WriteData(PsdBinaryWriter writer)
        {
            writer.Write(HDpi.Integer);
            writer.Write(HDpi.Fraction);
            writer.Write((Int16)HResDisplayUnit);
            writer.Write((Int16)WidthDisplayUnit);

            writer.Write(VDpi.Integer);
            writer.Write(VDpi.Fraction);
            writer.Write((Int16)VResDisplayUnit);
            writer.Write((Int16)HeightDisplayUnit);
        }
Exemplo n.º 8
0
 protected override void WriteData(PsdBinaryWriter writer)
 {
     writer.Write(Data);
 }