A set of helper constants, macros, and structures has been provided to help you decode and encode graphics orders. These items are defined in the header file PMORD.H.
There are four types of graphics orders. The first byte of each order, regardless of the graphics-order type, is the order code itself, which either partially or completely describes what follows. Depending on the order type, the graphics order can contain further information.
The four types of graphics order are:
BYTE 1 : order code.
BYTE 1 : order code BYTE 2 : associated value.Long Order
BYTE 1 : order code
BYTE 2 : length of order (0 to 255)
BYTE 3-257 : associated value bytes
depending on the order code.
There is a special long order (Escape) where:
BYTE 3 : escape type
BYTE 4 : escape identifier
BYTE 5-257 : associated value bytes
depending on the escape
identifier.
Very Long Order
BYTE 1 : order code
BYTE 2 : order qualifier
BYTE 3 : length of order
(most significant byte)
BYTE 4 : length of order
(least significant byte -
length of order is 0 to 65535)
BYTE 5-65537 : associated value bytes
depending on the order
qualifier.
There is a special very long order (Escape) where :
BYTE 5 : escape type
BYTE 6 : escape identifier
BYTE 7-65537 : associated value bytes
depending on the escape
identifier.