nKnots : UInt16
– Number of control knots in this contour set.flags : StaticCoordFlag ^ nKnots
– Flag array.xData, yData : Bytes
– Compressed X and Y coordinate data, driven by flags.
Flags are bytes described as follows: SC FR ZC-ZC XT-XT YT-YT
SC
: Start of contour. First flag implicitly sets this bit.FR
: Fraction coordinates.ZC
: Decides the type of this knot.- TBD: may be cubic only or a 2-3 MD spline with 0-1 knot intervals.
- MD looks too complex but it is the way to main compatibility with both cubic and quadratic outlines with exact 1-1 knot mapping.
XT
,YT
: X/Y coordinate type.00
: Zero01
: Positive short (Unsigned 8-bit or unsigned 8.8)10
: Negative short (Unsigned 8-bit or unsigned 8.8)11
: Long (signed 16-bit or signed 16.16)
nVariance : UInt16
– Number of variance masters applied.variations : ContourSetVariance ^ nVariance
– Array of variance application.
masterId : UInt16
– Index of master.flags : Array PolyCoordFlag
– Enough to cover all knots. See below.deltaX, deltaY : Bytes
– Compressed delta data, driven by flags.
Each flag may occupy 1–3 bytes: one leading byte decides the format of variance coordinates; the rest bytes decides how many points are affected.
Leading byte format: 00 FR NT-NT XT-XT YT-YT
FR
: X and Y delta coordinates are fraction.NT
: Type of trailing point number indicator.00
: Applies to one point. No trailing bytes.01
: Byte. Next byte represents the quantity of points affected minus one.10
: Short. Next two bytes, grouped together into a 16-bit unsigned integer represents the quantity of points affected minus one.11
: Applies to all remaining points. No trailing bytes.
XT
,YT
: Type of X and Y delta coordinates.00
: Zero. No data byte.01
: Signed byte or 8.8.10
: Signed short or 16.16.11
: Implicit. The coordinate is implicitly interpolated usingIUP
. No data byte.