Enum ResolvedPaint

Source
pub enum ResolvedPaint<'a> {
Show 13 variants ColrLayers { range: Range<usize>, }, Solid { palette_index: u16, alpha: f32, }, LinearGradient { x0: f32, y0: f32, x1: f32, y1: f32, x2: f32, y2: f32, color_stops: ColorStops<'a>, extend: Extend, }, RadialGradient { x0: f32, y0: f32, radius0: f32, x1: f32, y1: f32, radius1: f32, color_stops: ColorStops<'a>, extend: Extend, }, SweepGradient { center_x: f32, center_y: f32, start_angle: f32, end_angle: f32, color_stops: ColorStops<'a>, extend: Extend, }, Glyph { glyph_id: GlyphId16, paint: Paint<'a>, }, ColrGlyph { glyph_id: GlyphId16, }, Transform { xx: f32, yx: f32, xy: f32, yy: f32, dx: f32, dy: f32, paint: Paint<'a>, }, Translate { dx: f32, dy: f32, paint: Paint<'a>, }, Scale { scale_x: f32, scale_y: f32, around_center: Option<Point<f32>>, paint: Paint<'a>, }, Rotate { angle: f32, around_center: Option<Point<f32>>, paint: Paint<'a>, }, Skew { x_skew_angle: f32, y_skew_angle: f32, around_center: Option<Point<f32>>, paint: Paint<'a>, }, Composite { source_paint: Paint<'a>, mode: CompositeMode, backdrop_paint: Paint<'a>, },
}
Expand description

Simplified version of Paint with applied variation deltas.

These are constructed with the resolve_paint function.

This is roughly equivalent to FreeType’s FT_COLR_Paint type.

Variants§

§

ColrLayers

Fields

§range: Range<usize>
§

Solid

Fields

§palette_index: u16
§alpha: f32
§

LinearGradient

Fields

§x0: f32
§y0: f32
§x1: f32
§y1: f32
§x2: f32
§y2: f32
§color_stops: ColorStops<'a>
§extend: Extend
§

RadialGradient

Fields

§x0: f32
§y0: f32
§radius0: f32
§x1: f32
§y1: f32
§radius1: f32
§color_stops: ColorStops<'a>
§extend: Extend
§

SweepGradient

Fields

§center_x: f32
§center_y: f32
§start_angle: f32
§end_angle: f32
§color_stops: ColorStops<'a>
§extend: Extend
§

Glyph

Fields

§glyph_id: GlyphId16
§paint: Paint<'a>
§

ColrGlyph

Fields

§glyph_id: GlyphId16
§

Transform

Fields

§xx: f32
§yx: f32
§xy: f32
§yy: f32
§dx: f32
§dy: f32
§paint: Paint<'a>
§

Translate

Fields

§dx: f32
§dy: f32
§paint: Paint<'a>
§

Scale

Fields

§scale_x: f32
§scale_y: f32
§around_center: Option<Point<f32>>
§paint: Paint<'a>
§

Rotate

Fields

§angle: f32
§around_center: Option<Point<f32>>
§paint: Paint<'a>
§

Skew

Fields

§x_skew_angle: f32
§y_skew_angle: f32
§around_center: Option<Point<f32>>
§paint: Paint<'a>
§

Composite

Fields

§source_paint: Paint<'a>
§backdrop_paint: Paint<'a>

Trait Implementations§

Source§

impl TryFrom<&ResolvedPaint<'_>> for Transform

Source§

type Error = ReadError

The type returned in the event of a conversion error.
Source§

fn try_from(paint: &ResolvedPaint<'_>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'a> Freeze for ResolvedPaint<'a>

§

impl<'a> RefUnwindSafe for ResolvedPaint<'a>

§

impl<'a> Send for ResolvedPaint<'a>

§

impl<'a> Sync for ResolvedPaint<'a>

§

impl<'a> Unpin for ResolvedPaint<'a>

§

impl<'a> UnwindSafe for ResolvedPaint<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.