BurstSPI support for improved performance
Fork of RA8875 by
GraphicsDisplay Class Reference
The GraphicsDisplay class. More...
#include <GraphicsDisplay.h>
Inherits TextDisplay.
Inherited by RA8875.
Public Member Functions | |
GraphicsDisplay (const char *name) | |
The constructor. | |
virtual RetCode_t | pixel (loc_t x, loc_t y, color_t color)=0 |
Draw a pixel in the specified color. | |
virtual RetCode_t | pixelStream (color_t *p, uint32_t count, loc_t x, loc_t y)=0 |
Write a stream of pixels to the display. | |
virtual color_t | getPixel (loc_t x, loc_t y)=0 |
Get a pixel from the display. | |
virtual RetCode_t | getPixelStream (color_t *p, uint32_t count, loc_t x, loc_t y)=0 |
Get a stream of pixels from the display. | |
virtual uint16_t | width ()=0 |
get the screen width in pixels | |
virtual uint16_t | height ()=0 |
get the screen height in pixels | |
virtual RetCode_t | SetGraphicsCursor (loc_t x, loc_t y)=0 |
Prepare the controller to write binary data to the screen by positioning the memory cursor. | |
virtual RetCode_t | SetGraphicsCursor (point_t p)=0 |
Prepare the controller to write binary data to the screen by positioning the memory cursor. | |
virtual point_t | GetGraphicsCursor (void)=0 |
Read the current graphics cursor position as a point. | |
virtual RetCode_t | SetGraphicsCursorRead (loc_t x, loc_t y)=0 |
Prepare the controller to read binary data from the screen by positioning the memory read cursor. | |
virtual RetCode_t | fillrect (loc_t x1, loc_t y1, loc_t x2, loc_t y2, color_t color, fill_t fillit=FILL)=0 |
Draw a filled rectangle in the specified color. | |
virtual RetCode_t | SelectDrawingLayer (uint16_t layer, uint16_t *prevLayer=NULL)=0 |
Select the drawing layer for subsequent commands. | |
virtual uint16_t | GetDrawingLayer (void)=0 |
Get the currently active drawing layer. | |
virtual RetCode_t | WriteCommand (unsigned char command, unsigned int data=0xFFFF)=0 |
a function to write the command and data to the RA8875 chip. | |
virtual RetCode_t | WriteData (unsigned char data)=0 |
a function to write the data to the RA8875 chip. | |
virtual RetCode_t | window (rect_t r) |
Set the window, which controls where items are written to the screen. | |
virtual RetCode_t | window (loc_t x=0, loc_t y=0, dim_t w=(dim_t)-1, dim_t h=(dim_t)-1) |
Set the window, which controls where items are written to the screen. | |
virtual RetCode_t | WindowMax (void) |
method to set the window region to the full screen. | |
virtual RetCode_t | cls (uint16_t layers=0) |
Clear the screen. | |
virtual RetCode_t | _putp (color_t pixel) |
method to put a single color pixel to the screen. | |
virtual RetCode_t | fill (loc_t x, loc_t y, dim_t w, dim_t h, color_t color) |
method to fill a region. | |
virtual RetCode_t | blit (loc_t x, loc_t y, dim_t w, dim_t h, const int *color) |
method to stream bitmap data to the display | |
virtual const uint8_t * | getCharMetrics (const unsigned char c, dim_t *width, dim_t *height) |
This method returns the width in pixels of the chosen character from the previously selected external font. | |
virtual int | fontblit (loc_t x, loc_t y, const unsigned char c) |
This method transfers one character from the external font data to the screen. | |
color_t | RGBQuadToRGB16 (RGBQUAD *colorPaletteArray, uint16_t index) |
This method returns the color value from a palette. | |
RGBQUAD | RGB16ToRGBQuad (color_t c) |
This method converts a 16-bit color value into a 24-bit RGB Quad. | |
RetCode_t | RenderImageFile (loc_t x, loc_t y, const char *FileName) |
This method attempts to render a specified graphics image file at the specified screen location. | |
RetCode_t | RenderJpegFile (loc_t x, loc_t y, const char *Name_JPG) |
This method reads a disk file that is in jpeg format and puts it on the screen. | |
RetCode_t | RenderBitmapFile (loc_t x, loc_t y, const char *Name_BMP) |
This method reads a disk file that is in bitmap format and puts it on the screen. | |
RetCode_t | RenderIconFile (loc_t x, loc_t y, const char *Name_ICO) |
This method reads a disk file that is in ico format and puts it on the screen. | |
virtual int | character (int x, int y, int value) |
prints one character at the specified coordinates. | |
virtual int | columns (void) |
get the number of colums based on the currently active font | |
virtual int | rows (void) |
get the number of rows based on the currently active font | |
virtual RetCode_t | SelectUserFont (const uint8_t *font=NULL) |
Select a User Font for all subsequent text. | |
virtual bool | claim (FILE *stream) |
redirect output from a stream (stoud, sterr) to display | |
virtual RetCode_t | locate (textloc_t column, textloc_t row)=0 |
locate the cursor at a character position. | |
virtual RetCode_t | foreground (color_t color)=0 |
set the foreground color | |
virtual RetCode_t | background (color_t color)=0 |
set the background color | |
Protected Member Functions | |
virtual RetCode_t | _StartGraphicsStream (void)=0 |
Pure virtual method indicating the start of a graphics stream. | |
virtual RetCode_t | _EndGraphicsStream (void)=0 |
Pure virtual method indicating the end of a graphics stream. | |
RetCode_t | _RenderBitmap (loc_t x, loc_t y, uint32_t fileOffset, FILE *Image) |
Protected method to render an image given a file handle and coordinates. | |
virtual RetCode_t | booleanStream (loc_t x, loc_t y, dim_t w, dim_t h, const uint8_t *boolStream)=0 |
Pure virtual method to write a boolean stream to the display. | |
virtual int | _putc (int value) |
a method to put a character to the display. | |
virtual int | _getc () |
a method to get a character from the stdin | |
Protected Attributes | |
const unsigned char * | font |
reference to an external font somewhere in memory | |
short | _x |
keeps track of current X location | |
short | _y |
keeps track of current Y location | |
rect_t | windowrect |
window commands are held here for speed of access | |
uint16_t | _column |
character column location | |
uint16_t | _row |
character row location | |
color_t | _foreground |
presently set foreground color | |
color_t | _background |
presently set background color | |
char * | _path |
stream name when redirecting stdio |
Detailed Description
The GraphicsDisplay class.
This graphics display class supports both graphics and text operations. Typically, a subclass is derived from this which has localizations to adapt to a specific hardware platform (e.g. a display controller chip), that overrides methods in here to either add more capability or perhaps to improve performance, by leveraging specific hardware capabilities.
Definition at line 28 of file GraphicsDisplay.h.
Constructor & Destructor Documentation
GraphicsDisplay | ( | const char * | name ) |
The constructor.
Definition at line 88 of file GraphicsDisplay.cpp.
Member Function Documentation
virtual RetCode_t _EndGraphicsStream | ( | void | ) | [protected, pure virtual] |
Pure virtual method indicating the end of a graphics stream.
This is called to conclude a stream of pixel data that was sent. This may cause register configuration changes in the derived class in order to stop the hardware from accept the streaming data.
- Note:
- this method must be supported in the derived class.
- Returns:
- error code.
Implemented in RA8875.
int _getc | ( | ) | [protected, virtual, inherited] |
a method to get a character from the stdin
- Returns:
- the fetched character.
Definition at line 82 of file TextDisplay.cpp.
int _putc | ( | int | value ) | [protected, virtual, inherited] |
a method to put a character to the display.
- Parameters:
-
value is the character value to send to the display
- Returns:
- the character that was sent.
Reimplemented in RA8875.
Definition at line 40 of file TextDisplay.cpp.
RetCode_t _putp | ( | color_t | pixel ) | [virtual] |
method to put a single color pixel to the screen.
This method may be called as many times as necessary after
- See also:
- _StartGraphicsStream() is called, and it should be followed by _EndGraphicsStream.
- Parameters:
-
[in] pixel is a color value to be put on the screen.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Reimplemented in RA8875.
Definition at line 137 of file GraphicsDisplay.cpp.
RetCode_t _RenderBitmap | ( | loc_t | x, |
loc_t | y, | ||
uint32_t | fileOffset, | ||
FILE * | Image | ||
) | [protected] |
Protected method to render an image given a file handle and coordinates.
- Parameters:
-
[in] x is the horizontal pixel coordinate [in] y is the vertical pixel coordinate [in] fileOffset is the offset into the file where the image data starts [in] Image is the filename stream already opened for the data.
- Returns:
- success or error code.
Definition at line 282 of file GraphicsDisplay.cpp.
virtual RetCode_t _StartGraphicsStream | ( | void | ) | [protected, pure virtual] |
Pure virtual method indicating the start of a graphics stream.
This is called prior to a stream of pixel data being sent. This may cause register configuration changes in the derived class in order to prepare the hardware to accept the streaming data.
- Note:
- this method must be supported in the derived class.
- Returns:
- error code.
Implemented in RA8875.
virtual RetCode_t background | ( | color_t | color ) | [pure virtual, inherited] |
set the background color
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] color is color to use for background drawing.
- Returns:
- error code.
Implemented in RA8875.
RetCode_t blit | ( | loc_t | x, |
loc_t | y, | ||
dim_t | w, | ||
dim_t | h, | ||
const int * | color | ||
) | [virtual] |
method to stream bitmap data to the display
This method fills a region from a stream of color data.
- Parameters:
-
[in] x is the left-edge of the region. [in] y is the top-edge of the region. [in] w specifies the width of the region. [in] h specifies the height of the region. [in] color is a pointer to a color stream with w x h values.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Definition at line 172 of file GraphicsDisplay.cpp.
virtual RetCode_t booleanStream | ( | loc_t | x, |
loc_t | y, | ||
dim_t | w, | ||
dim_t | h, | ||
const uint8_t * | boolStream | ||
) | [protected, pure virtual] |
Pure virtual method to write a boolean stream to the display.
This takes a bit stream in memory and using the current color settings it will stream it to the display. Along the way, each bit is translated to either the foreground or background color value and then that pixel is pushed onward.
This is similar, but different, to the pixelStream API, which is given a stream of color values.
- Parameters:
-
[in] x is the horizontal position on the display. [in] y is the vertical position on the display. [in] w is the width of the rectangular region to fill. [in] h is the height of the rectangular region to fill. [in] boolStream is the inline memory image from which to extract the bitstream.
- Returns:
- success/failure code. See RetCode_t.
Implemented in RA8875.
int character | ( | int | x, |
int | y, | ||
int | value | ||
) | [virtual] |
prints one character at the specified coordinates.
This will print the character at the specified pixel coordinates.
- Parameters:
-
[in] x is the horizontal offset in pixels. [in] y is the vertical offset in pixels. [in] value is the character to print.
- Returns:
- number of pixels to index to the right if a character was printed, 0 otherwise.
Implements TextDisplay.
Definition at line 104 of file GraphicsDisplay.cpp.
bool claim | ( | FILE * | stream ) | [virtual, inherited] |
redirect output from a stream (stoud, sterr) to display
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] stream that shall be redirected to the TextDisplay
- Returns:
- true if the claim succeeded.
Definition at line 101 of file TextDisplay.cpp.
RetCode_t cls | ( | uint16_t | layers = 0 ) |
[virtual] |
Clear the screen.
The behavior is to clear the whole screen.
- Parameters:
-
[in] layers is ignored, but supports maintaining the same API for the graphics layer.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Implements TextDisplay.
Reimplemented in RA8875.
Definition at line 157 of file GraphicsDisplay.cpp.
int columns | ( | void | ) | [virtual] |
get the number of colums based on the currently active font
- Returns:
- number of columns.
Implements TextDisplay.
Reimplemented in RA8875.
Definition at line 520 of file GraphicsDisplay.cpp.
RetCode_t fill | ( | loc_t | x, |
loc_t | y, | ||
dim_t | w, | ||
dim_t | h, | ||
color_t | color | ||
) | [virtual] |
method to fill a region.
This method fills a region with the specified color. It essentially is an alias for fillrect, however this uses width and height rather than a second x,y pair.
- Parameters:
-
[in] x is the left-edge of the region. [in] y is the top-edge of the region. [in] w specifies the width of the region. [in] h specifies the height of the region. [in] color is the color value to use to fill the region
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Definition at line 152 of file GraphicsDisplay.cpp.
virtual RetCode_t fillrect | ( | loc_t | x1, |
loc_t | y1, | ||
loc_t | x2, | ||
loc_t | y2, | ||
color_t | color, | ||
fill_t | fillit = FILL |
||
) | [pure virtual] |
Draw a filled rectangle in the specified color.
- Note:
- As a side effect, this changes the current foreground color for subsequent operations.
- this method must be supported in the derived class.
- Parameters:
-
[in] x1 is the horizontal start of the line. [in] y1 is the vertical start of the line. [in] x2 is the horizontal end of the line. [in] y2 is the vertical end of the line. [in] color defines the foreground color. [in] fillit is optional to NOFILL the rectangle. default is FILL.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Implemented in RA8875.
int fontblit | ( | loc_t | x, |
loc_t | y, | ||
const unsigned char | c | ||
) | [virtual] |
This method transfers one character from the external font data to the screen.
The font being used has already been set with the SelectUserFont API.
- Note:
- the font data is in a special format as generate by the mikroe font creator. See http://www.mikroe.com/glcd-font-creator/
- Parameters:
-
[in] x is the horizontal pixel coordinate [in] y is the vertical pixel coordinate [in] c is the character to render
- Returns:
- how far the cursor should advance to the right in pixels.
- zero if the character could not be rendered.
Definition at line 227 of file GraphicsDisplay.cpp.
virtual RetCode_t foreground | ( | color_t | color ) | [pure virtual, inherited] |
set the foreground color
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] color is color to use for foreground drawing.
- Returns:
- error code.
Implemented in RA8875.
const uint8_t * getCharMetrics | ( | const unsigned char | c, |
dim_t * | width, | ||
dim_t * | height | ||
) | [virtual] |
This method returns the width in pixels of the chosen character from the previously selected external font.
- Parameters:
-
[in] c is the character of interest. [in,out] width is a pointer to where the width will be stored. This parameter is NULL tested and will only be written if not null which is convenient if you only want the height. [in,out] height is a pointer to where the height will be stored. This parameter is NULL tested and will only be written if not null which is convenient if you only want the width.
- Returns:
- a pointer to the raw character data or NULL if not found.
Definition at line 202 of file GraphicsDisplay.cpp.
virtual uint16_t GetDrawingLayer | ( | void | ) | [pure virtual] |
Get the currently active drawing layer.
This returns a value, 0 or 1, based on the screen configuration and the currently active drawing layer.
uint16_t prevLayer; lcd.SelectDrawingLayer(x, &prevLayer); lcd.circle(400,25, 25, BrightRed); lcd.SelectDrawingLayer(prevLayer);
- Attention:
- The user manual refers to Layer 1 and Layer 2, however the actual register values are value 0 and 1. This API as well as others that reference the layers use the values 0 and 1 for cleaner iteration in the code.
- Returns:
- the current drawing layer; 0 or 1.
Implemented in RA8875.
virtual point_t GetGraphicsCursor | ( | void | ) | [pure virtual] |
Read the current graphics cursor position as a point.
- Returns:
- the graphics cursor as a point.
Implemented in RA8875.
virtual color_t getPixel | ( | loc_t | x, |
loc_t | y | ||
) | [pure virtual] |
Get a pixel from the display.
- Note:
- this method must be supported in the derived class.
- Parameters:
-
[in] x is the horizontal offset to this pixel. [in] y is the vertical offset to this pixel.
- Returns:
- the pixel.
- See also:
- color_t
Implemented in RA8875.
virtual RetCode_t getPixelStream | ( | color_t * | p, |
uint32_t | count, | ||
loc_t | x, | ||
loc_t | y | ||
) | [pure virtual] |
Get a stream of pixels from the display.
- Note:
- this method must be supported in the derived class.
- Parameters:
-
[out] p is a pointer to a color_t array to accept the stream. [in] count is the number of pixels to read. [in] x is the horizontal offset to this pixel. [in] y is the vertical offset to this pixel.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Implemented in RA8875.
virtual uint16_t height | ( | ) | [pure virtual] |
get the screen height in pixels
- Note:
- this method must be supported in the derived class.
- Returns:
- screen height in pixels.
Implemented in RA8875.
RetCode_t locate | ( | textloc_t | column, |
textloc_t | row | ||
) | [pure virtual, inherited] |
locate the cursor at a character position.
Based on the currently active font, locate the cursor on screen.
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] column is the horizontal offset from the left side. [in] row is the vertical offset from the top.
- Returns:
- error code.
Implemented in RA8875.
Definition at line 74 of file TextDisplay.cpp.
virtual RetCode_t pixel | ( | loc_t | x, |
loc_t | y, | ||
color_t | color | ||
) | [pure virtual] |
Draw a pixel in the specified color.
- Note:
- this method must be supported in the derived class.
- Parameters:
-
[in] x is the horizontal offset to this pixel. [in] y is the vertical offset to this pixel. [in] color defines the color for the pixel.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Implemented in RA8875.
virtual RetCode_t pixelStream | ( | color_t * | p, |
uint32_t | count, | ||
loc_t | x, | ||
loc_t | y | ||
) | [pure virtual] |
Write a stream of pixels to the display.
- Note:
- this method must be supported in the derived class.
- Parameters:
-
[in] p is a pointer to a color_t array to write. [in] count is the number of pixels to write. [in] x is the horizontal position on the display. [in] y is the vertical position on the display.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Implemented in RA8875.
RetCode_t RenderBitmapFile | ( | loc_t | x, |
loc_t | y, | ||
const char * | Name_BMP | ||
) |
This method reads a disk file that is in bitmap format and puts it on the screen.
Supported formats:
- 1-bit color format (2 colors)
- 4-bit color format (16 colors)
- 8-bit color format (256 colors)
- 16-bit color format (65k colors)
- 24-bit color format (16M colors)
- compression: no.
- Note:
- This is a slow operation, typically due to the use of the file system, and partially because bmp files are stored from the bottom up, and the memory is written from the top down; as a result, it constantly 'seeks' on the file system for the next row of information.
As a performance test, a sample picture was timed. A family picture was converted to Bitmap format; shrunk to 352 x 272 pixels and save in 8-bit color format. The resulting file size was 94.5 KByte. The SPI port interface was set to 20 MHz. The original bitmap rendering software was purely in software, pushing 1 pixel at a time to the write function, which did use SPI hardware (not pin wiggling) to transfer commands and data to the display. Then, the driver was improved to leverage the capability of the derived display driver. As a final check, instead of the [known slow] local file system, a randomly chosen USB stick was used. The performance results are impressive (but depend on the listed factors).
- 34 seconds, LocalFileSystem, Software Rendering
- 9 seconds, LocalFileSystem, Hardware Rending for RA8875
- 3 seconds, MSCFileSystem, Hardware Rendering for RA8875
- Parameters:
-
[in] x is the horizontal pixel coordinate [in] y is the vertical pixel coordinate [in] Name_BMP is the filename on the mounted file system.
- Returns:
- success or error code.
Definition at line 455 of file GraphicsDisplay.cpp.
RetCode_t RenderIconFile | ( | loc_t | x, |
loc_t | y, | ||
const char * | Name_ICO | ||
) |
This method reads a disk file that is in ico format and puts it on the screen.
Reading the disk is slow, but a typical icon file is small so it should be ok.
- Note:
- An Icon file can have more than one icon in it. This implementation only processes the first image in the file.
- Parameters:
-
[in] x is the horizontal pixel coordinate [in] y is the vertical pixel coordinate [in] Name_ICO is the filename on the mounted file system.
- Returns:
- success or error code.
Definition at line 482 of file GraphicsDisplay.cpp.
RetCode_t RenderImageFile | ( | loc_t | x, |
loc_t | y, | ||
const char * | FileName | ||
) |
This method attempts to render a specified graphics image file at the specified screen location.
This supports several variants of the following file types:
- Bitmap file format,
- Icon file format.
- Note:
- The specified image width and height, when adjusted for the x and y origin, must fit on the screen, or the image will not be shown (it does not clip the image).
- The file extension is tested, and if it ends in a supported format, the appropriate handler is called to render that image.
- Parameters:
-
[in] x is the horizontal pixel coordinate [in] y is the vertical pixel coordinate [in] FileName refers to the fully qualified path and file on a mounted file system.
- Returns:
- success or error code.
Definition at line 401 of file GraphicsDisplay.cpp.
RetCode_t RenderJpegFile | ( | loc_t | x, |
loc_t | y, | ||
const char * | Name_JPG | ||
) |
This method reads a disk file that is in jpeg format and puts it on the screen.
- Parameters:
-
[in] x is the horizontal pixel coordinate [in] y is the vertical pixel coordinate [in] Name_JPG is the filename on the mounted file system.
- Returns:
- success or error code.
Definition at line 414 of file GraphicsDisplay.cpp.
RGBQUAD RGB16ToRGBQuad | ( | color_t | c ) |
This method converts a 16-bit color value into a 24-bit RGB Quad.
- Parameters:
-
[in] c is the 16-bit color.
- See also:
- color_t.
- Returns:
- an RGBQUAD value.
- See also:
- RGBQUAD
Definition at line 269 of file GraphicsDisplay.cpp.
color_t RGBQuadToRGB16 | ( | RGBQUAD * | colorPaletteArray, |
uint16_t | index | ||
) |
This method returns the color value from a palette.
This method accepts a pointer to a Bitmap color palette, which is a table in memory composed of RGB Quad values (r, g, b, 0), and an index into that table. It then extracts the color information and downsamples it to a color_t value which it returns.
- Note:
- This method probably has very little value outside of the internal methods for reading BMP files.
- Parameters:
-
[in] colorPaletteArray is the handle to the color palette array to use. [in] index is the index into the color palette.
- Returns:
- the color in color_t format.
Definition at line 252 of file GraphicsDisplay.cpp.
int rows | ( | void | ) | [virtual] |
get the number of rows based on the currently active font
- Returns:
- number of rows.
Implements TextDisplay.
Reimplemented in RA8875.
Definition at line 525 of file GraphicsDisplay.cpp.
virtual RetCode_t SelectDrawingLayer | ( | uint16_t | layer, |
uint16_t * | prevLayer = NULL |
||
) | [pure virtual] |
Select the drawing layer for subsequent commands.
If the screen configuration is 480 x 272, or if it is 800 x 480 and 8-bit color, the the display supports two layers, which can be independently drawn on and shown. Additionally, complex operations involving both layers are permitted.
//lcd.SetLayerMode(OnlyLayer0); // default is layer 0
lcd.rect(400,130, 475,155,Brown);
lcd.SelectDrawingLayer(1);
lcd.circle(400,25, 25, BrightRed);
wait(1);
lcd.SetLayerMode(ShowLayer1);
- Attention:
- The user manual refers to Layer 1 and Layer 2, however the actual register values are value 0 and 1. This API as well as others that reference the layers use the values 0 and 1 for cleaner iteration in the code.
- Parameters:
-
[in] layer is 0 or 1 to select the layer for subsequent commands. [out] prevLayer is an optiona pointer to where the previous layer will be written, making it a little easer to restore layers. Writes 0 or 1 when the pointer is not NULL.
- Returns:
- success/failure code. See RetCode_t.
Implemented in RA8875.
virtual RetCode_t SelectUserFont | ( | const uint8_t * | font = NULL ) |
[virtual] |
Select a User Font for all subsequent text.
- Note:
- Tool to create the fonts is accessible from its creator available at http://www.mikroe.com. For version 1.2.0.0, choose the "Export for TFT and new GLCD" format.
- Parameters:
-
[in] font is a pointer to a specially formed font resource.
- Returns:
- error code.
Reimplemented in RA8875.
virtual RetCode_t SetGraphicsCursor | ( | loc_t | x, |
loc_t | y | ||
) | [pure virtual] |
Prepare the controller to write binary data to the screen by positioning the memory cursor.
- Note:
- this method must be supported in the derived class.
- Parameters:
-
[in] x is the horizontal position in pixels (from the left edge) [in] y is the vertical position in pixels (from the top edge)
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Implemented in RA8875.
virtual RetCode_t SetGraphicsCursor | ( | point_t | p ) | [pure virtual] |
Prepare the controller to write binary data to the screen by positioning the memory cursor.
- Parameters:
-
[in] p is the point representing the cursor position to set
- Returns:
- success/failure code. See RetCode_t.
Implemented in RA8875.
virtual RetCode_t SetGraphicsCursorRead | ( | loc_t | x, |
loc_t | y | ||
) | [pure virtual] |
Prepare the controller to read binary data from the screen by positioning the memory read cursor.
- Parameters:
-
[in] x is the horizontal position in pixels (from the left edge) [in] y is the vertical position in pixels (from the top edge)
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Implemented in RA8875.
virtual uint16_t width | ( | ) | [pure virtual] |
get the screen width in pixels
- Note:
- this method must be supported in the derived class.
- Returns:
- screen width in pixels.
Implemented in RA8875.
RetCode_t window | ( | loc_t | x = 0 , |
loc_t | y = 0 , |
||
dim_t | w = (dim_t)-1 , |
||
dim_t | h = (dim_t)-1 |
||
) | [virtual] |
Set the window, which controls where items are written to the screen.
When something hits the window width, it wraps back to the left side and down a row.
- Note:
- If the initial write is outside the window, it will be captured into the window when it crosses a boundary. It may be appropriate to SetGraphicsCursor() to a point in the window.
- if no parameters are provided, it restores the window to full screen.
- Parameters:
-
[in] x is the left edge in pixels. [in] y is the top edge in pixels. [in] w is the window width in pixels. [in] h is the window height in pixels.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Reimplemented in RA8875.
Definition at line 114 of file GraphicsDisplay.cpp.
RetCode_t window | ( | rect_t | r ) | [virtual] |
Set the window, which controls where items are written to the screen.
When something hits the window width, it wraps back to the left side and down a row.
- Note:
- If the initial write is outside the window, it will be captured into the window when it crosses a boundary. It may be appropriate to SetGraphicsCursor() to a point in the window.
- Parameters:
-
[in] r is the rect_t rect to define the window.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Reimplemented in RA8875.
Definition at line 109 of file GraphicsDisplay.cpp.
RetCode_t WindowMax | ( | void | ) | [virtual] |
method to set the window region to the full screen.
This restores the 'window' to the full screen, so that other operations (
- See also:
- cls) would clear the whole screen.
- Returns:
- success/failure code.
- See also:
- RetCode_t.
Definition at line 132 of file GraphicsDisplay.cpp.
virtual RetCode_t WriteCommand | ( | unsigned char | command, |
unsigned int | data = 0xFFFF |
||
) | [pure virtual] |
virtual RetCode_t WriteData | ( | unsigned char | data ) | [pure virtual] |
Field Documentation
color_t _background [protected, inherited] |
presently set background color
Definition at line 145 of file TextDisplay.h.
uint16_t _column [protected, inherited] |
character column location
Definition at line 140 of file TextDisplay.h.
color_t _foreground [protected, inherited] |
presently set foreground color
Definition at line 144 of file TextDisplay.h.
char* _path [protected, inherited] |
stream name when redirecting stdio
Definition at line 146 of file TextDisplay.h.
uint16_t _row [protected, inherited] |
character row location
Definition at line 141 of file TextDisplay.h.
short _x [protected] |
keeps track of current X location
Definition at line 612 of file GraphicsDisplay.h.
short _y [protected] |
keeps track of current Y location
Definition at line 613 of file GraphicsDisplay.h.
const unsigned char* font [protected] |
reference to an external font somewhere in memory
Definition at line 609 of file GraphicsDisplay.h.
rect_t windowrect [protected] |
window commands are held here for speed of access
Definition at line 615 of file GraphicsDisplay.h.
Generated on Wed Jul 13 2022 02:00:17 by 1.7.2