#[non_exhaustive]#[repr(i32)]pub enum LogicOp {
Show 16 variants
Clear = 0,
And = 1,
AndReverse = 2,
Copy = 3,
AndInverted = 4,
Noop = 5,
Xor = 6,
Or = 7,
Nor = 8,
Equivalent = 9,
Invert = 10,
OrReverse = 11,
CopyInverted = 12,
OrInverted = 13,
Nand = 14,
Set = 15,
}
Expand description
Which logical operation to apply to the output values.
The operation is applied individually for each channel (red, green, blue and alpha).
Only relevant for integer or unsigned attachments.
Also note that some implementations don’t support logic operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Clear = 0
Returns 0
.
And = 1
Returns source & destination
.
AndReverse = 2
Returns source & !destination
.
Copy = 3
Returns source
.
AndInverted = 4
Returns !source & destination
.
Noop = 5
Returns destination
.
Xor = 6
Returns source ^ destination
.
Or = 7
Returns source | destination
.
Nor = 8
Returns !(source | destination)
.
Equivalent = 9
Returns !(source ^ destination)
.
Invert = 10
Returns !destination
.
OrReverse = 11
Returns `source | !destination.
CopyInverted = 12
Returns !source
.
OrInverted = 13
Returns !source | destination
.
Nand = 14
Returns !(source & destination)
.
Set = 15
Returns !0
(all bits set to 1).
Trait Implementations§
source§impl PartialEq for LogicOp
impl PartialEq for LogicOp
impl Copy for LogicOp
impl Eq for LogicOp
impl StructuralEq for LogicOp
impl StructuralPartialEq for LogicOp
Auto Trait Implementations§
impl RefUnwindSafe for LogicOp
impl Send for LogicOp
impl Sync for LogicOp
impl Unpin for LogicOp
impl UnwindSafe for LogicOp
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