[][src]Enum raqote::Source

pub enum Source<'a> {
    Solid(SolidSource),
    Image(Image<'a>, ExtendModeFilterModeTransform),
    RadialGradient(GradientSpreadTransform),
    TwoCircleRadialGradient(GradientSpreadPointf32Pointf32Transform),
    LinearGradient(GradientSpreadTransform),
}

LinearGradients have an implicit start point at 0,0 and an end point at 256,0. The transform parameter can be used to adjust them to the desired location. RadialGradients have an implict center at 0,0 and a radius of 128.

These locations are an artifact of the blitter implementation and will probably change in the future to become more ergonomic.

Variants

RadialGradient(GradientSpreadTransform)
TwoCircleRadialGradient(GradientSpreadPointf32Pointf32Transform)
LinearGradient(GradientSpreadTransform)

Methods

impl<'a> Source<'a>[src]

pub fn new_linear_gradient(
    gradient: Gradient,
    start: Point,
    end: Point,
    spread: Spread
) -> Source<'a>
[src]

Creates a new linear gradient source where the start point corresponds to the gradient stop at position = 0 and the end point corresponds to the gradient stop at position = 1.

pub fn new_radial_gradient(
    gradient: Gradient,
    center: Point,
    radius: f32,
    spread: Spread
) -> Source<'a>
[src]

Creates a new radial gradient that is centered at the given point and has the given radius.

pub fn new_two_circle_radial_gradient(
    gradient: Gradient,
    center1: Point,
    radius1: f32,
    center2: Point,
    radius2: f32,
    spread: Spread
) -> Source<'a>
[src]

Creates a new radial gradient that is centered at the given point and has the given radius.

Trait Implementations

impl<'a> Clone for Source<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Source<'a>

impl<'a> Send for Source<'a>

impl<'a> Sync for Source<'a>

impl<'a> Unpin for Source<'a>

impl<'a> UnwindSafe for Source<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.