The tiling method API. More...
#include "tileapi.h"
Data Fields | |
sw_tile_result(* | validate )(const sw_datum *params, sw_mon_type *monuid, uint8 *detail, size_t detailsize) |
Validate the parameters that will be used for tiling. More... | |
sw_tile_result(* | start_tiling )(int32 pno, const sw_tile_bbox *bbox, const sw_datum *params, sw_tile_iteration *handle) |
Start tiling a device space bounding box. More... | |
size_t(* | count_tiles )(sw_tile_iteration handle) |
Find out how many tiles will be generated by an iteration. More... | |
sw_tile_result(* | get_tiles )(sw_tile_iteration handle, size_t *ntiles, sw_tile_bbox tiles[]) |
Get a number of tiles from the iterator. More... | |
sw_tile_result(* | end_tiling )(sw_tile_iteration *handle) |
Finish a tiling iteration. More... | |
The tiling method API.
size_t( * sw_tiling_api_20190924::count_tiles) (sw_tile_iteration handle) |
Find out how many tiles will be generated by an iteration.
[in] | handle | A tiling iteration handle created by the start_tiling() method. |
sw_tile_result( * sw_tiling_api_20190924::end_tiling) (sw_tile_iteration *handle) |
Finish a tiling iteration.
[in,out] | phandle | A pointer to a tiling iteration handle created by the start_tiling() method. On exit, *handle is set to NULL. |
sw_tile_result( * sw_tiling_api_20190924::get_tiles) (sw_tile_iteration handle, size_t *ntiles, sw_tile_bbox tiles[]) |
Get a number of tiles from the iterator.
[in] | handle | A tiling iteration handle created by the start_tiling() method. |
[in,out] | ntiles | A pointer to the number of tile bounding boxes that can be stored in tiles. On entry, this should be set to the number of bounding boxes allocated. This may exceed the number of tiles in the iteration. On a successful exit, it will be updated with the actual number of tiles stored. The number stored may be zero, if all of the tiles have previously been stored. |
[out] | tiles | An array of tile bounding boxes. On a successful exit, the number of tiles now stored in *ntiles will have valid normalised device space bounding boxes, any other tiles supplied will be unmodified. |
Successive calls to the get_tiles() method will return successive ranges of tiles until the iterator is exhausted. Once the iterator is exhausted, this method will always set *ntiles to 0 and return SW_TILE_SUCCESS.
sw_tile_result( * sw_tiling_api_20190924::start_tiling) (int32 pno, const sw_tile_bbox *bbox, const sw_datum *params, sw_tile_iteration *handle) |
Start tiling a device space bounding box.
[in] | pno | Page number or -1 for HVDElement tiling. |
[in] | bbox | Device space bounding box of the raster to tile. |
[in] | params | A datum representing the entire parameter dictionary used for configuration. |
[out] | phandle | A pointer to a location to store the iteration handle. If the method succeeds, a handle to the iteration context is stored in this location. |
If this method returns SW_TILE_SUCCESS, then the end_tiling() method MUST be called with the iteration handle when finished.
sw_tile_result( * sw_tiling_api_20190924::validate) (const sw_datum *params, sw_mon_type *monuid, uint8 *detail, size_t detailsize) |
Validate the parameters that will be used for tiling.
[in] | params | A datum representing the entire parameter dictionary used for configuration. |
[out] | monuid | A location to store a unique error number. If the validation method does not return SW_TILE_SUCCESS, then this MUST be set. |
[out] | detail | A buffer in which the method may store a zero-terminated UTF-8 string giving more detail of a validation error. The validation may store detailsize characters into this buffer, including the required terminating zero. |
[in] | detailsize | The size of the detail buffer. If this is non-zero, then the validation method may write a detailed error message into detail, but MUST zero-terminate the buffer within the first detailsize characters. |
Validate the parameter dictionary used for the tiling method, as much as possible without the actual bounding box to tile. Note that while it expected that the parameters passed to a subsequent start_tiling() call will be the same, the tiling method should not assume this, and should re-validate parameters in start_tiling().