tcMenu
Loading...
Searching...
No Matches
BaseGraphicalRenderer.h File Reference

Contains the base functionality for all graphical renderers. More...

Go to the source code of this file.

Classes

class  tcgfx::DrawingFlags
class  tcgfx::GridPositionRowCacheEntry
class  tcgfx::RenderingNavigationListener
class  tcgfx::CachedDrawingLocation
class  tcgfx::BaseGraphicalRenderer

Enumerations

enum  tcgfx::LayoutMode : uint8_t { tcgfx::LAYOUT_VERTICAL_DEFAULT , tcgfx::LAYOUT_CARD_SIDEWAYS }

Functions

uint16_t tcgfx::rowCol (int row, int col)
int tcgfx::analogRangeToScreen (AnalogMenuItem *item, int screenWidth)
void tcgfx::preparePropertiesFromConfig (ConfigurableItemDisplayPropertiesFactory &factory, const ColorGfxMenuConfig< const void * > *gfxConfig, int titleHeight, int itemHeight)
GridPosition::GridDrawingMode tcgfx::modeFromItem (MenuItem *item, bool useSlider)

Detailed Description

Contains the base functionality for all graphical renderers.

Enumeration Type Documentation

◆ LayoutMode

enum tcgfx::LayoutMode : uint8_t

Indicates the layout mode, IE how the items will be rendered onto the display

Enumerator
LAYOUT_VERTICAL_DEFAULT 

The items will be laid out using default vertical rendering

LAYOUT_CARD_SIDEWAYS 

The items will layout in card view horizontally

Function Documentation

◆ rowCol()

uint16_t tcgfx::rowCol ( int row,
int col )
inline

An internal method used to calculate the row*col index that is used during rendering to locate items quickly

Parameters
rowthe row
colthe column
Returns
a key based on row and column.

◆ analogRangeToScreen()

int tcgfx::analogRangeToScreen ( AnalogMenuItem * item,
int screenWidth )
inline

This is a helper function for analog items that converts the range of an analog item over the width available in a menu item. It's mainly used by scrolling components.

Parameters
itemthe item to determine the current and max value from
screenWidththe width available for the full range
Returns
the point on the screen which represents current value

◆ preparePropertiesFromConfig()

void tcgfx::preparePropertiesFromConfig ( ConfigurableItemDisplayPropertiesFactory & factory,
const ColorGfxMenuConfig< const void * > * gfxConfig,
int titleHeight,
int itemHeight )

This method takes an existing graphics configuration and converts it into the new display properties format, its designer as a bridge between the old config object method and the new more supportable properties definitions.

Parameters
factorythe properties factory that we wish to populate
gfxConfigthe graphics configuration to convert
titleHeightthe height of the title
itemHeightthe height of a standard item

◆ modeFromItem()

GridPosition::GridDrawingMode tcgfx::modeFromItem ( MenuItem * item,
bool useSlider )

Gets the default drawing mode based on item type

Parameters
itemthe item
useSliderif sliders are enabled.
Returns
grid drawing mode