Enum glium::draw_parameters::BlendingFunction
source · pub enum BlendingFunction {
AlwaysReplace,
Min,
Max,
Addition {
source: LinearBlendingFactor,
destination: LinearBlendingFactor,
},
Subtraction {
source: LinearBlendingFactor,
destination: LinearBlendingFactor,
},
ReverseSubtraction {
source: LinearBlendingFactor,
destination: LinearBlendingFactor,
},
}
Expand description
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
Fields
source: LinearBlendingFactor
The factor to apply to the source pixel.
destination: LinearBlendingFactor
The factor to apply to the destination pixel.
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.
Subtraction
Fields
source: LinearBlendingFactor
The factor to apply to the source pixel.
destination: LinearBlendingFactor
The factor to apply to the destination pixel.
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.
ReverseSubtraction
Fields
source: LinearBlendingFactor
The factor to apply to the source pixel.
destination: LinearBlendingFactor
The factor to apply to the destination pixel.
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.
Trait Implementations§
source§impl Clone for BlendingFunction
impl Clone for BlendingFunction
source§fn clone(&self) -> BlendingFunction
fn clone(&self) -> BlendingFunction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BlendingFunction
impl Debug for BlendingFunction
source§impl PartialEq<BlendingFunction> for BlendingFunction
impl PartialEq<BlendingFunction> for BlendingFunction
source§fn eq(&self, other: &BlendingFunction) -> bool
fn eq(&self, other: &BlendingFunction) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for BlendingFunction
impl Eq for BlendingFunction
impl StructuralEq for BlendingFunction
impl StructuralPartialEq for BlendingFunction
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Content for Twhere
T: Copy,
impl<T> Content for Twhere T: Copy,
source§fn read<F, E>(size: usize, f: F) -> Result<T, E>where
F: FnOnce(&mut T) -> Result<(), E>,
fn read<F, E>(size: usize, f: F) -> Result<T, E>where F: FnOnce(&mut T) -> Result<(), E>,
Owned
.