pub enum JpegEncodeError {
EmptyDimensions,
DimensionsTooLarge {
width: u32,
height: u32,
},
SampleLength {
expected: usize,
actual: usize,
},
MemoryCapExceeded {
requested: usize,
cap: usize,
},
HostAllocationFailed {
bytes: usize,
},
IncompatibleSubsampling {
subsampling: JpegSubsampling,
samples: &'static str,
},
InvalidRestartInterval,
UnsupportedBackend {
backend: JpegBackend,
},
SegmentTooLarge {
name: &'static str,
},
MissingHuffmanCode {
symbol: u8,
},
InvalidDctImage {
reason: JpegDctImageError,
},
InternalInvariant {
reason: &'static str,
},
}Expand description
Errors produced by baseline JPEG encoding.
Variants§
EmptyDimensions
Width or height was zero.
DimensionsTooLarge
JPEG baseline SOF dimensions exceed the 16-bit marker fields.
SampleLength
Input sample buffer length does not match width, height, and format.
MemoryCapExceeded
A sample layout or encoded output exceeds the shared host allocation cap.
Fields
HostAllocationFailed
A required host buffer could not reserve its capacity.
IncompatibleSubsampling
Requested subsampling is incompatible with the supplied sample format.
Fields
subsampling: JpegSubsamplingRequested output sampling.
InvalidRestartInterval
Restart interval was explicitly set to zero.
UnsupportedBackend
Requested backend is not available in this crate.
Fields
backend: JpegBackendRequested backend.
SegmentTooLarge
A marker segment would exceed the JPEG 16-bit length field.
MissingHuffmanCode
Encoder attempted to emit a symbol absent from the active Huffman table.
InvalidDctImage
Caller-supplied coefficient-domain input cannot be re-emitted as baseline JPEG.
Fields
reason: JpegDctImageErrorTyped invalid-input reason.
InternalInvariant
A heap-free diagnostic for an impossible encoder state.
Trait Implementations§
Source§impl Clone for JpegEncodeError
impl Clone for JpegEncodeError
Source§fn clone(&self) -> JpegEncodeError
fn clone(&self) -> JpegEncodeError
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 JpegEncodeError
impl Debug for JpegEncodeError
Source§impl Display for JpegEncodeError
impl Display for JpegEncodeError
Source§impl Error for JpegEncodeError
impl Error for JpegEncodeError
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()
Auto Trait Implementations§
impl Freeze for JpegEncodeError
impl RefUnwindSafe for JpegEncodeError
impl Send for JpegEncodeError
impl Sync for JpegEncodeError
impl Unpin for JpegEncodeError
impl UnsafeUnpin for JpegEncodeError
impl UnwindSafe for JpegEncodeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more