KSM edits to RA8875

Dependents:   Liz_Test_Code

Committer:
WiredHome
Date:
Sun Mar 19 22:11:04 2017 +0000
Revision:
143:e872d65a710d
Parent:
142:6e9bff59878a
Child:
151:ae94daaaf8ad
Child:
152:a013ac0133e4
unbreaking change to SelectDrawingLayer to get the return value as an optional parameter.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dreschpe 0:de9d1462a835 1 /* mbed GraphicsDisplay Display Library Base Class
dreschpe 0:de9d1462a835 2 * Copyright (c) 2007-2009 sford
dreschpe 0:de9d1462a835 3 * Released under the MIT License: http://mbed.org/license/mit
dreschpe 0:de9d1462a835 4 *
dreschpe 0:de9d1462a835 5 * A library for providing a common base class for Graphics displays
dreschpe 0:de9d1462a835 6 * To port a new display, derive from this class and implement
dreschpe 0:de9d1462a835 7 * the constructor (setup the display), pixel (put a pixel
dreschpe 0:de9d1462a835 8 * at a location), width and height functions. Everything else
dreschpe 0:de9d1462a835 9 * (locate, printf, putc, cls, window, putp, fill, blit, blitbit)
dreschpe 0:de9d1462a835 10 * will come for free. You can also provide a specialised implementation
dreschpe 0:de9d1462a835 11 * of window and putp to speed up the results
dreschpe 0:de9d1462a835 12 */
dreschpe 0:de9d1462a835 13
dreschpe 0:de9d1462a835 14 #ifndef MBED_GRAPHICSDISPLAY_H
dreschpe 0:de9d1462a835 15 #define MBED_GRAPHICSDISPLAY_H
WiredHome 32:0e4f2ae512e2 16 #include "Bitmap.h"
dreschpe 0:de9d1462a835 17 #include "TextDisplay.h"
WiredHome 115:c9862fd0c689 18 #include "GraphicsDisplayJPEG.h"
dreschpe 0:de9d1462a835 19
WiredHome 32:0e4f2ae512e2 20 /// The GraphicsDisplay class
WiredHome 32:0e4f2ae512e2 21 ///
WiredHome 32:0e4f2ae512e2 22 /// This graphics display class supports both graphics and text operations.
WiredHome 32:0e4f2ae512e2 23 /// Typically, a subclass is derived from this which has localizations to
WiredHome 32:0e4f2ae512e2 24 /// adapt to a specific hardware platform (e.g. a display controller chip),
WiredHome 32:0e4f2ae512e2 25 /// that overrides methods in here to either add more capability or perhaps
WiredHome 32:0e4f2ae512e2 26 /// to improve performance, by leveraging specific hardware capabilities.
WiredHome 32:0e4f2ae512e2 27 ///
WiredHome 32:0e4f2ae512e2 28 class GraphicsDisplay : public TextDisplay
WiredHome 32:0e4f2ae512e2 29 {
WiredHome 32:0e4f2ae512e2 30 public:
WiredHome 32:0e4f2ae512e2 31 /// The constructor
dreschpe 0:de9d1462a835 32 GraphicsDisplay(const char* name);
WiredHome 32:0e4f2ae512e2 33
WiredHome 104:8d1d3832a215 34 //~GraphicsDisplay();
WiredHome 104:8d1d3832a215 35
WiredHome 32:0e4f2ae512e2 36 /// Draw a pixel in the specified color.
WiredHome 32:0e4f2ae512e2 37 ///
WiredHome 32:0e4f2ae512e2 38 /// @note this method must be supported in the derived class.
WiredHome 32:0e4f2ae512e2 39 ///
WiredHome 76:c981284eb513 40 /// @param[in] x is the horizontal offset to this pixel.
WiredHome 76:c981284eb513 41 /// @param[in] y is the vertical offset to this pixel.
WiredHome 76:c981284eb513 42 /// @param[in] color defines the color for the pixel.
WiredHome 32:0e4f2ae512e2 43 /// @returns success/failure code. @see RetCode_t.
WiredHome 32:0e4f2ae512e2 44 ///
WiredHome 37:f19b7e7449dc 45 virtual RetCode_t pixel(loc_t x, loc_t y, color_t color) = 0;
WiredHome 32:0e4f2ae512e2 46
WiredHome 41:2956a0a221e5 47 /// Write a stream of pixels to the display.
WiredHome 41:2956a0a221e5 48 ///
WiredHome 41:2956a0a221e5 49 /// @note this method must be supported in the derived class.
WiredHome 41:2956a0a221e5 50 ///
WiredHome 76:c981284eb513 51 /// @param[in] p is a pointer to a color_t array to write.
WiredHome 76:c981284eb513 52 /// @param[in] count is the number of pixels to write.
WiredHome 76:c981284eb513 53 /// @param[in] x is the horizontal position on the display.
WiredHome 76:c981284eb513 54 /// @param[in] y is the vertical position on the display.
WiredHome 41:2956a0a221e5 55 /// @returns success/failure code. @see RetCode_t.
WiredHome 41:2956a0a221e5 56 ///
WiredHome 41:2956a0a221e5 57 virtual RetCode_t pixelStream(color_t * p, uint32_t count, loc_t x, loc_t y) = 0;
WiredHome 41:2956a0a221e5 58
WiredHome 41:2956a0a221e5 59 /// Get a pixel from the display.
WiredHome 41:2956a0a221e5 60 ///
WiredHome 41:2956a0a221e5 61 /// @note this method must be supported in the derived class.
WiredHome 41:2956a0a221e5 62 ///
WiredHome 76:c981284eb513 63 /// @param[in] x is the horizontal offset to this pixel.
WiredHome 76:c981284eb513 64 /// @param[in] y is the vertical offset to this pixel.
WiredHome 125:7a0b70f56550 65 /// @returns the pixel. @see color_t
WiredHome 41:2956a0a221e5 66 ///
WiredHome 41:2956a0a221e5 67 virtual color_t getPixel(loc_t x, loc_t y) = 0;
WiredHome 41:2956a0a221e5 68
WiredHome 41:2956a0a221e5 69 /// Get a stream of pixels from the display.
WiredHome 41:2956a0a221e5 70 ///
WiredHome 41:2956a0a221e5 71 /// @note this method must be supported in the derived class.
WiredHome 41:2956a0a221e5 72 ///
WiredHome 76:c981284eb513 73 /// @param[out] p is a pointer to a color_t array to accept the stream.
WiredHome 76:c981284eb513 74 /// @param[in] count is the number of pixels to read.
WiredHome 76:c981284eb513 75 /// @param[in] x is the horizontal offset to this pixel.
WiredHome 76:c981284eb513 76 /// @param[in] y is the vertical offset to this pixel.
WiredHome 41:2956a0a221e5 77 /// @returns success/failure code. @see RetCode_t.
WiredHome 41:2956a0a221e5 78 ///
WiredHome 41:2956a0a221e5 79 virtual RetCode_t getPixelStream(color_t * p, uint32_t count, loc_t x, loc_t y) = 0;
WiredHome 41:2956a0a221e5 80
WiredHome 32:0e4f2ae512e2 81 /// get the screen width in pixels
WiredHome 32:0e4f2ae512e2 82 ///
WiredHome 32:0e4f2ae512e2 83 /// @note this method must be supported in the derived class.
WiredHome 32:0e4f2ae512e2 84 ///
WiredHome 32:0e4f2ae512e2 85 /// @returns screen width in pixels.
WiredHome 32:0e4f2ae512e2 86 ///
WiredHome 32:0e4f2ae512e2 87 virtual uint16_t width() = 0;
WiredHome 32:0e4f2ae512e2 88
WiredHome 32:0e4f2ae512e2 89 /// get the screen height in pixels
WiredHome 32:0e4f2ae512e2 90 ///
WiredHome 32:0e4f2ae512e2 91 /// @note this method must be supported in the derived class.
WiredHome 32:0e4f2ae512e2 92 ///
WiredHome 32:0e4f2ae512e2 93 /// @returns screen height in pixels.
WiredHome 32:0e4f2ae512e2 94 ///
WiredHome 32:0e4f2ae512e2 95 virtual uint16_t height() = 0;
WiredHome 32:0e4f2ae512e2 96
WiredHome 32:0e4f2ae512e2 97 /// Prepare the controller to write binary data to the screen by positioning
WiredHome 32:0e4f2ae512e2 98 /// the memory cursor.
WiredHome 32:0e4f2ae512e2 99 ///
WiredHome 32:0e4f2ae512e2 100 /// @note this method must be supported in the derived class.
WiredHome 32:0e4f2ae512e2 101 ///
WiredHome 76:c981284eb513 102 /// @param[in] x is the horizontal position in pixels (from the left edge)
WiredHome 76:c981284eb513 103 /// @param[in] y is the vertical position in pixels (from the top edge)
WiredHome 32:0e4f2ae512e2 104 /// @returns success/failure code. @see RetCode_t.
WiredHome 32:0e4f2ae512e2 105 ///
WiredHome 37:f19b7e7449dc 106 virtual RetCode_t SetGraphicsCursor(loc_t x, loc_t y) = 0;
WiredHome 32:0e4f2ae512e2 107
WiredHome 136:224e03d5c31f 108
WiredHome 136:224e03d5c31f 109 /// Prepare the controller to write binary data to the screen by positioning
WiredHome 136:224e03d5c31f 110 /// the memory cursor.
WiredHome 136:224e03d5c31f 111 ///
WiredHome 136:224e03d5c31f 112 /// @param[in] p is the point representing the cursor position to set
WiredHome 136:224e03d5c31f 113 /// @returns success/failure code. See @ref RetCode_t.
WiredHome 136:224e03d5c31f 114 ///
WiredHome 136:224e03d5c31f 115 virtual RetCode_t SetGraphicsCursor(point_t p) = 0;
WiredHome 136:224e03d5c31f 116
WiredHome 136:224e03d5c31f 117 /// Read the current graphics cursor position as a point.
WiredHome 136:224e03d5c31f 118 ///
WiredHome 136:224e03d5c31f 119 /// @returns the graphics cursor as a point.
WiredHome 136:224e03d5c31f 120 ///
WiredHome 136:224e03d5c31f 121 virtual point_t GetGraphicsCursor(void) = 0;
WiredHome 136:224e03d5c31f 122
WiredHome 41:2956a0a221e5 123 /// Prepare the controller to read binary data from the screen by positioning
WiredHome 41:2956a0a221e5 124 /// the memory read cursor.
WiredHome 41:2956a0a221e5 125 ///
WiredHome 76:c981284eb513 126 /// @param[in] x is the horizontal position in pixels (from the left edge)
WiredHome 76:c981284eb513 127 /// @param[in] y is the vertical position in pixels (from the top edge)
WiredHome 41:2956a0a221e5 128 /// @returns success/failure code. @see RetCode_t.
WiredHome 41:2956a0a221e5 129 ///
WiredHome 41:2956a0a221e5 130 virtual RetCode_t SetGraphicsCursorRead(loc_t x, loc_t y) = 0;
WiredHome 41:2956a0a221e5 131
WiredHome 32:0e4f2ae512e2 132 /// Draw a filled rectangle in the specified color
WiredHome 32:0e4f2ae512e2 133 ///
WiredHome 32:0e4f2ae512e2 134 /// @note As a side effect, this changes the current
WiredHome 32:0e4f2ae512e2 135 /// foreground color for subsequent operations.
WiredHome 32:0e4f2ae512e2 136 ///
WiredHome 32:0e4f2ae512e2 137 /// @note this method must be supported in the derived class.
WiredHome 32:0e4f2ae512e2 138 ///
WiredHome 76:c981284eb513 139 /// @param[in] x1 is the horizontal start of the line.
WiredHome 76:c981284eb513 140 /// @param[in] y1 is the vertical start of the line.
WiredHome 76:c981284eb513 141 /// @param[in] x2 is the horizontal end of the line.
WiredHome 76:c981284eb513 142 /// @param[in] y2 is the vertical end of the line.
WiredHome 76:c981284eb513 143 /// @param[in] color defines the foreground color.
WiredHome 76:c981284eb513 144 /// @param[in] fillit is optional to NOFILL the rectangle. default is FILL.
WiredHome 32:0e4f2ae512e2 145 /// @returns success/failure code. @see RetCode_t.
WiredHome 32:0e4f2ae512e2 146 ///
WiredHome 37:f19b7e7449dc 147 virtual RetCode_t fillrect(loc_t x1, loc_t y1, loc_t x2, loc_t y2,
WiredHome 32:0e4f2ae512e2 148 color_t color, fill_t fillit = FILL) = 0;
WiredHome 32:0e4f2ae512e2 149
WiredHome 142:6e9bff59878a 150 /// Select the drawing layer for subsequent commands.
WiredHome 142:6e9bff59878a 151 ///
WiredHome 142:6e9bff59878a 152 /// If the screen configuration is 480 x 272, or if it is 800 x 480
WiredHome 142:6e9bff59878a 153 /// and 8-bit color, the the display supports two layers, which can
WiredHome 142:6e9bff59878a 154 /// be independently drawn on and shown. Additionally, complex
WiredHome 142:6e9bff59878a 155 /// operations involving both layers are permitted.
WiredHome 142:6e9bff59878a 156 ///
WiredHome 142:6e9bff59878a 157 /// @code
WiredHome 142:6e9bff59878a 158 /// //lcd.SetLayerMode(OnlyLayer0); // default is layer 0
WiredHome 142:6e9bff59878a 159 /// lcd.rect(400,130, 475,155,Brown);
WiredHome 142:6e9bff59878a 160 /// lcd.SelectDrawingLayer(1);
WiredHome 142:6e9bff59878a 161 /// lcd.circle(400,25, 25, BrightRed);
WiredHome 142:6e9bff59878a 162 /// wait(1);
WiredHome 142:6e9bff59878a 163 /// lcd.SetLayerMode(ShowLayer1);
WiredHome 142:6e9bff59878a 164 /// @endcode
WiredHome 142:6e9bff59878a 165 ///
WiredHome 142:6e9bff59878a 166 /// @attention The user manual refers to Layer 1 and Layer 2, however the
WiredHome 142:6e9bff59878a 167 /// actual register values are value 0 and 1. This API as well as
WiredHome 142:6e9bff59878a 168 /// others that reference the layers use the values 0 and 1 for
WiredHome 142:6e9bff59878a 169 /// cleaner iteration in the code.
WiredHome 142:6e9bff59878a 170 ///
WiredHome 142:6e9bff59878a 171 /// @param[in] layer is 0 or 1 to select the layer for subsequent
WiredHome 142:6e9bff59878a 172 /// commands.
WiredHome 143:e872d65a710d 173 /// @param[out] prevLayer is an optiona pointer to where the previous layer
WiredHome 143:e872d65a710d 174 /// will be written, making it a little easer to restore layers.
WiredHome 143:e872d65a710d 175 /// Writes 0 or 1 when the pointer is not NULL.
WiredHome 143:e872d65a710d 176 /// @returns success/failure code. See @ref RetCode_t.
WiredHome 142:6e9bff59878a 177 ///
WiredHome 143:e872d65a710d 178 virtual RetCode_t SelectDrawingLayer(uint16_t layer, uint16_t * prevLayer = NULL) = 0;
WiredHome 142:6e9bff59878a 179
WiredHome 142:6e9bff59878a 180
WiredHome 142:6e9bff59878a 181 /// Get the currently active drawing layer.
WiredHome 142:6e9bff59878a 182 ///
WiredHome 142:6e9bff59878a 183 /// This returns a value, 0 or 1, based on the screen configuration
WiredHome 142:6e9bff59878a 184 /// and the currently active drawing layer.
WiredHome 142:6e9bff59878a 185 ///
WiredHome 142:6e9bff59878a 186 /// @code
WiredHome 143:e872d65a710d 187 /// uint16_t prevLayer;
WiredHome 143:e872d65a710d 188 /// lcd.SelectDrawingLayer(x, &prevLayer);
WiredHome 142:6e9bff59878a 189 /// lcd.circle(400,25, 25, BrightRed);
WiredHome 142:6e9bff59878a 190 /// lcd.SelectDrawingLayer(prevLayer);
WiredHome 142:6e9bff59878a 191 /// @endcode
WiredHome 142:6e9bff59878a 192 ///
WiredHome 142:6e9bff59878a 193 /// @attention The user manual refers to Layer 1 and Layer 2, however the
WiredHome 142:6e9bff59878a 194 /// actual register values are value 0 and 1. This API as well as
WiredHome 142:6e9bff59878a 195 /// others that reference the layers use the values 0 and 1 for
WiredHome 142:6e9bff59878a 196 /// cleaner iteration in the code.
WiredHome 142:6e9bff59878a 197 ///
WiredHome 142:6e9bff59878a 198 /// @returns the current drawing layer; 0 or 1.
WiredHome 142:6e9bff59878a 199 ///
WiredHome 142:6e9bff59878a 200 virtual uint16_t GetDrawingLayer(void) = 0;
WiredHome 142:6e9bff59878a 201
WiredHome 125:7a0b70f56550 202 /// a function to write the command and data to the RA8875 chip.
WiredHome 125:7a0b70f56550 203 ///
WiredHome 125:7a0b70f56550 204 /// @param command is the RA8875 instruction to perform
WiredHome 125:7a0b70f56550 205 /// @param data is the optional data to the instruction.
WiredHome 125:7a0b70f56550 206 /// @returns success/failure code. @see RetCode_t.
WiredHome 125:7a0b70f56550 207 ///
WiredHome 32:0e4f2ae512e2 208 virtual RetCode_t WriteCommand(unsigned char command, unsigned int data = 0xFFFF) = 0;
WiredHome 125:7a0b70f56550 209
WiredHome 125:7a0b70f56550 210
WiredHome 125:7a0b70f56550 211 /// a function to write the data to the RA8875 chip.
WiredHome 125:7a0b70f56550 212 ///
WiredHome 125:7a0b70f56550 213 /// This is typically used after a command has been initiated, and where
WiredHome 125:7a0b70f56550 214 /// there may be a data stream to follow.
WiredHome 125:7a0b70f56550 215 ///
WiredHome 125:7a0b70f56550 216 /// @param data is the optional data to the instruction.
WiredHome 125:7a0b70f56550 217 /// @returns success/failure code. @see RetCode_t.
WiredHome 125:7a0b70f56550 218 ///
WiredHome 32:0e4f2ae512e2 219 virtual RetCode_t WriteData(unsigned char data) = 0;
WiredHome 32:0e4f2ae512e2 220
WiredHome 32:0e4f2ae512e2 221 /// Set the window, which controls where items are written to the screen.
WiredHome 32:0e4f2ae512e2 222 ///
WiredHome 32:0e4f2ae512e2 223 /// When something hits the window width, it wraps back to the left side
WiredHome 126:c91bd2e500b9 224 /// and down a row.
WiredHome 126:c91bd2e500b9 225 ///
WiredHome 126:c91bd2e500b9 226 /// @note If the initial write is outside the window, it will
WiredHome 126:c91bd2e500b9 227 /// be captured into the window when it crosses a boundary. It may
WiredHome 126:c91bd2e500b9 228 /// be appropriate to SetGraphicsCursor() to a point in the window.
WiredHome 32:0e4f2ae512e2 229 ///
WiredHome 111:efe436c43aba 230 /// @param[in] r is the rect_t rect to define the window.
WiredHome 111:efe436c43aba 231 /// @returns success/failure code. @see RetCode_t.
WiredHome 111:efe436c43aba 232 ///
WiredHome 111:efe436c43aba 233 virtual RetCode_t window(rect_t r);
WiredHome 111:efe436c43aba 234
WiredHome 111:efe436c43aba 235 /// Set the window, which controls where items are written to the screen.
WiredHome 111:efe436c43aba 236 ///
WiredHome 111:efe436c43aba 237 /// When something hits the window width, it wraps back to the left side
WiredHome 126:c91bd2e500b9 238 /// and down a row.
WiredHome 126:c91bd2e500b9 239 ///
WiredHome 126:c91bd2e500b9 240 /// @note If the initial write is outside the window, it will
WiredHome 126:c91bd2e500b9 241 /// be captured into the window when it crosses a boundary. It may
WiredHome 126:c91bd2e500b9 242 /// be appropriate to SetGraphicsCursor() to a point in the window.
WiredHome 111:efe436c43aba 243 ///
WiredHome 114:dbfb996bfbf3 244 /// @note if no parameters are provided, it restores the window to full screen.
WiredHome 114:dbfb996bfbf3 245 ///
WiredHome 76:c981284eb513 246 /// @param[in] x is the left edge in pixels.
WiredHome 76:c981284eb513 247 /// @param[in] y is the top edge in pixels.
WiredHome 76:c981284eb513 248 /// @param[in] w is the window width in pixels.
WiredHome 76:c981284eb513 249 /// @param[in] h is the window height in pixels.
WiredHome 32:0e4f2ae512e2 250 /// @returns success/failure code. @see RetCode_t.
WiredHome 32:0e4f2ae512e2 251 ///
WiredHome 114:dbfb996bfbf3 252 virtual RetCode_t window(loc_t x = 0, loc_t y = 0, dim_t w = (dim_t)-1, dim_t h = (dim_t)-1);
WiredHome 32:0e4f2ae512e2 253
WiredHome 111:efe436c43aba 254 /// method to set the window region to the full screen.
WiredHome 111:efe436c43aba 255 ///
WiredHome 111:efe436c43aba 256 /// This restores the 'window' to the full screen, so that
WiredHome 111:efe436c43aba 257 /// other operations (@see cls) would clear the whole screen.
WiredHome 111:efe436c43aba 258 ///
WiredHome 111:efe436c43aba 259 /// @returns success/failure code. @see RetCode_t.
WiredHome 111:efe436c43aba 260 ///
WiredHome 111:efe436c43aba 261 virtual RetCode_t WindowMax(void);
WiredHome 111:efe436c43aba 262
WiredHome 32:0e4f2ae512e2 263 /// Clear the screen.
WiredHome 32:0e4f2ae512e2 264 ///
WiredHome 32:0e4f2ae512e2 265 /// The behavior is to clear the whole screen.
WiredHome 32:0e4f2ae512e2 266 ///
WiredHome 76:c981284eb513 267 /// @param[in] layers is ignored, but supports maintaining the same
WiredHome 61:8f3153bf0baa 268 /// API for the graphics layer.
WiredHome 32:0e4f2ae512e2 269 /// @returns success/failure code. @see RetCode_t.
WiredHome 32:0e4f2ae512e2 270 ///
WiredHome 61:8f3153bf0baa 271 virtual RetCode_t cls(uint16_t layers = 0);
WiredHome 32:0e4f2ae512e2 272
WiredHome 32:0e4f2ae512e2 273 /// method to put a single color pixel to the screen.
WiredHome 32:0e4f2ae512e2 274 ///
WiredHome 32:0e4f2ae512e2 275 /// This method may be called as many times as necessary after
WiredHome 32:0e4f2ae512e2 276 /// @see _StartGraphicsStream() is called, and it should be followed
WiredHome 32:0e4f2ae512e2 277 /// by _EndGraphicsStream.
WiredHome 32:0e4f2ae512e2 278 ///
WiredHome 76:c981284eb513 279 /// @param[in] pixel is a color value to be put on the screen.
WiredHome 79:544eb4964795 280 /// @returns success/failure code. @see RetCode_t.
WiredHome 32:0e4f2ae512e2 281 ///
WiredHome 55:dfbabef7003e 282 virtual RetCode_t _putp(color_t pixel);
WiredHome 32:0e4f2ae512e2 283
WiredHome 79:544eb4964795 284 /// method to fill a region.
WiredHome 79:544eb4964795 285 ///
WiredHome 125:7a0b70f56550 286 /// This method fills a region with the specified color. It essentially
WiredHome 125:7a0b70f56550 287 /// is an alias for fillrect, however this uses width and height rather
WiredHome 125:7a0b70f56550 288 /// than a second x,y pair.
WiredHome 79:544eb4964795 289 ///
WiredHome 79:544eb4964795 290 /// @param[in] x is the left-edge of the region.
WiredHome 79:544eb4964795 291 /// @param[in] y is the top-edge of the region.
WiredHome 79:544eb4964795 292 /// @param[in] w specifies the width of the region.
WiredHome 79:544eb4964795 293 /// @param[in] h specifies the height of the region.
WiredHome 125:7a0b70f56550 294 /// @param[in] color is the color value to use to fill the region
WiredHome 79:544eb4964795 295 /// @returns success/failure code. @see RetCode_t.
WiredHome 79:544eb4964795 296 ///
WiredHome 109:7b94f06f085b 297 virtual RetCode_t fill(loc_t x, loc_t y, dim_t w, dim_t h, color_t color);
WiredHome 76:c981284eb513 298
WiredHome 125:7a0b70f56550 299 /// method to stream bitmap data to the display
WiredHome 125:7a0b70f56550 300 ///
WiredHome 125:7a0b70f56550 301 /// This method fills a region from a stream of color data.
WiredHome 125:7a0b70f56550 302 ///
WiredHome 125:7a0b70f56550 303 /// @param[in] x is the left-edge of the region.
WiredHome 125:7a0b70f56550 304 /// @param[in] y is the top-edge of the region.
WiredHome 125:7a0b70f56550 305 /// @param[in] w specifies the width of the region.
WiredHome 125:7a0b70f56550 306 /// @param[in] h specifies the height of the region.
WiredHome 125:7a0b70f56550 307 /// @param[in] color is a pointer to a color stream with w x h values.
WiredHome 125:7a0b70f56550 308 /// @returns success/failure code. @see RetCode_t.
WiredHome 125:7a0b70f56550 309 ///
WiredHome 109:7b94f06f085b 310 virtual RetCode_t blit(loc_t x, loc_t y, dim_t w, dim_t h, const int * color);
WiredHome 29:422616aa04bd 311
WiredHome 101:e0aad446094a 312 /// This method returns the width in pixels of the chosen character
WiredHome 101:e0aad446094a 313 /// from the previously selected external font.
WiredHome 101:e0aad446094a 314 ///
WiredHome 101:e0aad446094a 315 /// @param[in] c is the character of interest.
WiredHome 106:c80828f5dea4 316 /// @param[in, out] width is a pointer to where the width will be stored.
WiredHome 101:e0aad446094a 317 /// This parameter is NULL tested and will only be written if not null
WiredHome 101:e0aad446094a 318 /// which is convenient if you only want the height.
WiredHome 106:c80828f5dea4 319 /// @param[in, out] height is a pointer to where the height will be stored.
WiredHome 101:e0aad446094a 320 /// This parameter is NULL tested and will only be written if not null
WiredHome 101:e0aad446094a 321 /// which is convenient if you only want the width.
WiredHome 101:e0aad446094a 322 /// @returns a pointer to the raw character data or NULL if not found.
WiredHome 101:e0aad446094a 323 ///
WiredHome 109:7b94f06f085b 324 virtual const uint8_t * getCharMetrics(const unsigned char c, dim_t * width, dim_t * height);
WiredHome 101:e0aad446094a 325
WiredHome 29:422616aa04bd 326 /// This method transfers one character from the external font data
WiredHome 29:422616aa04bd 327 /// to the screen.
WiredHome 29:422616aa04bd 328 ///
WiredHome 101:e0aad446094a 329 /// The font being used has already been set with the SelectUserFont
WiredHome 101:e0aad446094a 330 /// API.
WiredHome 101:e0aad446094a 331 ///
WiredHome 29:422616aa04bd 332 /// @note the font data is in a special format as generate by
WiredHome 95:ef538bd687c0 333 /// the mikroe font creator.
WiredHome 29:422616aa04bd 334 /// See http://www.mikroe.com/glcd-font-creator/
WiredHome 29:422616aa04bd 335 ///
WiredHome 76:c981284eb513 336 /// @param[in] x is the horizontal pixel coordinate
WiredHome 76:c981284eb513 337 /// @param[in] y is the vertical pixel coordinate
WiredHome 98:ecebed9b80b2 338 /// @param[in] c is the character to render
WiredHome 98:ecebed9b80b2 339 /// @returns how far the cursor should advance to the right in pixels.
WiredHome 98:ecebed9b80b2 340 /// @returns zero if the character could not be rendered.
WiredHome 29:422616aa04bd 341 ///
WiredHome 109:7b94f06f085b 342 virtual int fontblit(loc_t x, loc_t y, const unsigned char c);
WiredHome 29:422616aa04bd 343
WiredHome 32:0e4f2ae512e2 344 /// This method returns the color value from a palette.
WiredHome 32:0e4f2ae512e2 345 ///
WiredHome 32:0e4f2ae512e2 346 /// This method accepts a pointer to a Bitmap color palette, which
WiredHome 32:0e4f2ae512e2 347 /// is a table in memory composed of RGB Quad values (r, g, b, 0),
WiredHome 32:0e4f2ae512e2 348 /// and an index into that table. It then extracts the color information
WiredHome 32:0e4f2ae512e2 349 /// and downsamples it to a color_t value which it returns.
WiredHome 32:0e4f2ae512e2 350 ///
WiredHome 32:0e4f2ae512e2 351 /// @note This method probably has very little value outside of
WiredHome 32:0e4f2ae512e2 352 /// the internal methods for reading BMP files.
WiredHome 32:0e4f2ae512e2 353 ///
WiredHome 76:c981284eb513 354 /// @param[in] colorPaletteArray is the handle to the color palette array to use.
WiredHome 76:c981284eb513 355 /// @param[in] index is the index into the color palette.
WiredHome 32:0e4f2ae512e2 356 /// @returns the color in color_t format.
WiredHome 32:0e4f2ae512e2 357 ///
WiredHome 73:f22a18707b5e 358 color_t RGBQuadToRGB16(RGBQUAD * colorPaletteArray, uint16_t index);
WiredHome 32:0e4f2ae512e2 359
WiredHome 41:2956a0a221e5 360 /// This method converts a 16-bit color value into a 24-bit RGB Quad.
WiredHome 41:2956a0a221e5 361 ///
WiredHome 76:c981284eb513 362 /// @param[in] c is the 16-bit color. @see color_t.
WiredHome 41:2956a0a221e5 363 /// @returns an RGBQUAD value. @see RGBQUAD
WiredHome 41:2956a0a221e5 364 ///
WiredHome 41:2956a0a221e5 365 RGBQUAD RGB16ToRGBQuad(color_t c);
WiredHome 41:2956a0a221e5 366
WiredHome 42:7cbdfd2bbfc5 367 /// This method attempts to render a specified graphics image file at
WiredHome 42:7cbdfd2bbfc5 368 /// the specified screen location.
WiredHome 42:7cbdfd2bbfc5 369 ///
WiredHome 42:7cbdfd2bbfc5 370 /// This supports several variants of the following file types:
WiredHome 42:7cbdfd2bbfc5 371 /// \li Bitmap file format,
WiredHome 42:7cbdfd2bbfc5 372 /// \li Icon file format.
WiredHome 42:7cbdfd2bbfc5 373 ///
WiredHome 42:7cbdfd2bbfc5 374 /// @note The specified image width and height, when adjusted for the
WiredHome 42:7cbdfd2bbfc5 375 /// x and y origin, must fit on the screen, or the image will not
WiredHome 42:7cbdfd2bbfc5 376 /// be shown (it does not clip the image).
WiredHome 42:7cbdfd2bbfc5 377 ///
WiredHome 42:7cbdfd2bbfc5 378 /// @note The file extension is tested, and if it ends in a supported
WiredHome 42:7cbdfd2bbfc5 379 /// format, the appropriate handler is called to render that image.
WiredHome 42:7cbdfd2bbfc5 380 ///
WiredHome 76:c981284eb513 381 /// @param[in] x is the horizontal pixel coordinate
WiredHome 76:c981284eb513 382 /// @param[in] y is the vertical pixel coordinate
WiredHome 76:c981284eb513 383 /// @param[in] FileName refers to the fully qualified path and file on
WiredHome 42:7cbdfd2bbfc5 384 /// a mounted file system.
WiredHome 42:7cbdfd2bbfc5 385 /// @returns success or error code.
WiredHome 42:7cbdfd2bbfc5 386 ///
WiredHome 42:7cbdfd2bbfc5 387 RetCode_t RenderImageFile(loc_t x, loc_t y, const char *FileName);
WiredHome 42:7cbdfd2bbfc5 388
WiredHome 115:c9862fd0c689 389 /// This method reads a disk file that is in jpeg format and
WiredHome 115:c9862fd0c689 390 /// puts it on the screen.
WiredHome 115:c9862fd0c689 391 ///
WiredHome 115:c9862fd0c689 392 /// @param[in] x is the horizontal pixel coordinate
WiredHome 115:c9862fd0c689 393 /// @param[in] y is the vertical pixel coordinate
WiredHome 115:c9862fd0c689 394 /// @param[in] Name_JPG is the filename on the mounted file system.
WiredHome 115:c9862fd0c689 395 /// @returns success or error code.
WiredHome 115:c9862fd0c689 396 ///
WiredHome 115:c9862fd0c689 397 RetCode_t RenderJpegFile(loc_t x, loc_t y, const char *Name_JPG);
WiredHome 115:c9862fd0c689 398
WiredHome 31:c72e12cd5c67 399 /// This method reads a disk file that is in bitmap format and
WiredHome 31:c72e12cd5c67 400 /// puts it on the screen.
WiredHome 31:c72e12cd5c67 401 ///
WiredHome 36:300f6ee0b2cf 402 /// Supported formats:
WiredHome 112:325ca91bc03d 403 /// \li 1-bit color format (2 colors)
WiredHome 112:325ca91bc03d 404 /// \li 4-bit color format (16 colors)
WiredHome 112:325ca91bc03d 405 /// \li 8-bit color format (256 colors)
WiredHome 36:300f6ee0b2cf 406 /// \li 16-bit color format (65k colors)
WiredHome 112:325ca91bc03d 407 /// \li 24-bit color format (16M colors)
WiredHome 36:300f6ee0b2cf 408 /// \li compression: no.
WiredHome 36:300f6ee0b2cf 409 ///
WiredHome 36:300f6ee0b2cf 410 /// @note This is a slow operation, typically due to the use of
WiredHome 36:300f6ee0b2cf 411 /// the file system, and partially because bmp files
WiredHome 31:c72e12cd5c67 412 /// are stored from the bottom up, and the memory is written
WiredHome 32:0e4f2ae512e2 413 /// from the top down; as a result, it constantly 'seeks'
WiredHome 32:0e4f2ae512e2 414 /// on the file system for the next row of information.
WiredHome 31:c72e12cd5c67 415 ///
WiredHome 34:c99ec28fac66 416 /// As a performance test, a sample picture was timed. A family picture
WiredHome 34:c99ec28fac66 417 /// was converted to Bitmap format; shrunk to 352 x 272 pixels and save
WiredHome 34:c99ec28fac66 418 /// in 8-bit color format. The resulting file size was 94.5 KByte.
WiredHome 34:c99ec28fac66 419 /// The SPI port interface was set to 20 MHz.
WiredHome 34:c99ec28fac66 420 /// The original bitmap rendering software was purely in software,
WiredHome 34:c99ec28fac66 421 /// pushing 1 pixel at a time to the write function, which did use SPI
WiredHome 34:c99ec28fac66 422 /// hardware (not pin wiggling) to transfer commands and data to the
WiredHome 34:c99ec28fac66 423 /// display. Then, the driver was improved to leverage the capability
WiredHome 34:c99ec28fac66 424 /// of the derived display driver. As a final check, instead of the
WiredHome 34:c99ec28fac66 425 /// [known slow] local file system, a randomly chosen USB stick was
WiredHome 34:c99ec28fac66 426 /// used. The performance results are impressive (but depend on the
WiredHome 34:c99ec28fac66 427 /// listed factors).
WiredHome 34:c99ec28fac66 428 ///
WiredHome 35:7dcab9e3ab25 429 /// \li 34 seconds, LocalFileSystem, Software Rendering
WiredHome 35:7dcab9e3ab25 430 /// \li 9 seconds, LocalFileSystem, Hardware Rending for RA8875
WiredHome 35:7dcab9e3ab25 431 /// \li 3 seconds, MSCFileSystem, Hardware Rendering for RA8875
WiredHome 34:c99ec28fac66 432 ///
WiredHome 76:c981284eb513 433 /// @param[in] x is the horizontal pixel coordinate
WiredHome 76:c981284eb513 434 /// @param[in] y is the vertical pixel coordinate
WiredHome 76:c981284eb513 435 /// @param[in] Name_BMP is the filename on the mounted file system.
WiredHome 31:c72e12cd5c67 436 /// @returns success or error code.
WiredHome 31:c72e12cd5c67 437 ///
WiredHome 37:f19b7e7449dc 438 RetCode_t RenderBitmapFile(loc_t x, loc_t y, const char *Name_BMP);
WiredHome 31:c72e12cd5c67 439
WiredHome 42:7cbdfd2bbfc5 440
WiredHome 42:7cbdfd2bbfc5 441 /// This method reads a disk file that is in ico format and
WiredHome 42:7cbdfd2bbfc5 442 /// puts it on the screen.
WiredHome 42:7cbdfd2bbfc5 443 ///
WiredHome 42:7cbdfd2bbfc5 444 /// Reading the disk is slow, but a typical icon file is small
WiredHome 42:7cbdfd2bbfc5 445 /// so it should be ok.
WiredHome 42:7cbdfd2bbfc5 446 ///
WiredHome 42:7cbdfd2bbfc5 447 /// @note An Icon file can have more than one icon in it. This
WiredHome 42:7cbdfd2bbfc5 448 /// implementation only processes the first image in the file.
WiredHome 42:7cbdfd2bbfc5 449 ///
WiredHome 76:c981284eb513 450 /// @param[in] x is the horizontal pixel coordinate
WiredHome 76:c981284eb513 451 /// @param[in] y is the vertical pixel coordinate
WiredHome 76:c981284eb513 452 /// @param[in] Name_ICO is the filename on the mounted file system.
WiredHome 42:7cbdfd2bbfc5 453 /// @returns success or error code.
WiredHome 42:7cbdfd2bbfc5 454 ///
WiredHome 42:7cbdfd2bbfc5 455 RetCode_t RenderIconFile(loc_t x, loc_t y, const char *Name_ICO);
WiredHome 42:7cbdfd2bbfc5 456
WiredHome 42:7cbdfd2bbfc5 457
WiredHome 29:422616aa04bd 458 /// prints one character at the specified coordinates.
WiredHome 29:422616aa04bd 459 ///
WiredHome 29:422616aa04bd 460 /// This will print the character at the specified pixel coordinates.
WiredHome 29:422616aa04bd 461 ///
WiredHome 76:c981284eb513 462 /// @param[in] x is the horizontal offset in pixels.
WiredHome 76:c981284eb513 463 /// @param[in] y is the vertical offset in pixels.
WiredHome 76:c981284eb513 464 /// @param[in] value is the character to print.
WiredHome 29:422616aa04bd 465 /// @returns number of pixels to index to the right if a character was printed, 0 otherwise.
WiredHome 29:422616aa04bd 466 ///
WiredHome 29:422616aa04bd 467 virtual int character(int x, int y, int value);
WiredHome 29:422616aa04bd 468
WiredHome 32:0e4f2ae512e2 469 /// get the number of colums based on the currently active font
WiredHome 32:0e4f2ae512e2 470 ///
WiredHome 32:0e4f2ae512e2 471 /// @returns number of columns.
WiredHome 32:0e4f2ae512e2 472 ///
WiredHome 32:0e4f2ae512e2 473 virtual int columns(void);
WiredHome 32:0e4f2ae512e2 474
WiredHome 32:0e4f2ae512e2 475 /// get the number of rows based on the currently active font
WiredHome 32:0e4f2ae512e2 476 ///
WiredHome 32:0e4f2ae512e2 477 /// @returns number of rows.
WiredHome 32:0e4f2ae512e2 478 ///
WiredHome 32:0e4f2ae512e2 479 virtual int rows(void);
WiredHome 32:0e4f2ae512e2 480
WiredHome 98:ecebed9b80b2 481 /// Select a User Font for all subsequent text.
WiredHome 98:ecebed9b80b2 482 ///
WiredHome 98:ecebed9b80b2 483 /// @note Tool to create the fonts is accessible from its creator
WiredHome 98:ecebed9b80b2 484 /// available at http://www.mikroe.com.
WiredHome 98:ecebed9b80b2 485 /// For version 1.2.0.0, choose the "Export for TFT and new GLCD"
WiredHome 98:ecebed9b80b2 486 /// format.
WiredHome 98:ecebed9b80b2 487 ///
WiredHome 98:ecebed9b80b2 488 /// @param[in] font is a pointer to a specially formed font resource.
WiredHome 98:ecebed9b80b2 489 /// @returns error code.
WiredHome 98:ecebed9b80b2 490 ///
WiredHome 98:ecebed9b80b2 491 virtual RetCode_t SelectUserFont(const uint8_t * font = NULL);
WiredHome 98:ecebed9b80b2 492
WiredHome 32:0e4f2ae512e2 493
WiredHome 32:0e4f2ae512e2 494 protected:
WiredHome 32:0e4f2ae512e2 495
WiredHome 32:0e4f2ae512e2 496 /// Pure virtual method indicating the start of a graphics stream.
WiredHome 32:0e4f2ae512e2 497 ///
WiredHome 32:0e4f2ae512e2 498 /// This is called prior to a stream of pixel data being sent.
WiredHome 32:0e4f2ae512e2 499 /// This may cause register configuration changes in the derived
WiredHome 32:0e4f2ae512e2 500 /// class in order to prepare the hardware to accept the streaming
WiredHome 32:0e4f2ae512e2 501 /// data.
WiredHome 32:0e4f2ae512e2 502 ///
WiredHome 32:0e4f2ae512e2 503 /// @note this method must be supported in the derived class.
WiredHome 32:0e4f2ae512e2 504 ///
WiredHome 32:0e4f2ae512e2 505 /// @returns error code.
WiredHome 32:0e4f2ae512e2 506 ///
WiredHome 32:0e4f2ae512e2 507 virtual RetCode_t _StartGraphicsStream(void) = 0;
dreschpe 0:de9d1462a835 508
WiredHome 32:0e4f2ae512e2 509 /// Pure virtual method indicating the end of a graphics stream.
WiredHome 32:0e4f2ae512e2 510 ///
WiredHome 32:0e4f2ae512e2 511 /// This is called to conclude a stream of pixel data that was sent.
WiredHome 32:0e4f2ae512e2 512 /// This may cause register configuration changes in the derived
WiredHome 32:0e4f2ae512e2 513 /// class in order to stop the hardware from accept the streaming
WiredHome 32:0e4f2ae512e2 514 /// data.
WiredHome 32:0e4f2ae512e2 515 ///
WiredHome 32:0e4f2ae512e2 516 /// @note this method must be supported in the derived class.
WiredHome 32:0e4f2ae512e2 517 ///
WiredHome 32:0e4f2ae512e2 518 /// @returns error code.
WiredHome 32:0e4f2ae512e2 519 ///
WiredHome 32:0e4f2ae512e2 520 virtual RetCode_t _EndGraphicsStream(void) = 0;
WiredHome 32:0e4f2ae512e2 521
WiredHome 42:7cbdfd2bbfc5 522 /// Protected method to render an image given a file handle and
WiredHome 42:7cbdfd2bbfc5 523 /// coordinates.
WiredHome 42:7cbdfd2bbfc5 524 ///
WiredHome 76:c981284eb513 525 /// @param[in] x is the horizontal pixel coordinate
WiredHome 76:c981284eb513 526 /// @param[in] y is the vertical pixel coordinate
WiredHome 76:c981284eb513 527 /// @param[in] fileOffset is the offset into the file where the image data starts
WiredHome 76:c981284eb513 528 /// @param[in] Image is the filename stream already opened for the data.
WiredHome 42:7cbdfd2bbfc5 529 /// @returns success or error code.
WiredHome 42:7cbdfd2bbfc5 530 ///
WiredHome 42:7cbdfd2bbfc5 531 RetCode_t _RenderBitmap(loc_t x, loc_t y, uint32_t fileOffset, FILE * Image);
WiredHome 42:7cbdfd2bbfc5 532
WiredHome 115:c9862fd0c689 533 private:
WiredHome 122:79e431f98fa9 534
WiredHome 136:224e03d5c31f 535 loc_t img_x; /// x position of a rendered jpg
WiredHome 136:224e03d5c31f 536 loc_t img_y; /// y position of a rendered jpg
WiredHome 136:224e03d5c31f 537
WiredHome 122:79e431f98fa9 538 /// Analyze the jpeg data in preparation for decompression.
WiredHome 122:79e431f98fa9 539 ///
WiredHome 115:c9862fd0c689 540 JRESULT jd_prepare(JDEC * jd, uint16_t(* infunc)(JDEC * jd, uint8_t * buffer, uint16_t bufsize), void * pool, uint16_t poolsize, void * filehandle);
WiredHome 115:c9862fd0c689 541
WiredHome 122:79e431f98fa9 542 /// Decompress the jpeg and render it.
WiredHome 122:79e431f98fa9 543 ///
WiredHome 115:c9862fd0c689 544 JRESULT jd_decomp(JDEC * jd, uint16_t(* outfunct)(JDEC * jd, void * stream, JRECT * rect), uint8_t scale);
WiredHome 115:c9862fd0c689 545
WiredHome 122:79e431f98fa9 546 /// helper function to read data from the file system
WiredHome 122:79e431f98fa9 547 ///
WiredHome 115:c9862fd0c689 548 uint16_t privInFunc(JDEC * jd, uint8_t * buff, uint16_t ndata);
WiredHome 115:c9862fd0c689 549
WiredHome 122:79e431f98fa9 550 /// helper function to read data from the file system
WiredHome 122:79e431f98fa9 551 ///
WiredHome 115:c9862fd0c689 552 uint16_t getJpegData(JDEC * jd, uint8_t *buff, uint16_t ndata);
WiredHome 115:c9862fd0c689 553
WiredHome 122:79e431f98fa9 554 /// helper function to write data to the display
WiredHome 122:79e431f98fa9 555 ///
WiredHome 115:c9862fd0c689 556 uint16_t privOutFunc(JDEC * jd, void * bitmap, JRECT * rect);
WiredHome 115:c9862fd0c689 557
WiredHome 115:c9862fd0c689 558 JRESULT mcu_output (
WiredHome 115:c9862fd0c689 559 JDEC * jd, /* Pointer to the decompressor object */
WiredHome 115:c9862fd0c689 560 uint16_t (* outfunc)(JDEC * jd, void * stream, JRECT * rect), /* RGB output function */
WiredHome 115:c9862fd0c689 561 uint16_t x, /* MCU position in the image (left of the MCU) */
WiredHome 115:c9862fd0c689 562 uint16_t y /* MCU position in the image (top of the MCU) */
WiredHome 115:c9862fd0c689 563 );
WiredHome 115:c9862fd0c689 564
WiredHome 115:c9862fd0c689 565 int16_t bitext ( /* >=0: extracted data, <0: error code */
WiredHome 115:c9862fd0c689 566 JDEC * jd, /* Pointer to the decompressor object */
WiredHome 115:c9862fd0c689 567 uint16_t nbit /* Number of bits to extract (1 to 11) */
WiredHome 115:c9862fd0c689 568 );
WiredHome 115:c9862fd0c689 569
WiredHome 115:c9862fd0c689 570 int16_t huffext ( /* >=0: decoded data, <0: error code */
WiredHome 115:c9862fd0c689 571 JDEC * jd, /* Pointer to the decompressor object */
WiredHome 115:c9862fd0c689 572 const uint8_t * hbits, /* Pointer to the bit distribution table */
WiredHome 115:c9862fd0c689 573 const uint16_t * hcode, /* Pointer to the code word table */
WiredHome 115:c9862fd0c689 574 const uint8_t * hdata /* Pointer to the data table */
WiredHome 115:c9862fd0c689 575 );
WiredHome 115:c9862fd0c689 576
WiredHome 115:c9862fd0c689 577 JRESULT restart (
WiredHome 115:c9862fd0c689 578 JDEC * jd, /* Pointer to the decompressor object */
WiredHome 115:c9862fd0c689 579 uint16_t rstn /* Expected restert sequense number */
WiredHome 115:c9862fd0c689 580 );
WiredHome 115:c9862fd0c689 581
WiredHome 115:c9862fd0c689 582 JRESULT mcu_load (
WiredHome 115:c9862fd0c689 583 JDEC * jd /* Pointer to the decompressor object */
WiredHome 115:c9862fd0c689 584 );
WiredHome 115:c9862fd0c689 585
WiredHome 122:79e431f98fa9 586
WiredHome 115:c9862fd0c689 587 protected:
WiredHome 109:7b94f06f085b 588 /// Pure virtual method to write a boolean stream to the display.
WiredHome 109:7b94f06f085b 589 ///
WiredHome 109:7b94f06f085b 590 /// This takes a bit stream in memory and using the current color settings
WiredHome 109:7b94f06f085b 591 /// it will stream it to the display. Along the way, each bit is translated
WiredHome 109:7b94f06f085b 592 /// to either the foreground or background color value and then that pixel
WiredHome 109:7b94f06f085b 593 /// is pushed onward.
WiredHome 109:7b94f06f085b 594 ///
WiredHome 109:7b94f06f085b 595 /// This is similar, but different, to the @ref pixelStream API, which is
WiredHome 109:7b94f06f085b 596 /// given a stream of color values.
WiredHome 109:7b94f06f085b 597 ///
WiredHome 109:7b94f06f085b 598 /// @param[in] x is the horizontal position on the display.
WiredHome 109:7b94f06f085b 599 /// @param[in] y is the vertical position on the display.
WiredHome 109:7b94f06f085b 600 /// @param[in] w is the width of the rectangular region to fill.
WiredHome 109:7b94f06f085b 601 /// @param[in] h is the height of the rectangular region to fill.
WiredHome 109:7b94f06f085b 602 /// @param[in] boolStream is the inline memory image from which to extract
WiredHome 109:7b94f06f085b 603 /// the bitstream.
WiredHome 109:7b94f06f085b 604 /// @returns success/failure code. See @ref RetCode_t.
WiredHome 109:7b94f06f085b 605 ///
WiredHome 109:7b94f06f085b 606 virtual RetCode_t booleanStream(loc_t x, loc_t y, dim_t w, dim_t h, const uint8_t * boolStream) = 0;
WiredHome 109:7b94f06f085b 607
WiredHome 109:7b94f06f085b 608
WiredHome 29:422616aa04bd 609 const unsigned char * font; ///< reference to an external font somewhere in memory
WiredHome 29:422616aa04bd 610
dreschpe 0:de9d1462a835 611 // pixel location
WiredHome 125:7a0b70f56550 612 short _x; ///< keeps track of current X location
WiredHome 125:7a0b70f56550 613 short _y; ///< keeps track of current Y location
dreschpe 0:de9d1462a835 614
WiredHome 111:efe436c43aba 615 rect_t windowrect; ///< window commands are held here for speed of access
dreschpe 0:de9d1462a835 616 };
dreschpe 0:de9d1462a835 617
dreschpe 0:de9d1462a835 618 #endif
WiredHome 33:b6b710758ab3 619