CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Data Fields | |
unsigned | medium_width |
unsigned | medium_length |
unsigned | margin_bottom |
unsigned | margin_right |
unsigned | margin_top |
unsigned | margin_left |
unsigned | offset_top |
unsigned | offset_left |
unsigned | width |
unsigned | length |
unsigned | dot_size |
enum caps_colour_format | cf |
const void * | buffer |
ptrdiff_t | line_length |
Information about the rasterized image and how to print it on the medium
The rasterized image can have every format. It is unpredictable, since the rasterized document controles it. Don't rely ony any specific format!
This raster information provides everything to print it to the target medium, even if the rasterized image is smaller than the target medium.
The main information in caps_rstr_raster is the target medium size everything is calculated from and all results made for.
medium_width and medium_length defines the format of the target medium in [dots] or [lines] at the (previously) requested resolution.
margin_bottom, margin_right, margin_top and margin_left define the margins at all four medium edges where nothing should be printed to. Their values are meant in [dots], respectively [lines].
The rasterized image is stored into memory at the position where the member buffer points to. This is read only memory for you!
The rasterized image size is defined by the members width and length in [dots], respectively [lines].
The member dot_size defines the size of one dot in [bytes] (depending on the colour mode).
To be able to jump from one line to its next one in this rasterized image, the member line_length defines this offset. Its unit is [bytes].
As an alternative to access each line in the raster image you can use caps_rstr_line_get() instead.
The rasterized image has a colour format, the dots are encoded in. The member cf defines this colour format.
And now the details:
Now the members offset_top and offset_left come into play.
For all lines of the medium:
For each line:
Margins need to be considered:
The rasterized image might contain the margins. So, expect dots in these areas, where no dots should be on the print medium. You need to wipe-out these margins by yourself. You even cannot rely on the fact, the rasterized image is smaller than the imageable area of the print medium, and the offsets will ensure the margins as well.
Some notes about buffer:
It is of type void*
, but points to different dot formats depending on the member cf.
Colour mode | dot structure |
---|---|
CAPS_CF_MONOCHROME0 | caps_dot_monochrome |
CAPS_CF_MONOCHROME1 | caps_dot_monochrome |
CAPS_CF_GREY | caps_dot_grey |
CAPS_CF_RGB | caps_dot_rgb |
CAPS_CF_CMYK | caps_dot_cmyk |
unsigned medium_width |
Medium format's width, e.g. full [dot] count
unsigned medium_length |
Medium format's length, e.g. full [line] count
unsigned margin_bottom |
Amount of empty [lines] at the bottom edge of the medium
unsigned margin_right |
Amount of empty [dots] at the right edge of the medium
unsigned margin_top |
Amount of empty [lines] at the top edge of the medium
unsigned margin_left |
Amount of empty [dots] at the left edge of the medium
unsigned offset_top |
Empty [lines] from medium's top edge until the raster image starts
unsigned offset_left |
Empty [dots] from medium's left edge until the raster image starts
unsigned width |
Raw raster image [dot] count in each line, the first dot (the left one) is always valid
unsigned length |
Raw raster image [line] count, buffer points to
unsigned dot_size |
Size of one dot in [bytes], buffer points to.
enum caps_colour_format cf |
Raw raster image colour format. This defines the dot format buffer points to
const void* buffer |
Pointer to the raw raster image data, left, top coordinate
ptrdiff_t line_length |
Length of one line of the raw raster image in [bytes], buffer points to