FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
devices::display::DrawMode< COLOR > Class Template Reference

Drawing Mode to use for Display drawing primitives. More...

#include <fastarduino/devices/display.h>

Public Member Functions

 DrawMode (Mode mode=Mode::NO_CHANGE, COLOR color=COLOR{})
 Construct a new DrawMode object, to be sued with Display. More...
 
 operator bool () const
 Test if this DrawMode can change display or not, ie if its mode is not Mode::NO_CHANGE. More...
 
Mode mode () const
 Return the current Mode for this DrawMode. More...
 
COLOR color () const
 Return the current color for this DrawMode. More...
 
uint8_t bw_pixels_op (uint8_t source, uint8_t dest) const
 Combine 8 source B&W pixels and 8 destination B&W pixels, all gathered in a byte, according to the Mode set at construction time. More...
 
COLOR pixel_op (COLOR dest) const
 Combine the predefined color (defined at construction time) with one destination pixel, according to the Mode also set at construction time. More...
 

Detailed Description

template<typename COLOR>
class devices::display::DrawMode< COLOR >

Drawing Mode to use for Display drawing primitives.

This encapsulates a pixel operation Mode and a color to use.

Template Parameters
COLORthe type of one pixel color, as handled by the display device.
See also
Mode

Definition at line 123 of file display.h.

Constructor & Destructor Documentation

◆ DrawMode()

template<typename COLOR >
devices::display::DrawMode< COLOR >::DrawMode ( Mode  mode = Mode::NO_CHANGE,
COLOR  color = COLOR{} 
)
inline

Construct a new DrawMode object, to be sued with Display.

Parameters
modepixel opertion mode
colorcolor to use for this DrawMode
See also
Display.set_draw_mode()
Display.set_fill_mode()

Definition at line 135 of file display.h.

Member Function Documentation

◆ operator bool()

template<typename COLOR >
devices::display::DrawMode< COLOR >::operator bool ( ) const
inline

Test if this DrawMode can change display or not, ie if its mode is not Mode::NO_CHANGE.

This is useful in order to avoid complex primitive functions that will waste CPU with no effect.

Definition at line 144 of file display.h.

◆ mode()

template<typename COLOR >
Mode devices::display::DrawMode< COLOR >::mode ( ) const
inline

Return the current Mode for this DrawMode.

Returns
Mode current pixel operation mode

Definition at line 154 of file display.h.

◆ color()

template<typename COLOR >
COLOR devices::display::DrawMode< COLOR >::color ( ) const
inline

Return the current color for this DrawMode.

Returns
COLOR current color

Definition at line 164 of file display.h.

◆ bw_pixels_op()

template<typename COLOR >
uint8_t devices::display::DrawMode< COLOR >::bw_pixels_op ( uint8_t  source,
uint8_t  dest 
) const
inline

Combine 8 source B&W pixels and 8 destination B&W pixels, all gathered in a byte, according to the Mode set at construction time.

Parameters
sourcethe 8 B&W pixels we want to apply onto dest
destthe current 8 B&W pixels present on display, with which source pixels shall be combined according to Mode
Returns
uint8_t the resulting 8 B&W pixels to display

Definition at line 178 of file display.h.

◆ pixel_op()

template<typename COLOR >
COLOR devices::display::DrawMode< COLOR >::pixel_op ( COLOR  dest) const
inline

Combine the predefined color (defined at construction time) with one destination pixel, according to the Mode also set at construction time.

Parameters
destthe current pixel color present on display, with which color shall be combined according to Mode
Returns
COLOR the resulting color to display

Definition at line 208 of file display.h.


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