## Printer Device Driver

[prev][next][parent][TOC]

### CompressMode2Out

Compresses a scanline. The compression is done according to LJ IIP Mode 2 compression: mixed binary and run-length encoding.

Once in a repeated run, if a different byte is encountered, the driver stops and emits a block.

Once in a literal run, if at least 4 repeated bytes follow, the driver stops and emits a block. The next block will be a repeat block. Repeats of 2 or more instances of a byte b are represented by -(n-1) b. Literal runs of different bytes b1 b2 b3 .. bn are represented by (n-1) b1 b2 b3 .. bn.