Пример #1
0
        public GradientMap(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            ushort version = r.ReadUInt16();

            this.Reverse = r.ReadBoolean();
            this.Dither  = r.ReadBoolean();
            this.Name    = r.ReadPSDUnicodeString();
            r.JumpToEvenNthByte(2);

            ushort cnt = r.ReadUInt16();

            this.ColorStops = new List <ColorStop>();
            for (int i = 0; i < cnt; i++)
            {
                this.ColorStops.Add(new ColorStop(r));
            }

            cnt = r.ReadUInt16();
            this.TransparencyStops = new List <TransparencyStop>();
            for (int i = 0; i < cnt; i++)
            {
                this.TransparencyStops.Add(new TransparencyStop(r));
            }

            ushort expansionCount = r.ReadUInt16();

            if (expansionCount > 0)
            {
                this.Interpolation = r.ReadInt16();
            }

            ushort length = r.ReadUInt16();

            this.Mode       = r.ReadUInt16();
            this.RandomSeed = r.ReadUInt32();

            r.BaseStream.Position += 1;
            this.ShowTransparency  = r.ReadBoolean();

            r.BaseStream.Position += 1;
            this.UseVectorColor    = r.ReadBoolean();

            this.Roughness = r.ReadUInt32();

            this.ColorModel = r.ReadUInt16(); //ColorMode?!

            this.MinChannelValues = r.ReadPSDChannelValues(4);
            this.MaxChannelValues = r.ReadPSDChannelValues(4);

            this.Data = r.ReadBytes((int)r.BytesToEnd);
        }