roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
roo_display::Display Class Reference

Display facade that owns a display device and optional touch input. More...

#include <roo_display.h>

Public Member Functions

 Display (DisplayDevice &display_device)
 Constructs a display without touch support.
 
 Display (DisplayDevice &display_device, TouchDevice &touch_device, TouchCalibration touch_calibration=TouchCalibration())
 Constructs a display with touch support and optional calibration.
 
 Display (ComboDevice &device)
 Constructs a display from a combo device.
 
int32_t area () const
 Returns the total pixel area of the raw device.
 
const Boxextents () const
 Returns the current extents used by this display.
 
int16_t width () const
 Returns the width in pixels of the current extents.
 
int16_t height () const
 Returns the height in pixels of the current extents.
 
void init ()
 Initializes the display and touch devices.
 
void init (Color bgcolor)
 Initializes the device, fills the screen with the specified color, and sets that color as the default background hint.
 
void setOrientation (Orientation orientation)
 Sets the display orientation. Resets the clip box to the max display area.
 
Orientation orientation () const
 Returns the current orientation.
 
const TouchCalibrationtouchCalibration () const
 Returns the touch calibration for the display.
 
DisplayOutputoutput ()
 Returns mutable access to the display output.
 
const DisplayOutputoutput () const
 Returns const access to the display output.
 
TouchResult getTouch (TouchPoint *points, int max_points)
 Returns calibrated touch points in display coordinates.
 
TouchResult getRawTouch (TouchPoint *points, int max_points)
 Returns raw touch points in absolute coordinates (0-4095).
 
bool getTouch (int16_t &x, int16_t &y)
 Returns true and sets (x, y) if touched; otherwise returns false.
 
void resetExtents ()
 Resets the clip box to the maximum device-allowed values.
 
void setExtents (const Box &extents)
 Sets a default clip box, inherited by derived contexts.
 
void setBackground (const Rasterizable *bg)
 Sets a rasterizable background for all derived contexts.
 
void setTouchCalibration (TouchCalibration touch_calibration)
 Sets the touch calibration mapping.
 
const RasterizablegetRasterizableBackground () const
 Returns the rasterizable background for derived contexts.
 
void setBackgroundColor (Color bgcolor)
 Sets a background color used by all derived contexts. Initially set to color::Transparent.
 
Color getBackgroundColor () const
 Returns the background color for derived contexts.
 
void clear ()
 Clears the display, respecting the clip box and background settings.
 
void enableTurbo ()
 
void disableTurbo ()
 
bool isTurboEnabled () const
 

Friends

class DrawingContext
 

Detailed Description

Display facade that owns a display device and optional touch input.

Definition at line 64 of file roo_display.h.

Constructor & Destructor Documentation

◆ Display() [1/3]

roo_display::Display::Display ( DisplayDevice display_device)
inline

Constructs a display without touch support.

Definition at line 67 of file roo_display.h.

◆ Display() [2/3]

roo_display::Display::Display ( DisplayDevice display_device,
TouchDevice touch_device,
TouchCalibration  touch_calibration = TouchCalibration() 
)
inline

Constructs a display with touch support and optional calibration.

Definition at line 71 of file roo_display.h.

◆ Display() [3/3]

roo_display::Display::Display ( ComboDevice device)
inline

Constructs a display from a combo device.

Definition at line 76 of file roo_display.h.

Member Function Documentation

◆ area()

int32_t roo_display::Display::area ( ) const
inline

Returns the total pixel area of the raw device.

Definition at line 80 of file roo_display.h.

References roo_display::DisplayDevice::raw_height(), and roo_display::DisplayDevice::raw_width().

◆ clear()

void roo_display::Display::clear ( )

Clears the display, respecting the clip box and background settings.

Definition at line 90 of file roo_display.cpp.

References roo_display::DrawingContext::clear().

◆ disableTurbo()

void roo_display::Display::disableTurbo ( )

Definition at line 124 of file roo_display.cpp.

◆ enableTurbo()

void roo_display::Display::enableTurbo ( )

Definition at line 115 of file roo_display.cpp.

◆ extents()

const Box & roo_display::Display::extents ( ) const
inline

Returns the current extents used by this display.

Definition at line 85 of file roo_display.h.

Referenced by setExtents().

◆ getBackgroundColor()

Color roo_display::Display::getBackgroundColor ( ) const
inline

Returns the background color for derived contexts.

Definition at line 170 of file roo_display.h.

◆ getRasterizableBackground()

const Rasterizable * roo_display::Display::getRasterizableBackground ( ) const
inline

Returns the rasterizable background for derived contexts.

Definition at line 160 of file roo_display.h.

◆ getRawTouch()

TouchResult roo_display::Display::getRawTouch ( TouchPoint points,
int  max_points 
)
inline

Returns raw touch points in absolute coordinates (0-4095).

Definition at line 129 of file roo_display.h.

References roo_display::TouchDisplay::getRawTouch().

◆ getTouch() [1/2]

bool roo_display::Display::getTouch ( int16_t x,
int16_t y 
)

Returns true and sets (x, y) if touched; otherwise returns false.

Definition at line 37 of file roo_display.cpp.

References roo_display::TouchDisplay::getTouch(), roo_display::TouchResult::touch_points, roo_display::TouchPoint::x, and roo_display::TouchPoint::y.

◆ getTouch() [2/2]

TouchResult roo_display::Display::getTouch ( TouchPoint points,
int  max_points 
)
inline

Returns calibrated touch points in display coordinates.

If no touch has been registered, returns {.touch_points = 0} and does not modify points. If k touch points have been registered, sets up to max_points entries in points, and returns {.touch_points = k}. In both cases, the returned timestamp specifies the detection time.

Definition at line 124 of file roo_display.h.

References roo_display::TouchDisplay::getTouch().

◆ height()

int16_t roo_display::Display::height ( ) const
inline

Returns the height in pixels of the current extents.

Definition at line 90 of file roo_display.h.

References roo_display::Box::height().

◆ init() [1/2]

void roo_display::Display::init ( )
inline

Initializes the display and touch devices.

Definition at line 93 of file roo_display.h.

References roo_display::TouchDisplay::init(), and roo_display::DisplayDevice::init().

◆ init() [2/2]

void roo_display::Display::init ( Color  bgcolor)

Initializes the device, fills the screen with the specified color, and sets that color as the default background hint.

Definition at line 84 of file roo_display.cpp.

References bgcolor.

◆ isTurboEnabled()

bool roo_display::Display::isTurboEnabled ( ) const
inline

Definition at line 179 of file roo_display.h.

◆ orientation()

Orientation roo_display::Display::orientation ( ) const
inline

Returns the current orientation.

Definition at line 106 of file roo_display.h.

◆ output() [1/2]

DisplayOutput & roo_display::Display::output ( )
inline

Returns mutable access to the display output.

Definition at line 114 of file roo_display.h.

◆ output() [2/2]

const DisplayOutput & roo_display::Display::output ( ) const
inline

Returns const access to the display output.

Definition at line 116 of file roo_display.h.

◆ resetExtents()

void roo_display::Display::resetExtents ( )
inline

Resets the clip box to the maximum device-allowed values.

Definition at line 137 of file roo_display.h.

References roo_display::DisplayDevice::effective_height(), and roo_display::DisplayDevice::effective_width().

Referenced by setExtents().

◆ setBackground()

void roo_display::Display::setBackground ( const Rasterizable bg)
inline

Sets a rasterizable background for all derived contexts.

Definition at line 149 of file roo_display.h.

◆ setBackgroundColor()

void roo_display::Display::setBackgroundColor ( Color  bgcolor)
inline

Sets a background color used by all derived contexts. Initially set to color::Transparent.

Definition at line 164 of file roo_display.h.

References bgcolor, and roo_display::DisplayDevice::setBgColorHint().

◆ setExtents()

void roo_display::Display::setExtents ( const Box extents)
inline

Sets a default clip box, inherited by derived contexts.

Definition at line 143 of file roo_display.h.

References extents(), roo_display::Box::Intersect(), and resetExtents().

◆ setOrientation()

void roo_display::Display::setOrientation ( Orientation  orientation)

Sets the display orientation. Resets the clip box to the max display area.

Definition at line 74 of file roo_display.cpp.

◆ setTouchCalibration()

void roo_display::Display::setTouchCalibration ( TouchCalibration  touch_calibration)
inline

Sets the touch calibration mapping.

Definition at line 155 of file roo_display.h.

References roo_display::TouchDisplay::setCalibration().

◆ touchCalibration()

const TouchCalibration & roo_display::Display::touchCalibration ( ) const
inline

Returns the touch calibration for the display.

Definition at line 109 of file roo_display.h.

References roo_display::TouchDisplay::calibration().

◆ width()

int16_t roo_display::Display::width ( ) const
inline

Returns the width in pixels of the current extents.

Definition at line 88 of file roo_display.h.

References roo_display::Box::width().

Friends And Related Symbol Documentation

◆ DrawingContext

Definition at line 185 of file roo_display.h.


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