Decoding Graphics Orders
The recommended way of decoding a buffer of graphics orders (in C language)
is to use a pointer to address the first byte of the buffer, and then retrieve
the graphics order it contains. To discover which of the four types of order
you have, use the following macros:
- BYTE_ORDER (1-byte order)
- SHORT_ORDER (2-byte order)
- LONG_ORDER (long order)
- VLONG_ORDER (very long order).
These macros are defined in the header file PMORD.H. Each macro processes
a single byte of data and returns a Boolean value (zero or nonzero). A zero
value means that the order is not of that type. When you know the graphics-order
type, you can establish the length of the order, and add the length to the
pointer. You can then retrieve the next order in the buffer, and repeat
the process until all data has been retrieved.
You can decode the graphics-order data itself by providing a routine for
each of the order types, or a routine for each individual order:
- For a 1-byte graphic order, the decoding routine should
simply return a length of 1.
- For a 2-byte graphic order, the decoding routine can
use the overlay structure ORDER to decode the data. The routine should return
a length of 2.
- For a long order, the decoding routine can use the
overlay structure LORDER to decode the data. The length of the data is a
variable value.
- For a very long order, the decoding routine can use
the overlay structure VORDER to decode the data. The length of the data
is a variable value.
The overlay structures ORDER, LORDER, and VORDER are defined in the header
file PMORD.H.
You can build graphics orders using the same structures and order types
that are used for decoding graphics orders.
[Back: The Graphics-Orders Header File (PMORD.H)]
[Next: Naming Conventions]