Image decoding API of the ImageProcessor class. For details about the input and output formats, resolution ranges, and alignment modes, see Decode.
For details about how to use this API, see Image Decoding.
decode_bytes(data: bytes, dataSize: int, decodeFormat: image_format)
Parameter |
Type |
Description |
|---|---|---|
data |
bytes |
Binary data before decoding. |
dataSize |
int |
Valid length of the binary data. The value must be the same as the length of the input data. |
decodeFormat |
image_format enumerations |
Format of the decoded image. (This parameter does not need to be set when the PNG format is used for decoding.) The default value is base.nv12. |
Returns the decoded image class.
If the data type or length does not match, the decoding format is incorrect, or the decoding fails, a runtime exception is thrown.