Treehopper C# API
GraphicDisplay Class Referenceabstract

A class representing pixel-addressed displays More...

Inheritance diagram for GraphicDisplay:
IFlushable MonoGraphicDisplay LedGraphicDisplay Pcd8544 Ssd1306

Public Member Functions

 GraphicDisplay (int Width, int Height, double bytesPerPixel)
 Construct a graphic display of given width and height More...
 
Task FlushAsync (bool force=false)
 Flush changed data to the port expander More...
 
virtual Task Clear ()
 Clear the display More...
 

Protected Member Functions

abstract void setBrightness (double brightness)
 Sets the global brightness of the graphic display More...
 
abstract Task flush ()
 Flush any updates to the RawBuffer to the display More...
 

Properties

int Height [get, protected set]
 The height of the display, in pixels More...
 
int Width [get, protected set]
 The width of the display, in pixels. More...
 
byte [] RawBuffer [get, protected set]
 The raw byte buffer used by the display in its native format More...
 
double Brightness [get, set]
 Gets or sets the global brightness of the display More...
 
bool AutoFlush = true [get, set]
 
IFlushable Parent [get]
 

Detailed Description

A class representing pixel-addressed displays

Constructor & Destructor Documentation

◆ GraphicDisplay()

GraphicDisplay ( int  Width,
int  Height,
double  bytesPerPixel 
)

Construct a graphic display of given width and height

Parameters
WidthThe width, in pixels, of the display
HeightThe height, in pixels, of the display
bytesPerPixelThe number of bytes per row (stride) of the display

Member Function Documentation

◆ FlushAsync()

Task FlushAsync ( bool  force = false)

Flush changed data to the port expander

Parameters
forcewhether to flush all data to the port expander, even if it doesn't appear to have been changed

Implements IFlushable.

◆ Clear()

virtual Task Clear ( )
virtual

Clear the display

Returns
An awaitable task

Reimplemented in MonoGraphicDisplay.

◆ setBrightness()

abstract void setBrightness ( double  brightness)
protectedpure virtual

Sets the global brightness of the graphic display

Parameters
brightnessThe brightness of the display

Implemented in Ssd1306, LedGraphicDisplay, and Pcd8544.

◆ flush()

abstract Task flush ( )
protectedpure virtual

Flush any updates to the RawBuffer to the display

Returns
An awaitable task that completes upon sending the update to the display

Internal function called by the implementation to flush the RawBuffer to the display

Returns
An awaitable task that completes upon success

Implemented in Ssd1306, LedGraphicDisplay, and Pcd8544.

Property Documentation

◆ Height

int Height
getprotected set

The height of the display, in pixels

◆ Width

int Width
getprotected set

The width of the display, in pixels.

◆ RawBuffer

byte [] RawBuffer
getprotected set

The raw byte buffer used by the display in its native format

The format of this raw buffer depends on the particular implementation of this class

◆ Brightness

double Brightness
getset

Gets or sets the global brightness of the display

◆ AutoFlush

bool AutoFlush = true
getset

◆ Parent

IFlushable Parent
get

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