HP (Hewlett-Packard) PCL Photo Scanner User Manual


 
15-24 Raster Graphics EN
Example: Delta Row Compression
The following example demonstrates how to compress the following
data using the delta row compression. (The bytes highlighted in italic
type indicate those bytes needing replacement — those bytes that
are different from the previous row, the seed row.)
E
C
*r1A – The start raster graphics command initializes the seed row
to all zeros.
Row 1 —
E
C
*b3m2W(00000001)(11111111)
The 3m selects the delta row compression method and the 2W
indicates that 2 bytes of data to follow. The first three bits of the first
data byte, the command byte, signify a single byte replacement (all
three bits are 0). The next five bits indicate an offset of 1 byte from
the current position. The replacement byte follows and contains
11111111.
Row 2 —
E
C
*b2W(00000010)(11110000)
The first three bits of the command byte indicate that one byte will
be replaced, and the next five bits indicate a relative offset of 2, so
the replacement will occur 2 bytes from the current position. The
replacement byte follows and contains 11110000.
Row 3 —
E
C
*b5W(00000000)(00001111)(00100010)
(10101010)(10101010)
As in the other rows, the first three bits of the command byte are zero,
indicating a single byte replacement. The five offset bytes indicate a
relative offset of zero bytes. The replacement byte follows and is
00001111. The third byte is another command byte and the first three
bits signify the replacement of two bytes (the top three bits are 001).
The offset bits indicate an offset of two bytes from the current
position. The fourth and fifth bytes are the two replacement bytes.
Table 15-8
Byte
No.01234
Row 1
00000000
11111111
00000000 00000000 00000000
Row 2
00000000 11111111
11110000
00000000 00000000
Row 3
00001111 11111111 11110000
10101010
10101010