[][src]Enum screen_13::gpu::BlendMode

pub enum BlendMode {
    Add,
    AlphaAdd,
    ColorBurn,
    ColorDodge,
    Color,
    Darken,
    DarkerColor,
    Difference,
    Divide,
    Exclusion,
    HardLight,
    HardMix,
    LinearBurn,
    Multiply,
    Normal,
    Overlay,
    Screen,
    Subtract,
    VividLight,
}

Specifies a method for combining two images using a mathmatical formula.

Variants

Add

Blend formula: a + b

AlphaAdd

Blend formula:

ColorBurn

Blend formula: 1 - (1 - a) / b

ColorDodge

Blend formula: a / (1 - b)

Color

Blend formula:

Darken

Blend formula: min(a, b)

DarkerColor

Blend formula: min(a, b) (per-component)

Difference

Blend formula: abs(a - b)

Divide

Blend formula: a / b

Exclusion

Blend formula: a + b - 2 * a * b

HardLight

Blend formula: hard_light(a, b) (per-component)

Where:

  • hard_light(a, b) = if b < 0.5 { 2 * a * b } else { 1 - 2 * (1 - a) * (1 - b) }
HardMix

Blend formula: hard_mix(a, b) (per-component)

Where:

  • hard_mix(a, b) = if b < 0.5 { 2 * a * b } else { 1 - 2 * (1 - a) * (1 - b) }
LinearBurn

Blend formula: a + b - 1

Multiply

Blend formula: a * b

Normal

Blend formula: b

NOTE: This is the default blend mode.

Overlay

Blend formula: overlay(a, b) (per-component)

Where:

  • overlay(a, b) = if b < 0.5 { 2 * a * b } else { 1 - 2 * (1 - a) * (1 - b) }
Screen

Blend formula: 1 - (1 - a) * (1 - b)

Subtract

Blend formula: a - b

VividLight

Blend formula: vivid_light(a, b) (per-component)

Where:

  • vivid_light(a, b) = if b < 0.5 { 1 - (1 - a) / b } else { a / (1 - b) }

Trait Implementations

impl Clone for BlendMode[src]

impl Copy for BlendMode[src]

impl Debug for BlendMode[src]

impl Default for BlendMode[src]

impl Eq for BlendMode[src]

impl Hash for BlendMode[src]

impl PartialEq<BlendMode> for BlendMode[src]

impl StructuralEq for BlendMode[src]

impl StructuralPartialEq for BlendMode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.