Skip to main content

ImmutableRadialGradientBrush

Struct ImmutableRadialGradientBrush 

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

A brush that draws with a radial gradient.

Implementations§

Source§

impl ImmutableRadialGradientBrush

Source

pub fn new( gradient_stops: &[ImmutableGradientStop], opacity: f64, transform: Option<Rc<ImmutableTransform>>, transform_origin: Option<RelativePoint>, spread_method: GradientSpreadMethod, center: Option<RelativePoint>, gradient_origin: Option<RelativePoint>, radius_x: Option<RelativeScalar>, radius_y: Option<RelativeScalar>, relative_transform: Option<Rc<ImmutableTransform>>, ) -> Self

Creates a brush. transform_origin defaults to the top left corner, center and gradient_origin to the center and the radii to one half, relative.

Source

pub fn with_radius( gradient_stops: &[ImmutableGradientStop], opacity: f64, transform: Option<Rc<ImmutableTransform>>, transform_origin: Option<RelativePoint>, spread_method: GradientSpreadMethod, center: Option<RelativePoint>, gradient_origin: Option<RelativePoint>, radius: f64, ) -> Self

Creates a brush whose radii are both radius, relative to the painted area.

Source

pub fn from_stops(gradient_stops: &[ImmutableGradientStop]) -> Self

Creates a fully opaque brush with the given stops and default values for everything else.

Source

pub fn from_brush(source: &RadialGradientBrush) -> Self

Creates an immutable copy of source.

Source

pub fn center(&self) -> RelativePoint

The start point for the gradient.

Source

pub fn gradient_origin(&self) -> RelativePoint

The location of the two-dimensional focal point that defines the beginning of the gradient.

Source

pub fn radius_x(&self) -> RelativeScalar

The horizontal radius of the outermost circle of the radial gradient.

Source

pub fn radius_y(&self) -> RelativeScalar

The vertical radius of the outermost circle of the radial gradient.

Methods from Deref<Target = ImmutableGradientBrush>§

Source

pub fn gradient_stops(&self) -> &[Rc<dyn IGradientStop>]

The brush’s gradient stops.

Source

pub fn opacity(&self) -> f64

The opacity of the brush.

Source

pub fn transform(&self) -> Option<Rc<dyn ITransform>>

The transform of the brush.

Source

pub fn transform_origin(&self) -> RelativePoint

The transform origin of the brush.

Source

pub fn spread_method(&self) -> GradientSpreadMethod

The brush’s spread method.

Source

pub fn relative_transform(&self) -> Option<Rc<dyn ITransform>>

The transform of the brush, relative to the bounds of the painted area.

Trait Implementations§

Source§

impl Clone for ImmutableRadialGradientBrush

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for ImmutableRadialGradientBrush

Source§

type Target = ImmutableGradientBrush

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl IBrush for ImmutableRadialGradientBrush

Source§

fn opacity(&self) -> f64

The opacity of the brush.
Source§

fn transform(&self) -> Option<Rc<dyn ITransform>>

The transform of the brush.
Source§

fn transform_origin(&self) -> RelativePoint

The origin of the brush transform.
Source§

fn relative_transform(&self) -> Option<Rc<dyn ITransform>>

The transform of the brush, relative to the bounds of the painted area.
Source§

fn as_immutable_brush(&self) -> Option<&dyn IImmutableBrush>

The brush viewed as IImmutableBrush, when it is one (the is IImmutableBrush test of upstream).
Source§

fn as_any(&self) -> &dyn Any

The implementing value, for downcasts to immutable brush types. For mutable brushes use as_object.
Source§

fn as_gradient_brush(&self) -> Option<&dyn IGradientBrush>

The brush viewed as IGradientBrush, when it is one.
Source§

fn as_radial_gradient_brush(&self) -> Option<&dyn IRadialGradientBrush>

The brush viewed as IRadialGradientBrush, when it is one.
Source§

fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>

The brush as an IImmutableBrush handle, when it is immutable.
Source§

fn to_shared(&self) -> Option<SharedBrush>

The form of the brush that is sent to the render thread, when the type keeps one: see SharedBrush. An immutable brush creates it once, so its identity is stable.
Source§

fn as_object(&self) -> Option<&FerroObject>

The object behind the brush when it is a mutable Brush.
Source§

fn as_solid_color_brush(&self) -> Option<&dyn ISolidColorBrush>

The brush viewed as ISolidColorBrush, when it is one.
Source§

fn as_linear_gradient_brush(&self) -> Option<&dyn ILinearGradientBrush>

The brush viewed as ILinearGradientBrush, when it is one.
Source§

fn as_conic_gradient_brush(&self) -> Option<&dyn IConicGradientBrush>

The brush viewed as IConicGradientBrush, when it is one.
Source§

fn as_tile_brush(&self) -> Option<&dyn ITileBrush>

The brush viewed as ITileBrush, when it is one.
Source§

fn as_image_brush(&self) -> Option<&dyn IImageBrush>

The brush viewed as IImageBrush, when it is one.
Source§

fn as_scene_brush(&self) -> Option<&dyn ISceneBrush>

The brush viewed as ISceneBrush, when it is one.
Source§

fn as_mutable_brush(&self) -> Option<&dyn IMutableBrush>

The brush viewed as IMutableBrush, when it is one.
Source§

fn as_composition_render_resource( &self, ) -> Option<&dyn ICompositionRenderResource>

The composition render resource behind the object, if it is a mutable object with server-side counterparts on the compositors it is drawn with.
Source§

fn as_composition_brush(&self) -> Option<&CompositionBrush>

The brush as a composition brush, when it is one (the is CompositionBrush test of upstream).
Source§

fn equals(&self, other: &dyn IBrush) -> bool

Whether the brush equals other. Brushes compare by reference unless the type defines structural equality (immutable solid color brushes).
Source§

impl IGradientBrush for ImmutableRadialGradientBrush

Source§

fn gradient_stops(&self) -> Vec<Rc<dyn IGradientStop>>

The brush’s gradient stops.
Source§

fn spread_method(&self) -> GradientSpreadMethod

The brush’s spread method that defines how to draw a gradient that doesn’t fill the bounds of the destination control.
Source§

impl IImmutableBrush for ImmutableRadialGradientBrush

Source§

impl IRadialGradientBrush for ImmutableRadialGradientBrush

Source§

fn center(&self) -> RelativePoint

The start point for the gradient.
Source§

fn gradient_origin(&self) -> RelativePoint

The location of the two-dimensional focal point that defines the beginning of the gradient.
Source§

fn radius_x(&self) -> RelativeScalar

The horizontal radius of the outermost circle of the radial gradient.
Source§

fn radius_y(&self) -> RelativeScalar

The vertical radius of the outermost circle of the radial gradient.

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.