imreadanimation
import { imreadanimation } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
example: samples/cpp/tutorial_code/imgcodecs/animations.cpp
An example to show usage of cv::imreadanimation and cv::imwriteanimation functions.
Check tutorial_animations "the corresponding tutorial" for more details
Loads frames from an animated image file into an Animation structure.
The function imreadanimation loads frames from an animated image file (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.
imreadanimation(filename: EmbindString, animation: Animation, start: number, count: number): boolean;3 available overloads
imreadanimation(filename: EmbindString, animation: Animation): boolean;imreadanimation(filename: EmbindString, animation: Animation, start: number): boolean;imreadanimation(filename: EmbindString, animation: Animation, start: number, count: number): boolean;filenameA string containing the path to the file.
animationOutput destination, filled by the native operation. A reference to an Animation structure where the loaded frames will be stored. It should be initialized before the function is called.
startThe index of the first frame to load. This is optional and defaults to 0.
countThe number of frames to load. This is optional and defaults to 32767.
Returns true if the file was successfully loaded and frames were extracted; returns 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.