Trait embedded_graphics::geometry::OriginDimensions

source ·
pub trait OriginDimensions {
    // Required method
    fn size(&self) -> Size;
}
Expand description

Dimensions with top_left of the bounding box at (0, 0).

A blanket implementation of Dimensions is provided for all types that implement this trait. See the Dimensions trait documentation for more information about bounding boxes.

§Implementation notes

This trait should be implemented instead of Dimensions if the top left corner of the bounding box will always be at the origin, which will be the case for most display drivers. Some types, like ImageDrawable, require a bounding box that starts at the origin and can only be used if OriginDimensions is implemented.

Required Methods§

source

fn size(&self) -> Size

Returns the size of the bounding box.

Implementors§

source§

impl<C> OriginDimensions for MockDisplay<C>
where C: PixelColor,

source§

impl<C, BO> OriginDimensions for ImageRaw<'_, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw>, BO: ByteOrder,

source§

impl<C, R, BO, const WIDTH: usize, const HEIGHT: usize, const N: usize> OriginDimensions for Framebuffer<C, R, BO, WIDTH, HEIGHT, N>

source§

impl<T> OriginDimensions for Cropped<'_, T>
where T: DrawTarget,

source§

impl<T> OriginDimensions for SubImage<'_, T>