EN Set Compression Method Command 15-25
Adaptive Compression  (Method 5)
Adaptive compression enables the combined use of any of the four 
previous compression methods (0 through 3), and it includes the 
ability to print empty (all zeros) rows or to duplicate rows.
Adaptive compression interprets a raster image as a block of raster 
data rather than as individual rows. The result of this interpretation is 
that the Transfer Raster Data (
E
C
*b#W) command is sent only once 
at the beginning of a raster data transfer, and the value field (#) 
identifies the number of bytes in the block (all rows). For the other 
compression methods, the Transfer Raster Data command is sent at 
the beginning of each row and the value field (#) identifies the number 
of bytes for that row only.
The size of a block is limited to 32,767 bytes. (32,767 bytes is the 
number of compressed bytes and not the size of the uncompressed 
data). To transfer greater than 32,767 bytes, send multiple blocks. 
Adaptive compression uses three control bytes at the beginning of 
each row within the block. The first of these bytes, the command byte, 
identifies the type of compression for the row. The two following bytes 
identify the number of bytes or rows involved. The format for adaptive 
compression raster rows is shown below:
<command byte><# of bytes/rows - upper byte><# of bytes/rows - lower byte> ...
...<first raster row byte>...<last raster row byte>
The command byte designates the compression method, empty row, 
or row duplication. Command byte values are shown below.
Table 15-9
Value Compression Operation
0   -    Unencoded
1   -    Run-Length Encoding
2   -    Tagged Image File Format (TIFF) rev 4.0
3   -    Delta row
4   -    Empty row
5   -    Duplicate row