embedded_graphics::geometry

Trait Dimensions

Source
pub trait Dimensions {
    // Required methods
    fn top_left(&self) -> Point;
    fn bottom_right(&self) -> Point;
    fn size(&self) -> Size;
}
Expand description

Adds the ability to get the dimensions/position of a graphics object

This should be implemented for all builtin embedded-graphics primitives and fonts. Third party implementations do not have to implement this trait as an object may not have a known size. If the object does have a known size, this trait should be implemented.

Required Methods§

Source

fn top_left(&self) -> Point

Get the top left corner of the bounding box for an object

Source

fn bottom_right(&self) -> Point

Get the bottom right corner of the bounding box for an object

Source

fn size(&self) -> Size

Get the width and height for an object

Implementors§

Source§

impl Dimensions for Circle

Source§

impl Dimensions for Line

Source§

impl Dimensions for Rectangle

Source§

impl Dimensions for Triangle

Source§

impl<'a, I, C> Dimensions for Image<'a, I, C>
where I: ImageDimensions, C: PixelColor + From<<C as PixelColor>::Raw>,

Source§

impl<C, F> Dimensions for Styled<Text<'_>, TextStyle<C, F>>
where C: PixelColor, F: Font,

Source§

impl<T, S> Dimensions for Styled<T, S>
where T: Dimensions,