Harlequin RIP SDK
SDK support for eHVD output

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  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...
 

Macros

#define MEMFB_CACHEAPI_NAME   "MEMFB"
 Name used to register the local memory framebuffer HVD cache implementation in RDR.
 
#define RSTORE_CACHEAPI_NAME   "RASTERSTORE"
 Name used to register the raster store HVD cache implementation in RDR.
 
#define SHMFB_CACHEAPI_NAME   "SHMFB"
 Name used to register the shared memory framebuffer HVD cache implementation in RDR.
 

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

HqBool memfb_cache_register (void)
 Register the local memory framebuffer HVD cache implementation in RDR.
 
void memfb_cache_deregister (void)
 Deregister the local memory framebuffer HVD cache implementation from RDR.
 
const RasterDescriptionmemfb_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 uint8memfb_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. More...
 
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. More...
 
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.
 
HqBool rstore_cache_register (void)
 Register the raster store HVD cache implementation in RDR.
 
void rstore_cache_deregister (void)
 Deregister the raster store HVD cache implementation from RDR.
 
const RasterDescriptionrstore_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 uint8rstore_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. More...
 
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. More...
 
HqBool shmfb_cache_register (void)
 Register the shared memory framebuffer HVD cache implementation in RDR.
 
void shmfb_cache_deregister (void)
 Deregister the shared memory framebuffer HVD cache implementation from RDR.
 
const RasterDescriptionshmfb_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 uint8shmfb_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. More...
 
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. More...
 

Detailed Description

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.

Enabling eHVD in Raster output backends

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:

There are worked examples of this process present in several of the raster backends provided with the distributed application layers.

Using local memory framebuffers for eHVD

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 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.

Using raster stores for eHVD

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 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.

Using shared memory framebuffers for eHVD

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 HVD_shmfb_cache().

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.

Enumeration Type Documentation

◆ anonymous enum

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.

Function Documentation

◆ hvd_output_page()

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.

Parameters
[in]pageThe output page description from libHVD.
[in,out]paramsCallback functions and parameter data.
Return values
HVD_SUCCESSThe page was output successfully
Returns
One of the HVD_ERROR_* error codes, or any other return value greater than MON_CLASS_ERROR is an error UID. HVD_ERROR_* codes should be translated to monitor UID errors using HVD_result_translate(). The error subclass, PS error type, and UID for the error can be deconstructed using the macros in monevent.h.

◆ memfb_element_raster_close()

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().

Parameters
[in]contextA raster mapping context previously returned by hvd_output_page_params::element_raster_open().
[in]elementRasterA 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.

◆ memfb_element_raster_map()

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().

Parameters
[in]contextA raster mapping context previously returned by element_raster_open().
[in]elementRasterA 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]pstartlineA 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]pnlinesA 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]perrA location in which an error code is stored, if the raster context could not be acquired or created.
Returns
A pointer to data representing the lines in the updated pstartline and *pnlines range, or 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().

◆ memfb_element_raster_open()

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().

Parameters
[in]elementRasterA 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]planeA raster plane to map buffers from.
[out]perrA location in which an error code is stored, if the raster context could not be acquired or created.
Returns
A raster context that will be passed to hvd_output_page_params::element_raster_map(), or 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.

◆ memfb_raster_description()

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().

Parameters
[in]elementRasterA 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.
Returns
A packed raster description associated with the raster handle. The internal pointers (including the raster layout) of a packed raster description are invalid. It may be unpacked using RasterDescriptionUnpack() if the pointers need to be accessed.

◆ rstore_element_raster_close()

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().

Parameters
[in]contextA raster mapping context previously returned by hvd_output_page_params::element_raster_open().
[in]elementRasterA 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.

◆ rstore_element_raster_map()

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().

Parameters
[in]contextA raster mapping context previously returned by element_raster_open().
[in]elementRasterA 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]pstartlineA 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]pnlinesA 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]perrA location in which an error code is stored, if the raster context could not be acquired or created.
Returns
A pointer to data representing the lines in the updated pstartline and *pnlines range, or 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().

◆ rstore_element_raster_open()

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().

Parameters
[in]elementRasterA 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]planeA raster plane to map buffers from.
[out]perrA location in which an error code is stored, if the raster context could not be acquired or created.
Returns
A raster context that will be passed to hvd_output_page_params::element_raster_map(), or 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.

◆ rstore_raster_description()

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().

Parameters
[in]elementRasterA 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.
Returns
A packed raster description associated with the raster handle. The internal pointers (including the raster layout) of a packed raster description are invalid. It may be unpacked using RasterDescriptionUnpack() if the pointers need to be accessed.

◆ shmfb_element_raster_close()

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().

Parameters
[in]contextA raster mapping context previously returned by hvd_output_page_params::element_raster_open().
[in]elementRasterA 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.

◆ shmfb_element_raster_map()

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().

Parameters
[in]contextA raster mapping context previously returned by element_raster_open().
[in]elementRasterA 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]pstartlineA 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]pnlinesA 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]perrA location in which an error code is stored, if the raster context could not be acquired or created.
Returns
A pointer to data representing the lines in the updated pstartline and *pnlines range, or 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().

◆ shmfb_element_raster_open()

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().

Parameters
[in]elementRasterA 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]planeA raster plane to map buffers from.
[out]perrA location in which an error code is stored, if the raster context could not be acquired or created.
Returns
A raster context that will be passed to hvd_output_page_params::element_raster_map(), or 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.

◆ shmfb_raster_description()

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().

Parameters
[in]elementRasterA 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.
Returns
A packed raster description associated with the raster handle. The internal pointers (including the raster layout) of a packed raster description are invalid. It may be unpacked using RasterDescriptionUnpack() if the pointers need to be accessed.