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 Circle
pub fn new(center: Coord, radius: u32, color: u8) -> Self
[src]
pub fn new(center: Coord, radius: u32, color: u8) -> Self
Create a new circle with center point, radius and border color
Trait Implementations
impl Debug for Circle
[src]
impl Debug for Circle
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 Copy for Circle
[src]
impl Copy for Circle
impl Clone for Circle
[src]
impl Clone for Circle
fn clone(&self) -> Circle
[src]
fn clone(&self) -> Circle
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> IntoIterator for &'a Circle
[src]
impl<'a> IntoIterator for &'a Circle
type 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::IntoIter
Creates an iterator from a value. Read more
impl Drawable for Circle
[src]
impl Drawable for Circle
impl Transform for Circle
[src]
impl Transform for Circle
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, 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 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, 1); circle.translate_mut(Coord::new(10, 10)); assert_eq!(circle.center, Coord::new(15, 20));