FabGL
ESP32 VGA Controller and Graphics Library
vgacontroller.h
Go to the documentation of this file.
1 /*
2  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - <http://www.fabgl.com>
3  Copyright (c) 2019 Fabrizio Di Vittorio.
4  All rights reserved.
5 
6  This file is part of FabGL Library.
7 
8  FabGL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  FabGL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with FabGL. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef _VGACONTROLLER_H_INCLUDED
24 #define _VGACONTROLLER_H_INCLUDED
25 
26 
34 #include <stdint.h>
35 #include <stddef.h>
36 #include <atomic>
37 
38 #include "rom/lldesc.h"
39 #include "driver/gpio.h"
40 
41 #include "freertos/FreeRTOS.h"
42 #include "freertos/queue.h"
43 
44 #include "fabglconf.h"
45 #include "fabutils.h"
46 
47 
48 
49 
50 namespace fabgl {
51 
52 
53 
54 
55 
59  Sync,
62 };
63 
64 
66 struct Timings {
67  char label[22];
68  int frequency;
69  int16_t HVisibleArea;
70  int16_t HFrontPorch;
71  int16_t HSyncPulse;
72  int16_t HBackPorch;
73  int16_t VVisibleArea;
74  int16_t VFrontPorch;
75  int16_t VSyncPulse;
76  int16_t VBackPorch;
77  char HSyncLogic;
78  char VSyncLogic;
79  uint8_t scanCount;
80  uint8_t multiScanBlack;
82 };
83 
84 
85 
86 /*
87  Notes:
88  - all positions can have negative and outofbound coordinates. Shapes are always clipped correctly.
89 */
90 enum PrimitiveCmd {
91  // Set current pen color
92  // params: color
93  SetPenColor,
94 
95  // Set current brush color
96  // params: color
97  SetBrushColor,
98 
99  // Paint a pixel at specified coordinates, using current pen color
100  // params: color
101  SetPixel,
102 
103  // Move current position to the specified one
104  // params: point
105  MoveTo,
106 
107  // Draw a line from current position to the specified one, using current pen color. Update current position.
108  // params: point
109  LineTo,
110 
111  // Fill a rectangle using current brush color
112  // params: rect
113  FillRect,
114 
115  // Fill an ellipse, current position is the center, using current brush color
116  // params: size
117  FillEllipse,
118 
119  // Draw an ellipse, current position is the center, using current pen color
120  // params: size
121  DrawEllipse,
122 
123  // Fill viewport with brush color
124  // params: none
125  Clear,
126 
127  // Scroll vertically without copying buffers
128  // params: ivalue (scroll amount, can be negative)
129  VScroll,
130 
131  // Scroll horizontally (time consuming operation!)
132  // params: ivalue (scroll amount, can be negative)
133  HScroll,
134 
135  // Draw a glyph (BW image)
136  // params: glyph
137  DrawGlyph,
138 
139  // Set paint options
140  // params: glyphOptions
141  SetGlyphOptions,
142 
143  // Set gluph options
144  // params: paintOptions
145  SetPaintOptions,
146 
147 #if FABGLIB_HAS_INVERTRECT
148  // Invert a rectangle
149  // params: rect
150  InvertRect,
151 #endif
152 
153  // Copy (overlapping) rectangle to current position
154  // params: rect (source rectangle)
155  CopyRect,
156 
157  // Set scrolling region
158  // params: rect
159  SetScrollingRegion,
160 
161  // Swap foreground (pen) and background (brush) colors of all pixels inside the specified rectangles. Other colors remain untaltered.
162  // params: rect
163  SwapFGBG,
164 
165 #if FABGLIB_HAS_READWRITE_RAW_DATA
166  // Read raw viewport data
167  // params: rawData
168  ReadRawData,
169 
170  // Write raw viewport data
171  // params: rawData
172  WriteRawData,
173 #endif
174 
175  // Render glyphs buffer
176  // params: glyphsBufferRenderInfo
177  RenderGlyphsBuffer,
178 
179  // Draw a bitmap
180  // params: bitmapDrawingInfo
181  DrawBitmap,
182 
183  // Refresh sprites
184  // no params
185  RefreshSprites,
186 
187  // Swap buffers (m_doubleBuffered must be True)
188  SwapBuffers,
189 
190  // Fill a path, using current brush color
191  // params: path
192  FillPath,
193 
194  // Draw a path, using current pen color
195  // params: path
196  DrawPath,
197 };
198 
199 
200 
206 enum Color {
208  Red,
223 };
224 
225 
226 
233 struct RGB {
234  uint8_t R : 2;
235  uint8_t G : 2;
236  uint8_t B : 2;
238  RGB() : R(0), G(0), B(0) { }
239  RGB(Color color);
240  RGB(uint8_t red, uint8_t green, uint8_t blue) : R(red), G(green), B(blue) { }
241 };
242 
243 
244 inline bool operator==(RGB const& lhs, RGB const& rhs)
245 {
246  return lhs.R == rhs.R && lhs.G == rhs.G && lhs.B == rhs.B;
247 }
248 
249 
250 inline bool operator!=(RGB const& lhs, RGB const& rhs)
251 {
252  return lhs.R != rhs.R || lhs.G != rhs.G || lhs.B == rhs.B;
253 }
254 
255 
256 
262 struct Glyph {
263  int16_t X;
264  int16_t Y;
265  int16_t width;
266  int16_t height;
267  uint8_t const * data;
269  Glyph() : X(0), Y(0), width(0), height(0), data(NULL) { }
270  Glyph(int X_, int Y_, int width_, int height_, uint8_t const * data_) : X(X_), Y(Y_), width(width_), height(height_), data(data_) { }
271 };
272 
273 
274 
278 struct RawData {
279  int16_t X;
280  int16_t Y;
281  int16_t width;
282  int16_t height;
283  uint8_t * data;
285  RawData(int X_, int Y_, int width_, int height_, uint8_t * data_) : X(X_), Y(Y_), width(width_), height(height_), data(data_) { }
286 };
287 
288 
289 
294  struct {
295  uint16_t fillBackground : 1;
296  uint16_t bold : 1;
297  uint16_t reduceLuminosity : 1;
298  uint16_t italic : 1;
299  uint16_t invert : 1;
300  uint16_t blank : 1;
301  uint16_t underline : 1;
302  uint16_t doubleWidth : 2;
303  uint16_t userOpt1 : 1;
304  uint16_t userOpt2 : 1;
305  };
306  uint16_t value;
307 
309  GlyphOptions & FillBackground(bool value) { fillBackground = value; return *this; }
310 
312  GlyphOptions & Bold(bool value) { bold = value; return *this; }
313 
315  GlyphOptions & Italic(bool value) { italic = value; return *this; }
316 
318  GlyphOptions & Underline(bool value) { underline = value; return *this; }
319 
321  GlyphOptions & DoubleWidth(uint8_t value) { doubleWidth = value; return *this; }
322 
324  GlyphOptions & Invert(uint8_t value) { invert = value; return *this; }
325 };
326 
327 
328 
332 struct PaintOptions {
333  uint8_t swapFGBG : 1;
334 };
335 
336 
337 
338 // GlyphsBuffer.map support functions
339 // 0 .. 7 : index
340 // 8 .. 11 : BG color (Color)
341 // 12 .. 15 : FG color (Color)
342 // 16 .. 31 : options (GlyphOptions)
343 // note: volatile pointer to avoid optimizer to get less than 32 bit from 32 bit access only memory
344 #define GLYPHMAP_INDEX_BIT 0
345 #define GLYPHMAP_BGCOLOR_BIT 8
346 #define GLYPHMAP_FGCOLOR_BIT 12
347 #define GLYPHMAP_OPTIONS_BIT 16
348 #define GLYPHMAP_ITEM_MAKE(index, bgColor, fgColor, options) (((uint32_t)(index) << GLYPHMAP_INDEX_BIT) | ((uint32_t)(bgColor) << GLYPHMAP_BGCOLOR_BIT) | ((uint32_t)(fgColor) << GLYPHMAP_FGCOLOR_BIT) | ((uint32_t)((options).value) << GLYPHMAP_OPTIONS_BIT))
349 inline uint8_t glyphMapItem_getIndex(uint32_t const volatile * mapItem) { return *mapItem >> GLYPHMAP_INDEX_BIT & 0xFF; }
350 inline Color glyphMapItem_getBGColor(uint32_t const volatile * mapItem) { return (Color)(*mapItem >> GLYPHMAP_BGCOLOR_BIT & 0x0F); }
351 inline Color glyphMapItem_getFGColor(uint32_t const volatile * mapItem) { return (Color)(*mapItem >> GLYPHMAP_FGCOLOR_BIT & 0x0F); }
352 inline GlyphOptions glyphMapItem_getOptions(uint32_t const volatile * mapItem) { return (GlyphOptions){.value = (uint16_t)(*mapItem >> GLYPHMAP_OPTIONS_BIT & 0xFFFF)}; }
353 inline void glyphMapItem_setOptions(uint32_t volatile * mapItem, GlyphOptions const & options) { *mapItem = (*mapItem & ~((uint32_t)0xFFFF << GLYPHMAP_OPTIONS_BIT)) | ((uint32_t)(options.value) << GLYPHMAP_OPTIONS_BIT); }
354 
355 struct GlyphsBuffer {
356  int16_t glyphsWidth;
357  int16_t glyphsHeight;
358  uint8_t const * glyphsData;
359  int16_t columns;
360  int16_t rows;
361  uint32_t * map; // look at glyphMapItem_... inlined functions
362 };
363 
364 
365 struct GlyphsBufferRenderInfo {
366  int16_t itemX; // starts from 0
367  int16_t itemY; // starts from 0
368  GlyphsBuffer const * glyphsBuffer;
369 
370  GlyphsBufferRenderInfo(int itemX_, int itemY_, GlyphsBuffer const * glyphsBuffer_) : itemX(itemX_), itemY(itemY_), glyphsBuffer(glyphsBuffer_) { }
371 };
372 
373 
385 struct Bitmap {
386  int16_t width;
387  int16_t height;
388  uint8_t const * data;
391  Bitmap() : width(0), height(0), data(NULL), dataAllocated(false) { }
392  Bitmap(int width_, int height_, void const * data_, bool copy = false);
393  Bitmap(int width_, int height_, void const * data_, int bitsPerPixel, RGB foregroundColor, bool copy = false);
394  ~Bitmap();
395 };
396 
397 
398 struct BitmapDrawingInfo {
399  int16_t X;
400  int16_t Y;
401  Bitmap const * bitmap;
402 
403  BitmapDrawingInfo(int X_, int Y_, Bitmap const * bitmap_) : X(X_), Y(Y_), bitmap(bitmap_) { }
404 };
405 
406 
430 };
431 
432 
436 struct Cursor {
437  int16_t hotspotX;
438  int16_t hotspotY;
440 };
441 
442 
443 
444 struct QuadTreeObject;
445 
446 
455 struct Sprite {
456  volatile int16_t x;
457  volatile int16_t y;
458  Bitmap const * * frames; // array of pointer to Bitmap
459  int16_t framesCount;
460  int16_t currentFrame;
461  int16_t savedX;
462  int16_t savedY;
463  int16_t savedBackgroundWidth;
464  int16_t savedBackgroundHeight;
465  uint8_t * savedBackground;
466  QuadTreeObject * collisionDetectorObject;
467  struct {
468  uint8_t visible: 1;
469  // A static sprite should be positioned before dynamic sprites.
470  // It is never re-rendered unless allowDraw is 1. Static sprites always sets allowDraw=0 after drawings.
471  uint8_t isStatic: 1;
472  // This is always '1' for dynamic sprites and always '0' for static sprites.
473  uint8_t allowDraw: 1;
474  };
475 
476  Sprite();
477  ~Sprite();
478  Bitmap const * getFrame() { return frames ? frames[currentFrame] : NULL; }
479  int getFrameIndex() { return currentFrame; }
480  void nextFrame() { ++currentFrame; if (currentFrame >= framesCount) currentFrame = 0; }
481  Sprite * setFrame(int frame) { currentFrame = frame; return this; }
482  Sprite * addBitmap(Bitmap const * bitmap);
483  Sprite * addBitmap(Bitmap const * bitmap[], int count);
484  void clearBitmaps();
485  int getWidth() { return frames[currentFrame]->width; }
486  int getHeight() { return frames[currentFrame]->height; }
487  void allocRequiredBackgroundBuffer();
488  Sprite * move(int offsetX, int offsetY, bool wrapAround = true);
489  Sprite * moveTo(int x, int y);
490 };
491 
492 
493 struct Path {
494  Point const * points;
495  int pointsCount;
496 };
497 
498 
499 struct Primitive {
500  PrimitiveCmd cmd;
501  union {
502  int16_t ivalue;
503  RGB color;
504  Point position;
505  Size size;
506  Glyph glyph;
507  Rect rect;
508  GlyphOptions glyphOptions;
509  RawData rawData;
510  PaintOptions paintOptions;
511  GlyphsBufferRenderInfo glyphsBufferRenderInfo;
512  BitmapDrawingInfo bitmapDrawingInfo;
513  Path path;
514  };
515 
516  Primitive() { }
517 };
518 
519 
520 struct PaintState {
521  RGB penColor;
522  RGB brushColor;
523  Point position;
524  GlyphOptions glyphOptions;
525  PaintOptions paintOptions;
526  Rect scrollingRegion;
527 };
528 
529 
552 
553 public:
554 
571  void begin(gpio_num_t redGPIO, gpio_num_t greenGPIO, gpio_num_t blueGPIO, gpio_num_t HSyncGPIO, gpio_num_t VSyncGPIO);
572 
592  void begin(gpio_num_t red1GPIO, gpio_num_t red0GPIO, gpio_num_t green1GPIO, gpio_num_t green0GPIO, gpio_num_t blue1GPIO, gpio_num_t blue0GPIO, gpio_num_t HSyncGPIO, gpio_num_t VSyncGPIO);
593 
601  uint8_t getBitsPerChannel() { return m_bitsPerChannel; }
602 
630  void setResolution(char const * modeline, int viewPortWidth = -1, int viewPortHeight = -1, bool doubleBuffered = false);
631 
632  void setResolution(Timings const& timings, int viewPortWidth = -1, int viewPortHeight = -1, bool doubleBuffered = false);
633 
634  Timings * getResolutionTimings() { return &m_timings; }
635 
641  int getScreenWidth() { return m_timings.HVisibleArea; }
642 
648  int getScreenHeight() { return m_timings.VVisibleArea; }
649 
655  int getViewPortCol() { return m_viewPortCol; }
656 
662  int getViewPortRow() { return m_viewPortRow; }
663 
669  int getViewPortWidth() { return m_viewPortWidth; }
670 
676  int getViewPortHeight() { return m_viewPortHeight; }
677 
678  void addPrimitive(Primitive const & primitive);
679 
680  void primitivesExecutionWait();
681 
693  void enableBackgroundPrimitiveExecution(bool value);
694 
704 
711 
718  void processPrimitives();
719 
733  void moveScreen(int offsetX, int offsetY);
734 
749  void shrinkScreen(int shrinkX, int shrinkY);
750 
774  template <typename T>
775  void setSprites(T * sprites, int count) {
776  setSprites(sprites, count, sizeof(T));
777  }
778 
784  void removeSprites() { setSprites(NULL, 0, 0); }
785 
794  void refreshSprites();
795 
801  bool isDoubleBuffered() { return m_doubleBuffered; }
802 
808  void setMouseCursor(Cursor const * cursor);
809 
819  void setMouseCursor(CursorName cursorName);
820 
827  void setMouseCursorPos(int X, int Y);
828 
829 private:
830 
831  void init(gpio_num_t VSyncGPIO);
832 
833  uint8_t preparePixel(RGB rgb, bool HSync = false, bool VSync = false);
834 
835  void freeBuffers();
836  void fillHorizBuffers(int offsetX);
837  void fillVertBuffers(int offsetY);
838  int fill(uint8_t volatile * buffer, int startPos, int length, uint8_t red, uint8_t green, uint8_t blue, bool hsync, bool vsync);
839  void allocateViewPort();
840  void freeViewPort();
841  int calcRequiredDMABuffersCount(int viewPortHeight);
842 
843  void execPrimitive(Primitive const & prim);
844 
845  void execSetPixel(Point const & position);
846  void execLineTo(Point const & position);
847  void execFillRect(Rect const & rect);
848  void execFillEllipse(Size const & size);
849  void execDrawEllipse(Size const & size);
850  void execClear();
851  void execVScroll(int scroll);
852  void execHScroll(int scroll);
853  void execDrawGlyph(Glyph const & glyph, GlyphOptions glyphOptions, RGB penColor, RGB brushColor);
854  void execDrawGlyph_full(Glyph const & glyph, GlyphOptions glyphOptions, RGB penColor, RGB brushColor);
855  void execDrawGlyph_light(Glyph const & glyph, GlyphOptions glyphOptions, RGB penColor, RGB brushColor);
856  void execInvertRect(Rect const & rect);
857  void execCopyRect(Rect const & source);
858  void execSwapFGBG(Rect const & rect);
859  void execReadRawData(RawData const & rawData);
860  void execWriteRawData(RawData const & rawData);
861  void execRenderGlyphsBuffer(GlyphsBufferRenderInfo const & glyphsBufferRenderInfo);
862  void execDrawBitmap(BitmapDrawingInfo const & bitmapDrawingInfo, uint8_t * saveBackground, bool callHideSprites);
863  void execSwapBuffers();
864  void execDrawPath(Path const & path);
865  void execFillPath(Path const & path);
866 
867  void fillRow(int y, int x1, int x2, uint8_t pattern);
868  void swapRows(int yA, int yB, int x1, int x2);
869 
870  void drawLine(int X1, int Y1, int X2, int Y2, uint8_t pattern);
871 
872  void hideSprites();
873  void showSprites();
874 
875  void setSprites(Sprite * sprites, int count, int spriteSize);
876 
877  static void VSyncInterrupt();
878 
879  static void setupGPIO(gpio_num_t gpio, int bit, gpio_mode_t mode);
880 
881  // DMA related methods
882  bool setDMABuffersCount(int buffersCount);
883  void setDMABufferBlank(int index, void volatile * address, int length);
884  void setDMABufferView(int index, int row, int scan, volatile uint8_t * * viewPort, bool onVisibleDMA);
885  void setDMABufferView(int index, int row, int scan);
886  void volatile * getDMABuffer(int index, int * length);
887 
888  int m_bitsPerChannel; // 1 = 8 colors, 2 = 64 colors, set by begin()
889  Timings m_timings;
890  int16_t m_linesCount;
891  volatile int16_t m_maxVSyncISRTime; // Maximum us VSync interrupt routine can run
892 
893  // These buffers contains a full line, with FrontPorch, Sync, BackPorch and blank visible area, in the
894  // order specified by timings.HStartingBlock
895  volatile uint8_t * m_HBlankLine_withVSync;
896  volatile uint8_t * m_HBlankLine;
897  int16_t m_HLineSize;
898 
899  bool m_doubleBuffered;
900 
901  volatile int16_t m_viewPortCol;
902  volatile int16_t m_viewPortRow;
903  volatile int16_t m_viewPortWidth;
904  volatile int16_t m_viewPortHeight;
905 
906  // when double buffer is enabled the "drawing" view port is always m_viewPort, while the "visible" view port is always m_viewPortVisible
907  // when double buffer is not enabled then m_viewPort = m_viewPortVisible
908  volatile uint8_t * * m_viewPort;
909  volatile uint8_t * * m_viewPortVisible;
910 
911  uint8_t * m_viewPortMemoryPool[FABGLIB_VIEWPORT_MEMORY_POOL_COUNT + 1]; // last allocated pool is NULL
912 
913  volatile QueueHandle_t m_execQueue;
914  PaintState m_paintState;
915 
916  // when double buffer is enabled the running DMA buffer is always m_DMABuffersRunning
917  // when double buffer is not enabled then m_DMABuffers = m_DMABuffersRunning
918  lldesc_t volatile * m_DMABuffersHead;
919  lldesc_t volatile * m_DMABuffers;
920  lldesc_t volatile * m_DMABuffersVisible;
921 
922  int m_DMABuffersCount;
923 
924  gpio_num_t m_VSyncGPIO;
925  int m_VSyncInterruptSuspended; // 0 = enabled, >0 suspended
926  bool m_backgroundPrimitiveExecutionEnabled; // when False primitives are execute immediately
927 
928  void * m_sprites; // pointer to array of sprite structures
929  int m_spriteSize; // size of sprite structure
930  int m_spritesCount; // number of sprites in m_sprites array
931 
932  bool m_spritesHidden; // true between hideSprites() and showSprites()
933 
934  // mouse cursor (mouse pointer) support
935  Sprite m_mouseCursor;
936  int16_t m_mouseHotspotX;
937  int16_t m_mouseHotspotY;
938 
939 };
940 
941 
942 
943 } // end of namespace
944 
945 
946 extern fabgl::VGAControllerClass VGAController;
947 
948 
949 
950 #endif
int16_t height
Definition: vgacontroller.h:387
uint16_t blank
Definition: vgacontroller.h:300
Definition: vgacontroller.h:424
Defines a cursor.
Definition: vgacontroller.h:436
Represents an RGB color.
Definition: vgacontroller.h:233
uint8_t R
Definition: vgacontroller.h:234
Represents a sprite.
Definition: vgacontroller.h:455
int getViewPortWidth()
Return horizontal size of the viewport.
Definition: vgacontroller.h:669
int getViewPortHeight()
Return vertical size of the viewport.
Definition: vgacontroller.h:676
Definition: vgacontroller.h:416
Definition: vgacontroller.h:426
Definition: vgacontroller.h:220
uint16_t italic
Definition: vgacontroller.h:298
Definition: vgacontroller.h:58
Definition: vgacontroller.h:60
Definition: vgacontroller.h:429
int getViewPortRow()
Return vertical position of the viewport.
Definition: vgacontroller.h:662
void setMouseCursorPos(int X, int Y)
Set mouse cursor position.
Definition: vgacontroller.cpp:1947
void processPrimitives()
Draw immediately all primitives in the queue.
Definition: vgacontroller.cpp:792
Definition: vgacontroller.h:411
GlyphOptions & Bold(bool value)
Helper method to set or reset bold.
Definition: vgacontroller.h:312
Definition: vgacontroller.h:207
Represents a region of raw screen buffer.
Definition: vgacontroller.h:278
void shrinkScreen(int shrinkX, int shrinkY)
Reduce or expands screen size by the specified horizontal and vertical offset.
Definition: vgacontroller.cpp:591
GlyphOptions & FillBackground(bool value)
Helper method to set or reset fillBackground.
Definition: vgacontroller.h:309
Definition: vgacontroller.h:420
int16_t width
Definition: vgacontroller.h:386
Definition: vgacontroller.h:211
Definition: vgacontroller.h:222
int16_t HSyncPulse
Definition: vgacontroller.h:71
uint16_t invert
Definition: vgacontroller.h:299
Definition: vgacontroller.h:415
uint8_t const * data
Definition: vgacontroller.h:267
Definition: vgacontroller.h:412
Definition: vgacontroller.h:212
uint8_t const * data
Definition: vgacontroller.h:388
Definition: vgacontroller.h:61
Definition: vgacontroller.h:215
GlyphOptions & Invert(uint8_t value)
Helper method to set or reset foreground and background swapping.
Definition: vgacontroller.h:324
uint16_t doubleWidth
Definition: vgacontroller.h:302
int frequency
Definition: vgacontroller.h:68
int getViewPortCol()
Return horizontal position of the viewport.
Definition: vgacontroller.h:655
Definition: vgacontroller.h:208
void setMouseCursor(Cursor const *cursor)
Set mouse cursor and make it visible.
Definition: vgacontroller.cpp:1920
Definition: vgacontroller.h:421
void moveScreen(int offsetX, int offsetY)
Move screen by specified horizontal and vertical offset.
Definition: vgacontroller.cpp:582
Definition: vgacontroller.h:419
void enableBackgroundPrimitiveExecution(bool value)
Enable or disable drawings inside vertical retracing time.
Definition: vgacontroller.cpp:736
int16_t Y
Definition: vgacontroller.h:280
Represents a glyph position, size and binary data.
Definition: vgacontroller.h:262
Definition: vgacontroller.h:423
ScreenBlock
Represents one of the four blocks of horizontal or vertical line.
Definition: vgacontroller.h:57
Definition: vgacontroller.h:422
GlyphOptions & Underline(bool value)
Helper method to set or reset underlined.
Definition: vgacontroller.h:318
Represents the coordinate of a point.
Definition: fabutils.h:40
Represents an image with 64 colors image and transparency.
Definition: vgacontroller.h:385
Definition: vgacontroller.h:217
Definition: vgacontroller.h:59
int16_t VSyncPulse
Definition: vgacontroller.h:75
Definition: canvas.cpp:37
uint16_t bold
Definition: vgacontroller.h:296
char VSyncLogic
Definition: vgacontroller.h:78
int16_t hotspotX
Definition: vgacontroller.h:437
void setResolution(char const *modeline, int viewPortWidth=-1, int viewPortHeight=-1, bool doubleBuffered=false)
Set current resolution using linux-like modeline.
Definition: vgacontroller.cpp:285
Definition: vgacontroller.h:425
Color
This enum defines named colors.
Definition: vgacontroller.h:206
uint8_t * data
Definition: vgacontroller.h:283
int16_t HBackPorch
Definition: vgacontroller.h:72
Represents the VGA controller.
Definition: vgacontroller.h:551
Specifies various glyph painting options.
Definition: vgacontroller.h:293
Represents a rectangle.
Definition: fabutils.h:67
uint8_t getBitsPerChannel()
Get number of bits allocated for each channel.
Definition: vgacontroller.h:601
ScreenBlock HStartingBlock
Definition: vgacontroller.h:81
GlyphOptions & Italic(bool value)
Helper method to set or reset italic.
Definition: vgacontroller.h:315
Definition: vgacontroller.h:418
Definition: vgacontroller.h:414
void refreshSprites()
Force the sprites to be updated.
Definition: vgacontroller.cpp:1760
Definition: vgacontroller.h:216
char HSyncLogic
Definition: vgacontroller.h:77
Definition: vgacontroller.h:209
Definition: vgacontroller.h:428
void setSprites(T *sprites, int count)
Set the list of active sprites.
Definition: vgacontroller.h:775
int16_t X
Definition: vgacontroller.h:263
int16_t HFrontPorch
Definition: vgacontroller.h:70
int16_t VVisibleArea
Definition: vgacontroller.h:73
void removeSprites()
Empty the list of active sprites.
Definition: vgacontroller.h:784
int16_t width
Definition: vgacontroller.h:265
int16_t height
Definition: vgacontroller.h:282
int16_t width
Definition: vgacontroller.h:281
This file contains FabGL library configuration settings, like number of supported colors...
Definition: vgacontroller.h:427
uint8_t scanCount
Definition: vgacontroller.h:79
Definition: vgacontroller.h:221
int16_t VFrontPorch
Definition: vgacontroller.h:74
int getScreenHeight()
Return the screen height in pixels.
Definition: vgacontroller.h:648
Definition: vgacontroller.h:219
int16_t X
Definition: vgacontroller.h:279
Represents a bidimensional size.
Definition: fabutils.h:52
int getScreenWidth()
Return the screen width in pixels.
Definition: vgacontroller.h:641
GlyphOptions & DoubleWidth(uint8_t value)
Helper method to set or reset doubleWidth.
Definition: vgacontroller.h:321
int16_t Y
Definition: vgacontroller.h:264
CursorName
This enum defines a set of predefined mouse cursors.
Definition: vgacontroller.h:410
Specifies the VGA timings. This is a modeline decoded.
Definition: vgacontroller.h:66
uint16_t fillBackground
Definition: vgacontroller.h:295
uint8_t multiScanBlack
Definition: vgacontroller.h:80
Definition: vgacontroller.h:413
Definition: vgacontroller.h:210
uint8_t B
Definition: vgacontroller.h:236
void suspendBackgroundPrimitiveExecution()
Suspend drawings.
Definition: vgacontroller.cpp:754
uint16_t reduceLuminosity
Definition: vgacontroller.h:297
uint16_t userOpt2
Definition: vgacontroller.h:304
Definition: vgacontroller.h:417
Definition: vgacontroller.h:214
uint8_t G
Definition: vgacontroller.h:235
uint16_t userOpt1
Definition: vgacontroller.h:303
Definition: vgacontroller.h:213
#define FABGLIB_VIEWPORT_MEMORY_POOL_COUNT
Definition: fabglconf.h:127
uint16_t underline
Definition: vgacontroller.h:301
void begin(gpio_num_t redGPIO, gpio_num_t greenGPIO, gpio_num_t blueGPIO, gpio_num_t HSyncGPIO, gpio_num_t VSyncGPIO)
This is the 8 colors (5 GPIOs) initializer.
Definition: vgacontroller.cpp:140
int16_t VBackPorch
Definition: vgacontroller.h:76
Definition: vgacontroller.h:218
Specifies general paint options.
Definition: vgacontroller.h:332
char label[22]
Definition: vgacontroller.h:67
int16_t HVisibleArea
Definition: vgacontroller.h:69
uint8_t swapFGBG
Definition: vgacontroller.h:333
void resumeBackgroundPrimitiveExecution()
Resume drawings after suspendBackgroundPrimitiveExecution().
Definition: vgacontroller.cpp:764
Bitmap bitmap
Definition: vgacontroller.h:439
int16_t height
Definition: vgacontroller.h:266
bool dataAllocated
Definition: vgacontroller.h:389
bool isDoubleBuffered()
Return true if VGAControllerClass is on double buffered mode.
Definition: vgacontroller.h:801
int16_t hotspotY
Definition: vgacontroller.h:438