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_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. 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... | |
Interface for HVD element blitters.
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.
[in] | dest | The destination raster address and layout. The destination raster layout must be compatible with the source layout. |
[in] | src | The 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] | mask | The 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] | offsets | The intersection size, and offset from the destination and source rasters of the intersection, as computed by HVD_blit_offsets(). |
typedef struct HVD_raster_layout 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.
anonymous enum |
Values for HVD_data_format.
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.
[in] | dest | The destination raster layout, as previously passed to HVD_get_blitter(). |
[in] | src | The source raster layout, as previously passed to HVD_get_blitter(). |
[in] | xoffset | The X offset of the source raster layout relative to the destination raster. This may be negative. |
[in] | yoffset | The Y offset of the source raster layout relative to the destination raster. This may be negative. |
[out] | offsets | The width and height of the destination/source intersection, together with the offset from the source raster and the offset from the destination raster. |
TRUE | If the intersection of the destination and source rasters is not degenerate. |
FALSE | If the intersection of the destination and source rasters is degenerate. |
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.
[in] | dest | The destination raster address and layout. |
[in] | src | The source raster address and layout. |
[in] | mask | The 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. |