[][src]Function opencv::imgcodecs::imdecode_to

pub fn imdecode_to(
    buf: &dyn ToInputArray,
    flags: i32,
    dst: &mut Mat
) -> Result<Mat>

Reads an image from a buffer in memory.

The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or contains invalid data, the function returns an empty matrix ( Mat::data==NULL ).

See cv::imread for the list of supported formats and flags description.

Note: In the case of color images, the decoded images will have the channels stored in B G R order.

Parameters

  • buf: Input array or vector of bytes.
  • flags: The same flags as in cv::imread, see cv::ImreadModes.

Overloaded parameters

  • buf:
  • flags:
  • dst: The optional output placeholder for the decoded matrix. It can save the image reallocations when the function is called repeatedly for images of the same size.