105 #define PHASE_RGB_IN0_IMG_IDX (0u) 108 #define PHASE_RGB_OUT0_IMG_IDX (1u) 111 #define PHASE_RGB_MAX_PARAMS (2u) 218 printf(
" phase_rgb_user_kernel_add: ERROR: vxAddParameterToKernel, vxFinalizeKernel failed (%d)!!!\n", status);
226 printf(
" phase_rgb_user_kernel_add: ERROR: vxAddUserKernel failed (%d)!!!\n", status);
239 printf(
" phase_rgb_user_kernel_add: SUCCESS !!!\n");
267 printf(
" phase_rgb_user_kernel_add_as_user_kernel: ERROR: vxAllocateUserKernelId failed (%d)!!!\n", status);
321 printf(
" phase_rgb_user_kernel_add_as_target_kernel: ERROR: vxAllocateUserKernelId failed (%d)!!!\n", status);
390 printf(
" phase_rgb_user_kernel_remove: Unable to remove kernel (%d)!!!\n", status);
395 printf(
" phase_rgb_user_kernel_remove: SUCCESS !!!\n");
431 printf(
" phase_rgb_user_kernel_validate: ERROR: Number of parameters dont match !!!\n");
442 printf(
" phase_rgb_user_kernel_validate: ERROR: Parameter %d is NULL !!!\n", i);
462 printf(
" phase_rgb_user_kernel_validate: ERROR: Unable to query input image !!!\n");
482 printf(
" phase_rgb_user_kernel_validate: ERROR: Unable to query output image !!!\n");
494 printf(
" phase_rgb_user_kernel_validate: ERROR: Input/Output image format not correct !!!\n");
507 printf(
" phase_rgb_user_kernel_validate: ERROR: Input/Output image wxh do not match !!!\n");
528 printf(
" phase_rgb_user_kernel_validate: SUCCESS !!!\n");
551 printf(
" phase_rgb_user_kernel_init: SUCCESS !!!\n");
579 void *in_data_ptr, *out_data_ptr;
600 (
void**)&in_data_ptr,
611 (
void**)&out_data_ptr,
618 for(y=0; y<out_image_addr.
dim_y; y++)
620 for(x=0; x<out_image_addr.
dim_x; x++)
667 printf(
" phase_rgb_user_kernel_run: ERROR: Run failed (%d)!!!\n", status);
688 printf(
" phase_rgb_user_kernel_deinit: SUCCESS !!!\n");
723 refs,
sizeof(refs)/
sizeof(refs[0])
struct _vx_image * vx_image
#define TIVX_TUTORIAL_KERNEL_PHASE_RGB_NAME
Converts Phase output to RGB image.
vx_status VX_API_CALL vxQueryImage(vx_image image, vx_enum attribute, void *ptr, vx_size size)
static vx_status VX_CALLBACK phase_rgb_user_kernel_deinit(vx_node node, const vx_reference parameters[], vx_uint32 num)
User/target kernel de-init function.
#define PHASE_RGB_MAX_PARAMS
Total number of parameters for this function.
Interface to TI extension APIs.
vx_kernel VX_API_CALL vxAddUserKernel(vx_context context, const vx_char name[VX_MAX_KERNEL_NAME], vx_enum enumeration, vx_kernel_f func_ptr, vx_uint32 numParams, vx_kernel_validate_f validate, vx_kernel_initialize_f init, vx_kernel_deinitialize_f deinit)
vx_status phase_rgb_user_kernel_remove(vx_context context)
Remove user/target kernel from context.
static vx_kernel phase_rgb_user_kernel_add_as_target_kernel(vx_context context)
Add kernel as target kernel.
vx_status VX_API_CALL vxUnmapImagePatch(vx_image image, vx_map_id map_id)
static vx_enum phase_rgb_user_kernel_id
Kernel ID of the registered user kernel. Used to create a node for the kernel function [static global...
vx_status VX_API_CALL vxRemoveKernel(vx_kernel kernel)
struct _vx_context * vx_context
struct _vx_meta_format * vx_meta_format
#define PHASE_RGB_IN0_IMG_IDX
Index of input image in parameter list.
struct _vx_reference * vx_reference
#define TIVX_TARGET_DSP2
Name for DSP target class, instance 2.
static vx_kernel phase_rgb_user_kernel_add_as_user_kernel(vx_context context)
Add kernel as user kernel.
vx_node tivxCreateNodeByKernelEnum(vx_graph graph, vx_enum kernelenum, vx_reference params[], vx_uint32 num)
Utility function to create a node given parameter references and kernel enum.
vx_status VX_API_CALL vxMapImagePatch(vx_image image, const vx_rectangle_t *rect, vx_uint32 plane_index, vx_map_id *map_id, vx_imagepatch_addressing_t *addr, void **ptr, vx_enum usage, vx_enum mem_type, vx_uint32 flags)
#define TIVX_TARGET_DSP1
Name for DSP target class, instance 1.
VX_ERROR_INVALID_PARAMETERS
vx_status VX_API_CALL vxSetReferenceName(vx_reference ref, const vx_char *name)
struct _vx_kernel * vx_kernel
vx_status phase_rgb_user_kernel_add(vx_context context, vx_bool add_as_target_kernel)
Add user/target kernel to OpenVX context.
vx_status VX_API_CALL vxReleaseKernel(vx_kernel *kernel)
static vx_status VX_CALLBACK phase_rgb_user_kernel_run(vx_node node, const vx_reference parameters[], vx_uint32 num)
User/target kernel execute or run function.
#define PHASE_RGB_OUT0_IMG_IDX
Index of output image in parameter list.
vx_status VX_API_CALL vxFinalizeKernel(vx_kernel kernel)
VX_API_ENTRY vx_status VX_API_CALL tivxAddKernelTarget(vx_kernel kernel, const char *target_name)
Associate a target with a kernel.
VX_PARAMETER_STATE_REQUIRED
static vx_kernel phase_rgb_user_kernel
Handle to the registered user kernel [static global].
vx_node phase_rgb_user_kernel_node(vx_graph graph, vx_image in, vx_image out)
User/target kernel node create function.
static vx_status VX_CALLBACK phase_rgb_user_kernel_init(vx_node node, const vx_reference parameters[], vx_uint32 num)
User/target kernel init function.
static vx_status VX_CALLBACK phase_rgb_user_kernel_validate(vx_node node, const vx_reference parameters[], vx_uint32 num, vx_meta_format metas[])
User/target kernel validate function.
struct _vx_graph * vx_graph
vx_status VX_API_CALL vxAllocateUserKernelId(vx_context context, vx_enum *pKernelEnumId)
vx_bool tivxIsReferenceVirtual(vx_reference ref)
Utility function to check if the given reference is virtual or not.
struct _vx_node * vx_node
vx_status VX_API_CALL vxAddParameterToKernel(vx_kernel kernel, vx_uint32 index, vx_enum dir, vx_enum data_type, vx_enum state)
vx_status VX_API_CALL vxSetMetaFormatAttribute(vx_meta_format meta, vx_enum attribute, const void *ptr, vx_size size)
void *VX_API_CALL vxFormatImagePatchAddress2d(void *ptr, vx_uint32 x, vx_uint32 y, const vx_imagepatch_addressing_t *addr)
vx_status VX_API_CALL vxGetStatus(vx_reference reference)