#[repr(u8)]pub enum BlendMode {
Show 27 variants
SrcOver = 0,
Clear = 1,
Src = 2,
Dst = 3,
SrcIn = 4,
DstIn = 5,
SrcOut = 6,
DstOut = 7,
SrcAtop = 8,
DstAtop = 9,
Xor = 10,
Plus = 11,
Multiply = 12,
Screen = 13,
Overlay = 14,
Darken = 15,
Lighten = 16,
ColorDodge = 17,
ColorBurn = 18,
HardLight = 19,
SoftLight = 20,
Difference = 21,
Exclusion = 22,
Hue = 23,
Saturation = 24,
Color = 25,
Luminosity = 26,
}Expand description
完整 27 种 Porter-Duff 合成模式与 W3C Compositing & Blending Level 1 混合模式。
Variants§
SrcOver = 0
标准源覆盖目标(默认)。
Clear = 1
清空目标像素。
Src = 2
仅保留源像素(替换)。
Dst = 3
仅保留目标像素。
SrcIn = 4
源裁剪至目标 Alpha 内(遮罩保留源)。
DstIn = 5
目标裁剪至源 Alpha 内(使用源作为 Alpha Mask 裁切下层)。
SrcOut = 6
源仅绘制在目标透明区。
DstOut = 7
目标仅保留在源透明区(镂空/擦除)。
SrcAtop = 8
源绘制在目标已有像素上并保留目标轮廓。
DstAtop = 9
目标绘制在源轮廓内。
Xor = 10
源与目标异或镂空。
Plus = 11
线性光强相加(Additive / Lighter)。
Multiply = 12
正片叠底。
Screen = 13
滤色。
Overlay = 14
叠加。
Darken = 15
变暗。
Lighten = 16
变亮。
ColorDodge = 17
颜色减淡。
ColorBurn = 18
颜色加深。
HardLight = 19
强光。
SoftLight = 20
柔光。
Difference = 21
差值。
Exclusion = 22
排除。
Hue = 23
色相。
Saturation = 24
饱和度。
Color = 25
颜色(保留目标明度,替换源色相与饱和度)。
Luminosity = 26
明度(保留目标色相与饱和度,替换源明度)。
Implementations§
Trait Implementations§
impl Copy for BlendMode
impl Eq for BlendMode
impl StructuralPartialEq for BlendMode
Auto Trait Implementations§
impl Forget for BlendMode
impl Freeze for BlendMode
impl Move for BlendMode
impl RefUnwindSafe for BlendMode
impl Send for BlendMode
impl Sync for BlendMode
impl Unpin for BlendMode
impl UnsafeUnpin for BlendMode
impl UnwindSafe for BlendMode
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.Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。