pub fn imencodeanimation_def(
ext: &str,
animation: &impl AnimationTraitConst,
buf: &mut Vector<u8>,
) -> Result<bool>Expand description
Encodes an Animation to a memory buffer.
The function imencodeanimation encodes the provided Animation data into a memory buffer in an animated format. Supported formats depend on the implementation and may include formats like GIF, AVIF, APNG, or WEBP.
§Parameters
- ext: The file extension that determines the format of the encoded data.
- animation: A constant reference to an Animation struct containing the frames and metadata to be encoded.
- buf: A reference to a vector of unsigned chars where the encoded data will be stored.
- params: Optional format-specific parameters encoded as pairs (paramId_1,
paramValue_1, paramId_2, paramValue_2, …). These parameters are used to
specify additional options for the encoding process. Refer to
cv::ImwriteFlagsfor details on possible parameters.
§Returns
Returns true if the animation was successfully encoded; returns false otherwise.
§Note
This alternative version of imencodeanimation function uses the following default values for its arguments:
- params: std::vector
()