|
| static cairo_status_t | write_png_stream_to_byte_array (void *in_closure, const unsigned char *data, unsigned int length) |
| | Cairo PNG stream write callback appending encoded PNG chunks to a byte buffer.
|
| static cairo_status_t | read_png_stream_from_byte_array (void *in_closure, unsigned char *data, unsigned int length) |
| | Cairo PNG stream read callback feeding encoded PNG bytes from a memory buffer.
|
| static int | ro_composite_tile_read (struct storage_backend *store, const char *xmlconfig, const char *options, int x, int y, int z, char *buf, size_t sz, int *compressed, char *log_msg) |
| | Read tiles from both primary and secondary backends, composite them via Cairo, and encode as PNG.
|
| static struct stat_info | ro_composite_tile_stat (struct storage_backend *store, const char *xmlconfig, const char *options, int x, int y, int z) |
| | Delegate tile metadata and expiry lookup to the primary storage backend.
|
| static char * | ro_composite_tile_storage_id (struct storage_backend *store, const char *xmlconfig, const char *options, int x, int y, int z, char *string) |
| | Return a static identifier string for composite tiles.
|
| static int | ro_composite_metatile_write (struct storage_backend *store, const char *xmlconfig, const char *options, int x, int y, int z, const char *buf, int sz) |
| | Reject metatile write attempts on the read-only composite backend.
|
| static int | ro_composite_metatile_delete (struct storage_backend *store, const char *xmlconfig, int x, int y, int z) |
| | Reject metatile delete attempts on the read-only composite backend.
|
| static int | ro_composite_metatile_expire (struct storage_backend *store, const char *xmlconfig, int x, int y, int z) |
| | Reject metatile expiry attempts on the read-only composite backend.
|
| static int | ro_composite_close_storage (struct storage_backend *store) |
| | Close and free both child storage backends, the tile cache buffer, and ro_composite_ctx.
|
| struct storage_backend * | init_storage_ro_composite (const char *connection_string) |
| | Allocate and initialize a read-only Cairo compositing storage_backend.
|
| struct storage_backend * init_storage_ro_composite |
( |
const char * | connection_string | ) |
|
Allocate and initialize a read-only Cairo compositing storage_backend.
Parses connection_string of the form: "composite:{<xmlconfig_primary>,<backend_opts_primary>}{<xmlconfig_secondary>,<backend_opts_secondary>}", initializes both child storage backends via init_storage_backend(), sets the default render_size to 256, and wires all backend operation function pointers. Returns NULL if compiled without HAVE_CAIRO or if parsing/initialization fails.
- Parameters
-
| connection_string | Configuration URI beginning with "composite:{". |
- Returns
- Newly allocated struct storage_backend pointer, or NULL on failure or if unsupported.
| int ro_composite_tile_read |
( |
struct storage_backend * | store, |
|
|
const char * | xmlconfig, |
|
|
const char * | options, |
|
|
int | x, |
|
|
int | y, |
|
|
int | z, |
|
|
char * | buf, |
|
|
size_t | sz, |
|
|
int * | compressed, |
|
|
char * | log_msg ) |
|
static |
Read tiles from both primary and secondary backends, composite them via Cairo, and encode as PNG.
Fetches and decodes the PNG tile from store_primary (imageA), fetches and decodes the PNG tile from store_secondary (imageB), creates a render_size x render_size ARGB32 destination surface (imageC), paints imageA followed by imageB onto imageC, and encodes the resulting composite surface as PNG bytes into buf.
- Parameters
-
| store | Initialized composite storage_backend (storage_ctx holds struct ro_composite_ctx *). |
| xmlconfig | Logical map style name (overridden internally by xmlconfig_primary / xmlconfig_secondary). |
| options | Style parameterization options string forwarded to both child backends. |
| x | Tile X coordinate. |
| y | Tile Y coordinate. |
| z | Tile zoom level. |
| buf | Caller-supplied scratch/output buffer receiving the composited PNG bytes. |
| sz | Maximum capacity of buf in bytes. |
| compressed | Output compression flag populated by the child tile_read() calls. |
| log_msg | Caller-supplied buffer receiving an error message on failure. |
- Returns
- Byte length of the composited PNG written into buf (> 0) on success, or -1 on read/decode/surface error.