Struct embedded_graphics::primitives::circle::Circle [−][src]
pub struct Circle<C: PixelColor> { pub center: Coord, pub radius: u32, pub color: C, }
Circle primitive
Fields
center: Coord
Center point of circle
radius: u32
Radius of the circle
color: C
Line colour of circle
Methods
impl<C> Circle<C> where
C: PixelColor, [src]
impl<C> Circle<C> where
C: PixelColor, pub fn new(center: Coord, radius: u32, color: C) -> Self[src]
pub fn new(center: Coord, radius: u32, color: C) -> SelfCreate 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) -> ResultFormats 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)1.0.0
[src]Performs copy-assignment from source. 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::IntoIterCreates 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) -> SelfTranslate 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, 1u8); 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 SelfTranslate 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, 1u8); circle.translate_mut(Coord::new(10, 10)); assert_eq!(circle.center, Coord::new(15, 20));