pub trait Paint:
Clone
+ Default
+ 'static {
type ColorSourceFragment: ColorSourceFragment;
type ImageFilterFragment: ImageFilterFragment;
type Texture: Texture;
Show 25 methods
// Required methods
fn set_color(&mut self, color: impl Into<Color>);
fn set_blend_mode(&mut self, blend_mode: BlendMode);
fn set_draw_style(&mut self, draw_style: DrawStyle);
fn set_stroke_cap(&mut self, cap: StrokeCap);
fn set_stroke_join(&mut self, join: StrokeJoin);
fn set_stroke_width(&mut self, width: f32);
fn set_stroke_miter(&mut self, miter: f32);
fn set_color_source(
&mut self,
color_source: ColorSource<Self::Texture, Self::ColorSourceFragment>,
);
fn set_color_filter(&mut self, color_filter: ColorFilter);
fn set_image_filter(
&mut self,
image_filter: ImageFilter<Self::ImageFilterFragment>,
);
fn set_mask_filter(&mut self, mask_filter: MaskFilter);
// Provided methods
fn color(color: impl Into<Color>) -> Self { ... }
fn stroke_color(color: impl Into<Color>, stroke_width: f32) -> Self { ... }
fn color_source(
color_source: ColorSource<Self::Texture, Self::ColorSourceFragment>,
) -> Self { ... }
fn with_color(self, color: impl Into<Color>) -> Self { ... }
fn with_blend_mode(self, blend_mode: BlendMode) -> Self { ... }
fn with_draw_style(self, draw_style: DrawStyle) -> Self { ... }
fn with_stroke_cap(self, cap: StrokeCap) -> Self { ... }
fn with_stroke_join(self, join: StrokeJoin) -> Self { ... }
fn with_stroke_width(self, width: f32) -> Self { ... }
fn with_stroke_miter(self, miter: f32) -> Self { ... }
fn with_color_source(
self,
color_source: ColorSource<Self::Texture, Self::ColorSourceFragment>,
) -> Self { ... }
fn with_color_filter(self, color_filter: ColorFilter) -> Self { ... }
fn with_image_filter(
self,
image_filter: ImageFilter<Self::ImageFilterFragment>,
) -> Self { ... }
fn with_mask_filter(self, mask_filter: MaskFilter) -> Self { ... }
}Required Associated Types§
type ColorSourceFragment: ColorSourceFragment
type ImageFilterFragment: ImageFilterFragment
type Texture: Texture
Required Methods§
Sourcefn set_blend_mode(&mut self, blend_mode: BlendMode)
fn set_blend_mode(&mut self, blend_mode: BlendMode)
Sets the paint blend mode.
Sourcefn set_draw_style(&mut self, draw_style: DrawStyle)
fn set_draw_style(&mut self, draw_style: DrawStyle)
Set the paint draw style.
Sourcefn set_stroke_cap(&mut self, cap: StrokeCap)
fn set_stroke_cap(&mut self, cap: StrokeCap)
Sets how strokes rendered using this paint are capped.
Sourcefn set_stroke_join(&mut self, join: StrokeJoin)
fn set_stroke_join(&mut self, join: StrokeJoin)
Sets how strokes rendered using this paint are joined.
Sourcefn set_stroke_width(&mut self, width: f32)
fn set_stroke_width(&mut self, width: f32)
Sets the width of the strokes rendered using this paint.
Sourcefn set_stroke_miter(&mut self, miter: f32)
fn set_stroke_miter(&mut self, miter: f32)
Sets the miter limit of the strokes rendered using this paint.
Sourcefn set_color_source(
&mut self,
color_source: ColorSource<Self::Texture, Self::ColorSourceFragment>,
)
fn set_color_source( &mut self, color_source: ColorSource<Self::Texture, Self::ColorSourceFragment>, )
Sets the color source of the paint.
Sourcefn set_color_filter(&mut self, color_filter: ColorFilter)
fn set_color_filter(&mut self, color_filter: ColorFilter)
Sets the color filter of the paint.
Sourcefn set_image_filter(
&mut self,
image_filter: ImageFilter<Self::ImageFilterFragment>,
)
fn set_image_filter( &mut self, image_filter: ImageFilter<Self::ImageFilterFragment>, )
Sets the image filter of a paint.
Image filters are functions that are applied to regions of a texture to produce a single color.
Sourcefn set_mask_filter(&mut self, mask_filter: MaskFilter)
fn set_mask_filter(&mut self, mask_filter: MaskFilter)
Sets the mask filter of a paint.
Mask filters are functions that are applied over a shape after it has been drawn but before it has been blended into the final image.
Provided Methods§
fn color(color: impl Into<Color>) -> Self
fn stroke_color(color: impl Into<Color>, stroke_width: f32) -> Self
fn color_source( color_source: ColorSource<Self::Texture, Self::ColorSourceFragment>, ) -> Self
fn with_color(self, color: impl Into<Color>) -> Self
fn with_blend_mode(self, blend_mode: BlendMode) -> Self
fn with_draw_style(self, draw_style: DrawStyle) -> Self
fn with_stroke_cap(self, cap: StrokeCap) -> Self
fn with_stroke_join(self, join: StrokeJoin) -> Self
fn with_stroke_width(self, width: f32) -> Self
fn with_stroke_miter(self, miter: f32) -> Self
fn with_color_source( self, color_source: ColorSource<Self::Texture, Self::ColorSourceFragment>, ) -> Self
fn with_color_filter(self, color_filter: ColorFilter) -> Self
fn with_image_filter( self, image_filter: ImageFilter<Self::ImageFilterFragment>, ) -> Self
fn with_mask_filter(self, mask_filter: MaskFilter) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.