AnimationTraitConst

Trait AnimationTraitConst 

Source
pub trait AnimationTraitConst {
    // Required method
    fn as_raw_Animation(&self) -> *const c_void;

    // Provided methods
    fn loop_count(&self) -> i32 { ... }
    fn bgcolor(&self) -> Scalar { ... }
    fn durations(&self) -> Vector<i32> { ... }
    fn frames(&self) -> Vector<Mat> { ... }
    fn still_image(&self) -> Mat { ... }
}
Expand description

Constant methods for crate::imgcodecs::Animation

Required Methods§

Provided Methods§

Source

fn loop_count(&self) -> i32

Number of times the animation should loop. 0 means infinite looping.

Note: At some file format, when N is set, whether it is displayed N or N+1 times depends on the implementation of the user application. This loop times behaviour has not been documented clearly. * - (GIF) See https://issues.chromium.org/issues/40459899 * And animated GIF with loop is extended with the Netscape Application Block(NAB), which it not a part of GIF89a specification. See https://en.wikipedia.org/wiki/GIF[animated_gif] . * - (WebP) See https://issues.chromium.org/issues/41276895

Source

fn bgcolor(&self) -> Scalar

Background color of the animation in BGRA format.

Source

fn durations(&self) -> Vector<i32>

Duration for each frame in milliseconds.

Note: (GIF) Due to file format limitation * - Durations must be multiples of 10 milliseconds. Any provided value will be rounded down to the nearest 10ms (e.g., 88ms → 80ms). * - 0ms(or smaller than expected in user application) duration may cause undefined behavior, e.g. it is handled with default duration. * - Over 65535 * 10 milliseconds duration is not supported.

Source

fn frames(&self) -> Vector<Mat>

Vector of frames, where each Mat represents a single frame.

Source

fn still_image(&self) -> Mat

image that can be used for the format in addition to the animation or if animation is not supported in the reader (like in PNG).

Implementors§