16
www.printek.com
| P: 888.211.3400 | F: 269.925.8539 | E:
The PackBits data compression technique is used to reduce the bandwidth requirements of the
physical interface to the printer. These techniques are easily incorporated into Windows drivers and
are also simple enough to use in embedded systems (for either compressing/encoding or
decompressing/decoding).
NOTATION
The following notation(s) apply throughout this document.
-
Items enclosed in
curly braces ‘{ }’ are required
-
Items enclosed in braces ‘[ ]’ are optional.
-
A range of values are indicated by indicate a range ‘a..b’, where a and b are the limits of the
range, all ranges are integral.
-
The symbol ‘|’ indicates an ‘OR’ condition.
DEFINITION
ppir
= {grfx_ctl_code}{num_pen_pkts}{pen_res}{pen1_data}
Printrex Printer Independent Raster: This is the general structure of one raster line of graphic data.
Where:
grfx_ctl_code
= {1Bh 5Fh 52h}
Graphics Control Code: This value is always Esc_R. This control code indicates that the Printrex
raster graphics data structure follows.
num_pen_pkts
= {01h | 02h | 03h | 04h}
Number of Pen Packets: The value indicates the number of sets of packed pen data included in the
raster command. This also indicates the number of pens associated with the raster line (01h = 1 pen,
the only case that is relevant to the Interceptor 800 printer).
pen_res
= {01h | 04h | 08h}
Pen Resolution: This parameter is in bits per pixel. This value is used to apply the unpacked raster
pen data to pixels on the page. The values of 01h, 04h and 08h correspond to 1, 4 and 8 bits per pixel
respectively.
For multiple bits per pixel, consecutive bits of the unpacked pen raster data are grouped together to
formulate the pixel color weighting.
pen1_data
= {pkd_size}{pkd_bits}
The pen data uses the PackBits compression method. The PackBits method uses a combination of
RLE and literal data representation. The basic structure of the pen data is a double-byte (word)
defining the number of bytes requiring unpacking, followed by the pen raster data to unpack. This
method is detailed as follows:
pkd_size
= {0000h..FFFFh} Note: High byte first
Packet Size: This is the number of packed bytes requiring unpacking. This value is an unsigned
word, high byte first.
pkd_bits
= {flg1, data1, flg2, data2.. flgn, datan}
Packed Bits: The packed bits are a series of flags coupled with data. The flag indicates the nature
of the data (literal or run data) as well as an associated count to be used with the data. For literal
data, the count identifies the number of bytes of literal data to follow. For run data, the count