Skip to main content

RadialPattern

Struct RadialPattern 

Source
pub struct RadialPattern { /* private fields */ }
Expand description

Gradient between two circles (centre c0, radius r0) and (c1, r1).

Implementations§

Source§

impl RadialPattern

Source

pub fn new( color0: [u8; 3], color1: [u8; 3], c0x: f64, c0y: f64, r0: f64, c1x: f64, c1y: f64, r1: f64, t0: f64, t1: f64, extend_start: bool, extend_end: bool, ) -> Self

Create a radial gradient.

  • color0 / color1: RGB at inner / outer circle.
  • (c0x, c0y, r0): inner circle centre and radius (≥ 0).
  • (c1x, c1y, r1): outer circle centre and radius (≥ 0).
  • t0, t1: parameter range mapping to color0 / color1. May be inverted (t0 > t1).
  • extend_start / extend_end: extend colour beyond the gradient circles.

Trait Implementations§

Source§

impl Pattern for RadialPattern

Source§

fn fill_span(&self, y: i32, x0: i32, x1: i32, out: &mut [u8])

Fill out with colour bytes for pixels x0..=x1 on scanline y. Read more
Source§

fn is_static_color(&self) -> bool

Return true if this pattern yields the same colour at every coordinate. When true, fill_span will be called once and the result reused across the whole span (optimisation hint only — correctness is not affected).

Auto Trait Implementations§

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.