pub struct ImmutableRadialGradientBrush { /* private fields */ }Expand description
A brush that draws with a radial gradient.
Implementations§
Source§impl ImmutableRadialGradientBrush
impl ImmutableRadialGradientBrush
Sourcepub 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
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.
Sourcepub 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
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.
Sourcepub fn from_stops(gradient_stops: &[ImmutableGradientStop]) -> Self
pub fn from_stops(gradient_stops: &[ImmutableGradientStop]) -> Self
Creates a fully opaque brush with the given stops and default values for everything else.
Sourcepub fn from_brush(source: &RadialGradientBrush) -> Self
pub fn from_brush(source: &RadialGradientBrush) -> Self
Creates an immutable copy of source.
Sourcepub fn center(&self) -> RelativePoint
pub fn center(&self) -> RelativePoint
The start point for the gradient.
Sourcepub fn gradient_origin(&self) -> RelativePoint
pub fn gradient_origin(&self) -> RelativePoint
The location of the two-dimensional focal point that defines the beginning of the gradient.
Sourcepub fn radius_x(&self) -> RelativeScalar
pub fn radius_x(&self) -> RelativeScalar
The horizontal radius of the outermost circle of the radial gradient.
Sourcepub fn radius_y(&self) -> RelativeScalar
pub fn radius_y(&self) -> RelativeScalar
The vertical radius of the outermost circle of the radial gradient.
Methods from Deref<Target = ImmutableGradientBrush>§
Sourcepub fn gradient_stops(&self) -> &[Rc<dyn IGradientStop>]
pub fn gradient_stops(&self) -> &[Rc<dyn IGradientStop>]
The brush’s gradient stops.
Sourcepub fn transform(&self) -> Option<Rc<dyn ITransform>>
pub fn transform(&self) -> Option<Rc<dyn ITransform>>
The transform of the brush.
Sourcepub fn transform_origin(&self) -> RelativePoint
pub fn transform_origin(&self) -> RelativePoint
The transform origin of the brush.
Sourcepub fn spread_method(&self) -> GradientSpreadMethod
pub fn spread_method(&self) -> GradientSpreadMethod
The brush’s spread method.
Sourcepub fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
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
impl Clone for ImmutableRadialGradientBrush
Source§impl Deref for ImmutableRadialGradientBrush
impl Deref for ImmutableRadialGradientBrush
Source§impl IBrush for ImmutableRadialGradientBrush
impl IBrush for ImmutableRadialGradientBrush
Source§fn transform_origin(&self) -> RelativePoint
fn transform_origin(&self) -> RelativePoint
transform.Source§fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
Source§fn as_immutable_brush(&self) -> Option<&dyn IImmutableBrush>
fn as_immutable_brush(&self) -> Option<&dyn IImmutableBrush>
IImmutableBrush, when it is one (the is IImmutableBrush test of upstream).Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
as_object.Source§fn as_gradient_brush(&self) -> Option<&dyn IGradientBrush>
fn as_gradient_brush(&self) -> Option<&dyn IGradientBrush>
IGradientBrush, when it is one.Source§fn as_radial_gradient_brush(&self) -> Option<&dyn IRadialGradientBrush>
fn as_radial_gradient_brush(&self) -> Option<&dyn IRadialGradientBrush>
IRadialGradientBrush, when it is one.Source§fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>
fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>
IImmutableBrush handle, when it is immutable.SharedBrush. An
immutable brush creates it once, so its identity is stable.Source§fn as_object(&self) -> Option<&FerroObject>
fn as_object(&self) -> Option<&FerroObject>
Brush.Source§fn as_solid_color_brush(&self) -> Option<&dyn ISolidColorBrush>
fn as_solid_color_brush(&self) -> Option<&dyn ISolidColorBrush>
ISolidColorBrush, when it is one.Source§fn as_linear_gradient_brush(&self) -> Option<&dyn ILinearGradientBrush>
fn as_linear_gradient_brush(&self) -> Option<&dyn ILinearGradientBrush>
ILinearGradientBrush, when it is one.Source§fn as_conic_gradient_brush(&self) -> Option<&dyn IConicGradientBrush>
fn as_conic_gradient_brush(&self) -> Option<&dyn IConicGradientBrush>
IConicGradientBrush, when it is one.Source§fn as_tile_brush(&self) -> Option<&dyn ITileBrush>
fn as_tile_brush(&self) -> Option<&dyn ITileBrush>
ITileBrush, when it is one.Source§fn as_image_brush(&self) -> Option<&dyn IImageBrush>
fn as_image_brush(&self) -> Option<&dyn IImageBrush>
IImageBrush, when it is one.Source§fn as_scene_brush(&self) -> Option<&dyn ISceneBrush>
fn as_scene_brush(&self) -> Option<&dyn ISceneBrush>
ISceneBrush, when it is one.Source§fn as_mutable_brush(&self) -> Option<&dyn IMutableBrush>
fn as_mutable_brush(&self) -> Option<&dyn IMutableBrush>
IMutableBrush, when it is one.Source§fn as_composition_render_resource(
&self,
) -> Option<&dyn ICompositionRenderResource>
fn as_composition_render_resource( &self, ) -> Option<&dyn ICompositionRenderResource>
Source§fn as_composition_brush(&self) -> Option<&CompositionBrush>
fn as_composition_brush(&self) -> Option<&CompositionBrush>
is CompositionBrush test of upstream).Source§impl IGradientBrush for ImmutableRadialGradientBrush
impl IGradientBrush for ImmutableRadialGradientBrush
Source§fn gradient_stops(&self) -> Vec<Rc<dyn IGradientStop>>
fn gradient_stops(&self) -> Vec<Rc<dyn IGradientStop>>
Source§fn spread_method(&self) -> GradientSpreadMethod
fn spread_method(&self) -> GradientSpreadMethod
impl IImmutableBrush for ImmutableRadialGradientBrush
Source§impl IRadialGradientBrush for ImmutableRadialGradientBrush
impl IRadialGradientBrush for ImmutableRadialGradientBrush
Source§fn center(&self) -> RelativePoint
fn center(&self) -> RelativePoint
Source§fn gradient_origin(&self) -> RelativePoint
fn gradient_origin(&self) -> RelativePoint
Source§fn radius_x(&self) -> RelativeScalar
fn radius_x(&self) -> RelativeScalar
Source§fn radius_y(&self) -> RelativeScalar
fn radius_y(&self) -> RelativeScalar
Auto Trait Implementations§
impl !Freeze for ImmutableRadialGradientBrush
impl !RefUnwindSafe for ImmutableRadialGradientBrush
impl !Send for ImmutableRadialGradientBrush
impl !Sync for ImmutableRadialGradientBrush
impl !UnwindSafe for ImmutableRadialGradientBrush
impl Unpin for ImmutableRadialGradientBrush
impl UnsafeUnpin for ImmutableRadialGradientBrush
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more