pub struct ImageReport {
pub name: String,
pub source_path: Option<PathBuf>,
pub width: u32,
pub height: u32,
pub uncompressed_size: usize,
pub results: Vec<CodecResult>,
pub timestamp: DateTime<Utc>,
}Expand description
Report for a single image evaluated across multiple codecs and quality levels.
Fields§
§name: StringImage name or identifier.
source_path: Option<PathBuf>Path to the source image.
width: u32Image dimensions.
height: u32§uncompressed_size: usizeUncompressed image size in bytes (estimated).
results: Vec<CodecResult>Results for each codec/quality combination.
timestamp: DateTime<Utc>When this report was generated.
Implementations§
Source§impl ImageReport
impl ImageReport
Sourcepub fn results_for_codec(
&self,
codec_id: &str,
) -> impl Iterator<Item = &CodecResult>
pub fn results_for_codec( &self, codec_id: &str, ) -> impl Iterator<Item = &CodecResult>
Get results for a specific codec.
Sourcepub fn best_at_size(&self, max_bytes: usize) -> Option<&CodecResult>
pub fn best_at_size(&self, max_bytes: usize) -> Option<&CodecResult>
Get the best result (highest quality metric) at or below a target file size.
Sourcepub fn smallest_at_quality(&self, max_dssim: f64) -> Option<&CodecResult>
pub fn smallest_at_quality(&self, max_dssim: f64) -> Option<&CodecResult>
Get the smallest file that achieves at least the target quality.
Trait Implementations§
Source§impl Clone for ImageReport
impl Clone for ImageReport
Source§fn clone(&self) -> ImageReport
fn clone(&self) -> ImageReport
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 ImageReport
impl Debug for ImageReport
Source§impl<'de> Deserialize<'de> for ImageReport
impl<'de> Deserialize<'de> for ImageReport
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 ImageReport
impl RefUnwindSafe for ImageReport
impl Send for ImageReport
impl Sync for ImageReport
impl Unpin for ImageReport
impl UnwindSafe for ImageReport
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