The OpenVX Specification
r28647
|
Performs element-wise multiplication between two images and a scalar value.
Pixel-wise multiplication is performed between the pixel values in two VX_DF_IMAGE_U8
or VX_DF_IMAGE_S16
images and a scalar floating-point number scale. The output image can be VX_DF_IMAGE_U8
only if both source images are VX_DF_IMAGE_U8
and the output image is explicitly set to VX_DF_IMAGE_U8
. It is otherwise VX_DF_IMAGE_S16
. If one of the input images is of type VX_DF_IMAGE_S16
, all values are converted to VX_DF_IMAGE_S16
.
The scale with a value of \( {1}/{2^n} \), where n is an integer and \( 0 \le n \le 15 \), and 1/255 (0x1.010102p-8 C99 float hex) must be supported. The support for other values of scale is not prohibited. Furthermore, for scale with a value of 1/255 the rounding policy of VX_ROUND_POLICY_TO_NEAREST_EVEN
must be supported whereas for the scale with value of \( {1}/{2^n} \) the rounding policy of VX_ROUND_POLICY_TO_ZERO
must be supported. The support of other rounding modes for any values of scale is not prohibited.
The rounding policy VX_ROUND_POLICY_TO_ZERO
for this function is defined as:
\[ reference(x,y,scale) = truncate(((int32_t)in1(x,y)) * ((int32_t)in2(x,y)) * (double)scale) \]
The rounding policy VX_ROUND_POLICY_TO_NEAREST_EVEN
for this function is defined as:
\[ reference(x,y,scale) = round_to_nearest_even(((int32_t)in1(x,y)) * ((int32_t)in2(x,y)) * (double)scale) \]
The overflow handling is controlled by an overflow-policy parameter. For each pixel value in the two input images:
\[ out(x,y) = in_1(x,y) in_2(x,y) scale \]
Functions | |
vx_node | vxMultiplyNode (vx_graph graph, vx_image in1, vx_image in2, vx_scalar scale, vx_enum overflow_policy, vx_enum rounding_policy, vx_image out) |
[Graph] Creates an pixelwise-multiplication node. More... | |
vx_status | vxuMultiply (vx_context context, vx_image in1, vx_image in2, vx_float32 scale, vx_enum overflow_policy, vx_enum rounding_policy, vx_image out) |
[Immediate] Performs elementwise multiplications on pixel values in the input images and a scale. More... | |
vx_node vxMultiplyNode | ( | vx_graph | graph, |
vx_image | in1, | ||
vx_image | in2, | ||
vx_scalar | scale, | ||
vx_enum | overflow_policy, | ||
vx_enum | rounding_policy, | ||
vx_image | out | ||
) |
[Graph] Creates an pixelwise-multiplication node.
[in] | graph | The reference to the graph. |
[in] | in1 | An input image, VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 . |
[in] | in2 | An input image, VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 . |
[in] | scale | A non-negative VX_TYPE_FLOAT32 multiplied to each product before overflow handling. |
[in] | overflow_policy | A VX_TYPE_ENUM of the vx_convert_policy_e enumeration. |
[in] | rounding_policy | A VX_TYPE_ENUM of the vx_round_policy_e enumeration. |
[out] | out | The output image, a VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 image. |
vx_node
. 0 | Node could not be created. |
* | Node handle. |
vx_status vxuMultiply | ( | vx_context | context, |
vx_image | in1, | ||
vx_image | in2, | ||
vx_float32 | scale, | ||
vx_enum | overflow_policy, | ||
vx_enum | rounding_policy, | ||
vx_image | out | ||
) |
[Immediate] Performs elementwise multiplications on pixel values in the input images and a scale.
[in] | context | The reference to the overall context. |
[in] | in1 | A VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 input image. |
[in] | in2 | A VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 input image. |
[in] | scale | The scale value. |
[in] | overflow_policy | A vx_convert_policy_e enumeration. |
[in] | rounding_policy | A vx_round_policy_e enumeration. |
[out] | out | The output image in VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 format. |
vx_status_e
enumeration. VX_SUCCESS | Success |
* | An error occurred. See vx_status_e . |