![]() |
VisionWorks Toolkit ReferenceDecember 18, 2015 | 1.2 Release |
This section illustrates the implementation of the output validation callback function.
An output validation callback function is needed to validate output parameter data objects of a custom user node. The callback is called automatically at graph verification time for each individual output parameter of any node that instantiates the user custom kernel. The output validation callback differs from the input validation callback because its purpose is to set a vx_meta_format
object with the properties that are expected for the output parameter (metadata). From this vx_meta_format
object, VisionWorks checks whether the node output parameter has the expected properties and raises an error otherwise. In most cases, the properties of outputs are deduced from input parameters.
2.1 Output validation callback prototype
Output validation callbacks have the same prototype for any kernel:
2.2 Determine the expected output metadata
For an array, metadata are its capacity and the type of its elements. For an image, it would be its dimensions and format.