![]() |
CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Required definitions for SPL2 based printer. More...
Go to the source code of this file.
Data Structures | |
| struct | spl2_job_options |
| Options of the current job to print. More... | |
| struct | spl2_drv |
| Samsung SPL2 laser printer driver specific information. More... | |
| struct | dictionary_collection |
| The dictionary of same byte pattern to compress the band's data. More... | |
| struct | spl2_band_buffer |
| All required information to handle one band of print data. More... | |
Macros | |
| #define | caps_print_debug(fmt, ...) |
| #define | ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) |
| #define | DOTS_TO_BYTES(x) (((x) + 7) / 8) |
| #define | DOTS_TO_INDEX(x) ((x) / 8) |
| #define | MIN(x, y) (x < y ? x : y) |
| #define | _(string) (string) |
| #define | NLS_(string) (string) |
| #define | to_spl2_driver(x) ((struct spl2_drv*)x) |
| #define | COMPRESS_SAMPLE_SIZE 2048 |
Enumerations | |
| enum | caps_drv_printer_id { CAPS_SPL2_UNKNOWN , CAPS_SPL2_ML_1520 , CAPS_SPL2_ML_1630 , CAPS_SPL2_ML_1640 , CAPS_SPL2_ML_2010 , CAPS_SPL2_ML_2015 , CAPS_SPL2_ML_2240 , CAPS_SPL2_ML_2510 } |
| Yet supported printers. More... | |
Functions | |
| int | spl2_driver_module_init (struct caps_drv *drvi, void *d) |
| int | spl2_driver_module_exit (struct caps_drv *drvi, void *d) |
| int | spl2_driver_page_setup (struct caps_drv *drvi, void *d) |
| int | spl2_driver_runtime_adaptions (struct caps_drv *drvi, void *d) |
| int | spl2_driver_job_setup (struct caps_drv *drvi, void *d) |
| int | spl2_driver_page_print (struct caps_drv *drvi, void *d) |
| int | spl2_driver_job_finish (struct caps_drv *drvi, void *d) |
| int | spl2_driver_device_monitor (struct caps_drv *drvi, void *d) |
| int | printer_driver_runtime_adaptions (struct caps_drv *drvi, struct spl2_drv *info) |
| int | printer_driver_module_init (struct caps_drv *drvi, struct spl2_drv *info) |
| uint8_t | drv_spl2_band_rotate (struct spl2_band_buffer *info) |
| int | drv_spl2_band_compress (struct spl2_band_buffer *info) |
| unsigned | drv_spl2_par_threads_get (struct caps_drv *drvi) |
| int | ml1640_driver_page_print (struct caps_drv *drvi, void *d) |
Covers the following monochrome laser printers:
| #define caps_print_debug | ( | fmt, | |
| ... | |||
| ) |
| #define ARRAY_SIZE | ( | x | ) | (sizeof(x)/sizeof(x[0])) |
always useful
| #define DOTS_TO_BYTES | ( | x | ) | (((x) + 7) / 8) |
| #define DOTS_TO_INDEX | ( | x | ) | ((x) / 8) |
| #define MIN | ( | x, | |
| y | |||
| ) | (x < y ? x : y) |
| #define _ | ( | string | ) | (string) |
| #define NLS_ | ( | string | ) | (string) |
| #define to_spl2_driver | ( | x | ) | ((struct spl2_drv*)x) |
| #define COMPRESS_SAMPLE_SIZE 2048 |
Sample size to calculate the dictionary for band data compression
High values are expensive, keep it as small as possible. Below 1024 results into a lausy compression. 1024 fails badly (no compression at all).
Find out why 1024 fails so badly.
1025 looked good, because of a bug in the test reference routine. It was as bad as 1024.
| enum caps_drv_printer_id |
| int spl2_driver_module_init | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
Used to allocate some driver specific memory.
| int spl2_driver_module_exit | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
| int spl2_driver_page_setup | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
| int spl2_driver_runtime_adaptions | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
| int spl2_driver_job_setup | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
| int spl2_driver_page_print | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
| int spl2_driver_job_finish | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
| int spl2_driver_device_monitor | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
Adapt some features to the current run-time
| [in] | drvi | The framework handle |
| [in] | info | Our private data |
| 0 | On success |
| -EINVAL | If this job cannot be printed |
Printer driver specific run-time adaptions, in contrast to the generic spl2_driver_runtime_adaptions()
Called by the generic spl2_driver_runtime_adaptions().
Do some special init for this printer: currently nothing to be done
| [in] | drvi | The framework handle |
| [in] | info | Our private data |
| 0 | On success |
| -EINVAL | If this job cannot be printed |
Printer driver specific initialisation, in contrast to the generic spl2_driver_module_init()
Called by the generic spl2_driver_module_init().
Printer driver specific initialisation, in contrast to the generic spl2_driver_module_init()
Called by the generic spl2_driver_module_init().
| uint8_t drv_spl2_band_rotate | ( | struct spl2_band_buffer * | info | ) |
Rotate the input data into the band buffer for further processing.
| [in] | info | All we must know about the raw data and the resulting band |
We got our data line by line. The band data must be in collumn by collumn. So, rotate the bytes (not the pixels!) for the band first.
This copies the data from the (line based) input buffer to the (collumn based) band buffer.
| int drv_spl2_band_compress | ( | struct spl2_band_buffer * | info | ) |
Compress/encode one band of printer data
| [in,out] | info | Information about the current band |
| unsigned drv_spl2_par_threads_get | ( | struct caps_drv * | drvi | ) |
Get the amount of additional thread to be used to process indepenent bands
| [in] | drvi | The printer instance info |
| Positive | Amount of additional threads to use for processing (can be 0) |
Since it makes no sense to run more threads than CPU cores are available, limit the number of threads to use here. The calculation is:
@TODO in libcapsdriver! Generisch. Mit Doku, wie es pro Drucker zu überschreiben ist.
| int ml1640_driver_page_print | ( | struct caps_drv * | drvi, |
| void * | d | ||
| ) |
Convert one raw page and print it.
| [in] | drvi | Full job description |
| [in] | d | The info structure |
| 0 | On success |
| negative | Errno else |
| -EBADF | The device seems gone offline |
The image to process is expected as a monochrome bitmap, 8 pixel in one byte.