imencode_with_metadata

Function imencode_with_metadata 

Source
pub fn imencode_with_metadata(
    ext: &str,
    img: &impl ToInputArray,
    metadata_types: &Vector<i32>,
    metadata: &impl ToInputArray,
    buf: &mut Vector<u8>,
    params: &Vector<i32>,
) -> Result<bool>
Expand description

Encodes an image into a memory buffer.

The function imencode compresses the image and stores it in the memory buffer that is resized to fit the result. See cv::imwrite for the list of supported formats and flags description.

§Parameters

  • ext: File extension that defines the output format. Must include a leading period.
  • img: Image to be compressed.
  • metadataTypes: Vector with types of metadata chucks stored in metadata to write, see ImageMetadataType.
  • metadata: Vector of vectors or vector of matrices with chunks of metadata to store into the file
  • buf: Output buffer resized to fit the compressed image.
  • params: Format-specific parameters. See cv::imwrite and cv::ImwriteFlags.

§C++ default parameters

  • params: std::vector()