[−][src]Struct miniquad::graphics::BlendState
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]
equation: Equation,
sfactor: BlendFactor,
dfactor: BlendFactor
) -> BlendState
Trait Implementations
impl Clone for BlendState
[src]
fn clone(&self) -> BlendState
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for BlendState
[src]
impl Debug for BlendState
[src]
impl PartialEq<BlendState> for BlendState
[src]
fn eq(&self, other: &BlendState) -> bool
[src]
fn ne(&self, other: &BlendState) -> bool
[src]
impl StructuralPartialEq for BlendState
[src]
Auto Trait Implementations
impl RefUnwindSafe for BlendState
impl Send for BlendState
impl Sync for BlendState
impl Unpin for BlendState
impl UnwindSafe for BlendState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,