VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Delay Object Extensions

Adds various extensions to the vx_delay object.

This section describes different extensions and features to the standard Object: Delay.

Delay Auto-Aging

The application can register delay auto-aging in graphs: see nvxRegisterAutoAging.

Delay Sub-Objects and Delay Aging

A delay sub-object is an object retrieved by calling vxGetReferenceFromDelay.

Any delay sub-object accessed with vxAccess<Object> must be committed with vxCommit<Object> prior to aging the delay; otherwise, the behavior is undefined.

Aging a delay does not shift sub-objects, but instead shifts only their data content in an efficient way, without any copy. In other words calling vxGetReferenceFromDelay with i as index parameter always returns a reference to the same sub-object and after calling vxAgeDelay, this sub-object gets automatically updated with the correct data.

Example Code

vx_uint8 val = 0;
vx_scalar exemplar = vxCreateScalar(context, VX_TYPE_UINT8, &val);
vx_delay delay = vxCreateDelay(context, (vx_reference)exemplar, 3);
vxReleaseScalar(&exemplar);
/* Put 10 in the 'previous-previous' delay slot */
val = 10;
vxWriteScalarValue(prev_prev, &val);
/* Put 20 in the 'previous' delay slot */
val = 20;
vxWriteScalarValue(prev, &val);
/* Put 30 in the 'current' delay slot */
val = 30;
vxWriteScalarValue(current, &val);
/* Age the delay */
vxAgeDelay(delay);
/* Check the value of delay slots */
vx_uint8 prev_prev_value;
vxReadScalarValue(prev, &prev_prev_value);
printf("prev-prev is now %d\n", prev_prev_value); /* it now contains 20 */
vx_uint8 prev_value;
vxReadScalarValue(prev, &prev_value);
printf("prev is now %d\n", prev_value); /* it now contains 30 */