VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

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

Detailed Description

The Flip Image Primitive.

This primitive flips the input image in one of three different ways:

\[ dst(y, x) = \left\{ \begin{array}{l l} src(height - y - 1, x) & if\; flip\_mode = NVX\_FLIP\_VERTICAL \\ src(y, width - x - 1) & if\; flip\_mode = NVX\_FLIP\_HORIZONTAL \\ src(height - y - 1, width - x - 1) & if\; flip\_mode = NVX\_FLIP\_BOTH \\ \end{array} \right. \]

The primitive uses the following identifiers:

Use Cases

The example scenarios of using the function are the following:

Example Code

vx_image src = vxCreateImage(context, 640, 480, VX_DF_IMAGE_U8);
vx_image dst = vxCreateImage(context, 640, 480, VX_DF_IMAGE_U8);
vx_enum flip_mode = NVX_FLIP_BOTH;
nvxuFlipImage(context, src, dst, flip_mode);
vxReleaseContext(&context);

Enumerations

enum  nvx_flip_mode_e {
  NVX_FLIP_HORIZONTAL,
  NVX_FLIP_VERTICAL,
  NVX_FLIP_BOTH
}
 Defines modes for flip image operation. More...
 

Functions

vx_node nvxFlipImageNode (vx_graph graph, vx_image input, vx_image output, vx_enum flip_mode)
 [Graph] Flips the input image. More...
 
vx_status nvxuFlipImage (vx_context context, vx_image input, vx_image output, vx_enum flip_mode)
 [Immediate] Flips the input image. More...
 

Enumeration Type Documentation

Defines modes for flip image operation.

Enumerator
NVX_FLIP_HORIZONTAL 

Horizontal flipping of the image.

NVX_FLIP_VERTICAL 

Vertical flipping of the image.

NVX_FLIP_BOTH 

Simultaneous horizontal and vertical flipping of the image.

Definition at line 1039 of file nvx.h.

Function Documentation

vx_node nvxFlipImageNode ( vx_graph  graph,
vx_image  input,
vx_image  output,
vx_enum  flip_mode 
)

[Graph] Flips the input image.

Parameters
[in]graphSpecifies the graph.
[in]inputSpecifies the input image. Supported formats: VX_DF_IMAGE_U8, VX_DF_IMAGE_RGB, VX_DF_IMAGE_RGBX.
[out]outputSpecifies the output image. It should have the same size and format as the input image. Output size and format can be automatically determined for virtual images.
[in]flip_modeThe flipping mode (see nvx_flip_mode_e).
Returns
A valid node reference or an error object (use vxGetStatus).
vx_status nvxuFlipImage ( vx_context  context,
vx_image  input,
vx_image  output,
vx_enum  flip_mode 
)

[Immediate] Flips the input image.

Parameters
[in]contextSpecifies the context.
[in]inputSpecifies the input image. Supported formats: VX_DF_IMAGE_U8, VX_DF_IMAGE_RGB, VX_DF_IMAGE_RGBX.
[out]outputSpecifies the output image. It should have the same size and format as the input image.
[in]flip_modeThe flipping mode (see nvx_flip_mode_e).
Returns
A vx_status enumerator.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCESupplied parameters are not a valid references.
VX_ERROR_INVALID_PARAMETERSSupplied parameters are not valid.
VX_ERROR_INVALID_SCOPESupplied parameters are virtual objects, which can't be used in immediate mode.
VX_FAILUREInternal error in primitive implementation, check log for detailed information (Framework: Log).