Пример #1
0
        public static AspectSourceFlags AspectSourceFlags(MetafileReader reader, CommandHeader commandHeader)
        {
            // ASPECT SOURCE FLAGS: has up to 18 parameter-pairs, corresponding to each attribute that may be
            // bundled; each parameter-pair contains the ASF type and the ASF value:
            // (enumerated) ASF type; valid values are
            //      0 line type ASF
            //      1 line width ASF
            //      2 line colour ASF
            //      3 marker type ASF
            //      4 markersizeASF
            //      5 marker colour ASF
            //      6 text font index ASF
            //      7 text precision ASF
            //      8 character expansion factor ASF
            //      9 character spacing ASF
            //      10 text colour ASF
            //      11 interior style ASF
            //      12 fill colour ASF
            //      13 hatch index ASF
            //      14 pattern index ASF
            //      15 edge type ASF
            //      16 edge width ASF
            //      17 edge colour ASF
            // (enumerated) ASF value; valid values are
            //      0 individual
            //      1 bundled
            var asf = new Dictionary <AspectSourceFlagsType, AspectSourceFlagsValue>();

            while (reader.HasMoreData(2))
            {
                asf[reader.ReadEnum <AspectSourceFlagsType>()] = reader.ReadEnum <AspectSourceFlagsValue>();
            }
            return(new AspectSourceFlags(asf));
        }
 public static BeginTileArray BeginTileArray(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (point) position
     // P2: (enumerated) cell path direction: valid values are
     //      0 0°
     //      1 90°
     //      2 180°
     //      3 270°
     // P3: (enumerated) line progression direction: valid values are
     //      0 90°
     //      1 270°
     // P4: (integer) number of tiles in pth direction
     // P5: (integer) number of tiles in line direction
     // P6: (integer) number of cells/ tile in path direction
     // P7: (integer) number of cells/ tile in line direction
     // P8: (real) cell size in path direction
     // P9: (real) cell size in line direction
     // P10: (integer) image offset in path direction
     // P11: (integer) image offset in line direction
     // P12: (integer) image number of cells in path direction
     // P13: (integer) image number of cells in line direction
     return(new BeginTileArray(
                reader.ReadPoint(),
                reader.ReadEnum <CellPathDirection>(),
                reader.ReadEnum <LineProgressionDirection>(),
                reader.ReadInteger(), reader.ReadInteger(),
                reader.ReadInteger(), reader.ReadInteger(),
                reader.ReadReal(), reader.ReadReal(),
                reader.ReadInteger(), reader.ReadInteger(),
                reader.ReadInteger(), reader.ReadInteger()));
 }
Пример #3
0
 public static Transparency Transparency(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) on - off indicator: valid values are
     //      0 off: auxiliary colour background is required
     //      1 on: transparent background is required
     return(new Transparency(reader.ReadEnum <OnOffIndicator>()));
 }
Пример #4
0
        public static InheritanceFilter InheritanceFilter(MetafileReader reader, CommandHeader commandHeader)
        {
            // P1: (enumerated list) list of one or more of: (list omitted)
            // P2: (enumerated) setting: valid values are
            //      0 state list
            //      1 segment
            var items = new List <InheritanceFilterItem>();

            while (reader.HasMoreData(4)) // 2 per enum
            {
                items.Add(new InheritanceFilterItem(
                              reader.ReadEnum <InheritanceFilterDesignator>(),
                              reader.ReadEnum <InheritanceFilterSetting>()));
            }
            return(new InheritanceFilter(items.ToArray()));
        }
Пример #5
0
 public static ClipInheritance ClipInheritance(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) clip inheritance: valid values are
     //      0 state list
     //      1 intersection
     return(new ClipInheritance(reader.ReadEnum <ClipInheritanceType>()));
 }
Пример #6
0
 public static ColorSelectionMode ColorSelectionMode(MetafileReader reader, CommandHeader header)
 {
     // P1: (enumerated) colour selection mode:
     //      0 indexed colour mode
     //      1 direct colour mode
     return(new ColorSelectionMode(reader.ReadEnum <ColorModeType>()));
 }
Пример #7
0
 public static EdgeVisibility EdgeVisibility(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) edge visibility: valid values are
     //      0 off
     //      1 on
     return(new EdgeVisibility(reader.ReadEnum <OnOffIndicator>()));
 }
 public static VdcType VdcType(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) VDC TYPE: valid values are
     //      0 VDC values specified in integers
     //      1 VDC values specified in reals
     return(new VdcType(reader.ReadEnum <VdcTypeSpecification>()));
 }
Пример #9
0
 public static ClipIndicator ClipIndicator(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) clip indicator: valid values are
     //      0 off
     //      1 on
     return(new ClipIndicator(reader.ReadEnum <OnOffIndicator>()));
 }
Пример #10
0
 public static TextPrecision TextPrecision(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) text precision: valid values are
     //      0 string
     //      1 character
     //      2 stroke
     return(new TextPrecision(reader.ReadEnum <TextPrecisionType>()));
 }
Пример #11
0
 public static Message Message(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) action-required flag: valid values are
     //      0 noaction
     //      1 action
     // P2: (string fixed) message string
     return(new Message(reader.ReadEnum <ActionRequired>(), reader.ReadString()));
 }
Пример #12
0
 public static SegmentHighlighting SegmentHighlighting(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (name) segment identifier
     // P2: (enumerated) highlighting: valid values are
     //      0 normal
     //      1 highlighted
     return(new SegmentHighlighting(reader.ReadName(), reader.ReadEnum <Highlighting>()));
 }
Пример #13
0
 public static EdgeClippingMode EdgeClippingMode(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) clipping mode: valid values are
     //      0 locus
     //      1 shape
     //      2 locus then shape
     return(new EdgeClippingMode(reader.ReadEnum <ClippingMode>()));
 }
Пример #14
0
 public static GeneralizedTextPathMode GeneralizedTextPathMode(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) text path mode: valid values are
     //      0 off
     //      1 non - tangential
     //      2 axis - tangential
     return(new GeneralizedTextPathMode(reader.ReadEnum <TextPathMode>()));
 }
Пример #15
0
 public static AppendText AppendText(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) final / not - final flag: valid values are
     //      0 not final
     //      1 final
     // P2: (string) text string
     return(new AppendText(reader.ReadEnum <FinalFlag>(), reader.ReadString()));
 }
Пример #16
0
 public static TextPath TextPath(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) text path: valid values are:
     //      0 right
     //      1 left
     //      2 up
     //      3 down
     return(new TextPath(reader.ReadEnum <TextPathType>()));
 }
Пример #17
0
 public static MarkerSizeSpecificationMode MarkerSizeSpecificationMode(MetafileReader reader, CommandHeader header)
 {
     //  P1: (enumerated) marker size specification mode: valid values are
     //      0 absolute
     //      1 scaled
     //      2 fractional
     //      3 mm
     return(new MarkerSizeSpecificationMode(reader.ReadEnum <WidthSpecificationModeType>()));
 }
 public static CharacterCodingAnnouncer CharacterCodingAnnouncer(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) character coding announcer: valid values are
     //      0 basic 7 - bit
     //      1 basic 8 - bit
     //      2 extended 7 - bit
     //      3 extended 8 - bit
     return(new CharacterCodingAnnouncer(reader.ReadEnum <CharacterCodingAnnouncerType>()));
 }
Пример #19
0
 public static ProtectionRegionIndicator ProtectionRegionIndicator(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (index) region index
     // P2: (index) region indicator: valid values are
     //      1 off
     //      2 clip
     //      3 shield
     return(new ProtectionRegionIndicator(reader.ReadIndex(), reader.ReadEnum <RegionIndicator>()));
 }
Пример #20
0
 public static InteriorStyleSpecificationMode InteriorStyleSpecificationMode(MetafileReader reader, CommandHeader header)
 {
     // P1: (enumerated) valid values are
     //      0 absolute
     //      1 scaled
     //      2 fractional
     //      3 mm
     return(new InteriorStyleSpecificationMode(reader.ReadEnum <WidthSpecificationModeType>()));
 }
Пример #21
0
 public static TextCommand Text(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (point) text position
     // P2: (enumerated) final / not - final flag: valid values are
     //      0 not final
     //      1 final
     // P3: (string) text string
     return(new TextCommand(reader.ReadPoint(), reader.ReadEnum <FinalFlag>(), reader.ReadString()));
 }
Пример #22
0
 public static VdcRealPrecision VdcRealPrecision(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) form of representation for real values: valid values are
     //      0 floating point format
     //      1 fixed point format
     // P2: (integer) field width for exponent or whole part (including 1 bit for sign)
     // P3: (integer) field width for fraction or fractional part
     return(new VdcRealPrecision(reader.ReadEnum <RealRepresentation>(), reader.ReadInteger(), reader.ReadInteger()));
 }
Пример #23
0
 public static EdgeWidthSpecificationMode EdgeWidthSpecificationMode(MetafileReader reader, CommandHeader header)
 {
     //  P1: (enumerated) edge width specification mode: valid values are
     //      0 absolute
     //      1 scaled
     //      2 fractional
     //      3 mm
     return(new EdgeWidthSpecificationMode(reader.ReadEnum <WidthSpecificationModeType>()));
 }
Пример #24
0
 public static TextAlignment TextAlignment(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) horizontal alignment: valid values are:
     //      0 normal horizontal
     //      1 left
     //      2 centre
     //      3 right
     //      4 continuous horizontal
     // P2: (enumerated) vertical alignment
     //      0 normal vertical
     //      1 top
     //      2 cap
     //      3 half
     //      4 base
     //      5 bottom
     //      6 continuous vertical
     // P3: (real) continuous horizontal alignment
     // P4: (real) continuous vertical alignment
     return(new TextAlignment(reader.ReadEnum <HorizontalTextAlignment>(), reader.ReadEnum <VerticalTextAlignment>(), reader.ReadReal(), reader.ReadReal()));
 }
Пример #25
0
 public static InteriorStyle InteriorStyle(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) interior style: valid values are
     //      0 hollow
     //      1 solid
     //      2 pattern
     //      3 hatch
     //      4 empty
     //      5 geometric pattern
     //      6 interpolated
     return(new InteriorStyle(reader.ReadEnum <InteriorStyleType>()));
 }
Пример #26
0
 public static CopySegment CopySegment(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (name) segment identifier
     // P2: The next 6 values are components of a transformation matrix consisting of a scaling and rotation portion
     // (2 x 2 R) and a translation portion (2 x 1 VDC). In the binary encoding this is expressed as a 2 x 3 matrix of
     // the form:
     //      a11: (real) x scale component
     //      a12: (real) x rotation component
     //      a21: (real) y rotation component
     //      a22: (real) y scale component
     //      a13: (vdc) x translation component
     //      a23: (vdc) y translation component
     // P3: (enumerated) segment transformation application: valid values are
     //      0: no
     //      1: yes
     return(new CopySegment(reader.ReadName(), reader.ReadMatrix(), reader.ReadEnum <SegmentTransformationApplication>()));
 }
        public static CharacterSetList CharacterSetList(MetafileReader reader, CommandHeader commandHeader)
        {
            // P1: (enumerated) CHARACTER SET TYPE: valid codes are
            //      0 94 - character G - set
            //      1 96 - character G - set
            //      2 94 - character multibyte G-set
            //      3 96 - character multibyte G-set
            //      4 complete code
            // P2: (string fixed) Designation sequence tail; see Part 1, subclause 7.3.14.
            var entries = new List <CharacterSetListEntry>();

            while (reader.HasMoreData(3)) // enums take up 2 bytes, strings at least 1 byte
            {
                entries.Add(new CharacterSetListEntry(reader.ReadEnum <CharacterSetType>(), reader.ReadString()));
            }
            return(new CharacterSetList(entries));
        }
Пример #28
0
        public static ScalingMode ScalingMode(MetafileReader reader, CommandHeader header)
        {
            // P1: (enumerated) scaling mode: valid values are
            //      0 abstract scaling
            //      1 metric scaling
            // P2: (real) metric scaling factor, ignored if P1=0
            //
            // This parameter is always encoded as floating point, regardless of the value of the fixed/floating flag of
            // REAL PRECISION. If a REAL PRECISION (floating, n, m) has preceded, then the precision used is n,m.
            // If a REAL PRECISION element for floating point has not preceded, then a default precision of 9,23 (32-bit
            // floating point) is used.
            int numFloatBytes = 32 / 8;

            if (reader.Descriptor.RealPrecision == RealPrecisionSpecification.FloatingPoint64Bit)
            {
                numFloatBytes = 64 / 8;
            }
            return(new ScalingMode(reader.ReadEnum <ScalingModeType>(), reader.ReadFloatingPoint(numFloatBytes)));
        }
Пример #29
0
        public static PolygonSet PolygonSet(MetafileReader reader, CommandHeader commandHeader)
        {
            // P(i): (point) (X,Y) polygon vertex
            // P(i+1): (enumerated) edge out flag, indicating closures and edge visibility: valid values are
            //      0 invisible
            //      1 visible
            //      2 close, invisible
            //      3 close, visible
            var points = new List <PointF>();
            var flags  = new List <EdgeOutFlags>();

            // TODO: point is 2 VDCs, but that may range from 8 bits each until up to 64 bits for a single coordinate
            //       this should probably check for 2x VDC size instead of simply 2x minimum-possible VDC size
            while (reader.HasMoreData(3))
            {
                points.Add(reader.ReadPoint());
                flags.Add(reader.ReadEnum <EdgeOutFlags>());
            }
            return(new PolygonSet(points.ToArray(), flags.ToArray()));
        }
Пример #30
0
        public static DeviceViewportSpecificationMode DeviceViewportSpecificationMode(MetafileReader reader, CommandHeader header)
        {
            // P1: (enumerated) VC specifier: valid values are
            //      0 fraction of drawing surface
            //      1 millimetres with scale factor
            //      2 physical device coordinates
            // P2: (real) metric scale factor, ignored if P1=0 or P1=2
            //
            // This parameter is always encoded as floating point, regardless of the value of the fixed/floating flag of
            // REAL PRECISION. If a REAL PRECISION (floating, n, m) has preceded, then the precision used is n,m.
            // If a REAL PRECISION element for floating point has not preceded, then a default precision of 9,23 (32-bit
            // floating point) is used.
            int numFloatBytes = 32 / 8;

            if (reader.Descriptor.RealPrecision == RealPrecisionSpecification.FloatingPoint64Bit)
            {
                numFloatBytes = 64 / 8;
            }
            return(new DeviceViewportSpecificationMode(reader.ReadEnum <DeviceViewportSpecificationModeType>(), reader.ReadFloatingPoint(numFloatBytes)));
        }