pub enum EncodeError {
Show 27 variants
InvalidCanvasSize(CanvasSize),
ConfigInitialization,
InvalidQuality {
value: f32,
},
InvalidMethod {
value: u8,
},
InvalidAlphaQuality {
value: u8,
},
InvalidPreprocessing {
value: u8,
},
InvalidFilterStrength {
value: i32,
},
InvalidFilterSharpness {
value: i32,
},
InvalidFilterType {
value: i32,
},
IncompleteKeyframeInterval {
kmin: Option<i32>,
kmax: Option<i32>,
},
InvalidKeyframeInterval {
kmin: i32,
kmax: i32,
},
NonCanonicalKeyframeMode {
kmin: i32,
kmax: i32,
},
KeyframeIntervalBelowMinimum {
kmin: i32,
minimum: i32,
kmax: i32,
},
KeyframeIntervalTooWide {
kmin: i32,
kmax: i32,
maximum_span: i32,
},
KeyframeIntervalIgnoredByMinimizeSize,
LibwebpConfigRejected,
EncoderOptionsInitialization,
EncoderCreation,
NoFrames,
UnexpectedFrameCanvas {
actual: CanvasSize,
expected: CanvasSize,
},
InvalidFrameBufferLength {
actual: usize,
expected: usize,
},
NonMillisecondDuration(Duration),
TimestampOverflow,
FrameCountOverflow,
PictureInitialization,
PictureImport,
Libwebp(String),
}Expand description
Failure to create or use an AnimationEncoder.
Variants§
InvalidCanvasSize(CanvasSize)
The encoder canvas has a zero dimension or cannot be represented by libwebp.
ConfigInitialization
libwebp could not initialize its encoding configuration.
InvalidQuality
The lossy quality override is outside 0.0..=100.0 or is not finite.
InvalidMethod
The encoding method is outside libwebp’s 0..=6 range.
InvalidAlphaQuality
The alpha quality is outside libwebp’s 0..=100 range.
InvalidPreprocessing
The preprocessing mode is outside libwebp’s 0..=2 range.
InvalidFilterStrength
The filter strength is outside libwebp’s 0..=100 range.
InvalidFilterSharpness
The filter sharpness is outside libwebp’s 0..=7 range.
InvalidFilterType
The filter type is outside libwebp’s 0..=1 range.
IncompleteKeyframeInterval
Only one of kmin and kmax was supplied.
Fields
InvalidKeyframeInterval
kmin is negative or is not smaller than kmax.
NonCanonicalKeyframeMode
A special key-frame mode was not expressed as (0, 0) or (0, 1).
KeyframeIntervalBelowMinimum
kmin is below libwebp’s required minimum for the selected kmax.
Fields
KeyframeIntervalTooWide
The key-frame interval is wider than libwebp permits.
Fields
KeyframeIntervalIgnoredByMinimizeSize
Key-frame intervals cannot be combined with minimize_size = Some(true).
LibwebpConfigRejected
libwebp rejected an otherwise locally valid configuration.
EncoderOptionsInitialization
libwebp could not initialize animation encoder options.
EncoderCreation
libwebp could not create the animation encoder.
NoFrames
AnimationEncoder::finish was called before adding a frame.
UnexpectedFrameCanvas
A frame canvas differs from the encoder canvas.
Fields
actual: CanvasSizeCanvas supplied by the caller.
expected: CanvasSizeCanvas required by the encoder.
InvalidFrameBufferLength
A frame buffer is not tightly packed RGBA8 for the encoder canvas.
Fields
NonMillisecondDuration(Duration)
A frame duration is not an exact whole number of milliseconds.
TimestampOverflow
Cumulative frame duration exceeds libwebp’s timestamp range.
FrameCountOverflow
The number of added frames exceeds u32.
PictureInitialization
libwebp could not initialize a frame picture.
PictureImport
libwebp could not import RGBA pixels into a frame picture.
Libwebp(String)
libwebp reported an encoding error message.
Trait Implementations§
Source§impl Clone for EncodeError
impl Clone for EncodeError
Source§fn clone(&self) -> EncodeError
fn clone(&self) -> EncodeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncodeError
impl Debug for EncodeError
Source§impl Display for EncodeError
impl Display for EncodeError
Source§impl Error for EncodeError
impl Error for EncodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()