Raster backend support for eHVD output. More...
Files | |
file | hvdmemfb.h |
Support for local memory framebuffers for eHVD elements. | |
file | hvdoutput.h |
This file declares functions that can be used to composite eHVD elements and output the composed raster through the raster backend API. | |
file | hvdrstore.h |
Support for using the Raster Store API for eHVD elements. | |
file | hvdshmfb.h |
Support for shared memory framebuffers for eHVD elements. This allows a Scalable RIP to share eHVD elements across the entire RIP farm, without needing coordination from a raster manager or central controller. | |
file | phvdshmfb.c |
Platform functions to support shared memory framebuffers for eHVD elements. | |
file | hvdmemfb.c |
Support for local memory framebuffers for eHVD elements. | |
file | hvdoutput.c |
Support for raster output of composited external Harlequin VariData elements. | |
file | hvdrstore.c |
Support for raster store API for eHVD elements. | |
file | hvdshmfb.c |
Support for shared memory framebuffers for eHVD elements. This allows a Scalable RIP to share eHVD elements across the entire RIP farm, without needing coordination from a raster manager or central controller. | |
Data Structures | |
struct | hvd_output_page_params |
Structure to carry parameters and callback functions for compositing and outputting an eHVD page. More... | |
Typedefs | |
typedef struct hvd_output_page_params | hvd_output_page_params |
Structure to carry parameters and callback functions for compositing and outputting an eHVD page. | |
Enumerations | |
enum | { HVD_LOG_TIMING = 1 } |
Bitmask of options for the hvd_output_page_params::progress field. More... | |
Functions | |
void | memfb_raster_release (HVD_element *pElement, void *hraster) |
Function to use as HVD_raster_release_fn callback when using local memory elements. More... | |
HqBool | memfb_recovery_filter (HVD_element *pElement, HVD_recovery_reason_t reason) |
Function to use as HVD_recovery_filter_fn callback when using local memory elements. More... | |
const RasterDescription * | memfb_raster_description (void *elementRaster) |
Function to use as hvd_output_page_params::raster_description_fn when using local memory elements. More... | |
void * | memfb_element_raster_open (void *elementRaster, struct RASTER_PLANE *plane, HqnResult *perr) |
Function to use as hvd_output_page_params::element_raster_open when using local memory elements. More... | |
const uint8 * | memfb_element_raster_map (void *context, void *elementRaster, unsigned int *pstartline, unsigned int *pnlines, HqnResult *perr) |
void | memfb_element_raster_close (void *context, void *elementRaster) |
HVD_result | hvd_output_page (const struct HVD_page_output *page, hvd_output_page_params *params) |
Common support callback function for raster backends implementing libHVD to output an HVD page. More... | |
int | hvd_default_cache_policy (void) |
Get the default cache policy, allowing overriding of default values to avoid having to recompile debug RIPs. | |
void | rstore_raster_release (HVD_element *pElement, void *hraster) |
Function to use as HVD_raster_release_fn callback when using raster store elements. More... | |
HqBool | rstore_recovery_filter (HVD_element *pElement, HVD_recovery_reason_t reason) |
Function to use as HVD_recovery_filter_fn callback when using raster store elements. More... | |
size_t | rstore_raster_purge (HVD_element *pElement, void *hraster, size_t *recover) |
Function to use as HVD_raster_purge_fn callback when using raster store elements. More... | |
const RasterDescription * | rstore_raster_description (void *elementRaster) |
Function to use as hvd_output_page_params::raster_description_fn when using raster store elements. More... | |
void * | rstore_element_raster_open (void *elementRaster, struct RASTER_PLANE *plane, HqnResult *perr) |
Function to use as hvd_output_page_params::element_raster_open when using raster store elements. More... | |
const uint8 * | rstore_element_raster_map (void *context, void *elementRaster, unsigned int *pstartline, unsigned int *pnlines, HqnResult *perr) |
void | rstore_element_raster_close (void *context, void *elementRaster) |
void | shmfb_raster_release (HVD_element *pElement, void *hraster) |
Function to use as HVD_raster_release_fn callback when using shared memory elements. More... | |
HqBool | shmfb_recovery_filter (HVD_element *pElement, HVD_recovery_reason_t reason) |
Function to use as HVD_recovery_filter_fn callback when using shared memory elements. More... | |
HVD_cache_fns * | shmfb_HVD_cache_fns (void) |
const RasterDescription * | shmfb_raster_description (void *elementRaster) |
Function to use as hvd_output_page_params::raster_description_fn when using shared memory elements. More... | |
void * | shmfb_element_raster_open (void *elementRaster, struct RASTER_PLANE *plane, HqnResult *perr) |
Function to use as hvd_output_page_params::element_raster_open when using shared memory elements. More... | |
const uint8 * | shmfb_element_raster_map (void *context, void *elementRaster, unsigned int *pstartline, unsigned int *pnlines, HqnResult *perr) |
void | shmfb_element_raster_close (void *context, void *elementRaster) |
Raster backend support for eHVD output.
These support functions can be used to composite eHVD elements and output the composed raster through the raster backend API (Raster backend output API). This allows the same raster backend implementation to be used for eHVD output as non-eHVD output.
The Harlequin SDK provides functions to make it easy to enable eHVD output in raster backends using libHVD (see eHVD support library and SDK support for eHVD output). In the simplest case this involves:
OptimizedPDFId
, and call HVD_monitor_connected() to check whether the HVD monitor created in the previous step is connected. If so, this is an eHVD element targetted at this backend. Create the element storage using the create function for the storage type chosen, and save the element storage handle returned.There are worked examples of this process present in several of the raster backends provided with the distributed application layers.
To use local memory framebuffers for storage and output of eHVD elements, the libHVD event monitor needs to be configured to use the local memory framebuffer raster release and recovery functions, and the HVD output function should be called with the local memory framebuffer access functions.
Before calling the libHVD HVD_monitor_start() function, the HVD_monitor_params::raster_release_fn field should be set to the memfb_raster_release function pointer, and the HVD_monitor_params::recovery_filter_fn field should be set to the memfb_recovery_filter function pointer.
Before calling hvd_output_page(), the hvd_output_page_params::raster_description_fn field should be set to the memfb_raster_description function pointer, hvd_output_page_params::element_raster_open should be set to the memfb_element_raster_open function pointer, hvd_output_page_params::element_raster_map should be set to the memfb_element_raster_map function pointer, and hvd_output_page_params::element_raster_close should be set to the memfb_element_raster_close function pointer.
To use raster stores for storage and output of eHVD elements, the libHVD event monitor needs to be configured to use the raster store release and recovery functions, and the HVD output function should be called with the raster store framebuffer access functions.
Before calling the libHVD HVD_monitor_start() function, the HVD_monitor_params::raster_release_fn field should be set to the rstore_raster_release function pointer, the HVD_monitor_params::recovery_filter_fn field should be set to the rstore_recovery_filter function pointer, and the HVD_monitor_params::raster_purge_fn field should be set to the rstore_raster_purge function pointer.
Before calling hvd_output_page(), the hvd_output_page_params::raster_description_fn field should be set to the rstore_raster_description function pointer, hvd_output_page_params::element_raster_open should be set to the rstore_element_raster_open function pointer, hvd_output_page_params::element_raster_map should be set to the rstore_element_raster_map function pointer, and hvd_output_page_params::element_raster_close should be set to the rstore_element_raster_close function pointer.
To use shared memory framebuffers for storage and output of eHVD elements, the libHVD event monitor needs to be configured to use the shared memory framebuffer raster release and recovery functions, and the HVD output function should be called with the shared memory framebuffer access functions.
Before calling the libHVD HVD_monitor_start() function, the HVD_monitor_params::cache_fns field should be set to the return value of shmfb_HVD_cache_fns(). The HVD_monitor_params::raster_release_fn field should be set to the shmfb_raster_release function pointer, and the HVD_monitor_params::recovery_filter_fn field should be set to the shmfb_recovery_filter function pointer.
Before calling hvd_output_page(), the hvd_output_page_params::raster_description_fn field should be set to the shmfb_raster_description function pointer, hvd_output_page_params::element_raster_open should be set to the shmfb_element_raster_open function pointer, hvd_output_page_params::element_raster_map should be set to the shmfb_element_raster_map function pointer, and hvd_output_page_params::element_raster_close should be set to the shmfb_element_raster_close function pointer.
anonymous enum |
Bitmask of options for the hvd_output_page_params::progress field.
Enumerator | |
---|---|
HVD_LOG_TIMING | Log separation and page combined compositing and output timing information on MON_CHANNEL_PROGRESS. |
HVD_result hvd_output_page | ( | const struct HVD_page_output * | page, |
hvd_output_page_params * | params | ||
) |
Common support callback function for raster backends implementing libHVD to output an HVD page.
[in] | page | The output page description from libHVD. |
[in,out] | params | Callback functions and parameter data. |
HVD_SUCCESS | The page was output successfully |
void memfb_element_raster_close | ( | void * | context, |
void * | elementRaster | ||
) |
Function to use as hvd_output_page_params::element_raster_close when using local memory elements.
The context parameter will previously have been created by shmfb_element_raster_open().
The elementRaster parameter will previously have been created by shmfb_raster_create().
[in] | context | A raster mapping context previously returned by hvd_output_page_params::element_raster_open(). |
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
const uint8* memfb_element_raster_map | ( | void * | context, |
void * | elementRaster, | ||
unsigned int * | pstartline, | ||
unsigned int * | pnlines, | ||
HqnResult * | perr | ||
) |
Function to use as hvd_output_page_params::element_raster_map when using local memory elements.
The context parameter will previously have been created by memfb_element_raster_open().
The elementRaster parameter will previously have been created by memfb_raster_create().
[in] | context | A raster mapping context previously returned by element_raster_open(). |
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
[in,out] | pstartline | A pointer to the first line of data requested from the element raster. On a successful exit, this is updated to the first line of data represented in the buffer. This may be larger than the first line requested, if the element raster did not store data for the requested start line. |
[in,out] | pnlines | A pointer to the number of lines of data requested from the element raster. On a successful exit, this is updated to the number of lines of data represented in the buffer. This may be smaller than the number of lines requested, if the element raster did not have data stored for all of the requested lines. |
[out] | perr | A location in which an error code is stored, if the raster context could not be acquired or created. |
NULL
if there was an error getting the data. This data is owned by the element, and must not be modified by the client. This pointer remains valid until the next call to hvd_output_page_params::element_raster_map() using the same raster mapping context, or until hvd_output_page_params::element_raster_close() is called.If the pointer returned is non-NULL
, then *perr is not modified. If the pointer returned is NULL
, then *perr is either HQN_RESULT_SUCCESS, indicating there was no data in the range requested; or it is a code greater than MON_CLASS_ERROR indicating the error that occurred. The subclass, PS error type, and UID for the error can be deconstructed using the macros in monevent.h.
If there was no data in the range requested, then NULL
is returned, *perr is set to HQN_RESULT_SUCCESS, *pnlines is updated to zero and *pstartline is updated to the end of the requested range.
In all cases the element raster mapping context is still open, and requires closing using hvd_output_page_params::element_raster_close().
void* memfb_element_raster_open | ( | void * | elementRaster, |
struct RASTER_PLANE * | plane, | ||
HqnResult * | perr | ||
) |
Function to use as hvd_output_page_params::element_raster_open when using local memory elements.
The elementRaster parameter will previously have been created by memfb_raster_create().
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
[in] | plane | A raster plane to map buffers from. |
[out] | perr | A location in which an error code is stored, if the raster context could not be acquired or created. |
NULL
on error. If this is non-NULL
, a corresponding call to hvd_output_page_params::element_raster_close() will be made after mapping buffers for plane.If the pointer returned is non-NULL
, then *perr is not modified. If the pointer returned is NULL
, then *perr is set to a code greater than MON_CLASS_ERROR indicating the error that occurred. The subclass, PS error type, and UID for the error can be deconstructed using the macros in monevent.h.
const RasterDescription* memfb_raster_description | ( | void * | elementRaster | ) |
Function to use as hvd_output_page_params::raster_description_fn when using local memory elements.
The elementRaster parameter will previously have been created by memfb_raster_create().
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
void memfb_raster_release | ( | HVD_element * | pElement, |
void * | hraster | ||
) |
Function to use as HVD_raster_release_fn callback when using local memory elements.
The hraster parameter will previously have been created by memfb_raster_create().
[in] | pElement | The element which the raster handle was attached to. |
[in] | hraster | A raster handle previously passed to HVD_element_add_raster(). |
HqBool memfb_recovery_filter | ( | HVD_element * | pElement, |
HVD_recovery_reason_t | reason | ||
) |
Function to use as HVD_recovery_filter_fn callback when using local memory elements.
[in] | pElement | The element that might be removed from the cache. |
[in] | reason | The reason supplied to the call to HVD_cache_size() or HVD_cache_recover(). This parameter may be used to exclude elements or rasters from low-memory recovery, if they do not contribute to the type of memory requested. |
TRUE | The HVD raster is eligible for purging or removal. |
FALSE | The HVD raster is not eligible for purging or removal. |
void rstore_element_raster_close | ( | void * | context, |
void * | elementRaster | ||
) |
Function to use as hvd_output_page_params::element_raster_close when using raster store elements.
The context parameter will previously have been created by rstore_element_raster_open().
The elementRaster parameter will previously have been created by rstore_raster_create().
[in] | context | A raster mapping context previously returned by hvd_output_page_params::element_raster_open(). |
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
const uint8* rstore_element_raster_map | ( | void * | context, |
void * | elementRaster, | ||
unsigned int * | pstartline, | ||
unsigned int * | pnlines, | ||
HqnResult * | perr | ||
) |
Function to use as hvd_output_page_params::element_raster_map when using raster store elements.
The context parameter will previously have been created by rstore_element_raster_open().
The elementRaster parameter will previously have been created by rstore_raster_create().
[in] | context | A raster mapping context previously returned by element_raster_open(). |
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
[in,out] | pstartline | A pointer to the first line of data requested from the element raster. On a successful exit, this is updated to the first line of data represented in the buffer. This may be larger than the first line requested, if the element raster did not store data for the requested start line. |
[in,out] | pnlines | A pointer to the number of lines of data requested from the element raster. On a successful exit, this is updated to the number of lines of data represented in the buffer. This may be smaller than the number of lines requested, if the element raster did not have data stored for all of the requested lines. |
[out] | perr | A location in which an error code is stored, if the raster context could not be acquired or created. |
NULL
if there was an error getting the data. This data is owned by the element, and must not be modified by the client. This pointer remains valid until the next call to hvd_output_page_params::element_raster_map() using the same raster mapping context, or until hvd_output_page_params::element_raster_close() is called.If the pointer returned is non-NULL
, then *perr is not modified. If the pointer returned is NULL
, then *perr is either HQN_RESULT_SUCCESS, indicating there was no data in the range requested; or it is a code greater than MON_CLASS_ERROR indicating the error that occurred. The subclass, PS error type, and UID for the error can be deconstructed using the macros in monevent.h.
If there was no data in the range requested, then NULL
is returned, *perr is set to HQN_RESULT_SUCCESS, *pnlines is updated to zero and *pstartline is updated to the end of the requested range.
In all cases the element raster mapping context is still open, and requires closing using hvd_output_page_params::element_raster_close().
void* rstore_element_raster_open | ( | void * | elementRaster, |
struct RASTER_PLANE * | plane, | ||
HqnResult * | perr | ||
) |
Function to use as hvd_output_page_params::element_raster_open when using raster store elements.
The elementRaster parameter will previously have been created by rstore_raster_create().
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
[in] | plane | A raster plane to map buffers from. |
[out] | perr | A location in which an error code is stored, if the raster context could not be acquired or created. |
NULL
on error. If this is non-NULL
, a corresponding call to hvd_output_page_params::element_raster_close() will be made after mapping buffers for plane.If the pointer returned is non-NULL
, then *perr is not modified. If the pointer returned is NULL
, then *perr is set to a code greater than MON_CLASS_ERROR indicating the error that occurred. The subclass, PS error type, and UID for the error can be deconstructed using the macros in monevent.h.
const RasterDescription* rstore_raster_description | ( | void * | elementRaster | ) |
Function to use as hvd_output_page_params::raster_description_fn when using raster store elements.
The elementRaster parameter will previously have been created by rstore_raster_create().
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
size_t rstore_raster_purge | ( | HVD_element * | pElement, |
void * | hraster, | ||
size_t * | recover | ||
) |
Function to use as HVD_raster_purge_fn callback when using raster store elements.
The hraster parameter will previously have been created by rstore_raster_create().
[in] | pElement | The element which the raster handle was attached to. |
[in] | hraster | A raster handle previously passed to HVD_element_add_raster(). |
[in,out] | recover | A location where the amount of memory the purge operation still needs to recover is stored. On exit, the raster purge function should update this to the amount that is still needed after compressing, purging to storage, or otherwise reducing memory consumption. The reduction in memory may exceed the amount needed, in which case the raster purge function should set *recover to zero on exit. |
The purge function, if present, may be called while an element is locked. It must not discard raster data, but may make it slower to access.
void rstore_raster_release | ( | HVD_element * | pElement, |
void * | hraster | ||
) |
Function to use as HVD_raster_release_fn callback when using raster store elements.
The hraster parameter will previously have been created by rstore_raster_create().
[in] | pElement | The element which the raster handle was attached to. |
[in] | hraster | A raster handle previously passed to HVD_element_add_raster(). |
HqBool rstore_recovery_filter | ( | HVD_element * | pElement, |
HVD_recovery_reason_t | reason | ||
) |
Function to use as HVD_recovery_filter_fn callback when using raster store elements.
[in] | pElement | The element that might be removed from the cache. |
[in] | reason | The reason supplied to the call to HVD_cache_size() or HVD_cache_recover(). This parameter may be used to exclude elements or rasters from low-memory recovery, if they do not contribute to the type of memory requested. |
TRUE | The HVD raster is eligible for purging or removal. |
FALSE | The HVD raster is not eligible for purging or removal. |
void shmfb_element_raster_close | ( | void * | context, |
void * | elementRaster | ||
) |
Function to use as hvd_output_page_params::element_raster_close when using shared memory elements.
The context parameter will previously have been created by shmfb_element_raster_open().
The elementRaster parameter will previously have been created by shmfb_raster_create().
[in] | context | A raster mapping context previously returned by hvd_output_page_params::element_raster_open(). |
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
const uint8* shmfb_element_raster_map | ( | void * | context, |
void * | elementRaster, | ||
unsigned int * | pstartline, | ||
unsigned int * | pnlines, | ||
HqnResult * | perr | ||
) |
Function to use as hvd_output_page_params::element_raster_map when using shared memory elements.
The context parameter will previously have been created by shmfb_element_raster_open().
The elementRaster parameter will previously have been created by shmfb_raster_create().
[in] | context | A raster mapping context previously returned by element_raster_open(). |
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
[in,out] | pstartline | A pointer to the first line of data requested from the element raster. On a successful exit, this is updated to the first line of data represented in the buffer. This may be larger than the first line requested, if the element raster did not store data for the requested start line. |
[in,out] | pnlines | A pointer to the number of lines of data requested from the element raster. On a successful exit, this is updated to the number of lines of data represented in the buffer. This may be smaller than the number of lines requested, if the element raster did not have data stored for all of the requested lines. |
[out] | perr | A location in which an error code is stored, if the raster context could not be acquired or created. |
NULL
if there was an error getting the data. This data is owned by the element, and must not be modified by the client. This pointer remains valid until the next call to hvd_output_page_params::element_raster_map() using the same raster mapping context, or until hvd_output_page_params::element_raster_close() is called.If the pointer returned is non-NULL
, then *perr is not modified. If the pointer returned is NULL
, then *perr is either HQN_RESULT_SUCCESS, indicating there was no data in the range requested; or it is a code greater than MON_CLASS_ERROR indicating the error that occurred. The subclass, PS error type, and UID for the error can be deconstructed using the macros in monevent.h.
If there was no data in the range requested, then NULL
is returned, *perr is set to HQN_RESULT_SUCCESS, *pnlines is updated to zero and *pstartline is updated to the end of the requested range.
In all cases the element raster mapping context is still open, and requires closing using hvd_output_page_params::element_raster_close().
void* shmfb_element_raster_open | ( | void * | elementRaster, |
struct RASTER_PLANE * | plane, | ||
HqnResult * | perr | ||
) |
Function to use as hvd_output_page_params::element_raster_open when using shared memory elements.
The elementRaster parameter will previously have been created by shmfb_raster_create().
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
[in] | plane | A raster plane to map buffers from. |
[out] | perr | A location in which an error code is stored, if the raster context could not be acquired or created. |
NULL
on error. If this is non-NULL
, a corresponding call to hvd_output_page_params::element_raster_close() will be made after mapping buffers for plane.If the pointer returned is non-NULL
, then *perr is not modified. If the pointer returned is NULL
, then *perr is set to a code greater than MON_CLASS_ERROR indicating the error that occurred. The subclass, PS error type, and UID for the error can be deconstructed using the macros in monevent.h.
HVD_cache_fns* shmfb_HVD_cache_fns | ( | void | ) |
Return cache functions to use for shared memory elements with libHVD.
The pointer returned should be stored in the HVD_monitor_params::cache_fns field before calling HVD_monitor_start(), or the functions unpacked and stored in individual fields of HVD_cache_params before calling HVD_cache_create().
const RasterDescription* shmfb_raster_description | ( | void * | elementRaster | ) |
Function to use as hvd_output_page_params::raster_description_fn when using shared memory elements.
The elementRaster parameter will previously have been created by shmfb_raster_create().
[in] | elementRaster | A raster handle previously attached to an HVD element using one of libHVD's HVD_tracker_element_add_raster(), HVD_element_add_raster() or HVD_monitor_add_raster() functions. |
void shmfb_raster_release | ( | HVD_element * | pElement, |
void * | hraster | ||
) |
Function to use as HVD_raster_release_fn callback when using shared memory elements.
The hraster parameter will previously have been created by shmfb_raster_create().
[in] | pElement | The element which the raster handle was attached to. |
[in] | hraster | A raster handle previously passed to HVD_element_add_raster(). |
HqBool shmfb_recovery_filter | ( | HVD_element * | pElement, |
HVD_recovery_reason_t | reason | ||
) |
Function to use as HVD_recovery_filter_fn callback when using shared memory elements.
[in] | pElement | The element that might be removed from the cache. |
[in] | reason | The reason supplied to the call to HVD_cache_size() or HVD_cache_recover(). This parameter may be used to exclude elements or rasters from low-memory recovery, if they do not contribute to the type of memory requested. |
TRUE | The HVD raster is eligible for purging or removal. |
FALSE | The HVD raster is not eligible for purging or removal. |