NXP
/
rt1050_emwin_gui_demo
RT1050 GUI demo using emWin library
emwin/emWin_header/GUI_SetOrientationCX.h@0:dd702039127a, 2018-09-20 (annotated)
- Committer:
- alejandroRL
- Date:
- Thu Sep 20 19:16:34 2018 +0000
- Revision:
- 0:dd702039127a
emWin GUI Demo for RT1050
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alejandroRL | 0:dd702039127a | 1 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 3 | * Solutions for real time microcontroller applications * |
alejandroRL | 0:dd702039127a | 4 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 5 | * * |
alejandroRL | 0:dd702039127a | 6 | * (c) 1996 - 2016 SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 7 | * * |
alejandroRL | 0:dd702039127a | 8 | * Internet: www.segger.com Support: support@segger.com * |
alejandroRL | 0:dd702039127a | 9 | * * |
alejandroRL | 0:dd702039127a | 10 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 11 | |
alejandroRL | 0:dd702039127a | 12 | ** emWin V5.38 - Graphical user interface for embedded applications ** |
alejandroRL | 0:dd702039127a | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
alejandroRL | 0:dd702039127a | 14 | emWin is protected by international copyright laws. Knowledge of the |
alejandroRL | 0:dd702039127a | 15 | source code may not be used to write a similar product. This file may |
alejandroRL | 0:dd702039127a | 16 | only be used in accordance with the following terms: |
alejandroRL | 0:dd702039127a | 17 | |
alejandroRL | 0:dd702039127a | 18 | The software has been licensed to NXP Semiconductors USA, Inc. whose |
alejandroRL | 0:dd702039127a | 19 | registered office is situated at 411 E. Plumeria Drive, San Jose, |
alejandroRL | 0:dd702039127a | 20 | CA 95134, USA solely for the purposes of creating libraries for |
alejandroRL | 0:dd702039127a | 21 | NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and |
alejandroRL | 0:dd702039127a | 22 | distributed under the terms and conditions of the NXP End User License |
alejandroRL | 0:dd702039127a | 23 | Agreement. |
alejandroRL | 0:dd702039127a | 24 | Full source code is available at: www.segger.com |
alejandroRL | 0:dd702039127a | 25 | |
alejandroRL | 0:dd702039127a | 26 | We appreciate your understanding and fairness. |
alejandroRL | 0:dd702039127a | 27 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 28 | Licensing information |
alejandroRL | 0:dd702039127a | 29 | |
alejandroRL | 0:dd702039127a | 30 | Licensor: SEGGER Microcontroller Systems LLC |
alejandroRL | 0:dd702039127a | 31 | Licensed to: NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA |
alejandroRL | 0:dd702039127a | 32 | Licensed SEGGER software: emWin |
alejandroRL | 0:dd702039127a | 33 | License number: GUI-00186 |
alejandroRL | 0:dd702039127a | 34 | License model: emWin License Agreement, dated August 20th 2011 |
alejandroRL | 0:dd702039127a | 35 | Licensed product: - |
alejandroRL | 0:dd702039127a | 36 | Licensed platform: NXP's ARM 7/9, Cortex-M0,M3,M4 |
alejandroRL | 0:dd702039127a | 37 | Licensed number of seats: - |
alejandroRL | 0:dd702039127a | 38 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 39 | File : GUI_SetOrientationC0.c |
alejandroRL | 0:dd702039127a | 40 | Purpose : Runtime display orientation without cache |
alejandroRL | 0:dd702039127a | 41 | ---------------------------END-OF-HEADER------------------------------ |
alejandroRL | 0:dd702039127a | 42 | */ |
alejandroRL | 0:dd702039127a | 43 | |
alejandroRL | 0:dd702039127a | 44 | #include "GUI_SetOrientation.h" |
alejandroRL | 0:dd702039127a | 45 | |
alejandroRL | 0:dd702039127a | 46 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 47 | * |
alejandroRL | 0:dd702039127a | 48 | * Defines |
alejandroRL | 0:dd702039127a | 49 | * |
alejandroRL | 0:dd702039127a | 50 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 51 | */ |
alejandroRL | 0:dd702039127a | 52 | #define XY2PTR(x, y) (PIXEL *)(pContext->pData + y * pContext->BytesPerLine + x * pContext->pDrawingAPI->BytesPerPixel) |
alejandroRL | 0:dd702039127a | 53 | |
alejandroRL | 0:dd702039127a | 54 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 55 | * |
alejandroRL | 0:dd702039127a | 56 | * Static code |
alejandroRL | 0:dd702039127a | 57 | * |
alejandroRL | 0:dd702039127a | 58 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 59 | */ |
alejandroRL | 0:dd702039127a | 60 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 61 | * |
alejandroRL | 0:dd702039127a | 62 | * Static code |
alejandroRL | 0:dd702039127a | 63 | * |
alejandroRL | 0:dd702039127a | 64 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 65 | */ |
alejandroRL | 0:dd702039127a | 66 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 67 | * |
alejandroRL | 0:dd702039127a | 68 | * _Sort |
alejandroRL | 0:dd702039127a | 69 | * |
alejandroRL | 0:dd702039127a | 70 | * Purpose: |
alejandroRL | 0:dd702039127a | 71 | * Sorts the values pointed by the given pointers. Please note that |
alejandroRL | 0:dd702039127a | 72 | * the same static function is also in GUI_SetOrientationC0.h |
alejandroRL | 0:dd702039127a | 73 | * to enable better compiler optimization. |
alejandroRL | 0:dd702039127a | 74 | */ |
alejandroRL | 0:dd702039127a | 75 | static void _Sort(int * p0, int * p1) { |
alejandroRL | 0:dd702039127a | 76 | int temp; |
alejandroRL | 0:dd702039127a | 77 | |
alejandroRL | 0:dd702039127a | 78 | if (*p0 > *p1) { |
alejandroRL | 0:dd702039127a | 79 | temp = *p0; |
alejandroRL | 0:dd702039127a | 80 | *p0 = *p1; |
alejandroRL | 0:dd702039127a | 81 | *p1 = temp; |
alejandroRL | 0:dd702039127a | 82 | } |
alejandroRL | 0:dd702039127a | 83 | } |
alejandroRL | 0:dd702039127a | 84 | |
alejandroRL | 0:dd702039127a | 85 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 86 | * |
alejandroRL | 0:dd702039127a | 87 | * Static code: Bitmap drawing routines |
alejandroRL | 0:dd702039127a | 88 | * |
alejandroRL | 0:dd702039127a | 89 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 90 | */ |
alejandroRL | 0:dd702039127a | 91 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 92 | * |
alejandroRL | 0:dd702039127a | 93 | * Draw Bitmap 1 BPP |
alejandroRL | 0:dd702039127a | 94 | */ |
alejandroRL | 0:dd702039127a | 95 | static void _DrawBitLine1BPP(GUI_DEVICE * pDevice, unsigned x, unsigned y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) { |
alejandroRL | 0:dd702039127a | 96 | LCD_PIXELINDEX IndexMask, Index0, Index1, Pixel; |
alejandroRL | 0:dd702039127a | 97 | LCD_PIXELINDEX (* pfGetPixelIndex)(GUI_DEVICE *, int, int); |
alejandroRL | 0:dd702039127a | 98 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 99 | int x_phys, y_phys; |
alejandroRL | 0:dd702039127a | 100 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 101 | |
alejandroRL | 0:dd702039127a | 102 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 103 | Index0 = *(pTrans + 0); |
alejandroRL | 0:dd702039127a | 104 | Index1 = *(pTrans + 1); |
alejandroRL | 0:dd702039127a | 105 | x += Diff; |
alejandroRL | 0:dd702039127a | 106 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 107 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 108 | switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { |
alejandroRL | 0:dd702039127a | 109 | case 0: |
alejandroRL | 0:dd702039127a | 110 | do { |
alejandroRL | 0:dd702039127a | 111 | *pData = (PIXEL)((*p & (0x80 >> Diff)) ? Index1 : Index0); |
alejandroRL | 0:dd702039127a | 112 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 113 | if (++Diff == 8) { |
alejandroRL | 0:dd702039127a | 114 | Diff = 0; |
alejandroRL | 0:dd702039127a | 115 | p++; |
alejandroRL | 0:dd702039127a | 116 | } |
alejandroRL | 0:dd702039127a | 117 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 118 | break; |
alejandroRL | 0:dd702039127a | 119 | case LCD_DRAWMODE_TRANS: |
alejandroRL | 0:dd702039127a | 120 | do { |
alejandroRL | 0:dd702039127a | 121 | if (*p & (0x80 >> Diff)) { |
alejandroRL | 0:dd702039127a | 122 | *pData = (PIXEL)Index1; |
alejandroRL | 0:dd702039127a | 123 | } |
alejandroRL | 0:dd702039127a | 124 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 125 | if (++Diff == 8) { |
alejandroRL | 0:dd702039127a | 126 | Diff = 0; |
alejandroRL | 0:dd702039127a | 127 | p++; |
alejandroRL | 0:dd702039127a | 128 | } |
alejandroRL | 0:dd702039127a | 129 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 130 | break; |
alejandroRL | 0:dd702039127a | 131 | case LCD_DRAWMODE_XOR | LCD_DRAWMODE_TRANS: |
alejandroRL | 0:dd702039127a | 132 | case LCD_DRAWMODE_XOR: |
alejandroRL | 0:dd702039127a | 133 | pfGetPixelIndex = pDevice->pDeviceAPI->pfGetPixelIndex; |
alejandroRL | 0:dd702039127a | 134 | IndexMask = pDevice->pColorConvAPI->pfGetIndexMask(); |
alejandroRL | 0:dd702039127a | 135 | do { |
alejandroRL | 0:dd702039127a | 136 | if (*p & (0x80 >> Diff)) { |
alejandroRL | 0:dd702039127a | 137 | Pixel = pfGetPixelIndex(pDevice, x, y); |
alejandroRL | 0:dd702039127a | 138 | Pixel ^= IndexMask; |
alejandroRL | 0:dd702039127a | 139 | *pData = (PIXEL)Pixel; |
alejandroRL | 0:dd702039127a | 140 | } |
alejandroRL | 0:dd702039127a | 141 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 142 | x++; |
alejandroRL | 0:dd702039127a | 143 | if (++Diff == 8) { |
alejandroRL | 0:dd702039127a | 144 | Diff = 0; |
alejandroRL | 0:dd702039127a | 145 | p++; |
alejandroRL | 0:dd702039127a | 146 | } |
alejandroRL | 0:dd702039127a | 147 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 148 | break; |
alejandroRL | 0:dd702039127a | 149 | } |
alejandroRL | 0:dd702039127a | 150 | } |
alejandroRL | 0:dd702039127a | 151 | |
alejandroRL | 0:dd702039127a | 152 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 153 | * |
alejandroRL | 0:dd702039127a | 154 | * Draw Bitmap 2 BPP |
alejandroRL | 0:dd702039127a | 155 | */ |
alejandroRL | 0:dd702039127a | 156 | static void _DrawBitLine2BPP(GUI_DEVICE * pDevice, int x, int y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) { |
alejandroRL | 0:dd702039127a | 157 | LCD_PIXELINDEX Pixels, PixelIndex; |
alejandroRL | 0:dd702039127a | 158 | int CurrentPixel, Shift, Index; |
alejandroRL | 0:dd702039127a | 159 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 160 | int x_phys, y_phys; |
alejandroRL | 0:dd702039127a | 161 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 162 | |
alejandroRL | 0:dd702039127a | 163 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 164 | Pixels = *p; |
alejandroRL | 0:dd702039127a | 165 | CurrentPixel = Diff; |
alejandroRL | 0:dd702039127a | 166 | x += Diff; |
alejandroRL | 0:dd702039127a | 167 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 168 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 169 | switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { |
alejandroRL | 0:dd702039127a | 170 | case 0: |
alejandroRL | 0:dd702039127a | 171 | if (pTrans) { |
alejandroRL | 0:dd702039127a | 172 | do { |
alejandroRL | 0:dd702039127a | 173 | Shift = (3 - CurrentPixel) << 1; |
alejandroRL | 0:dd702039127a | 174 | Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 175 | PixelIndex = *(pTrans + Index); |
alejandroRL | 0:dd702039127a | 176 | *pData = (PIXEL)PixelIndex; |
alejandroRL | 0:dd702039127a | 177 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 178 | if (++CurrentPixel == 4) { |
alejandroRL | 0:dd702039127a | 179 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 180 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 181 | } |
alejandroRL | 0:dd702039127a | 182 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 183 | } else { |
alejandroRL | 0:dd702039127a | 184 | do { |
alejandroRL | 0:dd702039127a | 185 | Shift = (3 - CurrentPixel) << 1; |
alejandroRL | 0:dd702039127a | 186 | Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 187 | *pData = (PIXEL)Index; |
alejandroRL | 0:dd702039127a | 188 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 189 | if (++CurrentPixel == 4) { |
alejandroRL | 0:dd702039127a | 190 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 191 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 192 | } |
alejandroRL | 0:dd702039127a | 193 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 194 | } |
alejandroRL | 0:dd702039127a | 195 | break; |
alejandroRL | 0:dd702039127a | 196 | case LCD_DRAWMODE_TRANS: |
alejandroRL | 0:dd702039127a | 197 | if (pTrans) { |
alejandroRL | 0:dd702039127a | 198 | do { |
alejandroRL | 0:dd702039127a | 199 | Shift = (3 - CurrentPixel) << 1; |
alejandroRL | 0:dd702039127a | 200 | Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 201 | if (Index) { |
alejandroRL | 0:dd702039127a | 202 | PixelIndex = *(pTrans + Index); |
alejandroRL | 0:dd702039127a | 203 | *pData = (PIXEL)PixelIndex; |
alejandroRL | 0:dd702039127a | 204 | } |
alejandroRL | 0:dd702039127a | 205 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 206 | if (++CurrentPixel == 4) { |
alejandroRL | 0:dd702039127a | 207 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 208 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 209 | } |
alejandroRL | 0:dd702039127a | 210 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 211 | } else { |
alejandroRL | 0:dd702039127a | 212 | do { |
alejandroRL | 0:dd702039127a | 213 | Shift = (3 - CurrentPixel) << 1; |
alejandroRL | 0:dd702039127a | 214 | Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 215 | if (Index) { |
alejandroRL | 0:dd702039127a | 216 | *pData = (PIXEL)Index; |
alejandroRL | 0:dd702039127a | 217 | } |
alejandroRL | 0:dd702039127a | 218 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 219 | if (++CurrentPixel == 4) { |
alejandroRL | 0:dd702039127a | 220 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 221 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 222 | } |
alejandroRL | 0:dd702039127a | 223 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 224 | } |
alejandroRL | 0:dd702039127a | 225 | break; |
alejandroRL | 0:dd702039127a | 226 | } |
alejandroRL | 0:dd702039127a | 227 | } |
alejandroRL | 0:dd702039127a | 228 | |
alejandroRL | 0:dd702039127a | 229 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 230 | * |
alejandroRL | 0:dd702039127a | 231 | * Draw Bitmap 4 BPP |
alejandroRL | 0:dd702039127a | 232 | */ |
alejandroRL | 0:dd702039127a | 233 | static void _DrawBitLine4BPP(GUI_DEVICE * pDevice, int x, int y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) { |
alejandroRL | 0:dd702039127a | 234 | LCD_PIXELINDEX Pixels, PixelIndex; |
alejandroRL | 0:dd702039127a | 235 | int CurrentPixel, Shift, Index; |
alejandroRL | 0:dd702039127a | 236 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 237 | int x_phys, y_phys; |
alejandroRL | 0:dd702039127a | 238 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 239 | |
alejandroRL | 0:dd702039127a | 240 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 241 | Pixels = *p; |
alejandroRL | 0:dd702039127a | 242 | CurrentPixel = Diff; |
alejandroRL | 0:dd702039127a | 243 | x += Diff; |
alejandroRL | 0:dd702039127a | 244 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 245 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 246 | switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { |
alejandroRL | 0:dd702039127a | 247 | case 0: |
alejandroRL | 0:dd702039127a | 248 | if (pTrans) { |
alejandroRL | 0:dd702039127a | 249 | do { |
alejandroRL | 0:dd702039127a | 250 | Shift = (1 - CurrentPixel) << 2; |
alejandroRL | 0:dd702039127a | 251 | Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 252 | PixelIndex = *(pTrans + Index); |
alejandroRL | 0:dd702039127a | 253 | *pData = (PIXEL)PixelIndex; |
alejandroRL | 0:dd702039127a | 254 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 255 | if (++CurrentPixel == 2) { |
alejandroRL | 0:dd702039127a | 256 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 257 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 258 | } |
alejandroRL | 0:dd702039127a | 259 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 260 | } else { |
alejandroRL | 0:dd702039127a | 261 | do { |
alejandroRL | 0:dd702039127a | 262 | Shift = (1 - CurrentPixel) << 2; |
alejandroRL | 0:dd702039127a | 263 | Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 264 | *pData = (PIXEL)Index; |
alejandroRL | 0:dd702039127a | 265 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 266 | if (++CurrentPixel == 2) { |
alejandroRL | 0:dd702039127a | 267 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 268 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 269 | } |
alejandroRL | 0:dd702039127a | 270 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 271 | } |
alejandroRL | 0:dd702039127a | 272 | break; |
alejandroRL | 0:dd702039127a | 273 | case LCD_DRAWMODE_TRANS: |
alejandroRL | 0:dd702039127a | 274 | if (pTrans) { |
alejandroRL | 0:dd702039127a | 275 | do { |
alejandroRL | 0:dd702039127a | 276 | Shift = (1 - CurrentPixel) << 2; |
alejandroRL | 0:dd702039127a | 277 | Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 278 | if (Index) { |
alejandroRL | 0:dd702039127a | 279 | PixelIndex = *(pTrans + Index); |
alejandroRL | 0:dd702039127a | 280 | *pData = (PIXEL)PixelIndex; |
alejandroRL | 0:dd702039127a | 281 | } |
alejandroRL | 0:dd702039127a | 282 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 283 | if (++CurrentPixel == 2) { |
alejandroRL | 0:dd702039127a | 284 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 285 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 286 | } |
alejandroRL | 0:dd702039127a | 287 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 288 | } else { |
alejandroRL | 0:dd702039127a | 289 | do { |
alejandroRL | 0:dd702039127a | 290 | Shift = (1 - CurrentPixel) << 2; |
alejandroRL | 0:dd702039127a | 291 | Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; |
alejandroRL | 0:dd702039127a | 292 | if (Index) { |
alejandroRL | 0:dd702039127a | 293 | *pData = (PIXEL)Index; |
alejandroRL | 0:dd702039127a | 294 | } |
alejandroRL | 0:dd702039127a | 295 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 296 | if (++CurrentPixel == 2) { |
alejandroRL | 0:dd702039127a | 297 | CurrentPixel = 0; |
alejandroRL | 0:dd702039127a | 298 | Pixels = *(++p); |
alejandroRL | 0:dd702039127a | 299 | } |
alejandroRL | 0:dd702039127a | 300 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 301 | } |
alejandroRL | 0:dd702039127a | 302 | break; |
alejandroRL | 0:dd702039127a | 303 | } |
alejandroRL | 0:dd702039127a | 304 | } |
alejandroRL | 0:dd702039127a | 305 | |
alejandroRL | 0:dd702039127a | 306 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 307 | * |
alejandroRL | 0:dd702039127a | 308 | * Draw Bitmap 8 BPP |
alejandroRL | 0:dd702039127a | 309 | */ |
alejandroRL | 0:dd702039127a | 310 | static void _DrawBitLine8BPP(GUI_DEVICE * pDevice, int x, int y, U8 const * p, int xsize, const LCD_PIXELINDEX * pTrans) { |
alejandroRL | 0:dd702039127a | 311 | LCD_PIXELINDEX Pixel; |
alejandroRL | 0:dd702039127a | 312 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 313 | int x_phys, y_phys; |
alejandroRL | 0:dd702039127a | 314 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 315 | |
alejandroRL | 0:dd702039127a | 316 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 317 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 318 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 319 | switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { |
alejandroRL | 0:dd702039127a | 320 | case 0: |
alejandroRL | 0:dd702039127a | 321 | if (pTrans) { |
alejandroRL | 0:dd702039127a | 322 | do { |
alejandroRL | 0:dd702039127a | 323 | Pixel = *p++; |
alejandroRL | 0:dd702039127a | 324 | *pData = (PIXEL)*(pTrans + Pixel); |
alejandroRL | 0:dd702039127a | 325 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 326 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 327 | } else { |
alejandroRL | 0:dd702039127a | 328 | do { |
alejandroRL | 0:dd702039127a | 329 | *pData = (PIXEL)*p++; |
alejandroRL | 0:dd702039127a | 330 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 331 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 332 | } |
alejandroRL | 0:dd702039127a | 333 | break; |
alejandroRL | 0:dd702039127a | 334 | case LCD_DRAWMODE_TRANS: |
alejandroRL | 0:dd702039127a | 335 | if (pTrans) { |
alejandroRL | 0:dd702039127a | 336 | do { |
alejandroRL | 0:dd702039127a | 337 | Pixel = *p++; |
alejandroRL | 0:dd702039127a | 338 | if (Pixel) { |
alejandroRL | 0:dd702039127a | 339 | *pData = (PIXEL)*(pTrans + Pixel); |
alejandroRL | 0:dd702039127a | 340 | } |
alejandroRL | 0:dd702039127a | 341 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 342 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 343 | } else { |
alejandroRL | 0:dd702039127a | 344 | do { |
alejandroRL | 0:dd702039127a | 345 | Pixel = *p++; |
alejandroRL | 0:dd702039127a | 346 | if (Pixel) { |
alejandroRL | 0:dd702039127a | 347 | *pData = (PIXEL)Pixel; |
alejandroRL | 0:dd702039127a | 348 | } |
alejandroRL | 0:dd702039127a | 349 | pData += pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 350 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 351 | } |
alejandroRL | 0:dd702039127a | 352 | break; |
alejandroRL | 0:dd702039127a | 353 | } |
alejandroRL | 0:dd702039127a | 354 | } |
alejandroRL | 0:dd702039127a | 355 | |
alejandroRL | 0:dd702039127a | 356 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 357 | * |
alejandroRL | 0:dd702039127a | 358 | * Draw Bitmap 16 BPP |
alejandroRL | 0:dd702039127a | 359 | */ |
alejandroRL | 0:dd702039127a | 360 | static void _DrawBitLine16BPP(GUI_DEVICE * pDevice, int x, int y, U16 const * p, int xsize) { |
alejandroRL | 0:dd702039127a | 361 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 362 | int x_phys, y_phys, PixelOffset; |
alejandroRL | 0:dd702039127a | 363 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 364 | |
alejandroRL | 0:dd702039127a | 365 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 366 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 367 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 368 | PixelOffset = pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 369 | do { |
alejandroRL | 0:dd702039127a | 370 | *pData = (PIXEL)*p++; |
alejandroRL | 0:dd702039127a | 371 | pData += PixelOffset; |
alejandroRL | 0:dd702039127a | 372 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 373 | } |
alejandroRL | 0:dd702039127a | 374 | |
alejandroRL | 0:dd702039127a | 375 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 376 | * |
alejandroRL | 0:dd702039127a | 377 | * Draw Bitmap 32 BPP |
alejandroRL | 0:dd702039127a | 378 | */ |
alejandroRL | 0:dd702039127a | 379 | static void _DrawBitLine32BPP(GUI_DEVICE * pDevice, int x, int y, U32 const * p, int xsize) { |
alejandroRL | 0:dd702039127a | 380 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 381 | int x_phys, y_phys, PixelOffset; |
alejandroRL | 0:dd702039127a | 382 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 383 | |
alejandroRL | 0:dd702039127a | 384 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 385 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 386 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 387 | PixelOffset = pContext->PixelOffset; |
alejandroRL | 0:dd702039127a | 388 | do { |
alejandroRL | 0:dd702039127a | 389 | *pData = (PIXEL)*p++; |
alejandroRL | 0:dd702039127a | 390 | pData += PixelOffset; |
alejandroRL | 0:dd702039127a | 391 | } while (--xsize); |
alejandroRL | 0:dd702039127a | 392 | } |
alejandroRL | 0:dd702039127a | 393 | |
alejandroRL | 0:dd702039127a | 394 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 395 | * |
alejandroRL | 0:dd702039127a | 396 | * Static code: API functions for drawing operations, no cache |
alejandroRL | 0:dd702039127a | 397 | * |
alejandroRL | 0:dd702039127a | 398 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 399 | */ |
alejandroRL | 0:dd702039127a | 400 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 401 | * |
alejandroRL | 0:dd702039127a | 402 | * _DrawBitmap_CX |
alejandroRL | 0:dd702039127a | 403 | */ |
alejandroRL | 0:dd702039127a | 404 | static void _DrawBitmap_CX(GUI_DEVICE * pDevice, int x0, int y0, |
alejandroRL | 0:dd702039127a | 405 | int xSize, int ySize, |
alejandroRL | 0:dd702039127a | 406 | int BitsPerPixel, |
alejandroRL | 0:dd702039127a | 407 | int BytesPerLine, |
alejandroRL | 0:dd702039127a | 408 | const U8 * pData, int Diff, |
alejandroRL | 0:dd702039127a | 409 | const LCD_PIXELINDEX * pTrans) { |
alejandroRL | 0:dd702039127a | 410 | int x0_phys, y0_phys, x1_phys, y1_phys; |
alejandroRL | 0:dd702039127a | 411 | int i; |
alejandroRL | 0:dd702039127a | 412 | PIXEL * pDataBM; |
alejandroRL | 0:dd702039127a | 413 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 414 | |
alejandroRL | 0:dd702039127a | 415 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 416 | switch (BitsPerPixel) { |
alejandroRL | 0:dd702039127a | 417 | case 1: |
alejandroRL | 0:dd702039127a | 418 | for (i = 0; i < ySize; i++) { |
alejandroRL | 0:dd702039127a | 419 | _DrawBitLine1BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans); |
alejandroRL | 0:dd702039127a | 420 | pData += BytesPerLine; |
alejandroRL | 0:dd702039127a | 421 | } |
alejandroRL | 0:dd702039127a | 422 | break; |
alejandroRL | 0:dd702039127a | 423 | case 2: |
alejandroRL | 0:dd702039127a | 424 | for (i = 0; i < ySize; i++) { |
alejandroRL | 0:dd702039127a | 425 | _DrawBitLine2BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans); |
alejandroRL | 0:dd702039127a | 426 | pData += BytesPerLine; |
alejandroRL | 0:dd702039127a | 427 | } |
alejandroRL | 0:dd702039127a | 428 | break; |
alejandroRL | 0:dd702039127a | 429 | case 4: |
alejandroRL | 0:dd702039127a | 430 | for (i = 0; i < ySize; i++) { |
alejandroRL | 0:dd702039127a | 431 | _DrawBitLine4BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans); |
alejandroRL | 0:dd702039127a | 432 | pData += BytesPerLine; |
alejandroRL | 0:dd702039127a | 433 | } |
alejandroRL | 0:dd702039127a | 434 | break; |
alejandroRL | 0:dd702039127a | 435 | case 8: |
alejandroRL | 0:dd702039127a | 436 | for (i = 0; i < ySize; i++) { |
alejandroRL | 0:dd702039127a | 437 | _DrawBitLine8BPP(pDevice, x0, i + y0, pData, xSize, pTrans); |
alejandroRL | 0:dd702039127a | 438 | pData += BytesPerLine; |
alejandroRL | 0:dd702039127a | 439 | } |
alejandroRL | 0:dd702039127a | 440 | break; |
alejandroRL | 0:dd702039127a | 441 | case 16: |
alejandroRL | 0:dd702039127a | 442 | for (i = 0; i < ySize; i++) { |
alejandroRL | 0:dd702039127a | 443 | _DrawBitLine16BPP(pDevice, x0, i + y0, (U16 *)pData, xSize); |
alejandroRL | 0:dd702039127a | 444 | pData += BytesPerLine; |
alejandroRL | 0:dd702039127a | 445 | } |
alejandroRL | 0:dd702039127a | 446 | break; |
alejandroRL | 0:dd702039127a | 447 | case 32: |
alejandroRL | 0:dd702039127a | 448 | for (i = 0; i < ySize; i++) { |
alejandroRL | 0:dd702039127a | 449 | _DrawBitLine32BPP(pDevice, x0, i + y0, (U32 *)pData, xSize); |
alejandroRL | 0:dd702039127a | 450 | pData += BytesPerLine; |
alejandroRL | 0:dd702039127a | 451 | } |
alejandroRL | 0:dd702039127a | 452 | break; |
alejandroRL | 0:dd702039127a | 453 | } |
alejandroRL | 0:dd702039127a | 454 | |
alejandroRL | 0:dd702039127a | 455 | pContext->pfLog2Phys(pContext, x0 + Diff, y0, &x0_phys, &y0_phys); |
alejandroRL | 0:dd702039127a | 456 | pContext->pfLog2Phys(pContext, x0 + Diff + xSize - 1, y0 + ySize - 1, &x1_phys, &y1_phys); |
alejandroRL | 0:dd702039127a | 457 | _Sort(&x0_phys, &x1_phys); |
alejandroRL | 0:dd702039127a | 458 | _Sort(&y0_phys, &y1_phys); |
alejandroRL | 0:dd702039127a | 459 | pDataBM = XY2PTR(x0_phys, y0_phys); |
alejandroRL | 0:dd702039127a | 460 | pDevice = pDevice->pNext; |
alejandroRL | 0:dd702039127a | 461 | pDevice->pDeviceAPI->pfDrawBitmap(pDevice, |
alejandroRL | 0:dd702039127a | 462 | x0_phys, y0_phys, |
alejandroRL | 0:dd702039127a | 463 | x1_phys - x0_phys + 1, |
alejandroRL | 0:dd702039127a | 464 | y1_phys - y0_phys + 1, |
alejandroRL | 0:dd702039127a | 465 | pContext->pDrawingAPI->BytesPerPixel << 3, |
alejandroRL | 0:dd702039127a | 466 | pContext->pDrawingAPI->BytesPerPixel * pContext->vxSize, |
alejandroRL | 0:dd702039127a | 467 | (U8 *)pDataBM, 0, NULL); |
alejandroRL | 0:dd702039127a | 468 | } |
alejandroRL | 0:dd702039127a | 469 | |
alejandroRL | 0:dd702039127a | 470 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 471 | * |
alejandroRL | 0:dd702039127a | 472 | * _GetPixelIndex_CX |
alejandroRL | 0:dd702039127a | 473 | */ |
alejandroRL | 0:dd702039127a | 474 | static LCD_PIXELINDEX _GetPixelIndex_CX(GUI_DEVICE * pDevice, int x, int y) { |
alejandroRL | 0:dd702039127a | 475 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 476 | PIXEL Pixel; |
alejandroRL | 0:dd702039127a | 477 | int x_phys, y_phys; |
alejandroRL | 0:dd702039127a | 478 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 479 | |
alejandroRL | 0:dd702039127a | 480 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 481 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 482 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 483 | Pixel = *pData; |
alejandroRL | 0:dd702039127a | 484 | return Pixel; |
alejandroRL | 0:dd702039127a | 485 | } |
alejandroRL | 0:dd702039127a | 486 | |
alejandroRL | 0:dd702039127a | 487 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 488 | * |
alejandroRL | 0:dd702039127a | 489 | * _SetPixelIndex_CX |
alejandroRL | 0:dd702039127a | 490 | */ |
alejandroRL | 0:dd702039127a | 491 | static void _SetPixelIndex_CX(GUI_DEVICE * pDevice, int x, int y, LCD_PIXELINDEX PixelIndex) { |
alejandroRL | 0:dd702039127a | 492 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 493 | int x_phys, y_phys; |
alejandroRL | 0:dd702039127a | 494 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 495 | |
alejandroRL | 0:dd702039127a | 496 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 497 | pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); |
alejandroRL | 0:dd702039127a | 498 | pData = XY2PTR(x_phys, y_phys); |
alejandroRL | 0:dd702039127a | 499 | *pData = (PIXEL)PixelIndex; |
alejandroRL | 0:dd702039127a | 500 | pDevice = pDevice->pNext; |
alejandroRL | 0:dd702039127a | 501 | pDevice->pDeviceAPI->pfSetPixelIndex(pDevice, x_phys, y_phys, PixelIndex); |
alejandroRL | 0:dd702039127a | 502 | } |
alejandroRL | 0:dd702039127a | 503 | |
alejandroRL | 0:dd702039127a | 504 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 505 | * |
alejandroRL | 0:dd702039127a | 506 | * _XorPixel_CX |
alejandroRL | 0:dd702039127a | 507 | */ |
alejandroRL | 0:dd702039127a | 508 | static void _XorPixel_CX(GUI_DEVICE * pDevice, int x, int y) { |
alejandroRL | 0:dd702039127a | 509 | PIXEL Pixel, IndexMask; |
alejandroRL | 0:dd702039127a | 510 | |
alejandroRL | 0:dd702039127a | 511 | IndexMask = (PIXEL)pDevice->pColorConvAPI->pfGetIndexMask(); |
alejandroRL | 0:dd702039127a | 512 | Pixel = (PIXEL)pDevice->pDeviceAPI->pfGetPixelIndex(pDevice, x, y); |
alejandroRL | 0:dd702039127a | 513 | Pixel ^= IndexMask; |
alejandroRL | 0:dd702039127a | 514 | pDevice->pDeviceAPI->pfSetPixelIndex(pDevice, x, y, Pixel); |
alejandroRL | 0:dd702039127a | 515 | } |
alejandroRL | 0:dd702039127a | 516 | |
alejandroRL | 0:dd702039127a | 517 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 518 | * |
alejandroRL | 0:dd702039127a | 519 | * _DrawHLine_CX |
alejandroRL | 0:dd702039127a | 520 | */ |
alejandroRL | 0:dd702039127a | 521 | static void _DrawHLine_CX(GUI_DEVICE * pDevice, int x0, int y, int x1) { |
alejandroRL | 0:dd702039127a | 522 | pDevice->pDeviceAPI->pfFillRect(pDevice, x0, y, x1, y); |
alejandroRL | 0:dd702039127a | 523 | } |
alejandroRL | 0:dd702039127a | 524 | |
alejandroRL | 0:dd702039127a | 525 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 526 | * |
alejandroRL | 0:dd702039127a | 527 | * _DrawVLine_CX |
alejandroRL | 0:dd702039127a | 528 | */ |
alejandroRL | 0:dd702039127a | 529 | static void _DrawVLine_CX(GUI_DEVICE * pDevice, int x, int y0, int y1) { |
alejandroRL | 0:dd702039127a | 530 | pDevice->pDeviceAPI->pfFillRect(pDevice, x, y0, x, y1); |
alejandroRL | 0:dd702039127a | 531 | } |
alejandroRL | 0:dd702039127a | 532 | |
alejandroRL | 0:dd702039127a | 533 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 534 | * |
alejandroRL | 0:dd702039127a | 535 | * _FillRect_CX |
alejandroRL | 0:dd702039127a | 536 | */ |
alejandroRL | 0:dd702039127a | 537 | static void _FillRect_CX(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) { |
alejandroRL | 0:dd702039127a | 538 | PIXEL * pData; |
alejandroRL | 0:dd702039127a | 539 | PIXEL * pLine; |
alejandroRL | 0:dd702039127a | 540 | PIXEL * pPixel; |
alejandroRL | 0:dd702039127a | 541 | PIXEL Pixel, IndexMask; |
alejandroRL | 0:dd702039127a | 542 | int x0_phys, y0_phys, x1_phys, y1_phys; |
alejandroRL | 0:dd702039127a | 543 | int NumPixels, NumLines; |
alejandroRL | 0:dd702039127a | 544 | DRIVER_CONTEXT * pContext; |
alejandroRL | 0:dd702039127a | 545 | |
alejandroRL | 0:dd702039127a | 546 | pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; |
alejandroRL | 0:dd702039127a | 547 | pContext->pfLog2Phys(pContext, x0, y0, &x0_phys, &y0_phys); |
alejandroRL | 0:dd702039127a | 548 | pContext->pfLog2Phys(pContext, x1, y1, &x1_phys, &y1_phys); |
alejandroRL | 0:dd702039127a | 549 | _Sort(&x0_phys, &x1_phys); |
alejandroRL | 0:dd702039127a | 550 | _Sort(&y0_phys, &y1_phys); |
alejandroRL | 0:dd702039127a | 551 | pData = pLine = XY2PTR(x0_phys, y0_phys); |
alejandroRL | 0:dd702039127a | 552 | NumLines = y1_phys - y0_phys + 1; |
alejandroRL | 0:dd702039127a | 553 | if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) { |
alejandroRL | 0:dd702039127a | 554 | IndexMask = (PIXEL)pDevice->pColorConvAPI->pfGetIndexMask(); |
alejandroRL | 0:dd702039127a | 555 | do { |
alejandroRL | 0:dd702039127a | 556 | pPixel = pLine; |
alejandroRL | 0:dd702039127a | 557 | NumPixels = x1_phys - x0_phys + 1; |
alejandroRL | 0:dd702039127a | 558 | do { |
alejandroRL | 0:dd702039127a | 559 | *pPixel++ ^= IndexMask; |
alejandroRL | 0:dd702039127a | 560 | } while (--NumPixels); |
alejandroRL | 0:dd702039127a | 561 | pLine += pContext->vxSize; |
alejandroRL | 0:dd702039127a | 562 | } while (--NumLines); |
alejandroRL | 0:dd702039127a | 563 | } else { |
alejandroRL | 0:dd702039127a | 564 | Pixel = (PIXEL)LCD__GetColorIndex(); |
alejandroRL | 0:dd702039127a | 565 | if (sizeof(Pixel) == 1) { |
alejandroRL | 0:dd702039127a | 566 | NumPixels = x1_phys - x0_phys + 1; |
alejandroRL | 0:dd702039127a | 567 | do { |
alejandroRL | 0:dd702039127a | 568 | GUI_MEMSET((U8 *)pLine, (U8)Pixel, NumPixels); |
alejandroRL | 0:dd702039127a | 569 | pLine += pContext->vxSize; |
alejandroRL | 0:dd702039127a | 570 | } while (--NumLines); |
alejandroRL | 0:dd702039127a | 571 | } else { |
alejandroRL | 0:dd702039127a | 572 | do { |
alejandroRL | 0:dd702039127a | 573 | pPixel = pLine; |
alejandroRL | 0:dd702039127a | 574 | NumPixels = x1_phys - x0_phys + 1; |
alejandroRL | 0:dd702039127a | 575 | do { |
alejandroRL | 0:dd702039127a | 576 | *pPixel++ = Pixel; |
alejandroRL | 0:dd702039127a | 577 | } while (--NumPixels); |
alejandroRL | 0:dd702039127a | 578 | pLine += pContext->vxSize; |
alejandroRL | 0:dd702039127a | 579 | } while (--NumLines); |
alejandroRL | 0:dd702039127a | 580 | } |
alejandroRL | 0:dd702039127a | 581 | } |
alejandroRL | 0:dd702039127a | 582 | pDevice = pDevice->pNext; |
alejandroRL | 0:dd702039127a | 583 | pDevice->pDeviceAPI->pfDrawBitmap(pDevice, |
alejandroRL | 0:dd702039127a | 584 | x0_phys, y0_phys, |
alejandroRL | 0:dd702039127a | 585 | x1_phys - x0_phys + 1, |
alejandroRL | 0:dd702039127a | 586 | y1_phys - y0_phys + 1, |
alejandroRL | 0:dd702039127a | 587 | pContext->pDrawingAPI->BytesPerPixel << 3, |
alejandroRL | 0:dd702039127a | 588 | pContext->pDrawingAPI->BytesPerPixel * pContext->vxSize, |
alejandroRL | 0:dd702039127a | 589 | (U8 *)pData, 0, NULL); |
alejandroRL | 0:dd702039127a | 590 | } |
alejandroRL | 0:dd702039127a | 591 | |
alejandroRL | 0:dd702039127a | 592 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 593 | * |
alejandroRL | 0:dd702039127a | 594 | * Static data: Drawing API(s) |
alejandroRL | 0:dd702039127a | 595 | * |
alejandroRL | 0:dd702039127a | 596 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 597 | */ |
alejandroRL | 0:dd702039127a | 598 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 599 | * |
alejandroRL | 0:dd702039127a | 600 | * GUI_OrientationAPI_CX |
alejandroRL | 0:dd702039127a | 601 | */ |
alejandroRL | 0:dd702039127a | 602 | const GUI_ORIENTATION_API API_NAME = { |
alejandroRL | 0:dd702039127a | 603 | _DrawBitmap_CX, |
alejandroRL | 0:dd702039127a | 604 | _DrawHLine_CX, |
alejandroRL | 0:dd702039127a | 605 | _DrawVLine_CX, |
alejandroRL | 0:dd702039127a | 606 | _FillRect_CX, |
alejandroRL | 0:dd702039127a | 607 | _GetPixelIndex_CX, |
alejandroRL | 0:dd702039127a | 608 | _SetPixelIndex_CX, |
alejandroRL | 0:dd702039127a | 609 | _XorPixel_CX, |
alejandroRL | 0:dd702039127a | 610 | BYTES_PER_PIXEL |
alejandroRL | 0:dd702039127a | 611 | }; |
alejandroRL | 0:dd702039127a | 612 | |
alejandroRL | 0:dd702039127a | 613 | /*************************** End of file ****************************/ |