Image

Function Usage

Constructor of the Image class.

If the construction fails due to insufficient memory or unidentified processor, an exception occurs.

Prototype

Image();
Image(const std::shared_ptr<uint8_t> imageData, const uint32_t dataSize, const int32_t deviceId = -1,
      const Size imageSize = DEFAULT_IMAGE_SIZE, const ImageFormat format = ImageFormat::YUV_SP_420);

Parameter Description

Parameter

Input/Output

Description

imageData

Input

Input memory constructed by the user. The memory is allocated and destroyed by the user.

dataSize

Input

Size of the memory input by the user. The value must be the same as the actual size of the memory data.

imageSize

Input

Image height and width. The default value is (0, 0).

If the memory on the device is allocated by the user, set the value based on the actual memory data.

format

Input

Image decoding mode. The default value is ImageFormat::YUV_SP_420.

deviceId

Input

ID of the device where the user inputs memory The default value is -1, indicating the host. If the memory on the device is allocated by the user, enter the corresponding device ID.

Value range: [-1, Number of identified devices -1].