Struct embedded_graphics::primitives::circle::Circle
source · pub struct Circle<C: PixelColor> {
pub center: Coord,
pub radius: u32,
pub style: Style<C>,
}Expand description
Circle primitive
Fields
center: CoordCenter point of circle
radius: u32Radius of the circle
style: Style<C>Style of the circle
Implementations
Trait Implementations
sourceimpl<C: Clone + PixelColor> Clone for Circle<C>
impl<C: Clone + PixelColor> Clone for Circle<C>
sourceimpl<C: Debug + PixelColor> Debug for Circle<C>
impl<C: Debug + PixelColor> Debug for Circle<C>
sourceimpl<'a, C> IntoIterator for &'a Circle<C>where
C: PixelColor,
impl<'a, C> IntoIterator for &'a Circle<C>where
C: PixelColor,
sourceimpl<C> Transform for Circle<C>where
C: PixelColor,
impl<C> Transform for Circle<C>where
C: PixelColor,
sourcefn translate(&self, by: Coord) -> Self
fn translate(&self, by: Coord) -> Self
Translate the circle center from its current position to a new position by (x, y) pixels,
returning a new Circle. For a mutating transform, see translate_mut.
let circle = Circle::new(Coord::new(5, 10), 10)
let moved = circle.translate(Coord::new(10, 10));
assert_eq!(moved.center, Coord::new(15, 20));sourcefn translate_mut(&mut self, by: Coord) -> &mut Self
fn translate_mut(&mut self, by: Coord) -> &mut Self
Translate the circle center from its current position to a new position by (x, y) pixels.
let mut circle = Circle::new(Coord::new(5, 10), 10)
circle.translate_mut(Coord::new(10, 10));
assert_eq!(circle.center, Coord::new(15, 20));sourceimpl<C> WithStyle<C> for Circle<C>where
C: PixelColor,
impl<C> WithStyle<C> for Circle<C>where
C: PixelColor,
sourcefn with_style(self, style: Style<C>) -> Self
fn with_style(self, style: Style<C>) -> Self
Add a complete style to the object
sourcefn with_stroke(self, color: Option<C>) -> Self
fn with_stroke(self, color: Option<C>) -> Self
Set the stroke colour for the object Read more
sourcefn with_stroke_width(self, width: u8) -> Self
fn with_stroke_width(self, width: u8) -> Self
Set the stroke width for the object Read more
impl<C: Copy + PixelColor> Copy for Circle<C>
impl<C> Drawable for Circle<C>where
C: PixelColor,
Auto Trait Implementations
impl<C> RefUnwindSafe for Circle<C>where
C: RefUnwindSafe,
impl<C> Send for Circle<C>where
C: Send,
impl<C> Sync for Circle<C>where
C: Sync,
impl<C> Unpin for Circle<C>where
C: Unpin,
impl<C> UnwindSafe for Circle<C>where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more