#[non_exhaustive]pub enum CompositeOperator {
Over,
In,
Out,
Atop,
}Expand description
Compositing operators, mostly as per Porter-Duff.
The “source” block is the Composite’s stored block, and the “destination” block
is the block the modifier is attached to.
TODO: Document behavior of collision and selectable properties.
§Serialization stability warning
This type implements serde::Serialize and serde::Deserialize, but serialization
support is still experimental (as is the game data model in general). We do not guarantee that future versions of all-is-cubes
will be able to deserialize data which is serialized by this version.
Additionally, the serialization schema is designed with serde_json in mind. It is not
guaranteed that using a different data format crate, which may use a different subset of
the information exposed via serde::Serialize, will produce stable results.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Over
Porter-Duff “over”. If both source and destination are opaque, the source is taken; otherwise the destination is taken.
In
Porter-Duff “in”. If both source and destination are opaque, the source is taken; otherwise the result is transparent. Thus the destination acts as a mask constraining where the source is present; the source is “in” the destination. The destination’s color is not used.
Out
Porter-Duff “out”. If both source and destination are opaque, the result is transparent; otherwise the source is taken. Thus the destination acts as a mask removing portions of the source. The destination’s color is not used.
Atop
Porter-Duff “atop”. If both source and destination are opaque, the source is taken; otherwise the destination is taken. Thus the source is painted onto the destination’s substance.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for CompositeOperator
impl<'arbitrary> Arbitrary<'arbitrary> for CompositeOperator
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for CompositeOperator
impl Clone for CompositeOperator
Source§fn clone(&self) -> CompositeOperator
fn clone(&self) -> CompositeOperator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompositeOperator
impl Debug for CompositeOperator
Source§impl<'de> Deserialize<'de> for CompositeOperator
impl<'de> Deserialize<'de> for CompositeOperator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for CompositeOperator
impl Hash for CompositeOperator
Source§impl PartialEq for CompositeOperator
impl PartialEq for CompositeOperator
Source§impl Serialize for CompositeOperator
impl Serialize for CompositeOperator
impl Copy for CompositeOperator
impl Eq for CompositeOperator
impl StructuralPartialEq for CompositeOperator
Auto Trait Implementations§
impl Freeze for CompositeOperator
impl RefUnwindSafe for CompositeOperator
impl Send for CompositeOperator
impl Sync for CompositeOperator
impl Unpin for CompositeOperator
impl UnwindSafe for CompositeOperator
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more