imgcodecs library

Functions

haveImageReader(String filename) bool
Returns true if the specified image can be decoded by OpenCV.
haveImageWriter(String filename) bool
Returns true if an image with the specified filename can be encoded by OpenCV.
imcount(String filename, {int flags = IMREAD_ANYCOLOR}) int
Returns the number of images inside the give file.
imdecode(Uint8List buf, int flags, {Mat? dst}) Mat
imdecode reads an image from a buffer in memory. The function imdecode reads an image from the specified buffer in memory. If the buffer is too short or contains invalid data, the function returns an empty matrix. @param buf Input array or vector of bytes. @param flags The same flags as in cv::imread, see cv::ImreadModes.
imdecodeAsync(Uint8List buf, int flags, {Mat? dst}) Future<Mat>
async version of imdecode
imdecodeVec(VecUChar buf, int flags, {Mat? dst}) Mat
Same as imdecode but accepts VecUChar
imdecodeVecAsync(VecUChar vec, int flags, {Mat? dst}) Future<Mat>
Same as imdecodeAsync but accepts VecUChar
imencode(String ext, InputArray img, {VecI32? params}) → (bool, Uint8List)
imencode encodes an image Mat into a memory buffer. This function compresses the image and stores it in the returned memory buffer, using the image format passed in in the form of a file extension string.
imencodeAsync(String ext, InputArray img, {VecI32? params}) Future<(bool, Uint8List)>
async version of imencode
imencodeVec(String ext, InputArray img, {VecI32? params}) → (bool, VecUChar)
Same as imencode but returns VecUChar
imencodeVecAsync(String ext, InputArray img, {VecI32? params}) Future<(bool, VecUChar)>
Same as imencodeAsync but returns VecUChar
imread(String filename, {int flags = IMREAD_COLOR}) Mat
read an image from a file into a Mat. The flags param is one of the IMReadFlag flags. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty Mat.
imreadAsync(String filename, {int flags = IMREAD_COLOR}) Future<Mat>
async version of imread
imwrite(String filename, InputArray img, {VecI32? params}) bool
write a Mat to an image file.
imwriteAsync(String filename, InputArray img, {VecI32? params}) Future<bool>
async version of imwrite