Harlequin RIP SDK

Interface for HVD element blitters. More...

Data Structures

struct  HVD_raster_layout
 Layout of an HVD element raster buffer. More...
 
struct  HVD_raster_offsets
 Structure defining the offsets to apply to an eHVD blit operation. More...
 

Typedefs

typedef int HVD_data_format
 Type of HVD raster data represented.
 
typedef struct HVD_raster_layout HVD_raster_layout
 Layout of an HVD element raster buffer. More...
 
typedef void() HVD_blitter_fn(const HVD_raster_layout *dest, const HVD_raster_layout *src, const HVD_raster_layout *mask, const HVD_raster_offsets *offsets)
 Type of the HVD element blitter function. More...
 

Enumerations

enum  { HVD_DATA_PIXELS , HVD_DATA_MASK0 , HVD_DATA_ALPHA , HVD_DATA_RLE }
 Values for HVD_data_format. More...
 

Functions

HVD_blitter_fnHVD_get_blitter (const HVD_raster_layout *dest, const HVD_raster_layout *src, const HVD_raster_layout *mask)
 Get an HVD element blitter function suitable for blitting the raster layouts specified. More...
 
HqBool HVD_blit_offsets (const HVD_raster_layout *dest, const HVD_raster_layout *src, int32 xoffset, int32 yoffset, HVD_raster_offsets *offsets)
 Calculate the size and offsets of the intersection of the destination raster and the source element. More...
 

Detailed Description

Interface for HVD element blitters.

Typedef Documentation

◆ HVD_blitter_fn

typedef void() HVD_blitter_fn(const HVD_raster_layout *dest, const HVD_raster_layout *src, const HVD_raster_layout *mask, const HVD_raster_offsets *offsets)

Type of the HVD element blitter function.

The blitter function is selected by HVD_get_blitter(), using raster layout descriptions for the destination, source, and mask. The blitter function should be passed the same raster layout descriptions to do its work.

The blitter function copies a rectangle of raster data from a source raster into a destination raster at a specified device space (x,y) offset, applying a mask or alpha channel to the pixels.

The source raster rectangle will be clipped to the boundary of the destination raster.

Parameters
[in]destThe destination raster address and layout. The destination raster layout must be compatible with the source layout.
[in]srcThe source raster address and layout. The source raster layout must be compatible with the destination layout. The source raster layout must either have the same number of channels as the mask raster layout, or the mask raster layout must have one channel (which will be used to determine the application of all channels for each pixel).
[in]maskThe mask raster address and layout. The source raster layout must either have the same number of channels as the mask raster layout, or the mask raster layout must have one channel (which will be used to determine the application of all channels for each pixel). For the common HVD ContoneMask case, the source data can be set as format HVD_DATA_MASK0 and the mask pointer may be NULL; or the mask address can be identical to the source pointer.
[in]offsetsThe intersection size, and offset from the destination and source rasters of the intersection, as computed by HVD_blit_offsets().

◆ HVD_raster_layout

Layout of an HVD element raster buffer.

This type is used to represent the source, destination, and mask for blitting HVD elements. The raster layouts are used to discover optimised blitters to perform the blitting, and to inform the blitter of the layout and addresses of the raster buffers.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Values for HVD_data_format.

Enumerator
HVD_DATA_PIXELS 

Data represents pixels. This is the normal format for raster destination and source.

HVD_DATA_MASK0 

Data represents a mask. Do not apply pixels with minimum value (0, or maximum value values_per_channel-1 if the mask is inverted) to the destination.

HVD_DATA_ALPHA 

Data represents an alpha mask with Normal combining.

HVD_DATA_RLE 

Data represents an RLE stream.

Function Documentation

◆ HVD_blit_offsets()

HqBool HVD_blit_offsets ( const HVD_raster_layout dest,
const HVD_raster_layout src,
int32  xoffset,
int32  yoffset,
HVD_raster_offsets offsets 
)

Calculate the size and offsets of the intersection of the destination raster and the source element.

Parameters
[in]destThe destination raster layout, as previously passed to HVD_get_blitter().
[in]srcThe source raster layout, as previously passed to HVD_get_blitter().
[in]xoffsetThe X offset of the source raster layout relative to the destination raster. This may be negative.
[in]yoffsetThe Y offset of the source raster layout relative to the destination raster. This may be negative.
[out]offsetsThe width and height of the destination/source intersection, together with the offset from the source raster and the offset from the destination raster.
Return values
TRUEIf the intersection of the destination and source rasters is not degenerate.
FALSEIf the intersection of the destination and source rasters is degenerate.

◆ HVD_get_blitter()

HVD_blitter_fn* HVD_get_blitter ( const HVD_raster_layout dest,
const HVD_raster_layout src,
const HVD_raster_layout mask 
)

Get an HVD element blitter function suitable for blitting the raster layouts specified.

The blitter function should be passed the same raster layout descriptions as this function uses for selection.

For the common HVD ContoneMask case, the source data can be set as format HVD_DATA_MASK0 and the mask pointer may be NULL; or the mask address can be identical to the source pointer.

Parameters
[in]destThe destination raster address and layout.
[in]srcThe source raster address and layout.
[in]maskThe mask raster address and layout. If this is NULL and the source data format is not HVD_DATA_MASK0, the blit operation overwrites all pixels intersected by the source and destination rasters.
Returns
A blitter function pointer, or NULL if the layouts are incompatible or no blitter function exists for the operation specified.