pub struct DrawTargetRenderer<'d, D> { /* private fields */ }Expand description
Adapter implementing Renderer over any DrawTarget.
Implementations§
Trait Implementations§
Source§impl<'d, C, D> Renderer<C> for DrawTargetRenderer<'d, D>where
C: PixelColor,
D: DrawTarget<Color = C>,
impl<'d, C, D> Renderer<C> for DrawTargetRenderer<'d, D>where
C: PixelColor,
D: DrawTarget<Color = C>,
Source§fn fill_rect(&mut self, rect: Rectangle, color: C) -> Result<(), RenderError>
fn fill_rect(&mut self, rect: Rectangle, color: C) -> Result<(), RenderError>
Fill
rect with a solid color.Source§fn stroke_rect(&mut self, rect: Rectangle, color: C) -> Result<(), RenderError>
fn stroke_rect(&mut self, rect: Rectangle, color: C) -> Result<(), RenderError>
Draw a 1-pixel inside-aligned border around
rect.Source§fn fill_circle(
&mut self,
center: Point,
radius: u32,
color: C,
) -> Result<(), RenderError>
fn fill_circle( &mut self, center: Point, radius: u32, color: C, ) -> Result<(), RenderError>
Fill circle with a solid color.
Source§fn stroke_line(
&mut self,
start: Point,
end: Point,
color: C,
width: u32,
) -> Result<(), RenderError>
fn stroke_line( &mut self, start: Point, end: Point, color: C, width: u32, ) -> Result<(), RenderError>
Create a stroke line.
Source§fn draw_text(
&mut self,
text: &str,
position: Point,
font: &MonoFont<'_>,
color: C,
alignment: Alignment,
) -> Result<(), RenderError>
fn draw_text( &mut self, text: &str, position: Point, font: &MonoFont<'_>, color: C, alignment: Alignment, ) -> Result<(), RenderError>
Render text with a mono font at
position with the given alignment.Source§fn draw_image(
&mut self,
top_left: Point,
size: Size,
pixels: &[C],
) -> Result<(), RenderError>
fn draw_image( &mut self, top_left: Point, size: Size, pixels: &[C], ) -> Result<(), RenderError>
Used to draw an Image widget.
Source§fn stroke_arc(
&mut self,
center: Point,
radius: u32,
start_deg: i32,
sweep_deg: i32,
width: u32,
color: C,
) -> Result<(), RenderError>
fn stroke_arc( &mut self, center: Point, radius: u32, start_deg: i32, sweep_deg: i32, width: u32, color: C, ) -> Result<(), RenderError>
Stroke a circular arc centered at
center with the given
radius, beginning at start_deg and sweeping sweep_deg
degrees (positive = counter-clockwise in screen space, i.e.
toward the top, since 0° points right). width is the stroke
thickness in pixels. Read moreSource§fn fill_arc(
&mut self,
center: Point,
radius: u32,
start_deg: i32,
sweep_deg: i32,
color: C,
) -> Result<(), RenderError>
fn fill_arc( &mut self, center: Point, radius: u32, start_deg: i32, sweep_deg: i32, color: C, ) -> Result<(), RenderError>
Fill a circular sector (pie slice) centered at
center with the
given radius, from start_deg sweeping sweep_deg degrees. Read moreAuto Trait Implementations§
impl<'d, D> Freeze for DrawTargetRenderer<'d, D>
impl<'d, D> RefUnwindSafe for DrawTargetRenderer<'d, D>where
D: RefUnwindSafe,
impl<'d, D> Send for DrawTargetRenderer<'d, D>where
D: Send,
impl<'d, D> Sync for DrawTargetRenderer<'d, D>where
D: Sync,
impl<'d, D> Unpin for DrawTargetRenderer<'d, D>
impl<'d, D> UnsafeUnpin for DrawTargetRenderer<'d, D>
impl<'d, D> !UnwindSafe for DrawTargetRenderer<'d, D>
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.