Composite Class Reference#
3 min read time
Class for managing the Composite operator. More...
#include <op_composite.hpp>

Public Member Functions | |
Composite () | |
void | operator() (hipStream_t stream, const Tensor &foreground, const Tensor &background, const Tensor &mask, const Tensor &output, const eDeviceType device=eDeviceType::GPU) const |
Executes the Composite operation on the given HIP stream. Compositing blends the foreground image into the background image using the values in a grayscale alpha mask. More... | |
~Composite () | |
![]() | |
virtual | ~IOperator () |
Detailed Description
Class for managing the Composite operator.
Constructor & Destructor Documentation
◆ Composite()
|
inline |
◆ ~Composite()
|
inline |
Member Function Documentation
◆ operator()()
void roccv::Composite::operator() | ( | hipStream_t | stream, |
const Tensor & | foreground, | ||
const Tensor & | background, | ||
const Tensor & | mask, | ||
const Tensor & | output, | ||
const eDeviceType | device = eDeviceType::GPU |
||
) | const |
Executes the Composite operation on the given HIP stream. Compositing blends the foreground image into the background image using the values in a grayscale alpha mask.
Limitations:
Foreground: Supported TensorLayout(s): [NHWC, HWC] Channels: [3] Supported DataType(s): [U8, F32] Notes: Must be the same shape and datatype as the background tensor.
Background: Supported TensorLayout(s): [NHWC, HWC] Channels: [3] Supported DataTypes(s): [U8, F32] Notes: Must be the same shape and datatype as the foreground tensor.
Mask: Supported TensorLayout(s): [NHWC, HWC] Channels: [1] Supported DataTypes(s): [U8, F32] Notes: Must be the same shape as the foreground/background tensor. Can use any of the supported datatypes.
Output: Supported TensorLayout(s): [NHWC, HWC] Channels: [3, 4] Supported DataTypes(s): [U8, F32] Notes: Must be the same layout as the foreground/background/mask tensor. If 4 channels are selected, an alpha channel will be created with its value at 100%. Any of the supported datatypes can be used. This will convert the foreground/background images into the output datatype if they differ.
Input/Output dependency:
Property | Input == Output -------------- | ------------- TensorLayout | Yes DataType | No Channels | No Width | Yes Height | Yes Batch | Yes
- Parameters
-
[in] stream The HIP stream to run this operation on. [in] foreground Foreground images. [in] background Background images. [in] mask Greyscale mask image for the foreground. Must be a 1-channel grayscale image matching the datatype of the foreground and background images. [out] output Output tensor. If 4-channel, the alpha channel will be set to the max value, resulting in a RGBA/BGRA image (depending on the layout of the input images). [in] device The device to run this operation on. Default is GPU.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/op_composite.hpp