Skip to main content

ChromaStats

Struct ChromaStats 

Source
pub struct ChromaStats {
    pub mean_abs_dy: f32,
    pub mean_dy: f32,
    pub mean_abs_di: f32,
    pub mean_abs_dq: f32,
    pub mean_abs_dc: f32,
    pub chroma_cos: f32,
    pub sat1: f32,
    pub sat2: f32,
    pub chroma_rough: f32,
}
Expand description

Chroma-plane statistics of the changed pixels, all normalized to 255. Separates recolors (coherent, smooth chroma movement) from content replacements (scattered chroma) on photographic edits where luminance correlation alone saturates.

Fields§

§mean_abs_dy: f32

Mean |ΔY| (luminance delta magnitude).

§mean_dy: f32

Signed mean ΔY — a recolor often pushes luminance consistently in one direction, while a replacement balances out.

§mean_abs_di: f32

Mean |ΔI|.

§mean_abs_dq: f32

Mean |ΔQ|.

§mean_abs_dc: f32

Mean chroma-delta magnitude √(ΔI²+ΔQ²).

§chroma_cos: f32

Cosine between the chroma vectors of img1 and img2, weighted by their magnitudes. Near 1 = same hues, negative = coherent hue rotation.

§sat1: f32

Mean chroma magnitude (saturation) in img1.

§sat2: f32

Mean chroma magnitude in img2.

§chroma_rough: f32

Roughness of the chroma-delta field: mean |∇|Δc|| between adjacent changed pixels over the std of |Δc|. Low = smooth recolor, high = patchy replacement.

Trait Implementations§

Source§

impl Clone for ChromaStats

Source§

fn clone(&self) -> Self

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 Copy for ChromaStats

Source§

impl Debug for ChromaStats

Source§

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

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

impl<'de> Deserialize<'de> for ChromaStats

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ChromaStats

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for ChromaStats

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ChromaStats

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.