Important: The information in this document is obsolete and should not be used for new development.
Data
The sequence of the optional object-specific data that follows a data type opcode byte is predetermined and consists of type constants and data. Some data sequences are preceded by an omit byte. An omit byte is included in the data stream format to describe the presence or absence, meaning, order, and compression of data that corresponds to the fields of a type or the properties of an object. If an omit byte is not present for an object, then, with the exception of bitmaps and transforms, the compression type opcode in the data type opcode byte defines the data compression.Omit Byte Masks and Omit Byte Shifts
The omit byte provides an efficient method of assigning different data compressions to type constants and object properties that immediately follow the omit byte. Figure 7-7 shows the relationship of the bits in an omit byte and the four constants or properties that follow.Figure 7-7 Omit byte relationship with the data that follows
The compression type constants used in the omit byte are defined in the
gxTwoBitCompressionValues
enumeration listed in Table 7-2. Long, word, or byte data compression is applied if the enumeration constants are 0x00, 0x40, 0x80, respectively. If the constant is 0xC0, the compression is "omit compression," then the stream format does not include the field or property. For example, if the omit byte in Figure 7-7 contained 0x0C for bits 3 and 2, Data 3 constant or property would not appear in the stream and Data 4 would follow Data 2.Some omit byte enumerations provide multiple bytes of mask constants and shift constants to accommodate the description of all of the properties of an object or all of the fields of a structure. For example, the description of a layout shape requires three omit bytes to specify the compression of all of the properties. The data corresponding to each omit byte mask follows the mask. For multiple masks, the sequence is omit mask1, data, omit mask2, data, omit mask3, data, and so on.
You can use an omit byte mask and its corresponding omit byte shift to interpret the meaning of each of the bits in the omit byte. Each entry in an omit mask enumeration has a name and a value. The name describes the property. The hexadecimal value of the mask is given in the enumeration. The binary equivalent is the mask.
Table 7-10 shows a typical omit byte mask enumeration and its corresponding omit byte shift enumeration values. The example shows the
gxOmitTextMask
enumeration binary mask values and the bit shift from the correspondinggxOmitTextShift
enumeration.Figure 7-8 shows how you can use an omit mask and corresponding omit shift to analyze an omit byte in the data stream.
Figure 7-8 Select the bits from the omit byte
First, the bits in the omit byte are masked with the
gxOmit_Mask
enumeration with a value of 0xC0 and a binary value 11000000. This mask selects the first two high-order bits of the omit byte. In order to interpret the two bits selected, shift the bits to the right by the number of bits indicated by thegxOmit_Shift
enumeration value. Once the bits are selected and shifted, determine the compression of the data that follows by comparing these bits with thegxTwoBitCompressionValues
enumeration, as shown in Figure 7-9. The values of thegxTwoBitCompressionValues
enumeration are given in Table 7-2.Figure 7-9 Compare the bits selected and shifted with the compression enumeration
Here is an example of how this works with an omit byte describing the shape object for a text shape. First you need to correlate the names of the constants in the omit mask enumeration with the structures, enumerations, or properties of the object that they describe. For more information on correlating omit bytes, see the appropriate object-specific heading in the section"Data" beginning on page 7-22.
Table 7-11 shows the correlation between the
gxOmitTextMask
names and the parameters of theGXNewTextFunction
.A summary of these constants is provided in Table 7-10. The
gxOmitTextMask
enumeration constants correlate with the properties of the text shape. The text shape is described in the text shape chapter of Inside Macintosh: QuickDraw GX Typography.The order of the
gxOmitTextMask
enumeration tells us that the data to follow will be in the sequencecharCount
,position
.x
,position
.y
, andtext
.For instance, suppose the omit byte is 0xA4 or binary 10100100.
The binary mask value for the
gxOmitTextCharacterMask
, 11000000, selects the high order 2 bits, 10. ThegxTwoBitCompressionValues
enumeration with value 2 isgxByteCompression
. The data forcharCount
is therefore byte compressed.The binary mask value for the
gxOmitPositionXMask
, 00110000, selects the next 2 bits, 10. ThegxTwoBitCompressionValues
enumeration with value 2 is againgxByteCompression
. The data forposition.x
is therefore byte compressed.The binary mask value for the
gxOmitPositionYMask
, 00001100, selects the next 2 bits, 01. ThegxTwoBitCompressionValues
enumeration with value 1 isgxWordCompression
. The data forposition.y
is therefore word compressed.The binary mask value for the
gxOmitTextDataMask
, 10, selects the next bit, 0. ThegxTwoBitCompressionValues
enumeration with value 0 isgxNoCompression
. Thetext
data is therefore not compressed.The above example is from the analysis of a data stream of a flattened text shape. For additional information about this example see the section "Analyzing a Flattened Text Shape" beginning on page 7-72.
One or more omit mask bytes are included in the data stream whenever specific enumeration or structure data is required to describe a specific object.
Omit mask and omit shift enumerations can be used to analyze QuickDraw GX omit bytes and compare the masked bits to other values.
An omit byte is first masked to obtain the bits desired. The bits are then shifted using the omit shift enumeration that corresponds to the omit byte. The resulting bits can then be compared to other data in your application to obtain information about the data stream.
Listing 7-1 shows how to determine if the x-coordinate of the position field in a flattened shape data stream is compressed.
Listing 7-1 Determining if
position(x)
is byte compressed
unsigned char a = ReadByte(); if ((a & (gxOmitTextPositionXMask >> gxOmitTextPositionXShift)) == gxByteCompression { /* perform an action */ }The function reads the byte, masks it withgxOmitTextPositionXMask
to obtain the desired two bits, and then shifts it by the amount given by thegxOmitTextPositionShift
. The resulting 2 bits can now be compared to the 2 bits ofgxByteCompression.
Header Data
The header marks the beginning of a new flattened shape in the data stream. ThegxHeaderTypeOpcode
constant indicates that the version of QuickDraw GX that generated the data stream follows. As new versions become available, older software may not be able to interpret the newer portions of a data stream. The interpreter can then look at the version number and skip over versions that it doesn't understand. For example, if an interpreter that understands only QuickDraw GX version 1.0 encounters version 2.0 or if the interpreter finds a version 1.0 opcode, but doesn't recognize the data, an error is posted.The byte after the version byte contains the
gxFontListFlatten
andgxFontGlyphsFlatten
flags. These flags are functional only if the shape contains text.The
gxFontListFlatten
flag instructs theGXFlattenShape
function to attach a tag object to the flattened shape containing a list of the fonts referenced in the shape. A list of all of the fonts used in the data stream are included at the end of the data stream.The
gxFontGlyphsFlatten
flag instructs theGXFlattenShape
function to attach a tag to the flattened shape containing a list of the specific glyphs used from each font referenced by the shape. A list of all of the glyph codes used by all of the fonts referenced in a data stream is then included at the end of that data stream.For more information about the font and glyph list flags, see the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.
The font list and glyph list are combined to form a tag that is of type
gxFlatFontListItem
and designated'flst
'. During printing, only the fonts and glyphs used in the stream are loaded to the printing device.The
gxFlatFontList
structure includes thegxFlatFontListItem
structure. ThegxFlatFontListItem
contains two arrays. The first is the array of font names. The second is the array of glyphs that are used. The array of glyphs is obtained by setting a bit in an array for each glyph that is used. If you ask only for the font names, the glyph array will be omitted. The glyphs array cannot be selected without the font array selected. In other words, you may specify either a list of fonts or specify a list of fonts and glyphs to be listed at the end of the data stream.The fonts and glyphs included in the flattened list,
'flst
', are used in the print file for the QuickDraw GX portable digital document. For more information on the QuickDraw GX portable digital document see the section "Portable Digital Documents" beginning on page 7-53.For more information on the QuickDraw GX print file, see the section "About Print Files and Portable Digital Documents" beginning on page 7-51. For more information about how to use the print file data, see the section "Obtaining Data From a Print File" beginning on page 7-89.
For more information on
the
gxFlatFontName
,gxFlatFontListItemTag
, andgxFlatFontList
structures see the chapter "Fonts" in Inside Macintosh: QuickDraw GX Typography.New Shape Object Data
A new shape object always follows the style, ink, transform, and any other objects that have been built for the shape object in the data stream. New shape data follows an operation opcodegxNewObjectOpcode
constant and a data type opcode containing one of the constants inthe
gxGraphicsNewOpcode
enumeration. Values 1 (gxEmptyType
) through 13 (gxPictureType
) are the constants from thegxShapeTypes
enumeration.This opcode creates a new shape object with all of the properties of the previous shape object in the data stream. If the current shape object is the first shape object in the stream, then it is created with default properties.
The values of the constants for all of the shape objects are summarized in Table 7-3. Shape types are described in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.
Empty Shape Data
The data type opcode with a value 1 is thegxEmptyType
constant. Empty shapes store no information in their geometries. For the current shape object, thegxEmptyType
means that the current shape is an empty shape. No data follows.The
gxEmptyTypes
constant is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Point Shape Data
The data type opcode with a value 2 is thegxPointType
constant. The data for the fields of agxPoint
structure follows. The data sequence isx
(Fixed
),y
(Fixed
).Compression data:
gxNoCompression
- read 2longs
per point;gxWordCompression
- read 2 shorts per point or treat each short as a signed integer (120 = 120.0 and -171 = -171.0);gxByteCompression
- read 2 bytes per point and treat each byte as a signed integer (7 = 7.0 and -13 = -13.0).The
gxPoint
structure is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Line Shape Data
The data type opcode with a value 3 is thegxLineType
constant. The data for the fields of thegxLine
structure follows. The data sequence isfirst.x,first.y
last.x,last.y
.Compression data:
gxNoCompression
- read 2longs
per point;gxWordCompression
- read 2 shorts per point or treat each short as a signed integer (120 = 120.0 and -171 = -171.0);gxByteCompression
- read 2 bytes per point and treat each byte as a signed integer (7 = 7.0 and -13 = -13.0).The
gxLine
structure is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Curve Shape Data
The data type opcode with a value 4 is thegxCurveType
constant. The data for the fields of thegx
Curve structure follows. The fields in the structure correspond to the parameters in theGXNew
Curve function. The data sequence isx
(first point),y
(first point),x
(control point),y
(control point),x
(last point), andy
(last point).Compression data:
gxNoCompression
- read 2longs
per point;gxWordCompression
- read 2 shorts per point or treat each short as a signed integer (120 = 120.0 and -171 = -171.0);gxByteCompression
- read 2 bytes per point and treat each byte as a signed integer (7 = 7.0 and -13 = -13.0).The
gxCurve
structure is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Rectangle Shape Data
The data type opcode with a value 5 is thegxRectangleType
constant. The data for the fields of thegxRectangle
structure follows. The data sequence is left, top, right, bottom. Typically, the first corner is left-top and the second corner is right-bottom; but this order is not required. They need only be opposite corners of a rectangle.Compression data:
gxNoCompression
- read 2longs
per point;gxWordCompression
- read 2 shorts per point or treat each short as a signed integer (120 = 120.0 and -171 = -171.0);gxByteCompression
- read 2 bytes per point and treat each byte as a signed integer (7 = 7.0 and -13 = -13.0).The
gxRectangle
structure is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Polygon Shape Data
The data type opcode with a value 6 is thegxPolygonType
constant. The data for the fields of thegxPolygons
structure follows. ThegxPolygons
structure includes thegxPolygon
structure.The data sequence is
contours
,vectors
, omit byte,x
(first point),y
(first point),x
(second point),y
(second point),x
(third point),y
(third point), and so on. The numbers are compressed as fixed-point numbers.The point array for polygons and paths stream is stored as relative positions, not absolute positions ( as is the case for the point arrays in polygon and path shapes.)
The omit byte is interpreted by the
gxOmitPathMask
andgxOmitPathShift
enumerations.The first two entries of the omit byte describe the compression for the first two points of the polygon shape, which are absolute. The numbers are compressed as fixed-point numbers:
gxNoCompression
means 1long
for each fixed number;gxWordCompression
means 1short
for each fixed number treated as an integer
(17 = 17.0);gxByteCompression
means 1 byte per fixed number. Thus a byte compressed value can represent an integer fixed point number from -128.0 to 127.0; a word compression value can represent any integer fixed-point number.The second two entries in the omit byte describe the compression for the second through the last points in the contour. The coordinates of these points are relative to the first absolute points and appear in the stream as differences. The relative values are stored as differences. Thus each x value in the stream is subtracted from the prior value to reconstruct the original value. Conversely, each value in the shape is subtracted from the prior value to compute the delta to be written to the stream. The x and y coordinate values are considered separately. Each may be independently byte, word, or long compressed, using the same fixed-point compression as the absolute values. Each subsequent contour has its own omit byte to describe the absolute initial point values and the subsequent relative point values.
The compression bits in the data type opcode byte control the compression of the contour counts and all vector counts. Compression data:
gxNoCompression
- read 1 long for contour and each vector count;gxWordCompression
- read 1 word for contour count and each vector count;gxByteCompression
- read 1 byte for contour count and each vector count.The
gxPolygons
structure is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Path Shape Data
The data type opcode with a value 7 is thegxPathType
constant. The data for the fields of thegx
Paths structure follows. ThegxPaths
structure includes thegxPath
structure.The data sequence is
contours
(number of contours),vectors
(number of points in the contour), control bytes, omit byte,x
(absolute coordinate of first point),y
(absolute coordinate of first point),x
(relative coordinate of second point),y
(relative coordinate of second point),x
(relative coordinate of third point),y
(relative coordinate of third point), and so on.A control byte contains control bits for each point off or on the path. Each point is assigned a bit. Bits with value 1 are off the path; bits with value 0 are on the path. If the number of points exceeds 8, multiple control bytes are used. If the number of points is not an even multiple of 8, the final unused bits are ignored.
The omit byte is interpreted by the
gxOmitPathMask
andgxOmitPathShift
enumerations.The first two entries of the omit byte describe the compression for the first two points of the path shape, which are absolute coordinates. The numbers are compressed as fixed-point numbers:
gxNoCompression
means 1long
for each fixed number;gxWordCompression
means 1short
for each fixed number treated as an integer
(17 = 17.0);gxByteCompression
means 1 byte per fixed number. Thus a byte compressed value can represent an integer fixed point number from -128.0 to 127.0; a word compression value can represent any integer fixed-point number.The second two entries in the omit byte describe the compression for the second through the last relative points in the contour. The coordinates of these points are relative to the first absolute points and appear in the stream as differences. Thus each x value in the stream is subtracted from the prior value to reconstruct the original value. Conversely, each value in the shape is subtracted from the prior value to compute the delta to be written to the stream. The x and y coordinate values are considered separately. Each may be independently byte, word, or long compressed, using the same fixed-point compression as the absolute values. Each subsequent contour has its own omit byte to describe the absolute initial point values and the subsequent relative point values.
The compression bits in the data type opcode byte control the compression of the contour counts and all vector counts. Compression data:
gxNoCompression
- read 1 long for contour and each vector count;gxWordCompression
- read 1 word for contour count and each vector count;gxByteCompression
- read 1 byte for contour count and each vector count.The
gxPaths
structure is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Bitmap Shape Data
The data type opcode with a value 8 is thegxBitmapType
constant. The data for the fields of thegxBitmap
andgxPoint
structures follow. ThegxBitmap
structure includes thegxColorSpace
enumeration and the references to thegxColorSet
andgxColorProfile
structures.The data sequence is omit byte 1,
image
reference,width
,height
,rowBytes
, omit byte 2,pixelSize
,space
(color space),set
(color set),profile
(color profile), omit byte 3,x
(position),y
(position).Omit byte 1 is interpreted by the
gxOmitBitmapMask1
andgxOmitBitmapShift1
enumerations. Omit byte 2 is interpreted by thegxOmitBitmapMask2
andgxOmitBitmapShift2
enumerations. Omit byte 3 is interpreted by thegxOmitBitmapMask3
andgxOmitBitmapShift3
enumerations.Data compression: The value may be a byte, word, or long. The value references a previous bit image: a value of 1 references the first bit image, a value of 2 references the second bit image, etc. A value of 0 indicates that the bitmap references a bit image through a file alias. The bitmap shape must reference a tag containing the file alias and offset as described in the chapter "Tag Objects" in Inside Macintosh: QuickDraw GX Objects. All bitmap values are compressed as integers (see polygon coutour compression above) except for the x and y coordinate positions. These are compressed as
Fixed
(see polygon first absolute position). Unlike prior shape types in this section, bitmaps and shape types described below can also have fields with thegxOmitCompression
bits set. In this case, the value 0 ornil
is used wherever the omit compression bits are set.The
gxBitmap
structure is described in the chapter "Bitmap Shapes" in Inside Macintosh: QuickDraw GX Graphics.Text Shape Data
The data type opcode with a value 9 is thegxTextType
constant. The data that follows corresponds to the parameters of theGXNewText
function.The data sequence is omit byte, byte length (of text),
x
(position),y
(position),charCount
(number of characters), data (character text).The data is the character stream or glyph indexes for the text. For nonRoman scripts, the actual byte length may be more than the number of characters.
The omit byte is interpreted by the
gxOmitTextDataMask
andgxOmitTextDataShift
enumerations.Data compression: The byte length is compressed as a long. The x and y coordinates are compressed as a fixed number. The data stream may contain bytes or shorts. If the stream contains shorts and all values are less than 255, then the stream may be compressed. It is an error to specify a character count of zero (omit compression) and to set the text data omit bit.
The
GXNewText
function is described in the chapter "Text Shapes" in Inside Macintosh: QuickDraw GX Typography.Glyph Shape Data
The data type opcode with a value 10 is thegxGlyphType
constant. The data correspond to the parameters in theGXNewGlyphs
function and include thegxPoint
andgxStyle
structures.The data sequence is omit byte 1,
charCount
(number of characters), byte length (of text),runNumber
(number of runs), data(
glyph character), omit byte 2,positions
,advance
,tangents
,styleRuns
,glyphStyles
.Omit byte 1 is interpreted by the
gxOmitGlyphDataMask1
andgxOmitGlyphDataShift1
enumerations. Omit byte 2 is interpreted by thegxOmitGlyphDataMask2
andgxOmitGlyphDataShift2
enumerations.Data compression:
charCount
, byte length, andrunNumber
are compressed as longs. IfcharCount
is 0, the data, positions, advance, and tangents are not read. If thegxOmitGlyphOnePosition
bit is set in the first byte, then the glyph shape contains 1 absolute position or as many positions as there are in the stream. In either case, all are compressed as fixed point values, as bytes, words, or longs. Unlike polygon positions, the x and y values do not have separate compression bits, nor are the positions stored in the relative manner of polygons or paths.The advances in the glyph shape are read after the positions, if the
gxOmitGlyphAdvance
bits are notgxOmitCompression
constant. The character count determines the number of bytes read, as is the case with the control bits in a path shape.If the
gxOmitGlyphTangent
bits in the second omit byte are not equal to thegxOmitCompression
constant, thetangents
parameter follows. The tangent values are stored and compressed identically to the positions. If the number of runs (runNumber
) is greater than zero, then 1 bit in the second omit byte interprets the runs as shorts or shorts compressed to bytes (like the text character compression). IfrunNumber
is greater than 0, then the style array is compressed into an array of bytes, words, or longs. The values are references to previous styles in the stream: a value of 1 references the 1st style in the stream, and so on.The
GXNewGlyphs
function is described in the chapter "Glyph Shapes" in Inside Macintosh: QuickDraw GX Typography.Layout Shape Data
The data type opcode with a value 11 is thegxGlyphType
constant. The data correspond to the parameters in theGXNew
Layout function.Layouts are compressed in a way that is similar to glyphs. Like all types that are greater than or equal to
bitmap
type, all fields default to zero and omit compression is allowed. If the length is greater than 0, the data is read as shorts compressed as bytes or as an uncompressed stream (like text and glyphs). If the style run number is greater than 0, the style run array and style array are present identically to the glyph format. If theomitLayoutHasBaseline
bit is set in omit byte 3, uncompressed data is read the size of thegxLineBaselineRecord
. If the level run number is greater than zero, the 4th omit byte (read regardless) specifies the compression of thelevelRunLength
and level arrays as an optionally compressed array of shorts.The data sequence is omit byte 1,
length
,x
(position),y
(position), data,
omit byte 2,width
,flush
,set
,just
,options
, omit byte 3,style
, run number, level run number,hasBaseline
, style runs, styles, omit byte 4, level runs, levels.Omit byte 1 is interpreted by the
gxOmitLayoutMask1
andgxOmitLayoutShift1
enumerations. Omit byte 2 is interpreted by thegxOmitLayoutMask2
andgxOmitLayoutShift2
enumerations. Omit byte 3 is interpreted by thegxOmitLayoutMask3
andgxOmitLayoutShift3
enumerations. Omit byte 4 is interpreted by thegxOmitLayoutMask4
andgxOmitLayoutShift4
enumerations.The
GXNewLayout
function is described in the chapter "Layout Shapes" in Inside Macintosh: QuickDraw GX Typography.Full Shape Data
The data type opcode with a value 12 is thegxFullType
constant. Full shapes store no information in their geometries. For the current shape object, thegxFullType
constant is a parameter in theGXNewShape
function. No data follows.The
gxFullType
constant is described in the chapter "Geometric Shapes" in Inside Macintosh: QuickDraw GX Graphics.Picture Shape Data
The data type opcode with a value 13 is thegxPictureType
constant. The data corresponds to the parameters in theGXNewPicture
function. The data sequence is omit byte 1, the number of items (compressed as long as specified by the data type opcode), followed by an array of shapes and optional arrays of styles, inks, and transforms. The shape array must exist and may not contain nil (zero) references. The styles, inks and transform array references may be omitted entirely.The
gxPicture
structure is described in the chapter "Picture Shapes" in Inside Macintosh: QuickDraw GX Graphics.Modified Shape Object Data
Once a shape object is defined, it can be modified. Modified shape data follow agxSetDataOpcode
operation opcode and a data type opcode containing one of the constants from thegxShapeDataOpcode
enumeration. Table 7-4 summarizes the values of the constants for all of the modified shape objects.Attributes Data
An attribute is added to the current shape object if the data type opcode has value 0. This is thegxShapeAttributesOpcode
constant.The data for the fields of the
gxShapeAttributes
structure follow and are compressed as long. That data may be 1, 2, or 4 bytes depending on the compression bits.The
gxShapeAttributes
enumeration is described in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.Tag Data
A tag is added to the current shape if the data type opcode has value 1. This is thegxShapeTagOpcode
constant. The data for the parameters of theGXSetShapeTags
function follows.The size of the opcode specifies the number of tags; the compression specifies whether the data is in bytes, words, or longs. For instance, if the size is 4 and the compression is
gxShortCompression
(2 bytes), then the stream contains 4/2 == 2 tags. The equivalent operation would beGXSetShapeTags
(shape, nil, 1, 0, 2, tag array).The
GXSetShapeTags
function is described in the chapter "Shape Objects" of Inside Macintosh: QuickDraw GX Objects.Fill Data
A shape fill, compressed as long, is added to the current shape if the data type opcode has value 2. This is thegxShapeFillOpcode
. A constant from thegxShapeFill
enumeration follows.The
gxShapeFills
enumeration is described in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.New Style Object Data
Data for a new style object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 28. This is thegxStyleTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.This opcode creates a new style object with all of the properties of the previous style object in the data stream. If the current style object is the first style object in the stream, then it is created with default properties. No data follows for the new style object.
The style object is described in the chapter "Style Objects" in Inside Macintosh: QuickDraw GX Objects.
Modified Style Object Data
Once a style object is defined, it can be modified by the addition of style data. Modified style data follows agxSetDataOpcode
operation opcode and a data type opcode containing one of the constants from thegxStyleDataOpcode
enumeration. Table 7-5 summarizes the values of the constants for all of the modified style objects. For all style data, the opcodes described in the following subsections change the default style.Attributes Data
An attribute is added to the current style object if the data type opcode has value 0. This is thegxStyleAttributesOpcode
constant.The data, compressed as long, for the fields of the
gxStyleAttribute
structure follow and may be byte, short, or long.The
gxStyleAttribute
s enumeration is described in the chapter "Geometric Styles" in Inside Macintosh: QuickDraw GX Graphics.Tag Data
A tag is added to the current style if the data type opcode has value 1. This is thegxStyleTagOpcode
constant. The data for the parameters of theGXSetStyleTags
function follows.The size of the opcode specifies the number of tags; the compression specifies whether the data is in bytes, words, or longs. For instance, if the size is 4 and the compression is
gxShortCompression
(2 bytes), then the stream contains 4/2 == 2 tags. The equivalent operation would beGXSetShapeTags
(shape, nil, 1, 0, 2, tag array);The
GXSetStyleTags
function is described in the chapter "Style Objects" in Inside Macintosh: QuickDraw GX Objects.Curve Error Data
A curve error, compressed as fixed-point, is added to the current style if the data type opcode has value 2. This is thegxStyleCurveErrorOpcode
constant. The data for theerror
(Fixed
) parameter of theGXSetStyleCurveError
function follows.For fixed point compression
gxNoCompression
means 1long
for each fixed number;gxWordCompression
means 1short
for each fixed number treated as an integer
(17 = 17.0);gxByteCompression
means 1 byte per fixed number. Thus a byte compressed value can represent an integer fixed point number from -128.0 to 127.0; a word compression value can represent any integer fixed-point number.The
GXSetStyleCurveError
function is described in the chapter "Geometric Styles" in Inside Macintosh: QuickDraw GX Graphics.Pen Data
A pen, compressed as fixed point, is added to the current style object if the data type opcode has value 3. This is thegxStylePenOpcode
constant. The data for thepen
(Fixed
) parameter of theGXSetStylePen
function follows.For fixed-point compression
gxNoCompression
means 1long
for each fixed number;gxWordCompression
means 1short
for each fixed number treated as an integer
(17 = 17.0);gxByteCompression
means 1 byte per fixed number. Thus a byte compressed value can represent an integer fixed point number from -128.0 to 127.0; a word compression value can represent any integer fixed-point number.The
GXSetStylePen
function is described in the chapter "Geometric Styles" in Inside Macintosh: QuickDraw GX Objects.Join Data
A join is added to the current style object if the data type opcode has value 4. This is thegxStyleJoinOpcode
. The data for the fields of thegxJoinRecord
structure follows. ThegxJoinRecord
structure includes thegxShape
andgxJoinAttribute
structures.The data sequence is omit byte,
attributes
(modifier flags) compressed as long,join
(corner shape) compressed as long (reference),miter
(size limit) compressed as fixed point.The omit byte is interpreted by the
gxOmitJoinMask
andgxOmitJoinShift
enumerations.The
gxJoinAttribute
structure is described in the chapter "Geometric Styles" in Inside Macintosh: QuickDraw GX Graphics.Dash Data
A dash is added to the current style object if the data type opcode has value 5. This is thegxStyleDashOpcode
constant. The data for the fields of thegxDashRecord
structure follows. ThegxShape
andgxDashAttribute
enumerations are included in thegxDashRecord
structure.The data sequence is omit byte 1,
attributes
(modifier flags) compressed as long,dash
(shape used for dash) compressed as long (reference),advance
(distance between dashes) compressed as long,phase
(start offset) compressed as fract, omit byte 2, andscale
(height of dash) compressed as fixed.
In fract compression a long means a full fract; a word means that 16 bits are read followed by 16 bits of zeros; a byte means that 8 bits are read followed by 24 bits of zeros. Thus numbers like 1.0, -1.0, or fract 0.5 fit into a compressed byte.
Omit byte 1 is interpreted by the
gxOmitDashMask1
andgxOmitDashShift1
enumerations. Omit byte 2 is interpreted by thegxOmitDashMask2
andgxOmitDashShift2
enumerations.The
gxDashRecord
structure is described in the chapter "Geometric Styles" of Inside Macintosh: QuickDraw GX Graphics.Caps Data
A cap is added to the current style object if the data type opcode has value 6. This is thegxStyleCapsOpcode
. The data for the fields of thegxCapRecord
structure follows. ThegxShape
andgxCapAttribute
enumerations are included in thegxCapRecord
structure.The data sequence is omit byte,
attributes
(modifier flags) compressed as long,startCap
(shape used at start of contours) compressed as long (reference),endCap
(shape used at end of contours) compressed as long (reference).
The omit byte is interpreted by the
gxOmitCapMask
andgxOmitCapShift
enumerations.The
gxCapRecord
structure is described in the chapter "Geometric Styles" in Inside Macintosh: QuickDraw GX Graphics.Pattern Data
A pattern is added to the current style object if the data type opcode has value 7. This is thegxStylePatternOpcode
constant. The data for the fields of thegxPatternRecord
structure follows. ThegxShape
,gxPatternAttribute
, andgxPoint
enumerations are included in thegxPatternRecord
structure.The data sequence is omit byte 1,
attributes
(modifier flags) compressed as long,pattern
(shape to use as pattern) compressed as long (reference),x
(x-coordinate of vectoru
for pattern grid) compressed as fixed,y
(y-coordinate of vectoru
for pattern grid) compressed as fixed, omit byte 2,x
(x coordinate of vectorv
for pattern grid) compressed as fixed, andy
(y-coordinate of vectorv
for pattern grid) compressed as fixed. Note that for all of these, omit (zero) values are permitted.Omit byte 1 is interpreted by the
gxOmitPatternMask1
andgxOmitPatternShift1
enumerations. Omit byte 2 is interpreted by thegxOmitPatternMask2
andgxOmitPatternShift2
enumerations.The
gxPatternRecord
structure is described in the chapter "Geometric Styles" in Inside Macintosh: QuickDraw GX Graphics.Text Attributes Data
A text attribute compressed as long is added to the current style object if the data type opcode has value 8. This is thegxStyleTextAttributesOpcode
constant. The data may be byte, word, or long.The
gxTextAttribute
enumeration is described in the chapter "Typographic Styles" in Inside Macintosh: QuickDraw GX Typography.Text Size Data
The text size, compressed as long, for the current style object is specified if the data type opcode has value 9. This is thegxStyleTextSizeOpcode
constant. The data for thesize
(fixed point size of text) parameter of theGXSetStyleTextSize
function follows.The
GXSetStyleTextSize
function is described in the chapter "Typographic Styles" in Inside Macintosh: QuickDraw GX Typography.Font Data
A font is added to the current style object if the data type opcode has value 10. This is thegxStyleFontOpcode
constant. The attribute data for theGXSetStyleFont
function follows. It is compressed as long (reference ); the reference is to a font name defined earlier in the streamThe
GXSetStyleFont
function is described in the chapter "Typographic Styles" in Inside Macintosh: QuickDraw GX Typography.Text Face Data
A text face is added to the current style object if the data type opcode has value 11. This is thegxStyleTextFaceOpcode
constant. The data for the fields of thegxTextFace
structure follows.The data sequence is omit byte,
faceLayers
compressed as long, mapping size andadvanceMapping.
The
advanceMapping
in text face and transform mapping is reordered so that common mappings can be stored in fewer bytes. The omit byte and number of layers is followed by an optional byte (whose compression is described byomitFaceMapping).
The value of the byte may be one of the following:
Byte Value 2 Mapping contains identity plus elements h and k. 4 Same as byte 2, plus elements a and d. 6 Same as byte 4, plus elements b and c. 9 Same as byte 6 plus elements u, v, and w. The meaning of the elements mentioned in the previous table are shown in Figure 7-10.
Figure 7-10 Mapping matrix elements
The byte value is multiplied by the compression level to specify the length of the mapping data that follows. Byte compression multiplies by 1; word compression multiplies by 2; long compression multiplies by 4. The values in the left and middle columns are compressed as fixed values. The values in the right column are compressed as fract values. All elements whether the stream contains 2, 4, 6, or 9 numbers, have the same level of compression.
If the
faceLayers
value is greater than 0, then following the mapping data is an omit byte as described bygxOmitFaceLayer
Mask 1. The omit byte is followed by theoutlineFill
compressed as a long, the flags comrpessed as a long, theoutlineStyle
and reference compressed as a long, and theoutlineTransform
, also comrpessed as a long. The second omit byte describes the bold x and bold y, compressed as fixed values. This sequence is repeated for the second and all remaining layers.The omit byte is interpreted by the
gxOmitFaceMask
andgxOmitFaceShift
enumerations.The
gxTextFace
structure is described in the chapter "Typographic Styles" in Inside Macintosh: QuickDraw GX Typography.Platform Data
The platform, script, and language is defined for the current object if the data type opcode has value 12. This is thegxStylePlatformOpcode
constant. Data from thegxFontPlatform
,gxFontScript
, andgxFontLanguage
enumerations follow.The platform, script, and language are combined into a long and then that value is compressed as a long that is equal to
(platform << 16) | (script << 8) | languageThegxFontPlatform
,gxFontScript
, andgxFontLanguage
enumerations are described in the chapter "Font Objects" in Inside Macintosh: QuickDraw GX Typography.Font Variations Data
Font variations are added to the current style object if the data type opcode has value 13. The data is uncompressed. This is thegxStyleFontVariationsOpcode
constant. The data for the fields of thegxFontVariation
structure follows. ThegxFontVariationTag
structure is included in thegxFontVariations
structure.The data sequence is an array
[name
(variation tag),value
(Fixed
)].
The opcode size specifies the number of variations in the stream.The
gxFontVariation
structure is described in the chapter "Fonts" in Inside Macintosh: QuickDraw GX Typography.Run Controls Data
Run controls are added to the current style object if the data type opcode has value 14. The data is uncompressed. This is thegxStyleRunControlsOpcode
constant. The data for the fields of thegxRunControls
structure follows. The opcode size specifies the size in bytes of the run control stream.The
gxRunControls
structure is described in the chapter "Layout Line Controls" in Inside Macintosh: QuickDraw GX Typography.Run Priority Justification Override Data
A run priority justification override is added to the current style object if
the data type opcode has value 15. The data is uncompressed. This is thegxStyleRunPriorityJustOverrideOpcode
constant. The data for the fields
of thegxPriorityJustificationOverride
structure follows. The opcode size specifies the size in bytes of the run control stream.The data sequence is an array of delta. The opcode specifies the byte size.
The
gxPriorityJustificationOverride
structure is described in the chapter "Layout Line Controls" in Inside Macintosh: QuickDraw GX Typography.Run Glyph Justification Overrides Data
A run glyph justification override is added to the current style object if the
data type opcode has value 16. The data is uncompressed. This is thegxStyleRunGlyphJustOverrideOpcode
constant. The data for the fields
of thegxGlyphJustificationOverride
structure follows. ThegxGlyphJustificationOverride
structure includes thegxGlyphcode
andgxWidthDeltaRecord
enumerations. The opcode specifies the byte size.The data sequence is
count
,glyphJustificationOverrides.
The
gxGlyphJustificationOverride
structure is described in the chapter "Layout Line Controls" in Inside Macintosh: QuickDraw GX Typography.Run Glyph Substitutions Data
A run glyph substitution is added to the current style object if the data type
opcode has value 17. The data is uncompressed. This is thegxStyleRunGlyphSubstitutionsOpcode
constant. The data for the fields
of thegxGlyphSubstitution
structure follows.The data sequence is
count
,glyphsubstitutions[].
The
GXSetStyleRunGlyphSubstitutions
structure is described in the chapter "Layout Line Controls" in Inside Macintosh: QuickDraw GX Typography.Run Features Data
A run feature is added to the current style object if the data type opcode has value 18. The data is uncompressed. This is thegxStyleRunFeaturesOpcode
constant. The data for the fields of thegxRunFeature
structure follows.The data sequence is
count
,runFeatures[].
The
gxRunFeature
structure is described in the chapter "Layout Line Controls" in Inside Macintosh: QuickDraw GX Typography.Run Kerning Adjustments Data
Run kerning adjustment is added to the current style object if the data type opcode has value 19. The data is uncompressed. This is thegxStyleRunKerningAdjustmentsOpcode
constant. The data for the fields of thegxKerningAdjustment
structure follows.The data sequence is
count
,kerningAdjustments[].
The
gxKerningAdjustment
structure is described in the chapter "Layout Line Controls" in Inside Macintosh: QuickDraw GX Typography.Style Justification Data
Style justification is added to the current style object if the data type opcode has
value 20. The data is compressed as fract. This is thegxStyleJustificationOpcode
constant. The data for the justify parameter of theGXSetStyleJustification
function follows.In fract compression a long means a full fract; a word means that 16 bits are read followed by 16 bits of zeros; a byte means that 8 bits are read followed by 24 bits of zeros. Thus numbers like 1.0, -1.0, or fract 0.5 fit into a compressed byte.
The
GXSetStyleJustification
function is described in the chapter "Typographic Styles" in Inside Macintosh: QuickDraw GX Typography.New Ink Object Data
Data for a new ink object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 29. This is thegxInkTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.This opcode creates a new ink object with all of the properties of the previous ink object in the data stream. If the current ink object is the first ink object in the stream, then it is created with default properties. No data follows for the new ink object.
The ink object is described in the chapter "Ink Objects" in Inside Macintosh: QuickDraw GX Objects.
Modified Ink Object Data
Once an ink object is defined, it can be modified by the addition of ink data. Modified style data follows agxSetDataOpcode
operation opcode and a data type opcode containing one of the constants from thegxInkDataOpcode
enumeration. Table 7-6 summarizes the values of the constants for all of the modified ink objects.Attributes Data
An attribute, compressed as long, is added to the current ink object if the data type opcode has value 0. This is thegxInkAttributes
Opcode constant.The data for the fields of the
gxInkAttributes
structure follow. The next two bytes contain the ink attribute flags.The
gxInkAttributes
enumeration is described in the chapter "Ink Objects" in Inside Macintosh: QuickDraw GX Objects.Tag Data
A tag is added to the current ink object if the data type opcode has value 1. This is thegxInkTagOpcode
constant. The data for the parameters of theGXSetInkTags
function follows.The size of the opcode specifies the number of tags; the compression specifies whether the data is in bytes, words, or longs. For instance, if the size is 4 and the compression is
gxShortCompression
(2 bytes), then the stream contains 4/2 == 2 tags. The equivalent operation would beGXSetShapeTags
(shape, nil, 1, 0, 2, tag array).The sequence is
tagType
,index
,oldCount
,newCount
,items
.The
GXSetInkTags
function is described in the chapter "Ink Objects" in Inside Macintosh: QuickDraw GX Objects.Color Data
A color is added to the current ink object if the data type opcode has value 2. This is thegxInkColorOpcode
constant. The data for the fields of thegxInkAttribute
s structure follow. The data for the fields of thegxColor
structure follows.The data sequence is omit byte,
space
(long),
profile
(long). The value of the omit byte may be omit compression.The omit byte is interpreted by the
gxOmitColorsMask
andgxOmitColorsShift
enumerations.If space is indexed space,
gxOmitColoursIndex
is used to determine index compression (compressed as long), which is read first, followed by color set (compressed as long), with the compression determined bygxOmitColorsIndexSet
.If space is not indexed space, the color space determines the number of elements read from the stream as shown in Table 7-12.
Table 7-12 Color space and words read 16-bit 1 32-bit 2 gray, index 1 gray alpha 2 RGB, HSV, HLS, YXY, XYZ, LUV, LAB, YIQ 3 RGBA, CYMK 4 The bits in the omit byte determine whether a word is read from the stream for each word in the component or whether the byte is repeated twice for each word. For example, if the byte contains 0x3A, the word contains 0X3A3A. The
gxOmitColorsComponentsMask
sets 1 bit for up to 4 components.The
gxColor
enumeration is described in the chapter "Ink Objects" in Inside Macintosh: QuickDraw GX Objects.Transfer Mode Data
A transfer mode is added to the current ink object if the data type opcode has value 3. This is thegxInkTransferModeOpcode
constant. The data for the fields of thegxTransferMode
structure follow.The data sequence is omit byte 1,
space
, compressed as long,set
, compresssed as long,profile
, compressed as long; omits are allowed. Omit byte 2 follows and thensourceMatrix
,deviceMatrix,
resultMatrix
,flags
, andcomponent
; omits are allowed.The
sourceMatrix
,deviceMatrix,
andresultMatrix
are compressed as arrays of Fixed values. The color space determines the number of transfer components that follow, as shown in Table 7-12.Each transfer component is preceded by an omit byte (
gxomitTransferComponentMask1
) that describes the first 4 fields of the structure. Omit byte one is followed bygxOmitTransferComponentModeMask,
compressed as byte,gxOmitTransferComponentFlagsMask
, compressed as byte,gxOmitTransferComponentSourceMinimumShift
, compressed as color,gxOmitTransferComponentSourceMaximumMask
, compressed as color, andgxOmitTransferComponentDeviceMinimumMask
, compressed as color. Omit byte 2 follows which describesgxOmitTransferComponentDeviceMaximumMask, gxOmitTransferComponentClampMinimumMask,gxOmitTransferComponentClampMaximumMask,
andgxOmitTransferComponentOperandMask;
all these are compressed as color. The color compression specifies that the field may be omitted (inherits value from default), or is represented by a repeated byte (for example,0X7A ==0X7A7A
), or is represented as a word.Note that the mode and flags in the first omit byte have a single bit
The
gxTransferMode
structure is described in the chapter "Ink Objects" in Inside Macintosh: QuickDraw GX Objects.New Object Transform Data
Data for a new transform object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 0x2A. This is thegxTransformTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.This opcode creates a new transform object with all of the properties of the previous transform object in the data stream. If the current transform object is the first transform object in the stream, then it is created with default properties. No data follows for the new transform object.
The transform object is described in the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects. For additional information about transform mapping, see "Mapping Data" on page 7-46.
Modified Transform Object Data
Once a transform object is defined in the data stream, it can then be modified. Modified transform object data follows agxSetDataOpcode
operation opcode and a data type opcode containing one of the constants from thegxTransformDataOpcode
enumeration. Table 7-9 summarizes the values of the constants for all of the modified transform objects.Reserved Opcode for Modified Transform Data
The data type opcode with value 0 is reserved for future expansion.Tag Data
A tag is added to the current transform object if the data type opcode has value 1. This is thegxTransformTagOpcode
constant. The data for the parameters of theGXSetTransformTags
function follows.The data stream sequence is
tagType
,index
,oldCount
,newCount
,items[]
.The
GXSetTransformTags
function is described in the chapter "Transform Objects" of Inside Macintosh: QuickDraw GX Objects.Clip Data
A clip, compressed as long (reference) is added to the current transform object if the data type opcode has value 2. This is thegxTransformClipOpcode
constant. The data for theclip
parameter of theGXSetTransformClip
function follows.The
GXSetTransformClip
function is described in the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.Mapping Data
A mapping is added to the current transform object if the data type opcode has value 3. This is thegxTransformMappingOpcode
constant. The data for themap
parameter of theGXSetTransformMapping
function follows.A transform mapping is initiated by the sequential appearance of the
gxSetDataOpcode
, andgxTransformDataOpcode
constants in the data stream.The bytes following the appearance in the data stream of the
gxTransformMapping
constant from thegxTransformDataOpcode
enumeration have a special format. The interpretation of the bytes that follow require the determination of a size constant. The size to be used for a specific transform depends upon the compression and the size of the transform data specified by the byte containing the previousgxGraphicsOperationOpcode
constant. The size is the number of bytes, words, or longs, depending upon the type of compression.If the size obtained from the
gxGraphicsOperationOpcode
byte indicated that there are 24 bytes of transform data and the byte containing thegxTransformMappingOpcode
constant indicated that there was no compression, then the size of each transform attribute would be 4 bytes (longs) and the size constant for our transformation bytes format would be size 24/4 = 6. The interpretation of the mapping that occurs for each mapping size is summarized in the section "Text Face Data" on page 7-39.The
GXSetTransformMapping
function is described in the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.Part Mask Data
A part mask, compressed as a long, is added to the current transform object if the data type opcode has value 4. This is thegxTransformPartMaskOpcode
constant. The data for themask
parameter of theGXSetTransformHitTest
function follows.The
GXSetTransformHitTest
function is described in the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.Tolerance Data
Tolerance, compressed as long, is added to the current transform object if the data type opcode has value 5. This is thegxTransformToleranceOpcode
constant. The data for the tolerance parameter of theGXSetTransformHitTest
function follows.The
GXSetTransformHitTest
function is described in the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.New Color Profile Object Data
Data for a new color profile object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 0x2B. This is thegxColorProfileTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.This opcode creates a new color profile object with all of the properties of the previous color profile object in the data stream. If the current color profile object is the first color profile object in the stream, then it is created with default properties. The data that follows is uncompressed; the opcode size specifies the size of the stream.
The color profile object is described in the chapter "Color Objects" in Inside Macintosh: QuickDraw GX Objects.
Modified Color Profile Object Data
Once a color profile object is defined in the data stream, it can be modified. Modified color set object data follows agxSetDataOpcode
operation opcode and a data type opcode containing one of the constants from thegxColorProfileDataOpcode
enumeration. Table 7-8 summarizes the values of the constants for all of the modified color profile objects.Reserved Opcode for Modified Color Profile Data
The data type opcode with value 0 is reserved for future expansion.Color Profile Tag Data
A tag for the current color profile object is added if the data type opcode has value 1. This is thegxColorProfileTagOpcode
constant. The data for the parameters of theGXSetColorProfileTags
function follows.The size of the opcode specifies the number of tags; the compression specifies whether the data is in bytes, words, or longs. For instance, if the size is 4 and the compression is
gxShortCompression
(2 bytes), then the stream contains 4/2 == 2 tags. The equivalent operation would beGXSetShapeTags
(shape, nil, 1, 0, 2, tag array).The
GXSetColorProfileTags
function is described in the chapter "Color Objects" in Inside Macintosh: QuickDraw GX Objects.New Color Set Object Data
Data for a new color set object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 0x2C. This is thegxColorSetTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.This opcode creates a new color set object with all of the properties of the previous color set object in the data stream. If the current color set object is the first color set object in the stream, then it is created with default properties.
The color set object is described in the chapter "Color Objects" in Inside Macintosh: QuickDraw GX Objects.
Modified Color Set Object Data
Once a color set object is defined in the data stream, it can be modified. Modified color set object data follows an operation opcodegxSetDataOpcode
constant from thegxGraphicsOperationOpcode
enumeration and a data type opcode containing one of the constants from thegxColorSetDataOpcode
enumeration. Table 7-7 summarizes the values of the constants for modified color set objects.The first byte or two is space, space and specifies the number of components. The remaining stream is colors. The compression for the color set can be byte or word. To determine the number of colors in the stream use the following formula:
(size - colorSpaceByte * compression) / componentsInColorSpace * compressionFor instance, if the space isgxRGBSpace
, the compression isgxByteCompression
, and the size is 7, the number of colors would be (7 - 1 * 1)/3*1, which evaluates to 2. If the stream continued with 0, 0, 0, 0XFF, 0XFF, 0XFF, then the color set would contain black (0X0000, 0X0000,0X0000) and white 0XFFFF, 0XFFFF, 0XFFFF). As the example shows, the color set entries are compressed as colors. See section "Transfer Mode Data" on page 7-44 for information on color compression.Reserved Opcode for Modified Color Set Data
The data type opcode with value 0 is reserved for future expansion.Color Set Tag Data
A tag is added to the current color set object if the data type opcode has value 1. This is thegxColorSetTagOpcode
constant. The data for the parameters of theGXSetColorSetTags
function follows.The size of the opcode specifies the number of tags; the compression specifies whether the data is in bytes, words, or longs. For instance, if the size is 4 and the compression is
gxShortCompression
(2 bytes), then the stream contains 4/2 == 2 tags. The equivalent operation would beGXSetShapeTags
(shape, nil, 1, 0, 2, tag array).The
GXSetColorSetTags
function is described in the chapter "Color Objects" of Inside Macintosh: QuickDraw GX Objects.New Tag Object Data
Data for a new tag object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 0x2D. This is thegxTagTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.This opcode creates a new tag object with all of the properties of the previous tag object in the data stream. If the current tag object is the first tag object in the stream, then it is created with default properties. For tag data is uncompressed. The first parameter is tag type (long), followed by data computed from opcode length - sizeof (long).
The
GXNewtag
function is described in the chapter "Tag Objects" in Inside Macintosh: QuickDraw GX Objects.New Bit Image Object Data
Data for a bit image object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 0x2E. This is thegxBitImageTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.The data sequence is omit byte (gxOmitBitImage), followed by the fields described by omit byte:
rowBytes
, compressed as long,height
, compressed as long, anddata
compressed in the custom format described ahead. The bit image is compressed only if it makes the data stream smaller.The
GXNewBitmap
function is described in the chapter "Bitmap Shapes" in Inside Macintosh: QuickDraw GX Graphics.The bit image compression byte appears only in data streams containing a bitmap shape. This byte describes how each section of a bit image is compressed. The bit image compression byte follows the bytes containing the bit image attributes described by the
gxOmitBitImageMask
constant.Bit images are described in the "Bitmap Shapes" chapter of Inside Macintosh: QuickDraw GX Graphics.
The bit image compression byte has the format xx yyyyyy.
The xx bits describe which of the bit image compression type opcodes is used for the next part of the bit image. The bit image compression opcode values are either 0, 1, 2,
or 3.The yyyyyy bits describe the number of times, z, that the action defined by the bit image compression opcode is replicated. The number of replications, z, can vary range from 0 to 63. Table 7-13 summarizes the four compression opcodes.
The analysis of a bit image compression byte in a stream format is described in the section "Analyzing a Flattened Bitmap Shape" beginning on page 7-81.
New Font Name Data
Data for a font name follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 0x2F. This is thegxFontNameTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration.The fields in the
gxFlatFontName
structure follow. This structure includes thegxFontName
,gxFontPlatform
,gxFontScr
ipt,gxFontLanguage
, andgxFontName
structures, the byte length of the name and the name itself.The stream exactly mirrors the sequence and size of the fields in the
gxFlatFontName
structure.New Trailer Object Data
Data for a trailer object follows agxNewObjectOpcode
operation opcode and a data type opcode with a value 0x3F. This is thegxTrailerTypeOpcode
constant from thegxGraphicsNewOpcode
enumeration. This is the termination (last) object in the stream. No data follows.The last two bytes of a stream are always 0x01 and 0x3F. The next to the last byte in a data stream contains a
gxNewObjectOpcode
constant with a record size of 1 byte. The last byte in a data stream contains agxTrailerTypeOpcode
constant with agxTwoBitCompression
value of 0, indicating thegxNoCompression
constant.