|
static void | hl_c1027_line_append (struct cm1027_line *c, uint16_t word) |
|
static void | hl_c1027_sequence_append (struct cm1027_line *c, const uint16_t *pattern, size_t cnt) |
|
static uint16_t | hl_encoding_vertical (unsigned count) |
|
static uint16_t | hl_encoding_repeat_word (unsigned count) |
|
static uint16_t | hl_encoding_repeat_byte (unsigned count, unsigned data) |
|
static uint16_t | hl_encoding_repeat_nibble (unsigned count, unsigned data) |
|
static uint16_t | hl_encoding_copy (unsigned count) |
|
bool | hl_c1027_line_check_if_empty (unsigned cnt, const uint16_t line[cnt]) |
|
static bool | c1027_upper_lower_byte_match (uint16_t data) |
|
static bool | c1027_all_nibbles_match (uint16_t data) |
|
static void | hl_1027_plain_data_copy (struct cm1027_line *cline, const uint16_t *pattern, unsigned start, unsigned cnt) |
|
void | hl_c1027_line_encode (struct cm1027_line *cline, unsigned cnt, const uint16_t line[cnt], const uint16_t *prev) |
|
int | hl_c1027_block_flush (struct cm1027_block *block, FILE *outstream) |
|
int | hl_c1027_block_line_add (struct cm1027_block *block, const struct cm1027_line *line, FILE *outstream) |
|
int | hl_c1027_block_line_twin_add (struct cm1027_block *block, const struct cm1027_line *line, unsigned cnt, FILE *outstream) |
|
void | hl_c1027_block_init (struct cm1027_block *block, unsigned llength) |
|
void | hl_c1027_block_exit (struct cm1027_block *block) |
|
Read the corresponding header file for further information about this encoding method.
The printer wants the data to be print as:
- a bit is '0': this dot isn't printed, the paper colour is still visible at this position
- a bit is '1': this dot is printed, a black dot is visible at this position
static uint16_t hl_encoding_vertical |
( |
unsigned |
count | ) |
|
|
static |
Generate a vertical copy entry
- Parameters
-
- Returns
- The encoded compression code word
Copy count
words from the previous line
The generated entry is defined to (MSB left):
76543210 76543210 111ccccc cccccccc
With:
ccccccccccccc 13 bit of count
- Precondition
count
< 8192
- Todo:
- What does count == 0x00 mean?
static uint16_t hl_encoding_repeat_word |
( |
unsigned |
count | ) |
|
|
static |
Generate a horizontal word repeat entry
- Parameters
-
- Returns
- The encoded compression code word
Repeat the next 16 bit word count
times
The generated entry is defined to (MSB left):
76543210 76543210 100ccccc cccccccc <word>
With:
ccccccccccccc 13 bit of count
- Precondition
count
< 8192
- Todo:
- What does count == 0x00 mean?
static uint16_t hl_encoding_repeat_byte |
( |
unsigned |
count, |
|
|
unsigned |
data |
|
) |
| |
|
static |
Generate a horizontal byte repeat entry
- Parameters
-
[in] | count | Repeat counter |
[in] | data | Repeat byte twice count times |
- Returns
- The encoded compression code word
Repeat 8 bit data
count
* 2 times
The generated entry is defined to (MSB left):
76543210 76543210 110ccccc dddddddd
With:
dddddddd data
ccccc 6 bit of count
- Precondition
count
< 32
- Todo:
- What does a count == 0 mean?
static uint16_t hl_encoding_repeat_nibble |
( |
unsigned |
count, |
|
|
unsigned |
data |
|
) |
| |
|
static |
Generate a horizontal nibble repeat entry
- Parameters
-
[in] | count | Repeat counter |
[in] | data | Repeat lower nibble quad count times |
- Returns
- The encoded compression code word
Repeat data
nibble count
* 4 times
The generated entry is defined to (MSB left):
76543210 76543210 101ddddc cccccccc
With:
dddd lower nibble of data
ccccccccc 9 bit of count
- Precondition
count
< 512
int hl_c1027_block_line_twin_add |
( |
struct cm1027_block * |
block, |
|
|
const struct cm1027_line * |
line, |
|
|
unsigned |
cnt, |
|
|
FILE * |
outstream |
|
) |
| |
Add one line and a twin of it to the encoded data
- Parameters
-
[in,out] | block | Block info |
[in] | line | The line to add to this block |
[in] | cnt | Final length in words of one fully decoded line |
[in] | outstream | The IO stream to send the printer data to (on demand) |
This function adds two lines to the block for the HQ1200 mode, where the vertical resolution is still 600 DPI but the printer expects the lines for 1200 DPI.
The first line is the line
and the second one is a twin of it, encoded as a reuse of the full line
content.