A modifiedversion of TFTLCD by Todor Todorov with ultra-fast operation for SSD1289 controller. TODO: speed-up fonts, add my own fonts Can work out-of-the-box with ST Nucleo F401RE
Dependents: TFT_320QVT_Window_Drag_Demo TFT_320QVT_HelloWorld
Fork of TFTLCD by
Diff: lcd_base.h
- Revision:
- 28:2f24de90cb46
- Parent:
- 22:4c169297f374
--- a/lcd_base.h Mon Jul 22 01:48:06 2013 +0000 +++ b/lcd_base.h Mon Jan 11 09:35:06 2016 +0000 @@ -285,12 +285,12 @@ /** Gets the font width. * \return The current font width. */ - uint8_t GetFontWidth( void ); + virtual uint8_t GetFontWidth( void ); /** Gets the font height. * \return The current font height. */ - uint8_t GetFontHeight( void ); + virtual uint8_t GetFontHeight( void ); /** Fills the whole screen with a single color. * \param color The color to be used. The value must be in RGB-565 format. @@ -432,6 +432,45 @@ * \param roy */ virtual void DrawBitmap( unsigned short x, unsigned short y, const bitmap_t* img, unsigned short deg, unsigned short rox, unsigned short roy ); + + /** Draws a horizontal line. + * + * This is a utility function to draw horizontal-only lines + * for reduced code complexity and faster execution. + * + * \param x X coordinate of the starting point of the line. + * \param y Y coordinate of the starting point of the line. + * \param len Length of the line. + * \param color The color to use to draw the line. By default the global foreground color is used ( -2 ), + * -1 switches to the default background color, or any custom color can be used. + */ + virtual void DrawHLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 ); + + /** Draws a vertical line. + * + * This is a utility function to draw vertical-only lines + * for reduced code complexity and faster execution. + * + * \param x X coordinate of the starting point of the line. + * \param y Y coordinate of the starting point of the line. + * \param len Height of the line. + * \param color The color to use to draw the line. By default the global foreground color is used ( -2 ), + * -1 switches to the default background color, or any custom color can be used. + */ + virtual void DrawVLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 ); + + /** Prints a character at the given position and using the given color. + * + * \param c The character. + * \param x X coordinate of the character position. + * \param y Y coordinate of the character position. + * \param fgColor Foreground color for drawing. By default the global foreground color is used ( -2 ), + * -1 switches to the default background color, or any custom color can be used. + * \param bgColor Background color for drawing. By default the global background color is used ( -1 ), + * -2 switches to the default foreground color, or any custom color can be used. + */ + virtual void PrintChar( char c, unsigned short x, unsigned short y, int fgColor = -2, int bgColor = -1 ); + protected: /** Creates an instance of the class. @@ -516,43 +555,6 @@ */ virtual void SetPixelColor( unsigned int color, colordepth_t mode = RGB24 ) = 0; - /** Draws a horizontal line. - * - * This is a utility function to draw horizontal-only lines - * for reduced code complexity and faster execution. - * - * \param x X coordinate of the starting point of the line. - * \param y Y coordinate of the starting point of the line. - * \param len Length of the line. - * \param color The color to use to draw the line. By default the global foreground color is used ( -2 ), - * -1 switches to the default background color, or any custom color can be used. - */ - virtual void DrawHLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 ); - - /** Draws a vertical line. - * - * This is a utility function to draw vertical-only lines - * for reduced code complexity and faster execution. - * - * \param x X coordinate of the starting point of the line. - * \param y Y coordinate of the starting point of the line. - * \param len Height of the line. - * \param color The color to use to draw the line. By default the global foreground color is used ( -2 ), - * -1 switches to the default background color, or any custom color can be used. - */ - virtual void DrawVLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 ); - - /** Prints a character at the given position and using the given color. - * - * \param c The character. - * \param x X coordinate of the character position. - * \param y Y coordinate of the character position. - * \param fgColor Foreground color for drawing. By default the global foreground color is used ( -2 ), - * -1 switches to the default background color, or any custom color can be used. - * \param bgColor Background color for drawing. By default the global background color is used ( -1 ), - * -2 switches to the default foreground color, or any custom color can be used. - */ - virtual void PrintChar( char c, unsigned short x, unsigned short y, int fgColor = -2, int bgColor = -1 ); /** Prints a character at the given position and using the given color and with the given rotation. *