Struct embedded_graphics::primitives::circle::Circle [−][src]
pub struct Circle<C: PixelColor> { pub center: Coord, pub radius: u32, pub style: Style<C>, }
Circle primitive
Fields
center: Coord
Center point of circle
radius: u32
Radius of the circle
style: Style<C>
Style of the circle
Methods
impl<C> Circle<C> where
C: PixelColor,
[src]
impl<C> Circle<C> where
C: PixelColor,
pub fn new(center: Coord, radius: u32) -> Self
[src]
pub fn new(center: Coord, radius: u32) -> Self
Create a new circle with center point, radius and border color
Trait Implementations
impl<C: Debug + PixelColor> Debug for Circle<C>
[src]
impl<C: Debug + PixelColor> Debug for Circle<C>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<C: Copy + PixelColor> Copy for Circle<C>
[src]
impl<C: Copy + PixelColor> Copy for Circle<C>
impl<C: Clone + PixelColor> Clone for Circle<C>
[src]
impl<C: Clone + PixelColor> Clone for Circle<C>
fn clone(&self) -> Circle<C>
[src]
fn clone(&self) -> Circle<C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<C> WithStyle<C> for Circle<C> where
C: PixelColor,
[src]
impl<C> WithStyle<C> for Circle<C> where
C: PixelColor,
fn with_style(self, style: Style<C>) -> Self
[src]
fn with_style(self, style: Style<C>) -> Self
Add a complete style to the object
fn with_stroke(self, color: Option<C>) -> Self
[src]
fn with_stroke(self, color: Option<C>) -> Self
Set the stroke colour for the object Read more
fn with_stroke_width(self, width: u8) -> Self
[src]
fn with_stroke_width(self, width: u8) -> Self
Set the stroke width for the object Read more
fn with_fill(self, color: Option<C>) -> Self
[src]
fn with_fill(self, color: Option<C>) -> Self
Set the fill property of the object's style Read more
impl<'a, C> IntoIterator for &'a Circle<C> where
C: PixelColor,
[src]
impl<'a, C> IntoIterator for &'a Circle<C> where
C: PixelColor,
type Item = Pixel<C>
The type of the elements being iterated over.
type IntoIter = CircleIterator<C>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<C> Drawable for Circle<C> where
C: PixelColor,
[src]
impl<C> Drawable for Circle<C> where
C: PixelColor,
impl<C> Transform for Circle<C> where
C: PixelColor,
[src]
impl<C> Transform for Circle<C> where
C: PixelColor,
fn translate(&self, by: Coord) -> Self
[src]
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));
fn translate_mut(&mut self, by: Coord) -> &mut Self
[src]
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));