Harlequin RIP SDK

Harlequin VariData (external) raster discarding backend, HVDNONE, and raw raster backend, HVDRAW. More...

#include "hhrsdk.h"
#include "skintest.h"
#include "debugpage.h"
#include "hvdreport.h"
#include "rmreport.h"
#include "hvdrast.h"
#include <stdlib.h>

Data Structures

struct  HVD_RASTER_handle
 

Macros

#define HVD_ELEMENT_FILEFORMAT   "%i%?-N%?-S%?-03r.raw"
 
#define HVD_FILEFORMAT   "%f-%p%?-N%?-S%?-T.raw"
 
#define HVD_PAGES_FILEFORMAT   "%f-pages_%p.xml"
 

Typedefs

typedef struct HVD_RASTER_handle HVD_RASTER_handle
 

Functions

static void * mem_acquire (size_t size, uint32 id, void *data, HqnResult *perr)
 
static void mem_release (void *handle, size_t size, void *data)
 
static uint8mem_raster (void *handle, size_t offset, size_t size)
 
static HqBool save_pages_info (DEVICELIST *dev, RasterDescription *pRasterDescription)
 Writes the XML page and element info held by gPagesInfo to a file. More...
 
static RASTER_result HVDNONE_RASTER_start (void *pJobContext, RasterDescription *rd, RASTER_handle *handlep)
 Raster start for HVDNONE discarding backend.
 
static RASTER_result HVDRAW_RASTER_start (void *pJobContext, RasterDescription *rd, RASTER_handle *handlep)
 Raster start for HVDRAW output backend.
 
static RASTER_result HVDRAST_RASTER_write_data (void *pJobContext, RASTER_handle rh, RasterDescription *rd, void *data, int32 topline, int32 lines, int32 bytesperline, int32 channel)
 RASTER_write_data.
 
static RASTER_result HVDRAST_RASTER_finish (void *pJobContext, RASTER_handle *handlep, RasterDescription *rd, RASTER_result result)
 RASTER_finish.
 
static RASTER_result HVDRAST_RASTER_job_end (void *pJobContext, RASTER_handle *handlep)
 RASTER_job_end.
 
static RASTER_result HVDRAST_RasterRequirements (void *pJobContext, RASTER_REQUIREMENTS *pRasterRequirements, RasterDescription *pRD)
 This function gives the raster backend the details of the raster it's about to be handed. More...
 
static RASTER_result HVDRAST_RasterDestination (void *pJobContext, RASTER_DESTINATION *pRD, int32 sheetIndex)
 This function allows the raster backend to provide a memory address range into which to render. More...
 
static RASTER_result raw_hvd_raster_finish (void *pJobContext, RASTER_handle *handlep, RasterDescription *rd, RASTER_result result)
 
static HVD_result raw_shm_hvd_output_page (HVD_page_output *page)
 Callback function for libHVD to output an HVD page. More...
 
static HVD_result raw_mem_hvd_output_page (HVD_page_output *page)
 Callback function for libHVD to output an HVD page. More...
 
static HVD_result none_shm_hvd_output_page (HVD_page_output *page)
 Callback function for libHVD to output an HVD page. More...
 
static HVD_result none_mem_hvd_output_page (HVD_page_output *page)
 Callback function for libHVD to output an HVD page. More...
 
HqBool HVDRAST_RegisterHandlers (void)
 Register the raster backend and event handlers. More...
 

Detailed Description

Harlequin VariData (external) raster discarding backend, HVDNONE, and raw raster backend, HVDRAW.

This file implements an external Harlequin VariData backend. It receives raster data for each element from the RIP via a framebuffer, caches it, and composes an output page from the element data. The HVDNONE backend then discards the data, whereas the HVDRAW backend writes the data out to disk, along with an XML file detailing which elements are used by which pages.

It illustrates:

  • Using libHVD to handle the required Harlequin VariData event handlers
  • Additional event handlers to capture the XML data for the page.
  • use of a framebuffer to receive raster data from the RIP
  • asynchronous output of pages triggered by the Page Ready event

It does not illustrate:

  • synchronization on cache elements

Macro Definition Documentation

◆ HVD_ELEMENT_FILEFORMAT

#define HVD_ELEMENT_FILEFORMAT   "%i%?-N%?-S%?-03r.raw"

Fileformat string for the HVD element raw files. This is substituted for the leaf of the filename generated by HVD_FILEFORMAT when outputting HVD elements.

◆ HVD_FILEFORMAT

#define HVD_FILEFORMAT   "%f-%p%?-N%?-S%?-T.raw"

Fileformat string for the final raw files.

◆ HVD_PAGES_FILEFORMAT

#define HVD_PAGES_FILEFORMAT   "%f-pages_%p.xml"

Fileformat string for the XML file containing the page and element info.

Typedef Documentation

◆ HVD_RASTER_handle

Structure holding job information

Function Documentation

◆ HVDRAST_RasterDestination()

static RASTER_result HVDRAST_RasterDestination ( void *  pJobContext,
RASTER_DESTINATION pRD,
int32  sheetIndex 
)
static

This function allows the raster backend to provide a memory address range into which to render.

See also
SwLeRASTERDESTINATION in skinkit.h

◆ HVDRAST_RasterRequirements()

static RASTER_result HVDRAST_RasterRequirements ( void *  pJobContext,
RASTER_REQUIREMENTS pRasterRequirements,
RasterDescription pRD 
)
static

This function gives the raster backend the details of the raster it's about to be handed.

The framebuffer memory is allocated here once the page dimensions are known.

See also
SwLeRASTERREQUIREMENTS in skinkit.h

◆ HVDRAST_RegisterHandlers()

HqBool HVDRAST_RegisterHandlers ( void  )

Register the raster backend and event handlers.

Register the required external Harlequin VariData event handlers This function is called from RegisterHandlers()

Returns
TRUE if all the handlers are successfully registered

◆ mem_acquire()

static void* mem_acquire ( size_t  size,
uint32  id,
void *  data,
HqnResult perr 
)
static

Allocation function for framebuffer memory, using gfSysAlloc.

◆ mem_raster()

static uint8* mem_raster ( void *  handle,
size_t  offset,
size_t  size 
)
static

Raster address function for framebuffer memory allocated using gfSysAlloc.

◆ mem_release()

static void mem_release ( void *  handle,
size_t  size,
void *  data 
)
static

Release function for framebuffer memory, using gfSysAlloc.

◆ none_mem_hvd_output_page()

static HVD_result none_mem_hvd_output_page ( HVD_page_output page)
static

Callback function for libHVD to output an HVD page.

Parameters
[in]pageThe output page description from libHVD.
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.

◆ none_shm_hvd_output_page()

static HVD_result none_shm_hvd_output_page ( HVD_page_output page)
static

Callback function for libHVD to output an HVD page.

Parameters
[in]pageThe output page description from libHVD.
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.

◆ raw_hvd_raster_finish()

static RASTER_result raw_hvd_raster_finish ( void *  pJobContext,
RASTER_handle handlep,
RasterDescription rd,
RASTER_result  result 
)
static

Raster finish function for HVDRAW output when outputting completed HVD pages. This saves the page and element XML file before finishing the raster in the normal way.

◆ raw_mem_hvd_output_page()

static HVD_result raw_mem_hvd_output_page ( HVD_page_output page)
static

Callback function for libHVD to output an HVD page.

Parameters
[in]pageThe output page description from libHVD.
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.

◆ raw_shm_hvd_output_page()

static HVD_result raw_shm_hvd_output_page ( HVD_page_output page)
static

Callback function for libHVD to output an HVD page.

Parameters
[in]pageThe output page description from libHVD.
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.

◆ save_pages_info()

static HqBool save_pages_info ( DEVICELIST dev,
RasterDescription pRasterDescription 
)
static

Writes the XML page and element info held by gPagesInfo to a file.

Parameters
[in]devThe device to output the XML file on.
[in]pRasterDescriptionThe raster description for the page
Return values
TRUEif successful
FALSEIf the page description could not be saved