Skip to main content

CompOp

Enum CompOp 

Source
#[repr(u8)]
pub enum CompOp {
Show 29 variants SrcOver = 0, SrcCopy = 1, SrcIn = 2, SrcOut = 3, SrcAtop = 4, DstOver = 5, DstCopy = 6, DstIn = 7, DstOut = 8, DstAtop = 9, Xor = 10, Clear = 11, Plus = 12, Minus = 13, Modulate = 14, Multiply = 15, Screen = 16, Overlay = 17, Darken = 18, Lighten = 19, ColorDodge = 20, ColorBurn = 21, LinearBurn = 22, LinearLight = 23, PinLight = 24, HardLight = 25, SoftLight = 26, Difference = 27, Exclusion = 28,
}
Expand description

合成オペレーション。Blend2D の BLCompOp と値を合わせている。

Variants§

§

SrcOver = 0

source を destination の上に Porter-Duff SrcOver で合成する。 out = src + dst * (1 - srcA)

§

SrcCopy = 1

destination を source で完全に置き換える。 out = src

§

SrcIn = 2

out = src * dstA

§

SrcOut = 3

out = src * (1 - dstA)

§

SrcAtop = 4

out = src * dstA + dst * (1 - srcA)

§

DstOver = 5

out = dst + src * (1 - dstA)

§

DstCopy = 6

out = dst (何もしない)

§

DstIn = 7

out = dst * srcA

§

DstOut = 8

out = dst * (1 - srcA)

§

DstAtop = 9

out = dst * srcA + src * (1 - dstA)

§

Xor = 10

out = src * (1 - dstA) + dst * (1 - srcA)

§

Clear = 11

out = 0

§

Plus = 12

out = min(src + dst, 1)

§

Minus = 13

out = max(dst - src, 0), alpha = SrcOver

§

Modulate = 14

out_c = src_c * dst_c / 255 (チャネル乗算、alpha も同様)

§

Multiply = 15

Multiply ブレンド。blend = srcdst, out = blend + src(1-dstA) + dst*(1-srcA)

§

Screen = 16

Screen ブレンド。out = src + dst - src*dst

§

Overlay = 17

Overlay ブレンド。条件分岐 (2*Dc < Da)

§

Darken = 18

Darken ブレンド。blend = min(srcdstA, dstsrcA)

§

Lighten = 19

Lighten ブレンド。blend = max(srcdstA, dstsrcA)

§

ColorDodge = 20

ColorDodge ブレンド。除算あり

§

ColorBurn = 21

ColorBurn ブレンド。除算あり

§

LinearBurn = 22

LinearBurn ブレンド。飽和減算

§

LinearLight = 23

LinearLight ブレンド。clamp + 条件

§

PinLight = 24

PinLight ブレンド。条件分岐 + min/max

§

HardLight = 25

HardLight ブレンド。条件分岐 (2*Sc < Sa)

§

SoftLight = 26

SoftLight ブレンド。除算 + sqrt + 条件分岐

§

Difference = 27

Difference ブレンド。abs 差分

§

Exclusion = 28

Exclusion ブレンド。単純な算術

Trait Implementations§

Source§

impl Clone for CompOp

Source§

fn clone(&self) -> CompOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CompOp

Source§

impl Debug for CompOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CompOp

Source§

fn default() -> CompOp

Returns the “default value” for a type. Read more
Source§

impl Eq for CompOp

Source§

impl Hash for CompOp

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CompOp

Source§

fn eq(&self, other: &CompOp) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CompOp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.