Skip to main content

EncodeError

Enum EncodeError 

Source
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.

Fields

§value: f32

Rejected quality value.

§

InvalidMethod

The encoding method is outside libwebp’s 0..=6 range.

Fields

§value: u8

Rejected method value.

§

InvalidAlphaQuality

The alpha quality is outside libwebp’s 0..=100 range.

Fields

§value: u8

Rejected alpha quality value.

§

InvalidPreprocessing

The preprocessing mode is outside libwebp’s 0..=2 range.

Fields

§value: u8

Rejected preprocessing mode.

§

InvalidFilterStrength

The filter strength is outside libwebp’s 0..=100 range.

Fields

§value: i32

Rejected filter strength.

§

InvalidFilterSharpness

The filter sharpness is outside libwebp’s 0..=7 range.

Fields

§value: i32

Rejected filter sharpness.

§

InvalidFilterType

The filter type is outside libwebp’s 0..=1 range.

Fields

§value: i32

Rejected filter type.

§

IncompleteKeyframeInterval

Only one of kmin and kmax was supplied.

Fields

§kmin: Option<i32>

Supplied minimum key-frame interval.

§kmax: Option<i32>

Supplied maximum key-frame interval.

§

InvalidKeyframeInterval

kmin is negative or is not smaller than kmax.

Fields

§kmin: i32

Supplied minimum key-frame interval.

§kmax: i32

Supplied maximum key-frame interval.

§

NonCanonicalKeyframeMode

A special key-frame mode was not expressed as (0, 0) or (0, 1).

Fields

§kmin: i32

Supplied minimum key-frame interval.

§kmax: i32

Supplied maximum key-frame interval.

§

KeyframeIntervalBelowMinimum

kmin is below libwebp’s required minimum for the selected kmax.

Fields

§kmin: i32

Supplied minimum key-frame interval.

§minimum: i32

Required minimum key-frame interval.

§kmax: i32

Supplied maximum key-frame interval.

§

KeyframeIntervalTooWide

The key-frame interval is wider than libwebp permits.

Fields

§kmin: i32

Supplied minimum key-frame interval.

§kmax: i32

Supplied maximum key-frame interval.

§maximum_span: i32

Maximum permitted kmax - kmin span.

§

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: CanvasSize

Canvas supplied by the caller.

§expected: CanvasSize

Canvas required by the encoder.

§

InvalidFrameBufferLength

A frame buffer is not tightly packed RGBA8 for the encoder canvas.

Fields

§actual: usize

Actual frame buffer size in bytes.

§expected: usize

Required frame buffer size in bytes.

§

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

Source§

fn clone(&self) -> EncodeError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for EncodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for EncodeError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for EncodeError

Source§

fn eq(&self, other: &EncodeError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EncodeError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.