[][src]Struct miniquad::graphics::BlendState

pub struct BlendState { /* fields omitted */ }

Pixel arithmetic description for blending operations. Will be used in an equation: equation(sfactor * source_color, dfactor * destination_color) Where source_color is the new pixel color and destination color is color from the destination buffer.

Example:

BlendState::new(
    Equation::Add,
    BlendFactor::Value(BlendValue::SourceAlpha),
    BlendFactor::OneMinusValue(BlendValue::SourceAlpha)
);

This will be source_color * source_color.a + destination_color * (1 - source_color.a) Wich is quite common set up for alpha blending.

Implementations

impl BlendState[src]

pub fn new(
    equation: Equation,
    sfactor: BlendFactor,
    dfactor: BlendFactor
) -> BlendState
[src]

Trait Implementations

impl Clone for BlendState[src]

impl Copy for BlendState[src]

impl Debug for BlendState[src]

impl PartialEq<BlendState> for BlendState[src]

impl StructuralPartialEq for BlendState[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> 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.