CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Creating the printer's wire data for monochrome print. More...
Data Structures | |
struct | monochrome_line_wire_data |
Printer command to print one monochrome line. More... | |
struct | monochrome_line_wrapper |
Wrapper to define the command for one monochrome line of printer data. More... | |
Macros | |
#define | MONO_MODE 0x00 |
Functions | |
static void | monochrome_line_convert (size_t input_cnt, const conv_type input[input_cnt], struct monochrome_line_wrapper *cmd) |
static struct monochrome_line_wrapper * | monochrome_command_get (size_t bytes_per_line) |
static void | monochrome_command_put (void *cmd) |
static int | ql_next_monochrome_line_read (struct ql_drv *t, struct halftone_converter *cnv, unsigned line_no) |
static int | ql_monochrome_line_process (struct ql_drv *t, struct halftone_converter *cnv) |
int | ql_monochome_page_print (struct ql_drv *t) |
Routines to print monochrome rasters, e.g. black on white. This mode can be used by all label printers.
#define MONO_MODE 0x00 |
monochrome_line_wire_data::mode value to print a monochrome line. Used in the printer's command to print simple black dots, refer monochrome_line_wire_data for details
|
static |
Convert one line of data from the half-tone algorithm (e.g. one short int per pixel) into one monochrome line of printer data
[in] | input_cnt | Size of elements in input |
[in] | input | The data from the half-tone algorithm |
[out] | cmd | Where to build the monochrome printer data and its command |
This routine uses the transform_to_monochrome() function to mirror the line content while converting it into monochrome data format.
cmd
must be allocated and prepared by monochrome_command_get() input_cnt
must be a multiple of 8 and below 2041
|
static |
Allocate the buffer for the monochrome print command
[in] | bytes_per_line | Expected bytes per line to be sent to the printer |
bytes_per_line
defines the size of the monochrome_line_wire_data::data member
It allocates the command buffer and the trailing line data buffer at once.
bytes_per_line
requires to be 0 < bytes_per_line
< 256
|
static |
Free the buffer for the monochrome print command
[in] | cmd | The command buffer to be freed |
|
static |
Read in a line from a monochrome raster right border aligned
[in,out] | t | Full job description |
[in,out] | cnv | Half tone converter |
[in] | line_no | Line number to read in |
0 | On success |
-ENODATA | Mature end of raster input data |
Each raster must be handled right aligned in order to mirror the result prior sending it to the printer.
The raster can be wider or smaller than the printing area is. Deal with it.
|
static |
Process one monochrome line and send it to the printer
[in] | t | Full job description |
[in,out] | cnv | Half tone converter |
0 | On success |
Dither the top line according to the selected halftine algo and send the result to the printer
int ql_monochome_page_print | ( | struct ql_drv * | t | ) |
Convert the current page into the printer's wire data format
[in] | t | Full job description |
0 | On success |
-EINVAL | Unsupported raster input format |
-ECANCELED | Termination request from outerspace |
The routine loops through all lines of the current page and converts them into the printer's monochrome wire format