KSM edits to RA8875

Dependents:   Liz_Test_Code

Embed: (wiki syntax)

« Back to documentation index

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.
RetCode_t RenderGIFFile (loc_t x, loc_t y, const char *Name_GIF)
 Render a GIF file on screen.
RetCode_t GetGIFMetrics (gif_screen_descriptor_t *imageDescriptor, const char *Name_GIF)
 GetGIFMetrics.
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 *fh)
 Protected method to render an image given a file handle and coordinates.
RetCode_t _RenderGIF (loc_t x, loc_t y, FILE *fh)
 Protected method to render a GIF 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
uint8_t fontScaleX
 tracks the font scale factor for Soft fonts. Range: 1 .. 4
uint8_t fontScaleY
 tracks the font scale factor for soft fonts. Range: 1 .. 4
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 30 of file GraphicsDisplay.h.


Constructor & Destructor Documentation

GraphicsDisplay ( const char *  name )

The constructor.

Definition at line 90 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:
RetCode_t value.

Implemented in RA8875.

int _getc (  ) [protected, virtual, inherited]

a method to get a character from the stdin

Returns:
the fetched character.

Definition at line 81 of file TextDisplay.cpp.

int _putc ( int  value ) [protected, virtual, inherited]

a method to put a character to the display.

Parameters:
valueis the character value to send to the display
Returns:
the character that was sent.

Reimplemented in RA8875.

Definition at line 39 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]pixelis a color value to be put on the screen.
Returns:
success/failure code.
See also:
RetCode_t.

Reimplemented in RA8875.

Definition at line 142 of file GraphicsDisplay.cpp.

RetCode_t _RenderBitmap ( loc_t  x,
loc_t  y,
uint32_t  fileOffset,
FILE *  fh 
) [protected]

Protected method to render an image given a file handle and coordinates.

Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]fileOffsetis the offset into the file where the image data starts
[in]fhis the file handle to the stream already opened for the data.
Returns:
success or error code.

Definition at line 281 of file GraphicsDisplay.cpp.

RetCode_t _RenderGIF ( loc_t  x,
loc_t  y,
FILE *  fh 
) [protected]

Protected method to render a GIF given a file handle and coordinates.

Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]fhis the file handle to the stream already opened for the data.
Returns:
success or error code.

Definition at line 412 of file GraphicsDisplayGIF.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:
RetCode_t value.

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]coloris color to use for background drawing.
Returns:
RetCode_t value.

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]xis the left-edge of the region.
[in]yis the top-edge of the region.
[in]wspecifies the width of the region.
[in]hspecifies the height of the region.
[in]coloris a pointer to a color stream with w x h values.
Returns:
success/failure code.
See also:
RetCode_t.

Definition at line 177 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]xis the horizontal position on the display.
[in]yis the vertical position on the display.
[in]wis the width of the rectangular region to fill.
[in]his the height of the rectangular region to fill.
[in]boolStreamis the inline memory image from which to extract the bitstream.
Returns:
RetCode_t value.

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]xis the horizontal offset in pixels.
[in]yis the vertical offset in pixels.
[in]valueis 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 109 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]streamthat shall be redirected to the TextDisplay
Returns:
true if the claim succeeded.

Definition at line 100 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]layersis 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 162 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 521 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]xis the left-edge of the region.
[in]yis the top-edge of the region.
[in]wspecifies the width of the region.
[in]hspecifies the height of the region.
[in]coloris the color value to use to fill the region
Returns:
success/failure code.
See also:
RetCode_t.

Definition at line 157 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]x1is the horizontal start of the line.
[in]y1is the vertical start of the line.
[in]x2is the horizontal end of the line.
[in]y2is the vertical end of the line.
[in]colordefines the foreground color.
[in]fillitis 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]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]cis 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 231 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]coloris color to use for foreground drawing.
Returns:
RetCode_t value.

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]cis the character of interest.
[in,out]widthis 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]heightis 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 206 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.

RetCode_t GetGIFMetrics ( gif_screen_descriptor_t *  imageDescriptor,
const char *  Name_GIF 
)

GetGIFMetrics.

Get the GIF Image metrics.

Parameters:
[out]imageDescriptorcontains the image metrics on success.
[in]Name_GIFis the filename of the GIF file of interest.
Returns:
noerror, or a variety of error codes.

Definition at line 545 of file GraphicsDisplayGIF.cpp.

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]xis the horizontal offset to this pixel.
[in]yis 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]pis a pointer to a color_t array to accept the stream.
[in]countis the number of pixels to read.
[in]xis the horizontal offset to this pixel.
[in]yis 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]columnis the horizontal offset from the left side.
[in]rowis the vertical offset from the top.
Returns:
RetCode_t value.

Implemented in RA8875.

Definition at line 73 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]xis the horizontal offset to this pixel.
[in]yis the vertical offset to this pixel.
[in]colordefines 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]pis a pointer to a color_t array to write.
[in]countis the number of pixels to write.
[in]xis the horizontal position on the display.
[in]yis 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]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]Name_BMPis the filename on the mounted file system.
Returns:
success or error code.

Definition at line 456 of file GraphicsDisplay.cpp.

RetCode_t RenderGIFFile ( loc_t  x,
loc_t  y,
const char *  Name_GIF 
)

Render a GIF file on screen.

This function reads a GIF file, and places it onscreen at the specified coordinates.

Parameters:
[in]xis the left edge of the on-screen coordinates.
[in]yis the top edge of the on-screen coordinates.
[in]Name_GIFis a pointer to the fully qualified filename.
Returns:
noerror, or a variety of error codes.

Definition at line 563 of file GraphicsDisplayGIF.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]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]Name_ICOis the filename on the mounted file system.
Returns:
success or error code.

Definition at line 483 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]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]FileNamerefers to the fully qualified path and file on a mounted file system.
Returns:
success or error code.

Definition at line 400 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]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]Name_JPGis the filename on the mounted file system.
Returns:
success or error code.

Definition at line 415 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]cis the 16-bit color.
See also:
color_t.
Returns:
an RGBQUAD value.
See also:
RGBQUAD

Definition at line 268 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]colorPaletteArrayis the handle to the color palette array to use.
[in]indexis the index into the color palette.
Returns:
the color in color_t format.

Definition at line 251 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 526 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]layeris 0 or 1 to select the layer for subsequent commands.
[out]prevLayeris 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:
RetCode_t value.

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]fontis a pointer to a specially formed font resource.
Returns:
RetCode_t value.

Reimplemented 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]pis the point representing the cursor position to set
Returns:
RetCode_t value.

Implemented 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]xis the horizontal position in pixels (from the left edge)
[in]yis the vertical position in pixels (from the top edge)
Returns:
success/failure code.
See also:
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]xis the horizontal position in pixels (from the left edge)
[in]yis 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]xis the left edge in pixels.
[in]yis the top edge in pixels.
[in]wis the window width in pixels.
[in]his the window height in pixels.
Returns:
success/failure code.
See also:
RetCode_t.

Reimplemented in RA8875.

Definition at line 119 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]ris the rect_t rect to define the window.
Returns:
success/failure code.
See also:
RetCode_t.

Reimplemented in RA8875.

Definition at line 114 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 137 of file GraphicsDisplay.cpp.

virtual RetCode_t WriteCommand ( unsigned char  command,
unsigned int  data = 0xFFFF 
) [pure virtual]

a function to write the command and data to the RA8875 chip.

Parameters:
commandis the RA8875 instruction to perform
datais the optional data to the instruction.
Returns:
success/failure code.
See also:
RetCode_t.

Implemented in RA8875.

virtual RetCode_t WriteData ( unsigned char  data ) [pure virtual]

a function to write the data to the RA8875 chip.

This is typically used after a command has been initiated, and where there may be a data stream to follow.

Parameters:
datais the optional data to the instruction.
Returns:
success/failure code.
See also:
RetCode_t.

Implemented in RA8875.


Field Documentation

color_t _background [protected, inherited]

presently set background color

Definition at line 146 of file TextDisplay.h.

uint16_t _column [protected, inherited]

character column location

Definition at line 141 of file TextDisplay.h.

color_t _foreground [protected, inherited]

presently set foreground color

Definition at line 145 of file TextDisplay.h.

char* _path [protected, inherited]

stream name when redirecting stdio

Definition at line 147 of file TextDisplay.h.

uint16_t _row [protected, inherited]

character row location

Definition at line 142 of file TextDisplay.h.

short _x [protected]

keeps track of current X location

Definition at line 666 of file GraphicsDisplay.h.

short _y [protected]

keeps track of current Y location

Definition at line 667 of file GraphicsDisplay.h.

const unsigned char* font [protected]

reference to an external font somewhere in memory

Definition at line 663 of file GraphicsDisplay.h.

uint8_t fontScaleX [protected]

tracks the font scale factor for Soft fonts. Range: 1 .. 4

Definition at line 669 of file GraphicsDisplay.h.

uint8_t fontScaleY [protected]

tracks the font scale factor for soft fonts. Range: 1 .. 4

Definition at line 670 of file GraphicsDisplay.h.

rect_t windowrect [protected]

window commands are held here for speed of access

Definition at line 672 of file GraphicsDisplay.h.