Harlequin RIP SDK

Implementation of a framebuffer output 'device'. More...

#include "hhrsdk.h"
#include "skintest.h"
#include "hvdreport.h"
#include "libtiffrast.h"
#include "frametiffrast.h"

Data Structures

struct  FRAME_TIFF_RASTER_handle
 All output backends based on the rasthand.h prototypes must define a handle structure, which allows state information to persist across raster callback sequences. This example only needs a record of the underlying TIFF raster handle. More...
 

Macros

#define FRAME_TIFF_FILEFORMAT   "%f-%p%?-N%?-S%?-T.framebuffer.tif"
 The default file name format for files produced by the TIFF framebuffer raster output back end. More...
 
#define FRAME_TIFF_ELEMENT_FILEFORMAT   "%i%?-N%?-S%?-03r.framebuffer.tif"
 The file name format for all eHVD element output files produced by the TIFF framebuffer raster output back end. More...
 

Typedefs

typedef struct FRAME_TIFF_RASTER_handle FRAME_TIFF_RASTER_handle
 All output backends based on the rasthand.h prototypes must define a handle structure, which allows state information to persist across raster callback sequences. This example only needs a record of the underlying TIFF raster handle.
 

Functions

static FRAME_TIFF_RASTER_handleFRAME_TIFF_RASTER_new_handle (uint8 *ps_filename)
 Allocate memory for the raster handle structure. More...
 
static RASTER_result FRAME_TIFF_RASTER_start (void *pJobContext, RasterDescription *pRD, RASTER_handle *pHandle)
 This function is called once at the start of each sheet in each job. More...
 
static RASTER_result FRAME_TIFF_RASTER_write_data (void *pJobContext, RASTER_handle rh, RasterDescription *pRD, void *data, int32 topline, int32 lines, int32 bytesperline, int32 channel)
 For each page, multiple calls are made to this function, each delivering raster data for the page. More...
 
static RASTER_result FRAME_TIFF_RASTER_finish (void *pJobContext, RASTER_handle *pHandle, RasterDescription *pRD, RASTER_result result)
 This function is called once at the end of each sheet in each job. More...
 
static RASTER_result FRAME_TIFF_RASTER_job_end (void *pJobContext, RASTER_handle *pHandle)
 This function is called after the last sheet has been closed. More...
 
static RASTER_result FRAME_TIFF_RasterBandSize (void *pJobContext, RASTER_BANDSIZE *bandsize)
 This function allows the raster backend to increase the raster stride (byte offset between the start address of successive raster lines). More...
 
static RASTER_result FRAME_TIFF_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 FRAME_TIFF_RasterDestination (void *pJobContext, RASTER_DESTINATION *pRasterDestination, int32 sheetIndex)
 This function allows the raster backend to provide a memory address range into which to render. More...
 
static HVD_result frame_tiff_mem_output_page (HVD_page_output *page)
 Callback function for libHVD to output an HVD page. More...
 
static HVD_result frame_tiff_shm_output_page (HVD_page_output *page)
 Callback function for libHVD to output an HVD page. More...
 

Detailed Description

Implementation of a framebuffer output 'device'.

The main purpose of this example is to illustrate use of a handler-allocated framebuffer to receive the raster data from the RIP. It shows support for three different interleaving styles:

  • use of a single framebuffer to receive pixel-interleaved raster data
  • use of a framebuffer per colorant to receive frame-interleaved raster data
  • use of a framebuffer per separation to receive separated raster data

A real implementation would probably pick the most appropriate of these and the RIP would always be configured to use the corresponding interleaving style, rather than support multiple interleaving styles.

The RIP could instead be configured to produce band-interleaved raster data, and a framebuffer implementation can be written to handle that if it is the most convenient format. This example does not support band-interleaved raster data.

This example also shows:

  • use of the raster stride callback to constrain the RIP's data width to be a multiple of 32 bytes.

The raster handling functions piggyback on the LIBTIFF backend so that output can be easily viewed. A real implementation would probably pass the data to some other process for post-RIP manipulation.

The FRAMETIFF writer supports the same parameters for configuration as the standard TIFF writer, see libtiffrast_raster_params. When doing this the key used inside RasterParams must be /FRAMETIFF rather than /LIBTIFF.

Macro Definition Documentation

◆ FRAME_TIFF_ELEMENT_FILEFORMAT

#define FRAME_TIFF_ELEMENT_FILEFORMAT   "%i%?-N%?-S%?-03r.framebuffer.tif"

The file name format for all eHVD element output files produced by the TIFF framebuffer raster output back end.

The additional .framebuffer tag is used to distinguish between the output of this back end and the output of the other TIFF back ends.

This file name format cannot be overridden from the command line.

◆ FRAME_TIFF_FILEFORMAT

#define FRAME_TIFF_FILEFORMAT   "%f-%p%?-N%?-S%?-T.framebuffer.tif"

The default file name format for files produced by the TIFF framebuffer raster output back end.

The additional .framebuffer tag is used to distinguish between the output of this back end and the output of the other TIFF back ends.

Function Documentation

◆ frame_tiff_mem_output_page()

static HVD_result frame_tiff_mem_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.

◆ FRAME_TIFF_RASTER_finish()

static RASTER_result FRAME_TIFF_RASTER_finish ( void *  pJobContext,
RASTER_handle pHandle,
RasterDescription pRD,
RASTER_result  result 
)
static

This function is called once at the end of each sheet in each job.

See RASTER_FINISH_EX in rasthand.h

◆ FRAME_TIFF_RASTER_job_end()

static RASTER_result FRAME_TIFF_RASTER_job_end ( void *  pJobContext,
RASTER_handle pHandle 
)
static

This function is called after the last sheet has been closed.

See RASTER_JOB_END_EX in rasthand.h

◆ FRAME_TIFF_RASTER_new_handle()

static FRAME_TIFF_RASTER_handle* FRAME_TIFF_RASTER_new_handle ( uint8 ps_filename)
static

Allocate memory for the raster handle structure.

Returns
A pointer to the data.

◆ FRAME_TIFF_RASTER_start()

static RASTER_result FRAME_TIFF_RASTER_start ( void *  pJobContext,
RasterDescription pRD,
RASTER_handle pHandle 
)
static

This function is called once at the start of each sheet in each job.

See RASTER_START_EX in rasthand.h

◆ FRAME_TIFF_RASTER_write_data()

static RASTER_result FRAME_TIFF_RASTER_write_data ( void *  pJobContext,
RASTER_handle  rh,
RasterDescription pRD,
void *  data,
int32  topline,
int32  lines,
int32  bytesperline,
int32  channel 
)
static

For each page, multiple calls are made to this function, each delivering raster data for the page.

See RASTER_WRITE_DATA_EX in rasthand.h

◆ FRAME_TIFF_RasterBandSize()

static RASTER_result FRAME_TIFF_RasterBandSize ( void *  pJobContext,
RASTER_BANDSIZE bandsize 
)
static

This function allows the raster backend to increase the raster stride (byte offset between the start address of successive raster lines).

For illustrative purposes this example forces the stride to be a multiple of 32 bytes.

A real implementation may not need to implement this function, in which case the API pointer should be set to NULL.

◆ FRAME_TIFF_RasterDestination()

static RASTER_result FRAME_TIFF_RasterDestination ( void *  pJobContext,
RASTER_DESTINATION pRasterDestination,
int32  sheetIndex 
)
static

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

See SwLeRASTERDESTINATION in skinkit.h

◆ FRAME_TIFF_RasterRequirements()

static RASTER_result FRAME_TIFF_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 SwLeRASTERREQUIREMENTS in skinkit.h

◆ frame_tiff_shm_output_page()

static HVD_result frame_tiff_shm_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.