#[repr(u32)]pub enum CompositeOp {
Over = 0,
Under = 1,
In = 2,
Out = 3,
Atop = 4,
Xor = 5,
}Expand description
Porter-Duff alpha-compositing operator.
The discriminant is the value written into the shader’s composite uniform,
so variants are only ever appended, never renumbered. Each doc comment
gives the premultiplied output colour co and alpha ao.
Variants§
Over = 0
Source over destination. co = s + d(1-sa), ao = sa + da(1-sa).
Under = 1
Destination over source. co = d + s(1-da), ao = da + sa(1-da).
In = 2
Source shown only where the destination is opaque.
co = s·da, ao = sa·da.
Out = 3
Source shown only where the destination is transparent.
co = s(1-da), ao = sa(1-da).
Atop = 4
Source atop the destination; the destination’s shape is kept.
co = s·da + d(1-sa), ao = da.
Xor = 5
Whichever side the other does not cover.
co = s(1-da) + d(1-sa), ao = sa(1-da) + da(1-sa).
Trait Implementations§
Source§impl Clone for CompositeOp
impl Clone for CompositeOp
Source§fn clone(&self) -> CompositeOp
fn clone(&self) -> CompositeOp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CompositeOp
Source§impl Debug for CompositeOp
impl Debug for CompositeOp
Source§impl Default for CompositeOp
impl Default for CompositeOp
Source§fn default() -> CompositeOp
fn default() -> CompositeOp
Returns the “default value” for a type. Read more
impl Eq for CompositeOp
Source§impl PartialEq for CompositeOp
impl PartialEq for CompositeOp
impl StructuralPartialEq for CompositeOp
Auto Trait Implementations§
impl Freeze for CompositeOp
impl RefUnwindSafe for CompositeOp
impl Send for CompositeOp
impl Sync for CompositeOp
impl Unpin for CompositeOp
impl UnsafeUnpin for CompositeOp
impl UnwindSafe for CompositeOp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.