haveImageWriter
import { haveImageWriter } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Checks if the specified image file or specified file extension can be encoded by OpenCV.
The function haveImageWriter checks if OpenCV is capable of writing images with the specified file extension. This can be useful for verifying support for a given image format before attempting to save an image.
Note: The function checks the availability of image codecs that are either built into OpenCV or dynamically loaded. It does not check for the actual existence of the file but rather the ability to write files of the given type.
See: cv::haveImageReader, cv::imwrite, cv::imencode
haveImageWriter(filename: EmbindString): boolean;filenameThe name of the file or the file extension (e.g., ".jpg", ".png"). It is recommended to provide the file extension rather than the full file name.
true if an image writer for the specified extension is available, false otherwise.
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.