FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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).

    View source

    Members

    opacity

    fn opacity(self: &Self) -> f64
    

    The opacity of the brush.

    Source

    transform

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

    The transform of the brush.

    Source

    transform_origin

    fn transform_origin(self: &Self) -> RelativePoint
    

    The origin of the brush transform.

    Source

    relative_transform

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

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

    Source

    as_any

    fn as_any(self: &Self) -> &dyn Any
    

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

    Source

    as_object

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

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

    Source

    as_solid_color_brush

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

    The brush viewed as ISolidColorBrush, when it is one.

    Source

    as_gradient_brush

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

    The brush viewed as IGradientBrush, when it is one.

    Source

    as_linear_gradient_brush

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

    The brush viewed as ILinearGradientBrush, when it is one.

    Source

    as_radial_gradient_brush

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

    The brush viewed as IRadialGradientBrush, when it is one.

    Source

    as_conic_gradient_brush

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

    The brush viewed as IConicGradientBrush, when it is one.

    Source

    as_tile_brush

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

    The brush viewed as ITileBrush, when it is one.

    Source

    as_image_brush

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

    The brush viewed as IImageBrush, when it is one.

    Source

    as_scene_brush

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

    The brush viewed as ISceneBrush, when it is one.

    Source

    as_mutable_brush

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

    The brush viewed as IMutableBrush, when it is one.

    Source

    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).

    Source

    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).

    Source

    into_immutable_brush

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

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

    Source

    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.

    Source

    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).

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.