CAPS Universe documentation  1.0.4
All you need to know to be successful
Functions | Variables
libcapsraster.c File Reference

Collection of routines rasterizing pages from a to be printed document. More...

Functions

void caps_librstr_init (void)
 
const struct caps_supported_mime_listcaps_rstr_mime_list_get (void)
 
struct caps_rasterizercaps_rstr_create (void)
 
void caps_rstr_job_detach (struct caps_rasterizer *rstr)
 
void caps_rstr_destroy (struct caps_rasterizer *rstr)
 
static int caps_rstr_select_by_mime_type (struct caps_rasterizer *rstr)
 
const char * caps_rstr_job_mime_get (const struct caps_rasterizer *rstr)
 
static void init_limits (struct caps_rstr_page_limits *limits)
 
int caps_rstr_job_attach (struct caps_rasterizer *rstr, int fd, struct caps_ppd_options_table *ppd_options, const char *params)
 
void caps_rstr_printer_feature_set (struct caps_rasterizer *rstr, enum caps_rstr_feature feature)
 
struct caps_rstr_page_limits caps_rstr_limits_get (struct caps_rasterizer *rstr)
 
static void medium_format_name_and_size_adapt (struct caps_rstr_page_desc *pg_desc)
 
int caps_rstr_page_get_next (struct caps_rasterizer *rstr, const struct caps_rstr_page_desc **pg_desc)
 
static void setup_poisoning (struct raster_adapt_preparation *setup)
 
int caps_rstr_page_rasterize (struct caps_rasterizer *rstr, const struct caps_rstr_page *page)
 
int caps_rstr_raster_get (struct caps_rasterizer *rndr, struct caps_rstr_raster *raster_desc)
 
const void * caps_rstr_line_get (struct caps_rasterizer *rstr, const struct caps_rstr_raster *desc, unsigned line_no)
 
int caps_rstr_page_default_setup (struct caps_rasterizer *rstr, struct caps_rstr_page *pg)
 
int caps_rstr_predictive_size_get (struct caps_rasterizer *rstr, struct caps_rect size, struct caps_rect *psize)
 
struct caps_rect caps_rstr_format_size_get (const char *medium_name)
 
const char * caps_rstr_format_name_get (const struct caps_rect *size)
 
int caps_rstr_format_validate (const char *medium_name)
 
void caps_libraster_version_get (unsigned *major, unsigned *minor, unsigned *micro)
 

Variables

const struct rstr_provider cupsraster_renderer
 
struct rstr_provider pdf_raserizer
 
static char * mime_formats []
 
static const struct caps_supported_mime_list mime_list
 

Detailed Description

Author
Jürgen Borleis
Version
1.0.0
Warning
Use as experimental

Function Documentation

◆ caps_rstr_select_by_mime_type()

static int caps_rstr_select_by_mime_type ( struct caps_rasterizer rstr)
static

Select the corresponding rasterizer by the documents MIME type

Parameters
[in]rstrWhere to store the selected rasterizing provider
Returns
0 on success, negative errno else

◆ init_limits()

static void init_limits ( struct caps_rstr_page_limits limits)
static

Setup the default limits

Parameters
[in,out]limitsThe limit structure to set

There are mostly no more limits than the available memory.

These default settings can be overwritten individually by the rasterizer in use.

◆ medium_format_name_and_size_adapt()

static void medium_format_name_and_size_adapt ( struct caps_rstr_page_desc pg_desc)
static

Unify the source (e.g. document) intended medium format name and its size if possible

Parameters
[in,out]pg_descInformation to adapt if possible

The caps_rstr_page_desc::medium_sz is filled by the rasterizer and modified here.

Todo:
How does the rasterizer interact, if its reported values get modified this way?

Goal is to use standard format names and their sizes whenever possible. In the backend, libpaper is used, so users can define new format names without touching libcapsraster.

Note
This function is separate, because it could be useful in the future to move this kind of adaption into the rasterizer backend.

◆ setup_poisoning()

static void setup_poisoning ( struct raster_adapt_preparation setup)
static

Poison the setup for the rasterizer

This is only made when DEBUG is enabled. Let the compiler sort it out if not used

Using SNANs shoud crash the program and unrealistic unsigned should do the rest.

Variable Documentation

◆ cupsraster_renderer

const struct rstr_provider cupsraster_renderer
extern

◆ pdf_raserizer

struct rstr_provider pdf_raserizer
extern

◆ mime_formats

char* mime_formats[]
static
Initial value:
= {
"application/pdf",
"application/cups-raster",
"application/octet-stream",
}

The list of supported MIME formats within this library. A printer driver can extend this list, but then must process it by its own

◆ mime_list

const struct caps_supported_mime_list mime_list
static
Initial value:
= {
.cnt = (sizeof( mime_formats )/sizeof( mime_formats [0])),
.format = mime_formats,
}
static char * mime_formats[]
Definition: libcapsraster.c:65