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: Imaging With QuickDraw /
Appendix A - Picture Opcodes


Picture Opcode Data Types

The picture opcodes use the data types that are summarized in Table A-1.
Table A-1 Data types for picture opcodes (Continued)
Data typeSize
-128..1271 byte (signed)
0..2551 byte
Fixed4 bytes
Integer2 bytes
Long4 bytes
Mode2 bytes
Opcode2 bytes
Pattern8 bytes
Point4 bytes
Poly10+ bytes
Rect8 bytes (top, left, bottom, right: integer)
Rgn10+ bytes
RowBytes2 bytes (always an even quantity)

In addition, some picture opcode types, such as BkPixPat, may use the PixMap, ColorTable, and PixData data types, which makes the length of these opcodes quite variable. The PixMap record and ColorTable record are described in the chapter "Color QuickDraw" in this book. The following pseudocode describes the PixData data type:

PixData: {pseudocode describing the PixData data type}
IF rowBytes < 8 THEN 
   data is unpacked; 
   data size = rowBytes*(bounds.bottom-bounds.top);
IF rowBytes >= 8 THEN 
   data is packed;
   image contains (bounds.bottom-bounds.top) packed scanlines;



   packed scanlines are produced by the PackBits routine;
   each scanline consists of [byteCount] [data];
   IF rowBytes > 250 THEN 
      byteCount is a word;
   ELSE 
      byteCount is a byte.
END;

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996