示例#1
0
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties();

            int count = reader.ReadInt32();

            List<DescriptorStructure> dss = new List<DescriptorStructure>();

            for (int i = 0; i < count; i++)
            {
                string s = reader.ReadAscii(4);
                string k = reader.ReadAscii(4);
                var c = reader.ReadByte();
                var p = reader.ReadBytes(3);
                var l = reader.ReadInt32();
                var p2 = reader.Position;
                var ds = new DescriptorStructure(reader);
                dss.Add(ds);
                reader.Position = p2 + l;
            }

            props["Items"] = dss;

            value = props;
        }
示例#2
0
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties();

            int count = reader.ReadInt32();

            List <DescriptorStructure> dss = new List <DescriptorStructure>();

            for (int i = 0; i < count; i++)
            {
                string s  = reader.ReadAscii(4);
                string k  = reader.ReadAscii(4);
                var    c  = reader.ReadByte();
                var    p  = reader.ReadBytes(3);
                var    l  = reader.ReadInt32();
                var    p2 = reader.Position;
                var    ds = new DescriptorStructure(reader);
                dss.Add(ds);
                reader.Position = p2 + l;
            }

            props["Items"] = dss;

            value = props;
        }
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties();

            int version = reader.ReadInt32();

            if (version == 6)
            {
                var    r1    = reader.ReadInt32();
                var    r2    = reader.ReadInt32();
                var    r3    = reader.ReadInt32();
                var    r4    = reader.ReadInt32();
                string text  = reader.ReadString();
                var    count = reader.ReadInt32();

                List <IProperties> slices = new List <IProperties>(count);
                for (int i = 0; i < count; i++)
                {
                    slices.Add(ReadSliceInfo(reader));
                }
            }
            {
                var descriptor = new DescriptorStructure(reader) as IProperties;

                var items = descriptor["slices.Items[0]"] as object[];
                List <IProperties> slices = new List <IProperties>(items.Length);
                foreach (var item in items)
                {
                    slices.Add(ReadSliceInfo(item as IProperties));
                }
                props["Items"] = slices.ToArray();
            }

            value = props;
        }
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties();

            int version = reader.ReadInt32();
            if (version == 6)
            {
                var r1 = reader.ReadInt32();
                var r2 = reader.ReadInt32();
                var r3 = reader.ReadInt32();
                var r4 = reader.ReadInt32();
                string text = reader.ReadString();
                var count = reader.ReadInt32();

                List<IProperties> slices = new List<IProperties>(count);
                for (int i = 0; i < count; i++)
                {
                    slices.Add(ReadSliceInfo(reader));
                }
            }
            {
                var descriptor = new DescriptorStructure(reader) as IProperties;

                var items = descriptor["slices.Items[0]"] as object[];
                List<IProperties> slices = new List<IProperties>(items.Length);
                foreach (var item in items)
                {
                    slices.Add(ReadSliceInfo(item as IProperties));
                }
                props["Items"] = slices.ToArray();
            }

            value = props;
        }
示例#5
0
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties(7);

            reader.ValidateInt16(1, "Typetool Version");
            props["Transforms"]  = reader.ReadDoubles(6);
            props["TextVersion"] = reader.ReadInt16();
            props["Text"]        = new DescriptorStructure(reader);
            props["WarpVersion"] = reader.ReadInt16();
            props["Warp"]        = new DescriptorStructure(reader);
            props["Bounds"]      = reader.ReadDoubles(2);

            value = props;
        }
示例#6
0
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties(7);

            reader.ValidateInt16(1, "Typetool Version");
            props["Transforms"] = reader.ReadDoubles(6);
            props["TextVersion"] = reader.ReadInt16();
            props["Text"] = new DescriptorStructure(reader);
            props["WarpVersion"] = reader.ReadInt16();
            props["Warp"] = new DescriptorStructure(reader);
            props["Bounds"] = reader.ReadDoubles(2);

            value = props;
        }
示例#7
0
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties();

            reader.ValidateType("plcL", "LayerResource PlLd");
            props["Version"]        = reader.ReadInt32();
            props["UniqueID"]       = reader.ReadPascalString(1);
            props["PageNumbers"]    = reader.ReadInt32();
            props["Pages"]          = reader.ReadInt32();
            props["AntiAlias"]      = reader.ReadInt32();
            props["LayerType"]      = reader.ReadInt32();
            props["Transformation"] = reader.ReadDoubles(8);
            reader.ValidateInt32(0, "WarpVersion");
            props["Warp"] = new DescriptorStructure(reader);

            value = props;
        }
示例#8
0
        private Uri ReadAboluteUri(PsdReader reader)
        {
            IProperties props = new DescriptorStructure(reader);

            if (props.Contains("fullPath") == true)
            {
                Uri absoluteUri = new Uri(props["fullPath"] as string);
                if (File.Exists(absoluteUri.LocalPath) == true)
                {
                    return(absoluteUri);
                }
            }

            if (props.Contains("relPath") == true)
            {
                string relativePath = props["relPath"] as string;
                Uri    absoluteUri  = reader.Resolver.ResolveUri(reader.Uri, relativePath);
                if (File.Exists(absoluteUri.LocalPath) == true)
                {
                    return(absoluteUri);
                }
            }

            if (props.Contains("Nm") == true)
            {
                string name        = props["Nm"] as string;
                Uri    absoluteUri = reader.Resolver.ResolveUri(reader.Uri, name);
                if (File.Exists(absoluteUri.LocalPath) == true)
                {
                    return(absoluteUri);
                }
            }

            if (props.Contains("fullPath") == true)
            {
                return(new Uri(props["fullPath"] as string));
            }

            return(null);
        }
示例#9
0
 protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
 {
     reader.ValidateInt32(0, "lfx2 Version");
     value = new DescriptorStructure(reader, true);
 }
示例#10
0
 protected override void ReadValue(PsdReader reader, Object userData, out IProperties value)
 {
     reader.ValidateInt32(0, "lfx2 Version");
     value = new DescriptorStructure(reader, true);
 }
示例#11
0
 public override void ReadValue(PsdReader reader, object userData, out IProperties value)
 {
     reader.ValidateType("soLD", "SoLd ID");
     reader.ValidateInt32(4, "SoLd Version");
     value = new DescriptorStructure(reader, true);
 }
示例#12
0
 protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
 {
     reader.ValidateType("soLD", "SoLd ID");
     reader.ValidateInt32(4, "SoLd Version");
     value = new DescriptorStructure(reader, true);
 }