pub enum BlendMode2 {
Replace,
PremultipliedAlpha,
StraightAlpha,
// some variants omitted
}Expand description
The set of possible blending functions to choose from when determining how an image should be composited on top of other images.
Variants§
Replace
Indicates that the source pixels replace the destination pixels: source pixel
values, including alpha, are written into the output as-is, without blending
against the destination. A source pixel with partial or zero alpha is stamped
into the output with that alpha intact; it is not treated as opaque.
(This describes the blend function itself; a layer’s opacity can demote this
mode. See [LayerProperties.blend_mode].)
PremultipliedAlpha
The source pixels are drawn over the destination pixels. The final pixel color that is displayed is calculated as: C_src + (1.0 - alpha_src) * C_dst.
StraightAlpha
The source pixels are drawn over the destination pixels. The final pixel color that is displayed is calculated as: alpha_src * C_src + (1.0 - alpha_src) * C_dst.
Implementations§
Source§impl BlendMode2
impl BlendMode2
pub fn from_primitive(prim: u32) -> Option<BlendMode2>
pub fn from_primitive_allow_unknown(prim: u32) -> BlendMode2
pub fn unknown() -> BlendMode2
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for BlendMode2
impl Clone for BlendMode2
Source§fn clone(&self) -> BlendMode2
fn clone(&self) -> BlendMode2
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 BlendMode2
Source§impl Debug for BlendMode2
impl Debug for BlendMode2
Source§impl<D> Decode<BlendMode2, D> for BlendMode2where
D: ResourceDialect,
impl<D> Decode<BlendMode2, D> for BlendMode2where
D: ResourceDialect,
Source§fn new_empty() -> BlendMode2
fn new_empty() -> BlendMode2
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl<D> Encode<BlendMode2, D> for BlendMode2where
D: ResourceDialect,
impl<D> Encode<BlendMode2, D> for BlendMode2where
D: ResourceDialect,
impl Eq for BlendMode2
Source§impl Hash for BlendMode2
impl Hash for BlendMode2
Source§impl Ord for BlendMode2
impl Ord for BlendMode2
Source§fn cmp(&self, other: &BlendMode2) -> Ordering
fn cmp(&self, other: &BlendMode2) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BlendMode2
impl PartialEq for BlendMode2
Source§impl PartialOrd for BlendMode2
impl PartialOrd for BlendMode2
impl StructuralPartialEq for BlendMode2
Source§impl TypeMarker for BlendMode2
impl TypeMarker for BlendMode2
Source§type Owned = BlendMode2
type Owned = BlendMode2
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for BlendMode2
impl ValueTypeMarker for BlendMode2
Source§type Borrowed<'a> = BlendMode2
type Borrowed<'a> = BlendMode2
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
value: &<BlendMode2 as TypeMarker>::Owned,
) -> <BlendMode2 as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<BlendMode2 as TypeMarker>::Owned, ) -> <BlendMode2 as ValueTypeMarker>::Borrowed<'_>
&Self::Owned to Self::Borrowed.