Struct embedded_graphics::primitives::circle::Circle [−][src]
Circle primitive
Fields
center: Coord
Center point of circle
radius: u32
Radius of the circle
color: Color
Line colour of circle
Methods
impl Circle[src]
impl Circlepub fn new(center: Coord, radius: u32, color: u8) -> Self[src]
pub fn new(center: Coord, radius: u32, color: u8) -> SelfCreate a new circle with center point, radius and border color
Trait Implementations
impl Debug for Circle[src]
impl Debug for Circlefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Copy for Circle[src]
impl Copy for Circleimpl Clone for Circle[src]
impl Clone for Circlefn clone(&self) -> Circle[src]
fn clone(&self) -> CircleReturns 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> IntoIterator for &'a Circle[src]
impl<'a> IntoIterator for &'a Circletype Item = Pixel
The type of the elements being iterated over.
type IntoIter = CircleIterator
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 Drawable for Circle[src]
impl Drawable for Circleimpl Transform for Circle[src]
impl Transform for Circlefn 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, 1); 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, 1); circle.translate_mut(Coord::new(10, 10)); assert_eq!(circle.center, Coord::new(15, 20));