Table of Contents

Method ImEncodeWithMetadata

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

ImEncodeWithMetadata(string, InputArray, ImageMetadataType[], IEnumerable<Mat>, out byte[], int[]?)

Compresses the image into a memory buffer, additionally encoding metadata if the corresponding format supports it.

public static bool ImEncodeWithMetadata(string ext, InputArray img, ImageMetadataType[] metadataTypes, IEnumerable<Mat> metadata, out byte[] buf, int[]? prms = null)

Parameters

ext string

The file extension that defines the output format

img InputArray

The image to be written

metadataTypes ImageMetadataType[]

Array with types of metadata chunks stored in metadata to write.

metadata IEnumerable<Mat>

Array of matrices with chunks of metadata to store into the file.

buf byte[]

Output buffer resized to fit the compressed image.

prms int[]

Format-specific parameters.

Returns

bool