DUDS
Distributed Update of Data from Something
duds::hardware::display::BppGraphicDisplay Class Referenceabstract

Base class for bit-per-pixel graphic displays. More...

#include <BppGraphicDisplay.hpp>

Inheritance diagram for duds::hardware::display::BppGraphicDisplay:
Collaboration diagram for duds::hardware::display::BppGraphicDisplay:

Public Member Functions

const duds::ui::graphics::ImageDimensionsdimensions () const
 Returns the dimensions of the frame buffer. More...
 
const duds::ui::graphics::BppImageframe () const
 Provides access to the image in the frame buffer. More...
 
int height () const
 Returns the height of the frame buffer. More...
 
int width () const
 Returns the width of the frame buffer. More...
 
void write (const duds::ui::graphics::BppImage *img)
 Writes the new image to the display. More...
 
void write (const std::shared_ptr< const duds::ui::graphics::BppImage > &img)
 Writes the new image to the display. More...
 

Protected Member Functions

 BppGraphicDisplay ()=default
 Construct with an empty frame buffer. More...
 
 BppGraphicDisplay (const duds::ui::graphics::ImageDimensions &dim)
 Construct with a frame buffer of the specified size. More...
 
virtual void outputFrame (const duds::ui::graphics::BppImage *img)=0
 Writes out the given image to the display and updates the image in frmbuf to match. More...
 

Protected Attributes

duds::ui::graphics::BppImage frmbuf
 The frame buffer. More...
 

Detailed Description

Base class for bit-per-pixel graphic displays.

Author
Jeff Jackowski

Definition at line 21 of file BppGraphicDisplay.hpp.

Constructor & Destructor Documentation

◆ BppGraphicDisplay() [1/2]

duds::hardware::display::BppGraphicDisplay::BppGraphicDisplay ( )
protecteddefault

Construct with an empty frame buffer.

◆ BppGraphicDisplay() [2/2]

duds::hardware::display::BppGraphicDisplay::BppGraphicDisplay ( const duds::ui::graphics::ImageDimensions dim)
inlineprotected

Construct with a frame buffer of the specified size.

Parameters
dimThe size to make the frame buffer.

Definition at line 45 of file BppGraphicDisplay.hpp.

Member Function Documentation

◆ dimensions()

const duds::ui::graphics::ImageDimensions& duds::hardware::display::BppGraphicDisplay::dimensions ( ) const
inline

Returns the dimensions of the frame buffer.

Definition at line 69 of file BppGraphicDisplay.hpp.

◆ frame()

const duds::ui::graphics::BppImage& duds::hardware::display::BppGraphicDisplay::frame ( ) const
inline

Provides access to the image in the frame buffer.

Definition at line 51 of file BppGraphicDisplay.hpp.

◆ height()

int duds::hardware::display::BppGraphicDisplay::height ( ) const
inline

◆ outputFrame()

virtual void duds::hardware::display::BppGraphicDisplay::outputFrame ( const duds::ui::graphics::BppImage img)
protectedpure virtual

Writes out the given image to the display and updates the image in frmbuf to match.

Called by write() after ensuring the dimensions of img and frmbuf match.

Parameters
imgThe new image to show.
Precondition
The size of img and frmbuf are the same.
Postcondition
The image in frmbuf matches the image in img.

Implemented in duds::hardware::devices::displays::ST7920, and duds::hardware::devices::displays::SimulatedBppDisplay.

Referenced by write().

◆ width()

int duds::hardware::display::BppGraphicDisplay::width ( ) const
inline

◆ write() [1/2]

void duds::hardware::display::BppGraphicDisplay::write ( const duds::ui::graphics::BppImage img)

Writes the new image to the display.

Parameters
imgThe new image to show on the display.
Precondition
The size of img and frmbuf are the same.
Postcondition
The image in frmbuf matches the image in img.
Exceptions
DisplaySizeErrorThe dimensions of the supplied image do not match the frame buffer's dimensions.
Examples:
rendertext.cpp.

Definition at line 16 of file BppGraphicDisplay.cpp.

Referenced by dimensions(), and write().

◆ write() [2/2]

void duds::hardware::display::BppGraphicDisplay::write ( const std::shared_ptr< const duds::ui::graphics::BppImage > &  img)
inline

Writes the new image to the display.

Parameters
imgThe new image to show on the display.
Precondition
The size of img and frmbuf are the same.
Postcondition
The image in frmbuf matches the image in img.
Exceptions
DisplaySizeErrorThe dimensions of the supplied image do not match the frame buffer's dimensions.

Definition at line 89 of file BppGraphicDisplay.hpp.

Member Data Documentation

◆ frmbuf


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