CAPS Universe documentation
1.0.4
All you need to know to be successful
|
The 1027 encoding method uses a block oriented data set in conjunction with bands which split a page vertically in small pieces.
There is a limit of 64 lines (max. line count in a band) and the size of the encoding in one data block must not exceed 32 k words (64 kiB).
Encodes a line by replacing words, repeating nibbles, bytes and words and copy words from a previous line. Everything which does not fit into one of the encoding types is copied as-is. Thus, the compression ratio is very lousy if the content is complex. Maybe the yet unknown 'edit' functions (see below) add more features to gain a better compression ratio for complex content. Volunteers? :)
Encoding works in pieces of 'edits'. Due to the absence of an offset component, matching line content cannot be skipped like in the The Printer Data Encoding Method "3" or The Printer Data Encoding Method "1030" method. Each 'edit' is a 16 bit word where the topmost one or three bits define a function. The word itself must be encoded in big-endian:
76543210 76543210 0ccccccc ccccxxxx <word>…With:
ccccccccccc 11 bit of count of following words xxxx not used
76543210 76543210 100ccccc cccccccc <word>With:
ccccccccccccc 13 bit of count (e.g. max 8191 words)
76543210 76543210 110ccccc ddddddddWith:
dddddddd data ccccc 5 bit of count (e.g. max 31 words)
76543210 76543210 101ddddc ccccccccWith:
dddd lower nibble of data ccccccccc 9 bit of count (e.g. max 511 words)
76543210 76543210 111ccccc ccccccccWith:
ccccccccccccc 13 bit of count (max. 8191 words)For all encodings it's unclear, what a count of zero means.
A single band can be described by multiple blocks of up to 64 kiB data each.
Each block of data starts with "\033*b<number>W".
According to some documentation I found, the bands have fixed positions and are always of 64 lines. The data blocks can only be inside each band and should never cross its boundaries.
Each encoded data block comes with a #cm1027_band_data_header which defines its position on the paper like this:
paper | paper left border | right border | | | v | v +-------------|-------------------------------------------------------------+ <- (n * 64) | | Band | | | | | | | | | 'border_top' | | | | | | | | | | | V | | +-------------------------------------------------------------+ | |-------->| | Block | | | border_ | | line_cnt | | | left | | pixel_cnt | | | |---V-------------------------------------------------------->| | | +-------------------------------------------------------------+ | | | | | | | | | | | | | | | +---------------------------------------------------------------------------+ <- (n * 64 + 63)
So, for print jobs with only a few objects spread over the page the compression is very well. But if you have many objects (or a background image) the compression is very lousy.