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.)

Table 15-8

Byte

 

 

 

 

 

No.

0

1

2

3

4

 

 

 

 

 

 

Row 1

00000000

11111111

00000000

00000000

00000000

 

 

 

 

 

 

Row 2

00000000

11111111

11110000

00000000

00000000

 

 

 

 

 

 

Row 3

00001111

11111111

11110000

10101010

10101010

 

 

 

 

 

 

EC*r1A – The start raster graphics command initializes the seed row to all zeros.

Row 1 — EC*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 — EC*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 — EC*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.

15-24Raster Graphics

EN

Page 332
Image 332
HP 5961-0509 manual Example Delta Row Compression, Byte Row, 15-24Raster Graphics