TIOVX User Guide
phase_rgb_user_kernel.h File Reference

Go to the source code of this file.

Functions

vx_status phase_rgb_user_kernel_add (vx_context context, vx_bool add_as_target_kernel)
 Add user/target kernel to OpenVX context. More...
 
vx_status phase_rgb_user_kernel_remove (vx_context context)
 Remove user/target kernel from context. More...
 
vx_node phase_rgb_user_kernel_node (vx_graph graph, vx_image in, vx_image out)
 User/target kernel node create function. More...
 

Detailed Description

Interface file for user kernel functions

These interface functions are called by OpenVX application.

Definition in file phase_rgb_user_kernel.h.

Function Documentation

◆ phase_rgb_user_kernel_add()

vx_status phase_rgb_user_kernel_add ( vx_context  context,
vx_bool  add_as_target_kernel 
)

Add user/target kernel to OpenVX context.

Parameters
context[in] OpenVX context into with the user kernel is added
add_as_target_kernel[in] 'vx_false_e', add this kernel as user kernel
'vx_true_e', add this kernel as target kernel






- Depending on 'add_as_target_kernel' invoke user kernel or target kernel specific registration logic

phase_rgb_user_kernel_id is set as part of this function invocation.

/
if(add_as_target_kernel==(vx_bool)vx_false_e)
{
}
if(add_as_target_kernel==(vx_bool)vx_true_e)
{
}









- Checking is kernel was added successfully to OpenVX context

/
status = vxGetStatus((vx_reference)kernel);







- Now define parameters for the kernel

 When specifying the parameters, the below attributes of each parameter are specified,
 - parameter index in the function parameter list
 - the parameter direction: VX_INPUT or VX_OUTPUT
 - parameter data object type
 - paramater state: VX_PARAMETER_STATE_REQUIRED or VX_PARAMETER_STATE_OPTIONAL
/
index = 0;
if ( status == (vx_status)VX_SUCCESS)
{
status = vxAddParameterToKernel(kernel,
index,
);
index++;
}
if ( status == (vx_status)VX_SUCCESS)
{
status = vxAddParameterToKernel(kernel,
index,
);
index++;
}





- After all parameters are defined, now the kernel is finalized, i.e it is ready for use.

/
if ( status == (vx_status)VX_SUCCESS)
{
status = vxFinalizeKernel(kernel);
}



- Set kernel handle to the global user kernel handle

This global handle is used later to release the kernel when done with it

Definition at line 144 of file phase_rgb_user_kernel.c.

◆ phase_rgb_user_kernel_remove()

vx_status phase_rgb_user_kernel_remove ( vx_context  context)

Remove user/target kernel from context.

Parameters
context[in] OpenVX context from which the kernel will be removed


- Remove user kernel from context and set the global 'phase_rgb_user_kernel' to NULL

Definition at line 375 of file phase_rgb_user_kernel.c.

◆ phase_rgb_user_kernel_node()

vx_node phase_rgb_user_kernel_node ( vx_graph  graph,
vx_image  in,
vx_image  out 
)

User/target kernel node create function.

Given a graph reference, this function creates a OpenVX node and inserts it into the graph. The list of parameter references is also provided as input. Exact data type are used instead of base class references to allow some level of compile time type checking. In this example, there is one input image and one output image that are passed as parameters.

Parameters
graph[in] OpenVX graph
in[in] Input image reference
out[in] Output image reference
Returns
OpenVX node that is created and inserted into the graph



- Put parameters into a array of references

/
vx_reference refs[] = {(vx_reference)in, (vx_reference)out};



- Use TIOVX API to make a node using the graph, kernel ID, and parameter reference array as input

/
refs, sizeof(refs)/sizeof(refs[0])
);
vxSetReferenceName((vx_reference)node, "PHASE_RGB");

Definition at line 707 of file phase_rgb_user_kernel.c.