AnimationTrait

Trait AnimationTrait 

Source
pub trait AnimationTrait: AnimationTraitConst {
    // Required method
    fn as_raw_mut_Animation(&mut self) -> *mut c_void;

    // Provided methods
    fn set_loop_count(&mut self, val: i32) { ... }
    fn set_bgcolor(&mut self, val: Scalar) { ... }
    fn set_durations(&mut self, val: Vector<i32>) { ... }
    fn set_frames(&mut self, val: Vector<Mat>) { ... }
    fn set_still_image(&mut self, val: Mat) { ... }
}
Expand description

Mutable methods for crate::imgcodecs::Animation

Required Methods§

Provided Methods§

Source

fn set_loop_count(&mut self, val: 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 set_bgcolor(&mut self, val: Scalar)

Background color of the animation in BGRA format.

Source

fn set_durations(&mut self, val: 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 set_frames(&mut self, val: Vector<Mat>)

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

Source

fn set_still_image(&mut self, val: 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§