pub struct QualityScore {
pub overall: f32,
pub blur: f32,
pub exposure: f32,
pub composition: f32,
pub technical: f32,
}Expand description
Overall quality assessment score.
Fields§
§overall: f32Overall quality (0.0 to 1.0).
blur: f32Blur quality score component.
exposure: f32Exposure quality score component.
composition: f32Composition quality score component.
technical: f32Technical quality score component.
Implementations§
Source§impl QualityScore
impl QualityScore
Sourcepub fn new(blur: f32, exposure: f32, composition: f32, technical: f32) -> Self
pub fn new(blur: f32, exposure: f32, composition: f32, technical: f32) -> Self
Create new quality score with components.
The overall score is a weighted average of individual components using
the standard (0.35, 0.35, 0.15, 0.15) weights.
Sourcepub fn new_weighted(
blur: f32,
exposure: f32,
composition: f32,
technical: f32,
weights: (f32, f32, f32, f32),
) -> Self
pub fn new_weighted( blur: f32, exposure: f32, composition: f32, technical: f32, weights: (f32, f32, f32, f32), ) -> Self
Create a quality score with explicit component weights.
weights are (blur, exposure, composition, technical); the overall score
is their normalized weighted average (weights need not sum to 1.0).
Sourcepub fn meets_threshold(&self, threshold: f32) -> bool
pub fn meets_threshold(&self, threshold: f32) -> bool
Check if quality meets minimum threshold.
Sourcepub fn get_grade(&self) -> QualityGrade
pub fn get_grade(&self) -> QualityGrade
Get descriptive quality grade.
Trait Implementations§
Source§impl Clone for QualityScore
impl Clone for QualityScore
Source§fn clone(&self) -> QualityScore
fn clone(&self) -> QualityScore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 QualityScore
impl Debug for QualityScore
Source§impl<'de> Deserialize<'de> for QualityScore
impl<'de> Deserialize<'de> for QualityScore
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 QualityScore
impl RefUnwindSafe for QualityScore
impl Send for QualityScore
impl Sync for QualityScore
impl Unpin for QualityScore
impl UnsafeUnpin for QualityScore
impl UnwindSafe for QualityScore
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<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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