The OpenVX Specification  a73e458
Pixel-wise Multiplication

Detailed Description

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 [R00097]. 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 [R00098]. It is otherwise VX_DF_IMAGE_S16 [R00099]. If one of the input images is of type VX_DF_IMAGE_S16, all values are converted to VX_DF_IMAGE_S16 [R00100].

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 [R00101]. 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 [R00102]. For the scale with value of \( {1}/{2^n} \) the rounding policy of VX_ROUND_POLICY_TO_ZERO must be supported [R00103]. 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 [R00104]:

\[ reference(x,y,scale) = truncate(((int32\_t)in_1(x,y)) * ((int32\_t)in_2(x,y)) * (double)scale) \]

The rounding policy VX_ROUND_POLICY_TO_NEAREST_EVEN for this function is defined as [R00105]:

\[ reference(x,y,scale) = round\_to\_nearest\_even(((int32\_t)in_1(x,y)) * ((int32\_t)in_2(x,y)) * (double)scale) \]

The overflow handling is controlled by an overflow-policy parameter [R00106]. For each pixel value in the two input images:

\[ out(x,y) = in_1(x,y) * in_2(x,y) * scale \]

Functions

vx_node VX_API_CALL 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...
 

Function Documentation

◆ vxMultiplyNode()

vx_node VX_API_CALL 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.

Parameters
[in]graphThe reference to the graph [R00312].
[in]in1An input image, VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 [R00313].
[in]in2An input image, VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 [R00314].
[in]scaleA non-negative VX_TYPE_FLOAT32 multiplied to each product before overflow handling [R00315].
[in]overflow_policyUse a The Conversion Policy Enumeration. value [R00316].
[in]rounding_policyUse a The Round Policy Enumeration. value [R00317].
[out]outThe output image, a VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 image [R00318].
Returns
vx_node [R00319].
Return values
vx_nodeA node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus