Vision Apps User Guide

Introduction

This section contains module APIs for the TIOVX Scaler node tivxVpacMscScaleNode.

Data Structures

struct  ImgObj
 Scaler Image Data Structure. More...
 
struct  ScalerObj
 Scaler Module Data Structure. More...
 

Functions

void scale_set_coeff (tivx_vpac_msc_coefficients_t *coeff, uint32_t interpolation)
 Scaler module helper function for setting MSC coefficients. More...
 
vx_status app_init_scaler (vx_context context, ScalerObj *scalerObj, char *objName, vx_int32 num_ch, vx_int32 num_outputs)
 Scaler module init helper function. More...
 
void app_deinit_scaler (ScalerObj *obj)
 Scaler module deinit helper function. More...
 
void app_delete_scaler (ScalerObj *obj)
 Scaler module delete helper function. More...
 
vx_status app_create_graph_scaler (vx_context context, vx_graph graph, ScalerObj *scalerObj, vx_object_array input_img_arr)
 Scaler module create helper function. More...
 
vx_status app_create_graph_scaler_write_output (vx_graph graph, ScalerObj *scalerObj, vx_int32 output_idx)
 Scaler module write output helper function. More...
 
vx_status app_send_cmd_scaler_write_node (ScalerObj *scalerObj, vx_uint32 start_frame, vx_uint32 num_frames, vx_uint32 num_skip)
 Scaler module write output helper function. More...
 
vx_status readScalerInput (char *file_name, vx_object_array img_arr, vx_int32 read_mode, vx_int32 ch_num)
 Helper function to read image from file. More...
 
vx_status writeScalerOutput (char *file_name, vx_object_array img_arr)
 Helper function to write image from file. More...
 

Macros

#define APP_MODULES_MAX_SCALER_OUTPUTS   (5)
 Maximum amount of values allowed from scaler node. More...
 
#define APP_MODULES_READ_FILE   (0x333)
 Read mode for reading entire file. More...
 
#define APP_MODULES_READ_CHANNEL   (0x444)
 Read mode for reading selected channel. More...
 

Macro Definition Documentation

◆ APP_MODULES_MAX_SCALER_OUTPUTS

#define APP_MODULES_MAX_SCALER_OUTPUTS   (5)

Maximum amount of values allowed from scaler node.

◆ APP_MODULES_READ_FILE

#define APP_MODULES_READ_FILE   (0x333)

Read mode for reading entire file.

◆ APP_MODULES_READ_CHANNEL

#define APP_MODULES_READ_CHANNEL   (0x444)

Read mode for reading selected channel.

Function Documentation

◆ scale_set_coeff()

void scale_set_coeff ( tivx_vpac_msc_coefficients_t *  coeff,
uint32_t  interpolation 
)

Scaler module helper function for setting MSC coefficients.

This Scaler helper function sets the MSC coefficients based on the type of interpolation

Parameters
[out]coeffMSC coefficients set based on interpolation type
[in]interpolationScaler interpolation type; valid values are VX_INTERPOLATION_BILINEAR and VX_INTERPOLATION_NEAREST_NEIGHBOR

◆ app_init_scaler()

vx_status app_init_scaler ( vx_context  context,
ScalerObj scalerObj,
char *  objName,
vx_int32  num_ch,
vx_int32  num_outputs 
)

Scaler module init helper function.

This Scaler init helper function will create all the data objects required to create the Scaler node

Parameters
[in]contextOpenVX context which must be created using vxCreateContext
[out]scalerObjScaler Module object which gets populated with Scaler node data objects
[in]objNameString of the name of this object
[in]num_chNumber of Scaler channels
[in]num_outputsNumber of Scaler outputs

◆ app_deinit_scaler()

void app_deinit_scaler ( ScalerObj obj)

Scaler module deinit helper function.

This Scaler deinit helper function will release all the data objects created during the app_init_scaler call

Parameters
[in,out]objScaler Module object which contains scaler node data objects which are released in this function

◆ app_delete_scaler()

void app_delete_scaler ( ScalerObj obj)

Scaler module delete helper function.

This scaler delete helper function will delete the scaler node and write node that is created during the app_create_graph_scaler call

Parameters
[in,out]objScaler Module object which contains scaler node objects which are released in this function

◆ app_create_graph_scaler()

vx_status app_create_graph_scaler ( vx_context  context,
vx_graph  graph,
ScalerObj scalerObj,
vx_object_array  input_img_arr 
)

Scaler module create helper function.

This scaler create helper function will create the node using all the data objects created during the app_init_scaler call. Internally calls app_create_graph_scaler_write_output if en_out_scaler_write is set

Parameters
[in]contextOpenVX context which must be created using vxCreateContext
[in]graphOpenVX graph that has been created using vxCreateGraph and where the scaler node is created
[in,out]scalerObjScaler Module object which contains scaler node and write node which are created in this function
[in]input_img_arrInput object array to Scaler node. Must be created separately using vxCreateObjectArray

◆ app_create_graph_scaler_write_output()

vx_status app_create_graph_scaler_write_output ( vx_graph  graph,
ScalerObj scalerObj,
vx_int32  output_idx 
)

Scaler module write output helper function.

This scaler create helper function will create the node for writing the scaler output

Parameters
[in]graphOpenVX graph that has been created using vxCreateGraph and where the scaler node is created
[in,out]scalerObjScaler Module object which contains the write node used in this function
[in]output_idxOutput index of scaler images to write

◆ app_send_cmd_scaler_write_node()

vx_status app_send_cmd_scaler_write_node ( ScalerObj scalerObj,
vx_uint32  start_frame,
vx_uint32  num_frames,
vx_uint32  num_skip 
)

Scaler module write output helper function.

This scaler create helper function will create the node for writing the scaler output

Parameters
[in]scalerObjScaler Module object which contains the write node used in this function
[in]start_frameStarting frame to write
[in]num_framesTotal number of frames to write
[in]num_skipNumber of capture frames to skip writing

◆ readScalerInput()

vx_status readScalerInput ( char *  file_name,
vx_object_array  img_arr,
vx_int32  read_mode,
vx_int32  ch_num 
)

Helper function to read image from file.

This scaler create helper function will read in the image from file into the provided image array

Parameters
[in]file_nameFull path to file to read
[out]img_arrObject array containing images which file is read in to
[in]read_modeRead mode; options are APP_MODULES_READ_FILE and APP_MODULES_READ_CHANNEL
[in]ch_numChannel number of array to write

◆ writeScalerOutput()

vx_status writeScalerOutput ( char *  file_name,
vx_object_array  img_arr 
)

Helper function to write image from file.

This scaler create helper function will write the image from OpenVX object array to the provided file path

Parameters
[in]file_nameFull path to file to write
[in]img_arrObject array containing images which file written from