AWind
DC Class Reference

Device context. Abstraction layer to the device specific drawing code. Coordinates in drawing function are in window coordinate system that internaly translated into screen coordinate system. More...

#include <DC.h>

Public Types

enum  ScreenOrientation { Landscape, Portrate }
 

Public Member Functions

 DC (UTFT *lcd)
 Constructor for global context, that created only once in WindowsManager.
 
 DC ()
 Constructor that used locally. This constructor assumes that UTFT library is initialized already.
 
ScreenOrientation ScreenOrientation ()
 Returns screen orientation vertical or horisontal.
 
int DeviceWidth ()
 Returns screen width.
 
int DeviceHeight ()
 Returns screen height.
 
void Reset ()
 Resets device context into initial condition.
 
void Offset (int offset_x, int offset_y)
 Initializes drawing coordinate system offset. More...
 
int ToDC_X (int x)
 Converts x coordinate from window into screen coordinate system.
 
int ToDC_Y (int y)
 Converts y coordinate from window into screen coordinate system.
 
void Rectangle (int left, int top, int right, int bottom)
 Draws rectangle. Input coordinates have to be defined in the window coordinate system.
 
void Rectangle3D (int left, int top, int right, int bottom, Color color1, Color color2)
 Draws rectangle with 3D border. Input coordinates have to be defined in the window coordinate system.
 
void FillRect (int left, int top, int right, int bottom)
 Fills rectangle. Input coordinates have to be defined in the window coordinate system.
 
void FillGradientRect (int left, int top, int right, int bottom, Color color1, Color color2)
 Fills rectangle with gradient color. Input coordinates have to be defined in the window coordinate system.
 
void FillRoundRect (int left, int top, int right, int bottom)
 Fills rounded rectangle. Input coordinates have to be defined in the window coordinate system.
 
void DrawRoundRect (int left, int top, int right, int bottom)
 Draws rounded rectangle. Input coordinates have to be defined in the window coordinate system.
 
void DrawNumber (int number, int x, int y)
 Draws integer number. Input coordinates have to be defined in the window coordinate system.
 
void DrawNumber (float number, int dec, int x, int y)
 Draws float number. Input coordinates have to be defined in the window coordinate system. More...
 
void DrawText (const __FlashStringHelper *text, int x, int y)
 Draws PROGMEM string. Input coordinates have to be defined in the window coordinate system.
 
int FontWidth ()
 Returns symbol width for the current font.
 
int FontHeight ()
 Returns symbol jeight for the current font.
 
void DrawSymbol (const char c, int dc_x, int dc_y)
 Draws symbol. Input coordinates have to be defined in the screen system.
 
void DrawChar (const char c, int x, int y)
 Draws a character. Input coordinates have to be defined in the window coordinate system.
 
void DrawCaret (int pos, int x, int y)
 Draw caret. Input coordinates have to be defined in the window coordinate system.
 
void DrawText (const char *text, int x, int y)
 
void Sector (int x0, int y0, int radius, float angle_rad)
 Draws sector. Input coordinates have to be defined in the window coordinate system.
 
void SetDeviceColor (Color color)
 
void SetColor (Color color)
 
void SetBackColor (Color color)
 
void SetFont (uint8_t *font)
 
void MoveTo (int x, int y)
 
void LineTo (int x, int y)
 
void Line (int x1, int y1, int x2, int y2)
 

Detailed Description

Device context. Abstraction layer to the device specific drawing code. Coordinates in drawing function are in window coordinate system that internaly translated into screen coordinate system.

Member Function Documentation

void DC::DrawNumber ( float  number,
int  dec,
int  x,
int  y 
)
inline

Draws float number. Input coordinates have to be defined in the window coordinate system.

Parameters
numberfloat input value
decnumber decimal places
void DC::DrawText ( const char *  text,
int  x,
int  y 
)
inline

Draws string. Input coordinates have to be defined in the window coordinate system Draws string. Input coordinates have to be defined in the window coordinate system

void DC::Offset ( int  offset_x,
int  offset_y 
)
inline

Initializes drawing coordinate system offset.

Parameters
offset_xoffset in x direction
offset_yoffset in y direction

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