Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 7 - QuickDraw GX Stream Format / About QuickDraw GX Stream Format


Data Type Opcode Byte

A data type opcode byte always follows the record size. This byte contains both a compression type opcode and a data type opcode. Figure 7-5 shows the format of the data type opcode byte.

Figure 7-5 The format of the data type opcode byte

Compression Type Opcode

Bits 6 and 7 of the data type opcode byte contain the compression type opcode. This opcode specifies the type of compression used for the data that follows. The 2-bit compression opcode constants from the gxTwoBitCompressionValues enumeration specifies whether the next data are longs, words, bytes, or that no data follows. Table 7-2 lists the compression type opcode values.
Table 7-2 Compression values
ValueDescription
0x00No compression has been applied. The data that follows are long words.
0x40Word compression has been applied. The data that follows are words.
0x80Byte compression has been applied. The data that follows are bytes.
0xC0Omit compression. No data follows.

The gxTwoBitCompressionValues enumeration is also used to interpret the compression in the omit byte. For additional information about the interpretation of omit bytes, see the section "Omit Byte Masks and Omit Byte Shifts" beginning on page 7-22.

The relationship of the operation opcode, record size, compression type opcode, data type opcode, and optional data for a header or object is shown in Figure 7-6.

Figure 7-6 Relationship of stream format components

The appearance or absence of data after the data type opcode byte depends upon the values that appear in the operation opcode byte and the data type opcode byte.

If the gxNewObjectOpcode constant appears in the operation opcode byte, a new object follows. The new object copies the default values into the newly created object. The default values may have been changed by the last object created of this type. If the last object and the current object are equal, then the new object requires no additional data for its definition. In this case, the stream following the new opcode byte contains only the compression and data type opcode byte with compression set to no compression.

If the gxSetDataOpcode constant appears in the operation opcode byte, the record length is greater than 1 byte and object-specific data follows.

The gxSetDefaultOpcode constant appears only after the current object type has been defined. If the gxSetDefaultOpcode constant appears in the operation opcode byte, the data type opcode contains the gxStyleTypeOpcode, gxInkTypeOpcode, or gxTransformTypeOpcode constant. The compression type opcode defines the compression of the data of the object reference number that follows. This previously defined object becomes the default styles, ink, or transform for the shapes created subsequently.

The sequence of the object-specific data that follows the data type opcode byte is described in the next section. Subsections are provided for the header, shape data, style, ink, transform, color profile, color set, tag, bit image, font name, and trailer objects.

Data Type Opcode

Bits 0 through 5 of the data type opcode byte contain the data type opcode. This opcode specifies the type of data that follows. The type of data that follows depends upon the current value of the operation opcode. If the operation opcode is gxNewObjectOpcode, the data type opcode describes a new object. These data type opcodes are described in the next section. If the operation opcode is gxSetDataOpcode, the data type opcode, specifies how the current object will be modified. These data type opcodes are described in the sections "Data Type Opcodes to Modify a Shape Object" beginning on page 7-17, "Data Type Opcodes to Modify a Color Set Object" beginning on page 7-20, "Data Type Opcodes to Modify a Color Profile Object" beginning on page 7-21, and "Data Type Opcodes to Modify a Transform Object" beginning on page 7-21.

Data Type Opcodes for a New Object

When the current operation opcode is the gxNewObjectOpcode constant, bits 0 through 5 of the data type opcode byte specify the data type opcode for the new object. Data type opcode constants for header, style, ink, transform, color profile, color set, tag type, bit image, font name, and trailer are defined in the gxGraphicsNewOpcode enumeration. Data type opcode constants for empty, point, line, curve, rectangle, polygon, path, bitmap, text, glyph, layout, full, and picture are defined in the gxShapeTypes enumeration. Table 7-3 summarizes all of the data type opcodes for a new object.
Table 7-3 Data type opcodes for a new object
ConstantValueDescription
gxHeaderTypeOpcode0x00The data that follows is the header.
gxEmptyType0x01The data that follows describes an empty shape object. See the GXNewShape(gxEmptyType) function.
gxPointType0x02The data that follows describes a point object. See the GXNewPoint function.
gxLineType0x03The data that follows describes a line object. See the GXNewLine function.
gxCurveType0x04The data that follows describes a curve object. See the GXNewCurve function.
 
gxRectangleType0x05The data that follows describes a rectangle object. See the GXNewRectangle function.
gxPolygonType0x06The data that follows describes a polygon object. See the GXNewPolygons function.
gxPathType0x07The data that follows describes a path object. See the GXNewPaths function.
gxBitmapType0x08The data that follows describes a bitmap object. See the GXNewBitmap function.
gxTextType0x09The data that follows describes a text object. See the GXNewText function.
gxGlyphType0x10The data that follows describes a glyph object. See the GXNewGlyph function.
gxLayoutType0x11The data that follows describes a layout object. See the GXNewLayout function.
gxFullType0x12The data that follows describes a full shape object. See the GXNewShape(gxFullType) function.
gxPictureType0x13The data that follows describes a picture object. See the GXNewPicture function.
gxStyleTypeOpcode0x28The data that follows describes a style object. See the GXNewStyle function.
gxInkTypeOpcode0x29The data that follows describes an ink object. See the GXNewInk function.
gxTransformTypeOpcode0x2AThe data that follows describes a transform object. See the GXNewTransform function.
gxColorProfileOpcode0x2BThe data that follows describes a color profile object. See the GXNewColorProfile function.
gxColorSetOpcode0x2CThe data that follows describes a color set object. See the GXNewColorSet function.
gxTagTypeOpcode0x2DThe data that follows describes a tag object. See the GXNewTag function.
gxBitImageOpcode0x2EThe data that follows describes a bit image, the bits pointed to by a bitmap.
gxFontNameTypeOpcode0x2FThe data that follows describes a font name. See the GXNewFont function.
gxTrailerTypeOpcode0x3FThis opcode indicates the end of a data stream.

The omitted numbers are reserved by Apple Computer, Inc. for future use. You should extend the stream format by using tag objects to encapsulate custom data. Tags are described in the "Tag Objects" in Inside Macintosh:QuickDraw GX Objects.

Data Type Opcodes to Modify a Shape Object

When the current object is a shape object and the current operation opcode is the gxSetDataOpcode constant, bits 0 through 5 of the data type opcode byte specify the data type opcode for the shape object to be modified. Data type opcode constants for attributes, tag, ink, and fill are defined in the gxShapeDataOpcode enumeration.
Table 7-4 summarizes all of the data type opcodes used to modify a shape object.
Table 7-4 Data type opcodes to modify a shape object
ConstantValueDescription
gxShapeAttributesOpcode0x00The attributes data that follows is added to the current shape object. See the GXSetShapeAttributes function.
gxTagOpcode0x01The tag data that follows is added to the current shape object. See the GXSetShapeTags function.
gxFillOpcode0x02The fill data that follows is added to the current shape object. See the GXSetShapeFill function.

Data Type Opcodes to Modify a Style Object

When the current object is a style object and the current operation opcode is the gxSetDataOpcode constant, bits 0 through 5 of the data type opcode byte specify the data type opcode for the style object to be modified. Data type opcode constants for attributes, tag, curve error, pen, join, dash, caps, pattern, text attributes, text size, font, text face, platform, font variations, run controls, run priority justification override, run glyph justification overrides, run glyph substitutions, run features, run kerning adjustments, and justification are defined in the gxStyleDataOpcode enumeration. Table 7-5 summarizes all of the data type opcodes used to modify a style object.
Table 7-5 Data type opcodes to modify a style object
ConstantValueDescription
gxStyleAttributesOpcode0x00The attributes data that follows is added to the current shape object. See the GXSetStyleAttributes function.
gxStyleTagOpcode0x01The tag data that follows is added to the current shape object. See the GXSetStyleTags function.
gxStyleCurveErrorOpcode0x02The curve error data that follows is added to the current style object. See the GXSetStyleCurveError function.
gxStylePenOpcode0x03The pen data that follows is added to the current style object. See the GXSetStylePen function.
gxStyleJoinOpcode0x04The join data that follows is added to the current style object. See the GXSetStyleJoin function.
gxStyleDashOpcode0x05The dash data that follows is added to the current style object. See the GXSetStyleDash function.
gxStyleCapsOpcode0x06The caps data that follows is added to the current style object. See the GXSetStyleCaps function.
gxStylePatternOpcode0x07The pattern data that follows is added to the current style object. See the GXSetStylePattern function.
gxStyleTextAttributesOpcode0x08The text attributes data that follows is added to the current style object. See the GXSetStyleTextAttributes function.
gxStyleTextSizeOpcode0x09The text size data that follows is added to the current style object. See the GXSetStyleTextSize function.
gxStyleFontOpcode0x0AThe font data that follows is added to the current style object. See the GXSetStyleFont function.
gxStyleTextFaceOpcode0x0BThe text face data that follows is added to the current style object. See the GXSetStyleFace function.
gxStylePlatformOpcode0x0CThe platform data that follows is added to the current style object. See the GXSetStyleEncoding function.
gxStyleFontVariationsOpcode0x0DThe font variations data that follows is added to the current style object. See the GXSetStyleFontVariations function.
gxStyleRunControlsOpcode0x0EThe run controls data that follows is added to the current style object. See the GXSetStyleRunControls function.
gxStyleRunPriorityJustOverrideOpcode0x1FThe run priority justification override data that follows is added to the current style object. See the GXSetStyleRunPriorityJust
Override
function.
gxStyleRunGlyphJustOverridesOpcode0x10The run glyph justification overrides data that follows is added to the current style object. See the GXStyleRunGlyphJust
Overrides
function.
gxStyleRunGlyphSubstitutionsOpcode0x11The run glyph substitutions data that follows is added to the current style object. See the GXStyleRunGlyphSubstitutions function.
gxStyleRunFeaturesOpcode0x12The run features data that follows is added to the current style object. See the GXStyleRunFeatures function.
gxStyleRunKerningAdjustmentsOpcode0x13The run kerning adjustments data that follows is added to the current style object. See the GXStyleRunKerning
Adjustments
function.
gxStyleJustificationOpcode0x14The justification data that follows is added to the current style object. See the GXStyleJustification function.

Data Type Opcodes to Modify an Ink Object

When the current object is an ink object and the current operation opcode is the gxSetDataOpcode constant, bits 0 through 5 of the data type opcode byte specify the data type opcode for the ink object to be modified. Data type opcode constants for attributes, tag, color, and transfer mode are defined in the gxInkDataOpcode enumeration. Table 7-6 summarizes all of the data type opcodes used to modify an ink object.
Table 7-6 Data type opcodes to modify an ink object
ConstantValueDescription
gxInkAttributesOpcode0x00The attributes data that follows is added to the current ink object. See the GXSetInkAttributes function.
gxInkTagOpcode0x01The tag data that follows is added to the current ink object. See the GXSetInkTags function.
gxInkColorOpcode0x02The ink color data that follows is added to the current ink object. See the GXSetInkColor function.
gxInkTransferModeOpcode0x03The ink transfer mode data that follows is added to the current ink object. See the GXSetInkTransfer function.

Data Type Opcodes to Modify a Color Set Object

When the current object is a color set object and the current operation opcode is the gxSetDataOpcode constant, bits 0 through 5 of the data type opcode byte specify the data type opcode for the color set object to be modified. A data type opcode constant for tag is defined in the gxColorSetDataOpcode enumeration. The constant 0 is reserved for future use. Table 7-7 summarizes all of the data type opcodes used to modify a color set object.
Table 7-7 Data type opcodes to modify a color set object
ConstantValueDescription
gxColorSetReservedOpcode0x00This constant is reserved for future assignment.
gxColorSetTagOpcode0x01The tag data that follows is added to the current color set object. See the GXSetColorSetTags function.

Data Type Opcodes to Modify a Color Profile Object

When the current object is a color profile object and the current operation opcode is the gxSetDataOpcode constant, bits 0 through 5 of the data type opcode byte specify the data type opcode for the color profile object to be modified. A data type opcode constant for tag is defined in the gxProfileDataOpcode enumeration. The constant 0 is reserved for future use. Table 7-8 summarizes the data type opcodes used to modify a color profile object.
Table 7-8 Data type opcodes to modify a color profile object
ConstantValueDescription
gxColorProfileReservedOpcode0x00This constant is reserved for future assignment.
gxColorProfileTagOpcode0x01The tag data that follows is added to the current color profile object. See the GXSetColorProfileTags function.

Data Type Opcodes to Modify a Transform Object

When the current object is a transform object and the current operation opcode is the gxSetDataOpcode constant, bits 0 through 5 of the data type opcode byte specify the data type opcode for the transform object to be modified. A data type opcode constant for tag is defined in the gxTransformDataOpcode enumeration. The constant 0 is reserved for future use. Table 7-9 summarizes the data type opcodes used to modify a transform object.
Table 7-9 Data type opcodes to modify a transform object
ConstantValueDescription
gxTransformReservedOpcode0x00This constant is reserved for future assignment.
gxTransformTagOpcode0x01The tag data that follows is added to the current transform object. See the GXSetTransformTags function.
gxTransformClipOpcode0x02The tag data that follows is added to the current transform object. See the GXSetTransformClip function.
gxTransformMappingOpcode0x03The tag data that follows is added to the current transform object. See the GXSetTransformMapping function.
 
gxTransformPartMaskOpcode0x04The tag data that follows is added to the current transform object. See the description of the gxShapePart mask parameter to the GXSetTransformHitTest function.
gxTransformToleranceOpcode0x05The tag data that follows is added to the current transform object. See the description of the Fixed tolerance parameter to the GXSetTransformHitTest function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996