pub struct ImmutableGradientBrush { /* private fields */ }Expand description
The data shared by all immutable gradient brushes.
Implementations§
Source§impl ImmutableGradientBrush
impl ImmutableGradientBrush
Sourcepub fn new(
gradient_stops: &[ImmutableGradientStop],
opacity: f64,
transform: Option<Rc<ImmutableTransform>>,
transform_origin: Option<RelativePoint>,
spread_method: GradientSpreadMethod,
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, relative_transform: Option<Rc<ImmutableTransform>>, ) -> Self
Creates the gradient brush data. transform_origin defaults to the
top left corner.
Sourcepub fn from_brush(source: &GradientBrush) -> Self
pub fn from_brush(source: &GradientBrush) -> Self
Creates an immutable copy of the gradient data of source.
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§
Auto Trait Implementations§
impl !Freeze for ImmutableGradientBrush
impl !RefUnwindSafe for ImmutableGradientBrush
impl !Send for ImmutableGradientBrush
impl !Sync for ImmutableGradientBrush
impl !UnwindSafe for ImmutableGradientBrush
impl Unpin for ImmutableGradientBrush
impl UnsafeUnpin for ImmutableGradientBrush
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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