CUPS rastertoql filter  1.0.4
Filter for the Brother QL family of label printers
Functions | Variables
qlmedia.c File Reference

Common routines to deal with DK rolls for QL label printers. More...

Functions

static const struct dk_roll_typesql_dk_element_get (const char *name)
 
int ql_dk_information_get (struct dk_roll_types *medium, const char *name)
 
int ql_input_raster_crop (struct qldriver *ql)
 

Variables

static const struct dk_roll_types rolls []
 

Detailed Description

Common routines to deal with DK rolls for QL label printers.

Author
Jürgen Borleis

Media handling in QL label printers is a little bit confusing. The printers have some - lets call it 'interesting' - behaviour when dealing with continuous and pre-cut labels. The differences should be handled here.

Function Documentation

◆ ql_dk_element_get()

static const struct dk_roll_types* ql_dk_element_get ( const char *  name)
static

Loop through the list of rolls and search for a specific one

Parameters
[in]nameThe DK roll name to search for
Return values
PointerThe corresponding roll element
NULLname not found

◆ ql_dk_information_get()

int ql_dk_information_get ( struct dk_roll_types medium,
const char *  name 
)

Retrieve settings/information about a specific DK roll/cassette

Parameters
[out]mediumThe settings for the DK roll named by name
[in]nameThe DK roll name the settings should be retrieved for
Return values
0On success, *medium is valid
-EINVALRoll with the given name not found

DK rolls can inherit settings from other rolls. This routine walks through the table and uses the dk_roll_types::like member to re-use their settings.

◆ ql_input_raster_crop()

int ql_input_raster_crop ( struct qldriver ql)

Crop the input raster to meet the printer's expectations/requirements

Parameters
[in]qlFull job description

The printer device has some - hmm, lets it call - interesting requirements about the print data it accepts. Continuous labels are easy, but pre-cut labels aren't. In order to ensure the printer always cuts inbetween two pre-cut labels, we need to tweak the amount of lines to be print.

Read How the Filter deals with margins about details.

Variable Documentation

◆ rolls

const struct dk_roll_types rolls[]
static

List of known DK rolls and their special requirements. At least we need to know here if the DK rolls are continuous or pre-cut. And since the QL8xx printer variants we also need to know, if the DK roll can be used for bi-colour prints.
But most of the time, they are more or less the same from the printer point of view, so the .like member points to a base DK roll type.

Todo:
All transport tape sizes are still to be checked