Skip to main content

Correction

Enum Correction 

Source
#[non_exhaustive]
pub enum Correction { BrightnessContrast { brightness: i32, contrast: i32, }, Levels(Vec<[f64; 5]>), ToneCurve(Vec<Vec<(f64, f64)>>), HueSaturationValue { hue: i32, saturation: i32, value: i32, }, ColorBalance { preserve_luminosity: bool, shadows: [i32; 3], midtones: [i32; 3], highlights: [i32; 3], }, Invert, Posterize(i32), Threshold(i32), GradientMap(Ramp), }
Expand description

The settings of a correction layer, by type.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BrightnessContrast

明るさ・コントラスト (type 1).

Fields

§brightness: i32

-100..100.

§contrast: i32

-100..100.

§

Levels(Vec<[f64; 5]>)

レベル補正 (type 2). Per slot: input black, gamma point, input white, output black, output white (0..1).

§

ToneCurve(Vec<Vec<(f64, f64)>>)

トーンカーブ (type 3). Per slot: control points (0..1).

§

HueSaturationValue

色相・彩度・明度 (type 4).

Fields

§hue: i32

Degrees.

§saturation: i32

-100..100.

§value: i32

-100..100.

§

ColorBalance

カラーバランス (type 5).

Fields

§preserve_luminosity: bool

輝度を保持.

§shadows: [i32; 3]

R, G, B shift of the shadows (-100..100).

§midtones: [i32; 3]

R, G, B shift of the midtones (-100..100).

§highlights: [i32; 3]

R, G, B shift of the highlights (-100..100).

§

Invert

階調の反転 (type 6).

§

Posterize(i32)

ポスタリゼーション (type 7): the number of levels.

§

Threshold(i32)

2値化 (type 8): the threshold.

§

GradientMap(Ramp)

グラデーションマップ (type 9).

Implementations§

Source§

impl Correction

Source

pub fn parse(data: &[u8]) -> Result<Self>

Parse a FilterLayerInfo blob.

Source

pub fn is_approximate(&self) -> bool

True when the result is an approximation: a gradient map in the 知覚的 mode.

Source

pub fn filter(&self) -> Filter<'_>

Prepare for applying to many pixels.

Trait Implementations§

Source§

impl Clone for Correction

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 Debug for Correction

Source§

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

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

impl PartialEq for Correction

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 StructuralPartialEq for Correction

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> 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.