DUDS
Distributed Update of Data from Something
duds::hardware::devices::displays::SimulatedBppDisplay Class Reference

Writes text, expecting a typical Linux terminal, to simulate a bit-per-pixel graphic display. More...

#include <SimulatedBppDisplay.hpp>

Inheritance diagram for duds::hardware::devices::displays::SimulatedBppDisplay:
Collaboration diagram for duds::hardware::devices::displays::SimulatedBppDisplay:

Public Member Functions

 SimulatedBppDisplay ()
 Creates the object with an invalid display size. More...
 
 SimulatedBppDisplay (const duds::ui::graphics::ImageDimensions &id)
 Initializes the object to a usable state. More...
 
 SimulatedBppDisplay (unsigned int w, unsigned int h)
 Initializes the object to a usable state. More...
 
void configure (const duds::ui::graphics::ImageDimensions &id)
 Initializes the object to a usable state. More...
 
void configure (unsigned int w, unsigned int h)
 Initializes the object to a usable state. More...
 
- Public Member Functions inherited from duds::hardware::display::BppGraphicDisplay
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...
 

Private Member Functions

virtual void outputFrame (const duds::ui::graphics::BppImage *img)
 Writes out only the changed portions of the image to the display, and updates the image in frmbuf to match. More...
 

Private Attributes

bool bottom = false
 True after rendering a frame to denote output is at the bottom of the frame. More...
 

Additional Inherited Members

- Protected Member Functions inherited from duds::hardware::display::BppGraphicDisplay
 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...
 
- Protected Attributes inherited from duds::hardware::display::BppGraphicDisplay
duds::ui::graphics::BppImage frmbuf
 The frame buffer. More...
 

Detailed Description

Writes text, expecting a typical Linux terminal, to simulate a bit-per-pixel graphic display.

Intended for testing.

Author
Jeff Jackowski
Examples:
rendertext.cpp.

Definition at line 20 of file SimulatedBppDisplay.hpp.

Constructor & Destructor Documentation

◆ SimulatedBppDisplay() [1/3]

duds::hardware::devices::displays::SimulatedBppDisplay::SimulatedBppDisplay ( )

Creates the object with an invalid display size.

Definition at line 18 of file SimulatedBppDisplay.cpp.

◆ SimulatedBppDisplay() [2/3]

duds::hardware::devices::displays::SimulatedBppDisplay::SimulatedBppDisplay ( const duds::ui::graphics::ImageDimensions id)

Initializes the object to a usable state.

Parameters
idThe dimensions of the display in "pixels" (really characters). It will work poorly if it doesn't fit on the display.

Definition at line 20 of file SimulatedBppDisplay.cpp.

◆ SimulatedBppDisplay() [3/3]

duds::hardware::devices::displays::SimulatedBppDisplay::SimulatedBppDisplay ( unsigned int  w,
unsigned int  h 
)
inline

Initializes the object to a usable state.

Parameters
wThe width of the display in "pixels" (really characters). It will work poorly if it doesn't fit on the display.
hThe height of the display in "pixels" (really characters). It will work poorly if it doesn't fit on the display.

Definition at line 52 of file SimulatedBppDisplay.hpp.

Member Function Documentation

◆ configure() [1/2]

void duds::hardware::devices::displays::SimulatedBppDisplay::configure ( const duds::ui::graphics::ImageDimensions id)

Initializes the object to a usable state.

Parameters
idThe dimensions of the display in "pixels" (really characters). It will work poorly if it doesn't fit on the display.
Exceptions
DisplaySizeErrorEither the width or height is zero.
Examples:
rendertext.cpp.

Definition at line 25 of file SimulatedBppDisplay.cpp.

Referenced by configure(), and SimulatedBppDisplay().

◆ configure() [2/2]

void duds::hardware::devices::displays::SimulatedBppDisplay::configure ( unsigned int  w,
unsigned int  h 
)
inline

Initializes the object to a usable state.

Parameters
wThe width of the display in "pixels" (really characters). It will work poorly if it doesn't fit on the display.
hThe height of the display in "pixels" (really characters). It will work poorly if it doesn't fit on the display.
Exceptions
DisplaySizeErrorEither the width or height is zero.

Definition at line 71 of file SimulatedBppDisplay.hpp.

◆ outputFrame()

void duds::hardware::devices::displays::SimulatedBppDisplay::outputFrame ( const duds::ui::graphics::BppImage img)
privatevirtual

Writes out only the changed portions of the image to the display, and updates the image in frmbuf to match.

Parameters
imgThe new image to show.

Implements duds::hardware::display::BppGraphicDisplay.

Definition at line 36 of file SimulatedBppDisplay.cpp.

Member Data Documentation

◆ bottom

bool duds::hardware::devices::displays::SimulatedBppDisplay::bottom = false
private

True after rendering a frame to denote output is at the bottom of the frame.

Definition at line 25 of file SimulatedBppDisplay.hpp.

Referenced by configure(), and outputFrame().


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