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
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
source: LinearBlendingFactorThe factor to apply to the source pixel.
destination: LinearBlendingFactorThe 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
source: LinearBlendingFactorThe factor to apply to the source pixel.
destination: LinearBlendingFactorThe 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
source: LinearBlendingFactorThe factor to apply to the source pixel.
destination: LinearBlendingFactorThe factor to apply to the destination pixel.
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 for BlendingFunction
impl PartialEq for BlendingFunction
impl Copy for BlendingFunction
impl Eq for BlendingFunction
impl StructuralPartialEq for BlendingFunction
Auto Trait Implementations§
impl Freeze for BlendingFunction
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
fn read<F, E>(size: usize, f: F) -> Result<T, E>
Owned.Source§fn get_elements_size() -> usize
fn get_elements_size() -> usize
Source§fn to_void_ptr(&self) -> *const ()
fn to_void_ptr(&self) -> *const ()
Source§fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>
fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>
Source§fn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.