pub struct CodecResult {
pub codec_id: String,
pub codec_version: String,
pub quality: f64,
pub file_size: usize,
pub bits_per_pixel: f64,
pub encode_time: Duration,
pub decode_time: Option<Duration>,
pub metrics: MetricResult,
pub perception: Option<PerceptionLevel>,
pub cached_path: Option<PathBuf>,
pub codec_params: HashMap<String, String>,
}Expand description
Result from evaluating a single codec on a single image at a single quality.
Fields§
§codec_id: StringCodec identifier.
codec_version: StringCodec version string.
quality: f64Quality setting used.
file_size: usizeEncoded file size in bytes.
bits_per_pixel: f64Bits per pixel of the encoded image.
encode_time: DurationEncoding time.
decode_time: Option<Duration>Decoding time (if decoder was provided).
metrics: MetricResultQuality metrics comparing decoded to reference.
perception: Option<PerceptionLevel>Perception level based on metrics.
cached_path: Option<PathBuf>Path to cached encoded file (if caching enabled).
codec_params: HashMap<String, String>Additional codec-specific parameters used.
Implementations§
Source§impl CodecResult
impl CodecResult
Sourcepub fn compression_ratio(&self, original_size: usize) -> f64
pub fn compression_ratio(&self, original_size: usize) -> f64
Calculate compression ratio (original size / encoded size).
Trait Implementations§
Source§impl Clone for CodecResult
impl Clone for CodecResult
Source§fn clone(&self) -> CodecResult
fn clone(&self) -> CodecResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodecResult
impl Debug for CodecResult
Source§impl<'de> Deserialize<'de> for CodecResult
impl<'de> Deserialize<'de> for CodecResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CodecResult
impl RefUnwindSafe for CodecResult
impl Send for CodecResult
impl Sync for CodecResult
impl Unpin for CodecResult
impl UnwindSafe for CodecResult
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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