[][src]Enum stdweb::web::CompositeOperation

pub enum CompositeOperation {
    SourceOver,
    SourceIn,
    SourceOut,
    SourceAtop,
    DestinationOver,
    DestinationIn,
    DestinationOut,
    DestinationAtop,
    Lighter,
    Copy,
    Xor,
    Multiply,
    Screen,
    Overlay,
    Darken,
    Lighten,
    ColorDodge,
    ColorBurn,
    HardLight,
    SoftLight,
    Difference,
    Exclusion,
    Hue,
    Saturation,
    Color,
    Luminosity,
}

The type of compositing operation to apply when drawing new shapes

(JavaScript docs)

Variants

SourceOver

Draws new shapes over existing canvas content

SourceIn

Draws new shapes over existing canvas content, but only where existing canvas content overlaps. Anything not in that area becomes transparent.

SourceOut

New shapes are drawn where there is no existing canvas content. Everything else (including old canvas content) is made transparent.

SourceAtop

Draws new shapes only where there is existing canvas content, over existing canvas content

DestinationOver

Draws new shapes behind existing canvas content

DestinationIn

Keeps existing canvas content where it overlaps with the new shape. Everything outside the overlap is made transparent.

DestinationOut

The existing content is kept where it doesn't overlap with the new shape. Everything else, including the new shape area, is made transparent.

DestinationAtop

Existing content is kept only where it overlaps with the new shape. The new shape is drawn behind the existing content.

Lighter

Where both shapes overlap, the new color is determined by adding color values

Copy

Only the new shape is shown

Xor

Where both shapes overlap, make it transparent

Multiply

The pixels of the new and old layer are multiplied. (Pixel values are in the range of [0,1], so this makes a darker picture)

Screen

Pixels from both new and old are inverted, multiplied together, then inverted again. (Pixel values are in the range of [0,1], so this makes a lighter picture)

Overlay

Applies Multiply to dark colors in the existing content, and Screen to bright colors in the existing content

Darken

Retains the darkest pixels

Lighten

Retains the lighest pixels

ColorDodge

Divides the bottom layer by the inverted top layer.

ColorBurn

Divides the inverted bottom layer by the top layer, and then inverts the result.

HardLight

A combination of multiply and screen like overlay, but with top and bottom layer swapped.

SoftLight

A softer version of hard-light. Pure black or white does not result in pure black or white.

Difference

Subtracts the bottom layer from the top layer or the other way round to always get a positive value.

Exclusion

Like difference, but with lower contrast.

Hue

Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.

Saturation

Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.

Color

Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.

Luminosity

Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.

Trait Implementations

impl Eq for CompositeOperation[src]

impl Clone for CompositeOperation[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for CompositeOperation[src]

impl PartialEq<CompositeOperation> for CompositeOperation[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Debug for CompositeOperation[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]