예제 #1
0
            public Descriptor(BinaryPSDReader r)
            {
                uint version = r.ReadUInt32();    //?

                r.BaseStream.Position += 6;       //?
                string type     = new string(r.ReadPSDChars(4));
                uint   unknown1 = r.ReadUInt32(); //?
                uint   unknown2 = r.ReadUInt32(); //?
                string resType1 = new string(r.ReadPSDChars(4));
                string resType2 = new string(r.ReadPSDChars(4));

                string uniName = r.ReadPSDUnicodeString();

                while (r.ReadByte() != 0x2f)
                {
                    ;
                }
                this.Items = new List <Item>();
                while (true)
                {
                    Item item = new Item();
                    this.Items.Add(item);
                    if (item.Read(r) == false)
                    {
                        break;
                    }
                }
            }
예제 #2
0
파일: Levels.cs 프로젝트: timgaunt/resizer
        public Levels(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            ushort version = r.ReadUInt16();

            this.Records = new List <LevelRecord>();
            int endPos = (int)Math.Min(r.BytesToEnd, 292);

            while (r.BaseStream.Position < endPos)
            {
                this.Records.Add(new LevelRecord(r));
            }

            if (r.BytesToEnd > 0)
            {
                string head     = new string(r.ReadPSDChars(4));
                ushort unknown1 = r.ReadUInt16();
                ushort unknown2 = r.ReadUInt16();
                while (r.BytesToEnd > 0)
                {
                    this.Records.Add(new LevelRecord(r));
                }
            }
            this.Data = null;
        }
예제 #3
0
        public SectionDivider(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            this.Type = r.ReadUInt32(); //0 = any other type of layer, 1 = open folder, 2 = closed folder, 3 = bounding section divider, hidden in the UI
            if (r.BytesToEnd > 0)
            {
                string header = new string(r.ReadPSDChars(4));
                this.BlendKey = new string(r.ReadPSDChars(4));
                if (this.BlendKey != "pass")
                {
                }
            }
            this.Data = null;
        }
예제 #4
0
        public LayerNameSource(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            Name      = new string(r.ReadPSDChars((int)r.BytesToEnd));
            this.Data = null;
        }
예제 #5
0
        public XMLInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();
            string          xml    = new string(reader.ReadPSDChars((int)reader.BaseStream.Length));
            XmlDocument     doc    = new XmlDocument();

            doc.LoadXml(xml);
            this.Xml = doc;

            reader.Close();
        }
예제 #6
0
        public AlphaChannelNames(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();

            while (reader.BytesToEnd > 0)
            {
                //no padding in these strings!
                byte   length = reader.ReadByte();
                string name   = new string(reader.ReadPSDChars(length));
                if (name.Length > 0)
                {
                    this._names.Add(name);
                }
            }
            reader.Close();
        }
예제 #7
0
파일: Curves.cs 프로젝트: timgaunt/resizer
        public Curves(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            byte   unknown       = r.ReadByte();
            ushort version       = r.ReadUInt16();
            uint   definedCurves = r.ReadUInt32();

            this.Records = new List <Curve>();
            int channelNum = -1;

            while (definedCurves > 0)
            {
                if ((definedCurves & 1) > 0)
                {
                    Curve curve = new Curve(r);
                    curve.Channel = channelNum;
                    this.Records.Add(curve);
                }
                channelNum++;
                definedCurves >>= 1;
            }

            if (r.BytesToEnd > 0)
            {
                //Same again? Clear Records and begin anew? Brrr... Adobe, argh!
                string head = new string(r.ReadPSDChars(4));
                version = r.ReadUInt16(); //version??
                uint numCurves = r.ReadUInt32();

                for (int i = 0; i < numCurves; i++)
                {
                    ushort channelId = r.ReadUInt16();
                    Curve  curve     = new Curve(r);
                    curve.Channel = (int)channelId - 1;
                }
            }

            this.Data = null;
        }
예제 #8
0
            public Descriptor(BinaryPSDReader r)
            {
                uint version = r.ReadUInt32(); //?
                r.BaseStream.Position += 6; //?
                string type = new string(r.ReadPSDChars(4));
                uint unknown1 = r.ReadUInt32(); //?
                uint unknown2 = r.ReadUInt32(); //?
                string resType1 = new string(r.ReadPSDChars(4));
                string resType2 = new string(r.ReadPSDChars(4));

                string uniName = r.ReadPSDUnicodeString();
                while (r.ReadByte() != 0x2f)
                    ;
                this.Items = new List<Item>();
                while (true)
                {
                    Item item = new Item();
                    this.Items.Add(item);
                    if (item.Read(r) == false)
                        break;
                }
            }