public TypeToolObject(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            ushort Version = r.ReadUInt16(); //1= Photoshop 5.0

            this.Transform = new Matrix2D(r);

            ushort TextDescriptorVersion = r.ReadUInt16(); //=50. For Photoshop 6.0.

            if (true)
            {
                this.TxtDescriptor = new DynVal(r, true);
            }
            else
            {
                uint XTextDescriptorVersion = r.ReadUInt32(); //=16. For Photoshop 6.0.
                this.TextDescriptor = new Descriptor(r);
            }
            this.Data = r.ReadBytes((int)r.BytesToEnd);

            ////ushort WarpDescriptorVersion = r.ReadUInt16(); //=50. For Photoshop 6.0.
            ////uint XWarpDescriptorVersion = r.ReadUInt32(); //=16. For Photoshop 6.0.
            ////Descriptor warpDescriptor = new Descriptor(r);
            //this.WarpDescriptor = new DynVal(r, true);

            //this.WarpRect = ERectangleF.FromLTRB((float)r.ReadPSDDouble(), (float)r.ReadPSDDouble(), (float)r.ReadPSDDouble(), (float)r.ReadPSDDouble());
            ////this.WarpRect.Left = r.ReadPSDDouble();
            ////double warpRectTop = r.ReadPSDDouble();
            ////double warpRectRight = r.ReadPSDDouble();
            ////double warpRectBottom = r.ReadPSDDouble();

            //this.Data = null;
        }
Example #2
0
        public TypeToolObject(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            ushort Version = r.ReadUInt16(); //1= Photoshop 5.0

            this.Transform = new Matrix2D(r);

            ushort TextDescriptorVersion = r.ReadUInt16(); //=50. For Photoshop 6.0.
            if (true)
                this.TxtDescriptor = new DynVal(r, true);
            else
            {
                uint XTextDescriptorVersion = r.ReadUInt32(); //=16. For Photoshop 6.0.
                this.TextDescriptor = new Descriptor(r);
            }
            this.Data = r.ReadBytes((int)r.BytesToEnd);

            ////ushort WarpDescriptorVersion = r.ReadUInt16(); //=50. For Photoshop 6.0.
            ////uint XWarpDescriptorVersion = r.ReadUInt32(); //=16. For Photoshop 6.0.
            ////Descriptor warpDescriptor = new Descriptor(r);
            //this.WarpDescriptor = new DynVal(r, true);

            //this.WarpRect = ERectangleF.FromLTRB((float)r.ReadPSDDouble(), (float)r.ReadPSDDouble(), (float)r.ReadPSDDouble(), (float)r.ReadPSDDouble());
            ////this.WarpRect.Left = r.ReadPSDDouble();
            ////double warpRectTop = r.ReadPSDDouble();
            ////double warpRectRight = r.ReadPSDDouble();
            ////double warpRectBottom = r.ReadPSDDouble();

            //this.Data = null;
        }
Example #3
0
        public Slices(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();

            this.Version    = reader.ReadUInt32();
            this.Rectangle  = reader.ReadPSDRectangle(); // new Rectangle(reader).ToERectangle();
            this.SlicesName = reader.ReadPSDUnicodeString();

            int cnt = (int)reader.ReadUInt32();

            this.SliceList = new List <Slice>();
            for (int i = 0; i < cnt; i++)
            {
                this.SliceList.Add(new Slice(reader));
            }

            int    unknown1 = (int)reader.ReadUInt32();
            int    unknown2 = (int)reader.ReadUInt32();
            ushort unknown3 = reader.ReadUInt16();
            string unknown4 = DynVal.ReadSpecialString(reader);
            int    unknown5 = (int)reader.ReadUInt32();

            this.Values = new List <DynVal>();
            while (reader.BytesToEnd > 0)
            {
                DynVal val = DynVal.ReadValue(reader, false);
                this.Values.Add(val);
            }
            //this.Values = DynVal.ReadValues(reader);
            //this.Data = reader.ReadBytes((int)reader.BytesToEnd);
            reader.Close();
        }
Example #4
0
        public Txt2(BinaryPSDReader reader)
            : base(reader)
        {
            bool readData = false; //Set to true to see it in all its... glory.

            if (readData)
            {
                BinaryPSDReader r = this.GetDataReader();
                r.BaseStream.Position += 2;
                this.Values            = new DynVal();
                this.Values.Children   = new List <DynVal>();
                while (true)
                {
                    DynVal child = new DynVal();
                    this.Values.Children.Add(child);
                    try
                    {
                        if (child.ReadTdtaItem(r) == false)
                        {
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }

            this.Data = null;
        }
        public PatternFill(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            this.Descriptor = new DynVal(r, true);

            this.Data = null;
        }
        public GradientFill(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();
            this.Descriptor = new DynVal(r, true);
            //uint version = r.ReadUInt32();
            //string unknown = Endogine.Serialization.ReadableBinary.CreateHexEditorString(r.ReadBytes(6));
            //this.Values = DynVal.ReadValues(r);

            this.Data = null;
        }
Example #7
0
        public ObjectBasedEffects(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();

            r.ReadUInt32(); //Object version, Always 0

            this.Descriptor = new DynVal(r, true);
            //r.ReadUInt32(); //Descriptor version, 16 = PS6.0
            //string unknown = Endogine.Serialization.ReadableBinary.CreateHexEditorString(r.ReadBytes(6));
            //this.Values = DynVal.ReadValues(r);
            //Action Descriptor(s)
        }
Example #8
0
        public TypeToolObject(PhotoshopFile.Layer.AdjustmentLayerInfo info)
        {
            this.m_data  = info.Data;
            this.m_key   = info.Key;
            this.m_layer = info.Layer;

            BinaryReverseReader r = this.DataReader;

            ushort PhotshopVersion = r.ReadUInt16();   //2 bytes, =1 Photoshop 6 (not 5)

            this.Transform = new Matrix2D(r);          //six doubles (48 bytes)

            ushort TextVersion       = r.ReadUInt16(); //2 bytes, =50. For Photoshop 6.0.
            uint   DescriptorVersion = r.ReadUInt32(); //4 bytes,=16. For Photoshop 6.0.


            this.TxtDescriptor = DynVal.ReadDescriptor(r); //Text descriptor

            ushort WarpVersion           = r.ReadUInt16(); //2 bytes, =1. For Photoshop 6.0.
            uint   WarpDescriptorVersion = r.ReadUInt32(); //4 bytes, =16. For Photoshop 6.0.

            engineData       = (Dictionary <string, object>)TxtDescriptor.Children.Find(c => c.Name == "EngineData").Value;
            StylesheetReader = new TdTaStylesheetReader(engineData);

            //string desc = this.TxtDescriptor.getString();

            this.WarpDescriptor = DynVal.ReadDescriptor(r);       //Warp descriptor
            this.Data           = r.ReadBytes((int)r.BytesToEnd); //17 bytes???? All zeroes?
            if (Data.Length != 17 || !(Array.TrueForAll(Data, b => b == 0)))
            {
                string s = ReadableBinary.CreateHexEditorString(Data);
                Debug.Write(s);
            }

            //this.WarpRect = new RectangleF();
            //WarpRect.X = (float)r.ReadDouble();
            //WarpRect.Y = (float)r.ReadDouble();
            //this.Data.
            //WarpRect.Width = (float)r.ReadDouble() - WarpRect.X;
            //WarpRect.Height = (float)r.ReadDouble() - WarpRect.Y;

            //this.Data = r.ReadBytes((int)r.BytesToEnd);
        }
Example #9
0
 public static DynVal ToDynVal <T>(this T[] original) => DynVal.Init(original);
Example #10
0
        public Txt2(BinaryPSDReader reader)
            : base(reader)
        {
            bool readData = false; //Set to true to see it in all its... glory.
            if (readData)
            {
                BinaryPSDReader r = this.GetDataReader();
                r.BaseStream.Position += 2;
                this.Values = new DynVal();
                this.Values.Children = new List<DynVal>();
                while (true)
                {
                    DynVal child = new DynVal();
                    this.Values.Children.Add(child);
                    try
                    {
                        if (child.ReadTdtaItem(r) == false)
                            break;
                    }
                    catch (Exception ex)
                    {

                    }
                }
            }

            this.Data = null;
        }
Example #11
0
        public ObjectBasedEffects(BinaryPSDReader reader)
            : base(reader)
        {
            BinaryPSDReader r = this.GetDataReader();
            r.ReadUInt32(); //Object version, Always 0

            this.Descriptor = new DynVal(r, true);
            //r.ReadUInt32(); //Descriptor version, 16 = PS6.0
            //string unknown = Endogine.Serialization.ReadableBinary.CreateHexEditorString(r.ReadBytes(6));
            //this.Values = DynVal.ReadValues(r);
            //Action Descriptor(s)
        }