Graphics::GlyphObject Class Referenceabstract
A character glyph image. More...
#include <Object.h>
Inheritance diagram for Graphics::GlyphObject:
Collaboration diagram for Graphics::GlyphObject:
Public Types | |
using | Bits = std::bitset< 64 > |
using | Options = TextOptions |
using | Metrics = GlyphMetrics |
![]() | |
enum class | Kind { XX } |
using | List = LinkedObjectListTemplate< Object > |
using | OwnedList = OwnedLinkedObjectListTemplate< Object > |
![]() | |
using | Iterator = IteratorTemplate< Object, Object *, Object & > |
using | ConstIterator = IteratorTemplate< const Object, const Object *, const Object & > |
Public Member Functions | |
GlyphObject (const Metrics &metrics, const Options &options) | |
Kind | kind () const override |
PixelFormat | getPixelFormat () const override |
Get native pixel format. More... | |
size_t | readPixels (const Location &loc, PixelFormat format, void *buffer, uint16_t width) const override |
Read pixels in requested format. More... | |
virtual Bits | getBits (uint16_t row) const =0 |
virtual void | readAlpha (void *buffer, Point origin, size_t stride) const =0 |
Obtain glyph information as block of 8-bit alpha values. More... | |
const Metrics & | getMetrics () const |
![]() | |
ImageObject (Size size) | |
void | write (MetaWriter &meta) const override |
Renderer * | createRenderer (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... | |
![]() | |
Kind | kind () const override |
![]() | |
bool | operator== (const Object &other) const |
virtual String | getTypeStr () const |
![]() | |
Object * | getNext () const |
bool | insertAfter (Object *object) |
Iterator | begin () const |
Iterator | end () const |
Iterator | cbegin () const |
Iterator | cend () const |
![]() | |
virtual | ~LinkedObject () |
virtual LinkedObject * | next () const |
bool | insertAfter (LinkedObject *object) |
bool | operator== (const LinkedObject &other) const |
bool | operator!= (const LinkedObject &other) const |
Protected Attributes | |
Metrics | metrics |
Options | options |
![]() | |
Size | imageSize {} |
Detailed Description
A character glyph image.
Characters are accessed like regular images but there are some specialisations which may be necessary which this class exposes:
- To support devices with custom renderers we require access to the raw monochrome bits
- Images currently don't support transparency, although this could be enabled using a flag bits in the PackedColor format. The display driver or renderer would then need to interpret this flag and render accordingly. An alternative method is to nominate a transparent colour.
Member Typedef Documentation
◆ Bits
using Graphics::GlyphObject::Bits = std::bitset<64> |
◆ Metrics
◆ Options
Constructor & Destructor Documentation
◆ GlyphObject()
Member Function Documentation
◆ getBits()
|
pure virtual |
Implemented in Graphics::LcdGlyph.
◆ getMetrics()
|
inline |
◆ getPixelFormat()
|
inlineoverridevirtual |
Get native pixel format.
- Return values
-
PixelFormat Return None if ambivalent about format (e.g. calculated pixel data)
Implements Graphics::ImageObject.
◆ kind()
|
inlineoverridevirtual |
Implements Graphics::Object.
◆ readAlpha()
|
pure virtual |
Obtain glyph information as block of 8-bit alpha values.
- Parameters
-
buffer origin Location of cursor within buffer stride Number of bytes per row in buffer
This method is called with a positive origin to accommodate negative x/y glyph offsets. Italic and script typefaces do this a lot!
Implemented in Graphics::LcdGlyph.
◆ readPixels()
|
overridevirtual |
Read pixels in requested format.
- Parameters
-
loc Start position format Required pixel format buffer Buffer for pixels width Number of pixels to read
- Return values
-
size_t Number of bytes written
Implements Graphics::ImageObject.
Member Data Documentation
◆ metrics
|
protected |
◆ options
|
mutableprotected |
The documentation for this class was generated from the following file: