Struct tiny_skia::Paint[][src]

pub struct Paint<'a> {
    pub shader: Shader<'a>,
    pub blend_mode: BlendMode,
    pub anti_alias: bool,
    pub force_hq_pipeline: bool,
}

Controls how a shape should be painted.

Fields

shader: Shader<'a>

A paint shader.

Default: black color

blend_mode: BlendMode

Paint blending mode.

Default: SourceOver

anti_alias: bool

Enables anti-aliased painting.

Default: false

force_hq_pipeline: bool

Forces the high quality/precision rendering pipeline.

tiny-skia, just like Skia, has two rendering pipelines: one uses f32 and another one uses u16. u16 one is usually way faster, but less precise. Which can lead to slight differences.

By default, tiny-skia will choose the pipeline automatically, depending on a blending mode and other parameters. But you can force the high quality one using this flag.

This feature is especially useful during testing.

Unlike high quality pipeline, the low quality one doesn’t support all rendering stages, therefore we cannot force it like hq one.

Default: false

Implementations

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

pub fn set_color(&mut self, color: Color)[src]

Sets a paint source to a solid color.

pub fn set_color_rgba8(&mut self, r: u8, g: u8, b: u8, a: u8)[src]

Sets a paint source to a solid color.

self.shader = Shader::SolidColor(Color::from_rgba8(50, 127, 150, 200)); shorthand.

pub fn is_solid_color(&self) -> bool[src]

Checks that the paint source is a solid color.

Trait Implementations

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

impl<'a> Debug for Paint<'a>[src]

impl Default for Paint<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Paint<'a>

impl<'a> Send for Paint<'a>

impl<'a> Sync for Paint<'a>

impl<'a> Unpin for Paint<'a>

impl<'a> UnwindSafe for Paint<'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.