public ImageDataSection Read(Stream stream)
        {
            var reader  = new BigEndianBinaryReader(stream);
            var section = new ImageDataSection();

            section.CompressionMethod = (CompressionMethod)reader.ReadInt16();
            section.Offset            = stream.Position;
            section.Length            = stream.Length - section.Offset;

            return(section);
        }
示例#2
0
        internal void Read(Stream stream, PsdResolver resolver, Uri uri)
        {
            this.reader = new PsdReader(stream, resolver, uri);
            this.reader.ReadDocumentHeader();

            this.fileHeaderSection     = new FileHeaderSection(this.reader);
            this.colorModeDataSection  = new ColorModeDataSection(this.reader);
            this.imageResourcesSection = new ImgageResourcesSection(this.reader);
            this.layerAndMaskSection   = new LayerAndMaskInformationSection(this.reader, this);
            this.imageDataSection      = new ImageDataSection(this.reader, this);
        }
示例#3
0
        private PhotoshopFile(
            [NotNull] Stream stream,
            [NotNull] PhotoshopFileSectionReader <HeaderSection> headerSectionReader,
            [NotNull] PhotoshopFileSectionReader <ColorModeDataSection> colorModeDataSectionReader,
            [NotNull] PhotoshopFileSectionReader <ImageResourcesSection> imageResourcesSectionReader,
            [NotNull] PhotoshopFileSectionReader <LayerMaskInformationSection> layerMaskInformationSectionReader,
            [NotNull] PhotoshopFileSectionReader <ImageDataSection> imageDataSectionReader)
        {
            Assert.NotNull(stream, nameof(stream));
            Assert.NotNull(headerSectionReader, nameof(headerSectionReader));
            Assert.NotNull(colorModeDataSectionReader, nameof(colorModeDataSectionReader));
            Assert.NotNull(imageResourcesSectionReader, nameof(imageResourcesSectionReader));
            Assert.NotNull(layerMaskInformationSectionReader, nameof(layerMaskInformationSectionReader));
            Assert.NotNull(imageDataSectionReader, nameof(imageDataSectionReader));

            _stream = stream;
            _reader = new PhotoshopFileReader(stream);

            _headerSection               = headerSectionReader.ReadSection(_reader, this);
            _colorModeDataSection        = colorModeDataSectionReader.ReadSection(_reader, this);
            _imageResourcesSection       = imageResourcesSectionReader.ReadSection(_reader, this);
            _layerMaskInformationSection = layerMaskInformationSectionReader.ReadSection(_reader, this);
            _imageDataSection            = imageDataSectionReader.ReadSection(_reader, this);
        }