IBrush
trait · ferroui-base · v0.5.0
trait IBrush: 'static
Describes how an area is painted.
Implemented by the immutable brush types and, through an adapter, by
every class deriving from Brush: a handle of such a class converts to
Rc<dyn IBrush> with into(), so a value of that type can hold either
kind of brush. The as_* members replace interface casts
(brush as ISolidColorBrush).
Members
opacitytransformtransform_originrelative_transformas_anyas_objectas_solid_color_brushas_gradient_brushas_linear_gradient_brushas_radial_gradient_brushas_conic_gradient_brushas_tile_brushas_image_brushas_scene_brushas_mutable_brushas_immutable_brushas_composition_brushinto_immutable_brushto_sharedequals
opacity
fn opacity(self: &Self) -> f64
The opacity of the brush.
transform
fn transform(self: &Self) -> Option<Rc<dyn ITransform>>
The transform of the brush.
transform_origin
fn transform_origin(self: &Self) -> RelativePoint
The origin of the brush transform.
relative_transform
fn relative_transform(self: &Self) -> Option<Rc<dyn ITransform>>
The transform of the brush, relative to the bounds of the painted area.
as_any
fn as_any(self: &Self) -> &dyn Any
The implementing value, for downcasts to immutable brush types. For
mutable brushes use as_object.
as_object
fn as_object(self: &Self) -> Option<&FerroObject>
The object behind the brush when it is a mutable Brush.
as_solid_color_brush
fn as_solid_color_brush(self: &Self) -> Option<&dyn ISolidColorBrush>
The brush viewed as ISolidColorBrush, when it is one.
as_gradient_brush
fn as_gradient_brush(self: &Self) -> Option<&dyn IGradientBrush>
The brush viewed as IGradientBrush, when it is one.
as_linear_gradient_brush
fn as_linear_gradient_brush(self: &Self) -> Option<&dyn ILinearGradientBrush>
The brush viewed as ILinearGradientBrush, when it is one.
as_radial_gradient_brush
fn as_radial_gradient_brush(self: &Self) -> Option<&dyn IRadialGradientBrush>
The brush viewed as IRadialGradientBrush, when it is one.
as_conic_gradient_brush
fn as_conic_gradient_brush(self: &Self) -> Option<&dyn IConicGradientBrush>
The brush viewed as IConicGradientBrush, when it is one.
as_tile_brush
fn as_tile_brush(self: &Self) -> Option<&dyn ITileBrush>
The brush viewed as ITileBrush, when it is one.
as_image_brush
fn as_image_brush(self: &Self) -> Option<&dyn IImageBrush>
The brush viewed as IImageBrush, when it is one.
as_scene_brush
fn as_scene_brush(self: &Self) -> Option<&dyn ISceneBrush>
The brush viewed as ISceneBrush, when it is one.
as_mutable_brush
fn as_mutable_brush(self: &Self) -> Option<&dyn IMutableBrush>
The brush viewed as IMutableBrush, when it is one.
as_immutable_brush
fn as_immutable_brush(self: &Self) -> Option<&dyn IImmutableBrush>
The brush viewed as IImmutableBrush, when it is one (the is IImmutableBrush test of upstream).
as_composition_brush
fn as_composition_brush(self: &Self) -> Option<&crate::rendering::composition::CompositionBrush>
The brush as a composition brush, when it is one (the is CompositionBrush test of upstream).
into_immutable_brush
fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>
The brush as an IImmutableBrush handle, when it is immutable.
to_shared
fn to_shared(self: &Self) -> Option<crate::media::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.
equals
fn equals(self: &Self, other: &dyn IBrush) -> bool
Whether the brush equals other. Brushes compare by reference unless
the type defines structural equality (immutable solid color brushes).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.