roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
roo_display::Drawable Class Referenceabstract

Interface for objects that can be drawn to an output device. More...

#include <drawable.h>

Inheritance diagram for roo_display::Drawable:
[legend]

Public Member Functions

virtual ~Drawable ()
 
virtual Box extents () const =0
 Return the bounding box encompassing all pixels that need to be drawn.
 
virtual Box anchorExtents () const
 Return the bounds used for alignment.
 

Static Public Member Functions

static const DrawableEmpty ()
 A singleton representing a no-op drawable with no bounding box.
 

Friends

void Surface::drawObject (const Drawable &object) const
 

Detailed Description

Interface for objects that can be drawn to an output device.

Examples include images, shapes, and UI widgets. Some drawables also implement Streamable (including Rasterizable types). Streamable and Rasterizable objects can be used in specialized contexts that generic drawables cannot, such as backgrounds, overlays, and streamable or rasterizable stacks.

Implementations must:

  • Override extents() to return the bounding box at (0, 0).
  • Override either drawTo() or drawInteriorTo() to implement drawing.

Definition at line 229 of file drawable.h.

Constructor & Destructor Documentation

◆ ~Drawable()

virtual roo_display::Drawable::~Drawable ( )
inlinevirtual

Definition at line 231 of file drawable.h.

Member Function Documentation

◆ anchorExtents()

virtual Box roo_display::Drawable::anchorExtents ( ) const
inlinevirtual

◆ Empty()

const Drawable * roo_display::Drawable::Empty ( )
static

A singleton representing a no-op drawable with no bounding box.

Returns
Pointer to a shared empty drawable instance.

Definition at line 40 of file drawable.cpp.

◆ extents()

virtual Box roo_display::Drawable::extents ( ) const
pure virtual

Return the bounding box encompassing all pixels that need to be drawn.

This method is called during a transaction and must not block or perform I/O.

Implemented in roo_display::Fill, roo_display::Clear, roo_display::RadialGradient, roo_display::RadialGradientSq, roo_display::LinearGradient, roo_display::AngularGradient, roo_display::RasterizableStack, roo_display::StreamableStack, roo_display::Offscreen< ColorMode, pixel_order, byte_order, pixels_per_byte, storage_type >, roo_display::Offscreen< Monochrome >, roo_display::Raster< PtrTypeT, ColorModeT, pixel_order, byte_order >, roo_display::Raster< const roo::byte *, ColorMode, ColorPixelOrder::kMsbFirst, roo_io::kBigEndian >, roo_display::Raster< const roo::byte *, typename Target::ColorMode, ColorPixelOrder::kMsbFirst, roo_io::kBigEndian >, roo_display::Raster< const roo::byte *PROGMEM, ColorMode, ColorPixelOrder::kMsbFirst, roo_io::kBigEndian >, roo_display::Raster< roo::byte *, ColorMode, ColorPixelOrder::kMsbFirst, roo_io::kBigEndian >, roo_display::SimpleRasterizable< Getter >, roo_display::SimpleTiledRasterizable< Getter >, roo_display::SimpleStreamable< Iterable, ColorMode, StreamType >, roo_display::SimpleStreamable< ProgMemPtr, Monochrome, ColorPixelOrder::kLsbFirst, roo_io::kBigEndian >, roo_display::TransformedDrawable, roo_display::JpegImage, roo_display::JpegFile, roo_display::PngImage, roo_display::PngFile, roo_display::DrawableRawStreamable< RawStreamable >, roo_display::Line, roo_display::RectBase, roo_display::FilledRect, roo_display::RoundRectBase, roo_display::CircleBase, roo_display::TriangleBase, roo_display::RoundRectShadow, roo_display::SmoothShape, roo_display::TransformedRaster< RasterType, TransformationType >, roo_display::TextLabel, roo_display::StringViewLabel, roo_display::ClippedStringViewLabel, and roo_display::internal::TileBase.

Referenced by anchorExtents(), roo_display::Rasterizable::createStream(), roo_display::TransformedDrawable::extents(), and roo_display::Rasterizable::readColorsMaybeOutOfBounds().

Friends And Related Symbol Documentation

◆ Surface::drawObject

void Surface::drawObject ( const Drawable object) const
friend

The documentation for this class was generated from the following files: