CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Reading the raw raster line by line for your own processing. More...
Data Structures | |
struct | caps_drv_raw_raster |
Raw raster information for full medium raster reconstruction. More... | |
Functions | |
int | caps_drv_raw_raster_info_get (struct caps_drv *cdrv, struct caps_drv_raw_raster *rr) |
const void * | caps_drv_raw_raster_line_get (struct caps_drv *cdrv, unsigned line_no) |
All these functions hide the details of libcapsraster behind. You can call them in the caps_generic_driver::page_print callback.
In the caps_generic_driver::page_print callback you get access to a raw raster which covers only a part of the medium size you have set in the caps_generic_driver::page_setup's callback via caps_drv_print_medium_size_set(). Since the raw raster size depends on the printable area and the print resolution you always need the following functions to retrieve this information from the library.
The raw raster is most of the time smaller than the medium size, but can be as large as the medium size as well. You always need to consider the caps_drv_raw_raster::skipped_top_lines and caps_drv_raw_raster::skipped_left_dots members. These members can be zero!
If your printer is able to optimize empty areas in some manner, this API could help to detect the area where real data has to be printed.
Another use case is a printer which has hardware dependent margins and the first dot to be sent must be the first one to be printed (e.g. the dots in the hardware margin must be skipped).
int caps_drv_raw_raster_info_get | ( | struct caps_drv * | cdrv, |
struct caps_drv_raw_raster * | rr | ||
) |
Get the information how to reconstruct the full medium raster from the raw raster
[in] | cdrv | libcapsdriver handle |
[out] | rr | Raw raster information |
0 | *rr contains the requested information |
-EINVAL | No raster information available |
The returned raw raster information is intended to be used to reconstruct the full medium raster according to the following image:
Access to the raw raster must be made through caps_drv_raw_raster_line_get()
const void * caps_drv_raw_raster_line_get | ( | struct caps_drv * | cdrv, |
unsigned | line_no | ||
) |
Get a pointer to a line of dots into the raw raster data
[in] | cdrv | libcapsdriver handle |
[in] | line_no | Raster line number to return a pointer to |
line_no
The line contains the dot count of the raw raster data. This dot count might cover the imageable area you have defined in caps_drv_print_medium_size_set(). But can also be much smaller, if the document defines a smaller page.