[][src]Enum glium::BlendingFunction

pub enum BlendingFunction {
    AlwaysReplace,
    Min,
    Max,
    Addition {
        source: LinearBlendingFactor,
        destination: LinearBlendingFactor,
    },
    Subtraction {
        source: LinearBlendingFactor,
        destination: LinearBlendingFactor,
    },
    ReverseSubtraction {
        source: LinearBlendingFactor,
        destination: LinearBlendingFactor,
    },
}

Function that the GPU will use for blending.

Variants

AlwaysReplace

Simply overwrite the destination pixel with the source pixel.

The alpha channels are simply ignored. This is the default mode.

For example writing (0.5, 0.9, 0.4, 0.2) over (0.9, 0.1, 0.4, 0.3) will result in (0.5, 0.9, 0.4, 0.2).

Min

For each individual component (red, green, blue, and alpha), the minimum value is chosen between the source and the destination.

For example writing (0.5, 0.9, 0.4, 0.2) over (0.9, 0.1, 0.4, 0.3) will result in (0.5, 0.1, 0.4, 0.2).

Max

For each individual component (red, green, blue, and alpha), the maximum value is chosen between the source and the destination.

For example writing (0.5, 0.9, 0.4, 0.2) over (0.9, 0.1, 0.4, 0.3) will result in (0.9, 0.9, 0.4, 0.3).

Addition

For each individual component (red, green, blue, and alpha), a weighted addition between the source and the destination.

The result is equal to source_component * source_factor + dest_component * dest_factor, where source_factor and dest_factor are the values of source and destination of this enum.

Fields of Addition

source: LinearBlendingFactor

The factor to apply to the source pixel.

destination: LinearBlendingFactor

The factor to apply to the destination pixel.

Subtraction

For each individual component (red, green, blue, and alpha), a weighted subtraction of the source by the destination.

The result is equal to source_component * source_factor - dest_component * dest_factor, where source_factor and dest_factor are the values of source and destination of this enum.

Fields of Subtraction

source: LinearBlendingFactor

The factor to apply to the source pixel.

destination: LinearBlendingFactor

The factor to apply to the destination pixel.

ReverseSubtraction

For each individual component (red, green, blue, and alpha), a weighted subtraction of the destination by the source.

The result is equal to -source_component * source_factor + dest_component * dest_factor, where source_factor and dest_factor are the values of source and destination of this enum.

Fields of ReverseSubtraction

source: LinearBlendingFactor

The factor to apply to the source pixel.

destination: LinearBlendingFactor

The factor to apply to the destination pixel.

Trait Implementations

impl Clone for BlendingFunction[src]

impl Copy for BlendingFunction[src]

impl Debug for BlendingFunction[src]

impl Eq for BlendingFunction[src]

impl PartialEq<BlendingFunction> for BlendingFunction[src]

impl StructuralEq for BlendingFunction[src]

impl StructuralPartialEq for BlendingFunction[src]

Auto Trait Implementations

impl RefUnwindSafe for BlendingFunction

impl Send for BlendingFunction

impl Sync for BlendingFunction

impl Unpin for BlendingFunction

impl UnwindSafe for BlendingFunction

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> Content for T where
    T: Copy
[src]

type Owned = T

A type that holds a sized version of the content.

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

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

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.