The OpenVX Specification
dba1aa3
|
Converts image bit depth. The output image dimensions should be the same as the dimensions of the input image.
This kernel converts an image from some source bit-depth to another bit-depth as described by the table below. If the input value is unsigned the shift must be in zeros. If the input value is signed, the shift used must be an arithmetic shift. The columns in the table below are the output types and the rows are the input types. The API version on which conversion is supported is also listed. (An X denotes an invalid operation.)
I/O | U8 | U16 | S16 | U32 | S32 |
---|---|---|---|---|---|
U8 | X | 1.0 | |||
U16 | X | X | |||
S16 | 1.0 | X | X | ||
U32 | X | X | |||
S32 | X | X |
The table below identifies the conversion types for the allowed bith depth conversions.
From | To | Conversion Type |
---|---|---|
U8 | S16 | Up-conversion |
S16 | U8 | Down-conversion |
Down-conversions with VX_CONVERT_POLICY_WRAP
follow this equation:
Down-conversions with VX_CONVERT_POLICY_SATURATE
follow this equation:
Up-conversions ignore the policy and perform this operation:
The valid values for 'shift' are as specified below, all other values produce undefined behavior.
Functions | |
vx_node VX_API_CALL | vxConvertDepthNode (vx_graph graph, vx_image input, vx_image output, vx_enum policy, vx_scalar shift) |
[Graph] Creates a bit-depth conversion node. More... | |
vx_status VX_API_CALL | vxuConvertDepth (vx_context context, vx_image input, vx_image output, vx_enum policy, vx_int32 shift) |
[Immediate] Converts the input images bit-depth into the output image. More... | |
vx_node VX_API_CALL vxConvertDepthNode | ( | vx_graph | graph, |
vx_image | input, | ||
vx_image | output, | ||
vx_enum | policy, | ||
vx_scalar | shift | ||
) |
[Graph] Creates a bit-depth conversion node.
[in] | graph | The reference to the graph. |
[in] | input | The input image. |
[out] | output | The output image with the same dimensions of the input image. |
[in] | policy | A VX_TYPE_ENUM of the vx_convert_policy_e enumeration. |
[in] | shift | A scalar containing a VX_TYPE_INT32 of the shift value. |
vx_node
. vx_node | A node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus |
vx_status VX_API_CALL vxuConvertDepth | ( | vx_context | context, |
vx_image | input, | ||
vx_image | output, | ||
vx_enum | policy, | ||
vx_int32 | shift | ||
) |
[Immediate] Converts the input images bit-depth into the output image.
[in] | context | The reference to the overall context. |
[in] | input | The input image. |
[out] | output | The output image. |
[in] | policy | A VX_TYPE_ENUM of the vx_convert_policy_e enumeration. |
[in] | shift | A scalar containing a VX_TYPE_INT32 of the shift value. |
vx_status_e
enumeration. VX_SUCCESS | Success |
* | An error occurred. See vx_status_e .. |