imdecodeWithMetadata
import { imdecodeWithMetadata } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Reads an image from a memory buffer and extracts associated metadata.
This function decodes an image from the specified memory buffer. 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.
imdecodeWithMetadata(buf: Mat, metadataTypes: IntVector, metadata: MatVector, flags: number): Mat;bufInput array or vector of bytes containing the encoded image data.
metadataTypesOutput destination, filled by the native operation. Output vector with types of metadata chucks returned in metadata, see cv::ImageMetadataType
metadataOutput destination, filled by the native operation. Output vector of vectors or vector of matrices to store the retrieved metadata
flagsFlag that can take values of cv::ImreadModes.
The decoded image as a cv::Mat object. If decoding fails, the function returns an empty matrix. Release returned native handles with using or delete(), including handles nested in results.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.