[−][src]Struct tiny_skia::Paint
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,