Enum tetra::graphics::BlendFactor
source · [−]pub enum BlendFactor {
Show 13 variants
Zero,
One,
Src,
OneMinusSrc,
SrcAlpha,
OneMinusSrcAlpha,
Dst,
OneMinusDst,
DstAlpha,
OneMinusDstAlpha,
SrcAlphaSaturated,
Constant,
OneMinusConstant,
}
Expand description
Defines a multiplier that will be applied to a color or alpha value before blending it.
Variants
Zero
Each component will be multiplied by zero.
- Color:
r * 0
,g * 0
,b * 0
- Alpha:
a * 0
One
Each component will be multiplied by one.
- Color:
r * 1
,g * 1
,b * 1
- Alpha:
a * 1
Src
Each component will be multiplied by the source value (color or alpha, depending on the context).
- Color:
r * srcR
,g * srcG
,b * srcB
- Alpha:
a * srcA
OneMinusSrc
Each component will be multiplied by the inverse of the source value (color or alpha, depending on the context).
- Color:
r * (1 - srcR)
,g * (1 - srcG
,b * (1 - srcB)
- Alpha:
a * (1 - srcA)
SrcAlpha
Each component will be multiplied by the source alpha value.
- Color:
r * srcA
,g * srcA
,b * srcA
- Alpha:
a * srcA
OneMinusSrcAlpha
Each component will be multiplied by the inverse of the source alpha value.
- Color:
r * (1 - srcA)
,g * (1 - srcA)
,b * (1 - srcA)
- Alpha:
a * (1 - srcA)
Dst
Each component will be multiplied by the destination value (color or alpha, depending on the context).
- Color:
r * dstR
,g * dstG
,b * dstB
- Alpha:
a * dstA
OneMinusDst
Each component will be multiplied by the inverse of the destination value (color or alpha, depending on the context).
- Color:
r * (1 - dstR)
,g * (1 - dstG)
,b * (1 - dstB)
- Alpha:
a * (1 - dstA)
DstAlpha
Each component will be multiplied by the destination alpha value.
- Color:
r * dstA
,g * dstA
,b * dstA
- Alpha:
a * dstA
OneMinusDstAlpha
Each component will be multiplied by the inverse of the destination alpha value.
- Color:
r * (1 - dstA)
,g * (1 - dstA)
,b * (1 - dstA)
- Alpha:
a * dstA
SrcAlphaSaturated
Each component will be multiplied by either the source alpha value, or its inverse, whichever is greater.
When applied to an alpha value, this acts the same as BlendFactor::One
.
- Color:
r * min(dstA, 1 - dstA)
,g * min(dstA, 1 - dstA)
,b * min(dstA, 1 - dstA)
- Alpha:
a * 1
Constant
Each component will be multiplied by a constant value.
The means of setting this constant is not yet exposed in Tetra - please create an issue or a PR if you need to use this!
- Color:
r * c
,g * c
,b * c
- Alpha:
a * c
OneMinusConstant
Each component will be multiplied by the inverse of a constant value.
The means of setting this constant is not yet exposed in Tetra - please create an issue or a PR if you need to use this!
- Color:
r * (1 - c)
,g * (1 - c)
,b * (1 - c)
- Alpha:
a * (1 - c)
Trait Implementations
sourceimpl Clone for BlendFactor
impl Clone for BlendFactor
sourcefn clone(&self) -> BlendFactor
fn clone(&self) -> BlendFactor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BlendFactor
impl Debug for BlendFactor
sourceimpl PartialEq<BlendFactor> for BlendFactor
impl PartialEq<BlendFactor> for BlendFactor
impl Copy for BlendFactor
impl Eq for BlendFactor
impl StructuralEq for BlendFactor
impl StructuralPartialEq for BlendFactor
Auto Trait Implementations
impl RefUnwindSafe for BlendFactor
impl Send for BlendFactor
impl Sync for BlendFactor
impl Unpin for BlendFactor
impl UnwindSafe for BlendFactor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more