pub struct BlendState {
pub color: BlendComponent,
pub alpha: BlendComponent,
}Expand description
The full blend state of a single color target.
Alpha blending is BlendComponent { operation: Add, source: SourceAlpha, destination: OneMinusSourceAlpha } on both the color and
the alpha channel; replacing the source and keeping the destination is
how a fade-to-black and other multiply blends are expressed.
Fields§
§color: BlendComponentThe blend applied to the RGB channels.
alpha: BlendComponentThe blend applied to the alpha channel, which is frequently not the same as the color blend.
Implementations§
Source§impl BlendState
Named constructors for the pipeline state structs.
impl BlendState
Named constructors for the pipeline state structs.
Sourcepub fn alpha_over() -> Self
pub fn alpha_over() -> Self
Alpha blending applied identically to the color and the alpha channel, which is what an ordinary translucent surface wants.
§Returns
Self- The assembled blend state.
Source§impl BlendState
impl BlendState
pub fn get_color(&self) -> BlendComponent
pub fn get_alpha(&self) -> BlendComponent
Source§impl BlendState
impl BlendState
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlendState
impl RefUnwindSafe for BlendState
impl Send for BlendState
impl Sync for BlendState
impl Unpin for BlendState
impl UnsafeUnpin for BlendState
impl UnwindSafe for BlendState
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
Mutably borrows from an owned value. Read more