pub struct Ellipse<S = f32> {
pub rect: Rect<S>,
pub resolution: S,
}
Expand description
A simple ellipse type with helper methods around the ellipse
module’s functions.
Fields§
§rect: Rect<S>
The width and height off the Ellipse
.
resolution: S
The resolution (number of sides) of the Ellipse
.
Implementations§
source§impl<S> Ellipse<S>where
S: EllipseScalar,
impl<S> Ellipse<S>where
S: EllipseScalar,
sourcepub fn new(rect: Rect<S>, resolution: S) -> Ellipse<S>
pub fn new(rect: Rect<S>, resolution: S) -> Ellipse<S>
Construct a new ellipse from its bounding rect and resolution (number of sides).
sourcepub fn section(self, offset_radians: S, section_radians: S) -> Section<S>
pub fn section(self, offset_radians: S, section_radians: S) -> Section<S>
A section of the Ellipse
.
offset_radians
describes the angle at which the offset begins.
section_radians
describes how large the section is as an angle.
sourcepub fn circumference(self) -> Circumference<S> ⓘ
pub fn circumference(self) -> Circumference<S> ⓘ
Produces an iterator yielding the points of the ellipse circumference.
sourcepub fn triangles(self) -> Triangles<S> ⓘ
pub fn triangles(self) -> Triangles<S> ⓘ
Produces an iterator yielding the triangles that describe the ellipse.
TODO: Describe the order.
sourcepub fn triangle_indices(&self) -> (TriangleVertices<S>, TriangleIndices)
pub fn triangle_indices(&self) -> (TriangleVertices<S>, TriangleIndices)
The same as Triangles, but produces the indices of each triangle into the returned
TriangleVertices iterator rather than the vertices for each corner.
Trait Implementations§
source§impl<S> PartialEq for Ellipse<S>where
S: PartialEq,
impl<S> PartialEq for Ellipse<S>where
S: PartialEq,
source§impl<S> PartialOrd for Ellipse<S>where
S: PartialOrd,
impl<S> PartialOrd for Ellipse<S>where
S: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<S> Copy for Ellipse<S>where
S: Copy,
impl<S> StructuralPartialEq for Ellipse<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for Ellipse<S>where
S: RefUnwindSafe,
impl<S> Send for Ellipse<S>where
S: Send,
impl<S> Sync for Ellipse<S>where
S: Sync,
impl<S> Unpin for Ellipse<S>where
S: Unpin,
impl<S> UnwindSafe for Ellipse<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined range,
otherwise an
OutOfBounds
error is returned which contains the unclamped color. Read more