Harlequin RIP SDK
HVD_cache_params Struct Reference

Parameters for the HVD cache instance. More...

#include "hvdcache.h"

Data Fields

size_t size
 The size of this structure.
 
const uint8cache_id
 HVD cache ID for this cache.
 
const uint8setup_id
 
HVD_cache_policy cache_policy
 Caching purging policy.
 
HVD_element_release_fnelement_release_fn
 
HVD_raster_release_fnraster_release_fn
 
HVD_recovery_filter_fnrecovery_filter_fn
 
HVD_raster_purge_fnraster_purge_fn
 
sw_memory_instancemem
 Memory allocation/deallocation functions.
 

Detailed Description

Parameters for the HVD cache instance.

Field Documentation

◆ element_release_fn

HVD_element_release_fn* HVD_cache_params::element_release_fn

A function to call when an element is destroyed. This is called after destroying all rasters attached to the element.

Parameters
[in]pElementThe element which the element handle was attached to.
[in]helementData attached to the element using HVD_element_set_data().

◆ raster_purge_fn

HVD_raster_purge_fn* HVD_cache_params::raster_purge_fn

A function to compress or purge data from rasters when running low on cache memory. This is called for each raster attached to an element. If not enough memory can be recovered by purging the top candidate elements, they will be released.

Parameters
[in]pElementThe element which the raster handle was attached to.
[in]hrasterA raster handle previously passed to HVD_element_add_raster().
[in,out]recoverA location where the amount of memory the purge operation still needs to recover is stored. On exit, the raster purge function should update this to the amount that is still needed after compressing, purging to storage, or otherwise reducing memory consumption. The reduction in memory may exceed the amount needed, in which case the raster purge function should set *recover to zero on exit.
Returns
The new size of the raster data after compressing, purging to storage, or otherwise reducing memory consumption.

The purge function, if present, may be called while an element is locked. It must not discard raster data, but may make it slower to access.

◆ raster_release_fn

HVD_raster_release_fn* HVD_cache_params::raster_release_fn

A function to call when an element with attached rasters is destroyed. This is called for each raster attached to the element.

Parameters
[in]pElementThe element which the raster handle was attached to.
[in]hrasterA raster handle previously passed to HVD_element_add_raster().

◆ recovery_filter_fn

HVD_recovery_filter_fn* HVD_cache_params::recovery_filter_fn

A function to filter rasters to those suitable for compression or eviction when running low on memory. If this parameter is NULL, then all elements and rasters will be considered eligible for all low memory calls.

Parameters
[in]pElementThe element that might be removed from the cache.
[in]reasonThe reason supplied to the call to HVD_cache_size() or HVD_cache_recover(). This parameter may be used to exclude elements or rasters from low-memory recovery, if they do not contribute to the type of memory requested.
Return values
TRUEThe HVD raster is eligible for purging or removal.
FALSEThe HVD raster is not eligible for purging or removal.

◆ setup_id

const uint8* HVD_cache_params::setup_id

The setup ID for the cache instance. If this is an empty string, it will not match any existing cache instance. This guarantees that all elements are deleted when the connection is disconnected.


The documentation for this struct was generated from the following file: