Graphics::ImageObject Class Referenceabstract

Virtual base class for an image. More...

#include <Object.h>

Inheritance diagram for Graphics::ImageObject:
Collaboration diagram for Graphics::ImageObject:

Public Member Functions

 ImageObject (Size size)
 
void write (MetaWriter &meta) const override
 
RenderercreateRenderer (const Location &location) const override
 Create a software renderer for this object. More...
 
Size getSize () const
 
uint16_t width () const
 
uint16_t height () const
 
virtual bool init ()=0
 Initialise the object, e.g. parse header content and obtain dimensions. More...
 
virtual PixelFormat getPixelFormat () const =0
 Get native pixel format. More...
 
virtual size_t readPixels (const Location &loc, PixelFormat format, void *buffer, uint16_t width) const =0
 Read pixels in requested format. More...
 
- Public Member Functions inherited from Graphics::ObjectTemplate< Object::Kind::Image >
Kind kind () const override
 
- Public Member Functions inherited from Graphics::Object
bool operator== (const Object &other) const
 
virtual String getTypeStr () const
 
- Public Member Functions inherited from LinkedObjectTemplate< Object >
Object * getNext () const
 
bool insertAfter (Object *object)
 
Iterator begin () const
 
Iterator end () const
 
Iterator cbegin () const
 
Iterator cend () const
 
- Public Member Functions inherited from LinkedObject
virtual ~LinkedObject ()
 
virtual LinkedObjectnext () const
 
bool insertAfter (LinkedObject *object)
 
bool operator== (const LinkedObject &other) const
 
bool operator!= (const LinkedObject &other) const
 

Protected Attributes

Size imageSize {}
 

Additional Inherited Members

- Public Types inherited from Graphics::Object
enum class  Kind { XX }
 
using List = LinkedObjectListTemplate< Object >
 
using OwnedList = OwnedLinkedObjectListTemplate< Object >
 
- Public Types inherited from LinkedObjectTemplate< Object >
using Iterator = IteratorTemplate< Object, Object *, Object & >
 
using ConstIterator = IteratorTemplate< const Object, const Object *, const Object & >
 

Detailed Description

Virtual base class for an image.

Constructor & Destructor Documentation

◆ ImageObject()

Graphics::ImageObject::ImageObject ( Size  size)
inline

Member Function Documentation

◆ createRenderer()

Renderer* Graphics::ImageObject::createRenderer ( const Location location) const
overridevirtual

Create a software renderer for this object.

Parameters
location
Return values
rendererReturned renderer object

Return nullptr if object cannot/should not be rendered

Implements Graphics::Object.

◆ getPixelFormat()

virtual PixelFormat Graphics::ImageObject::getPixelFormat ( ) const
pure virtual

Get native pixel format.

Return values
PixelFormatReturn None if ambivalent about format (e.g. calculated pixel data)

Implemented in Graphics::GlyphObject, Graphics::FileImageObject, Graphics::MemoryImageObject, Graphics::RawImageObject, and Graphics::BitmapObject.

◆ getSize()

Size Graphics::ImageObject::getSize ( ) const
inline

◆ height()

uint16_t Graphics::ImageObject::height ( ) const
inline

◆ init()

virtual bool Graphics::ImageObject::init ( )
pure virtual

Initialise the object, e.g. parse header content and obtain dimensions.

Implemented in Graphics::RawImageObject, Graphics::BitmapObject, and Graphics::LcdGlyph.

◆ readPixels()

virtual size_t Graphics::ImageObject::readPixels ( const Location loc,
PixelFormat  format,
void *  buffer,
uint16_t  width 
) const
pure virtual

Read pixels in requested format.

Parameters
locStart position
formatRequired pixel format
bufferBuffer for pixels
widthNumber of pixels to read
Return values
size_tNumber of bytes written

Implemented in Graphics::GlyphObject, Graphics::RawImageObject, and Graphics::BitmapObject.

◆ width()

uint16_t Graphics::ImageObject::width ( ) const
inline

◆ write()

void Graphics::ImageObject::write ( MetaWriter meta) const
inlineoverridevirtual

Member Data Documentation

◆ imageSize

Size Graphics::ImageObject::imageSize {}
protected

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