Enum BlendMode
#[repr(i32)]pub enum BlendMode {
Show 29 variants
Clear = 0,
Src = 1,
Dst = 2,
SrcOver = 3,
DstOver = 4,
SrcIn = 5,
DstIn = 6,
SrcOut = 7,
DstOut = 8,
SrcATop = 9,
DstATop = 10,
Xor = 11,
Plus = 12,
Modulate = 13,
Screen = 14,
Overlay = 15,
Darken = 16,
Lighten = 17,
ColorDodge = 18,
ColorBurn = 19,
HardLight = 20,
SoftLight = 21,
Difference = 22,
Exclusion = 23,
Multiply = 24,
Hue = 25,
Saturation = 26,
Color = 27,
Luminosity = 28,
}Expand description
Blends are operators that take in two colors (source, destination) and return a new color. Many of these operate the same on all 4 components: red, green, blue, alpha. For these, we just document what happens to one component, rather than naming each one separately.
Different color types have different representations for color components: 8-bit: 0..255 6-bit: 0..63 5-bit: 0..31 4-bit: 0..15 floats: 0…1
The documentation is expressed as if the component values are always 0..1 (floats).
For brevity, the documentation uses the following abbreviations:
s : source
d : destination
sa : source alpha
da : destination alpha
Results are abbreviated:
r : if all 4 components are computed in the same manner
ra : result alpha component
rc : result “color”: red, green, blue components
Variants§
Clear = 0
Src = 1
Dst = 2
SrcOver = 3
DstOver = 4
SrcIn = 5
DstIn = 6
SrcOut = 7
DstOut = 8
SrcATop = 9
DstATop = 10
Xor = 11
Plus = 12
Modulate = 13
Screen = 14
Overlay = 15
Darken = 16
Lighten = 17
ColorDodge = 18
ColorBurn = 19
HardLight = 20
SoftLight = 21
Difference = 22
Exclusion = 23
Multiply = 24
Hue = 25
Saturation = 26
Color = 27
Luminosity = 28
Implementations§
§impl SkBlendMode
impl SkBlendMode
pub const LastCoeffMode: SkBlendMode = SkBlendMode::Screen
§impl SkBlendMode
impl SkBlendMode
pub const LastSeparableMode: SkBlendMode = SkBlendMode::Multiply
§impl SkBlendMode
impl SkBlendMode
pub const LastMode: SkBlendMode = SkBlendMode::Luminosity
§impl SkBlendMode
impl SkBlendMode
pub fn as_coeff(self) -> Option<(SkBlendModeCoeff, SkBlendModeCoeff)>
pub fn name(self) -> &'static str
Trait Implementations§
§impl Clone for SkBlendMode
impl Clone for SkBlendMode
§fn clone(&self) -> SkBlendMode
fn clone(&self) -> SkBlendMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SkBlendMode
§impl Debug for SkBlendMode
impl Debug for SkBlendMode
§impl Default for SkBlendMode
impl Default for SkBlendMode
§fn default() -> SkBlendMode
fn default() -> SkBlendMode
impl Eq for SkBlendMode
§impl From<BlendMode> for SkBlendMode
impl From<BlendMode> for SkBlendMode
§fn from(value: BlendMode) -> SkBlendMode
fn from(value: BlendMode) -> SkBlendMode
§impl From<SkBlendMode> for RCHandle<SkBlender>
impl From<SkBlendMode> for RCHandle<SkBlender>
§fn from(mode: SkBlendMode) -> RCHandle<SkBlender>
fn from(mode: SkBlendMode) -> RCHandle<SkBlender>
§impl Hash for SkBlendMode
impl Hash for SkBlendMode
§impl PartialEq for SkBlendMode
impl PartialEq for SkBlendMode
impl StructuralPartialEq for SkBlendMode
Auto Trait Implementations§
impl Freeze for SkBlendMode
impl RefUnwindSafe for SkBlendMode
impl Send for SkBlendMode
impl Sync for SkBlendMode
impl Unpin for SkBlendMode
impl UnsafeUnpin for SkBlendMode
impl UnwindSafe for SkBlendMode
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.