FabGL
ESP32 Display Controller and Graphics Library
VGA8Controller Class Reference

Represents the VGA 8 colors bitmapped controller. More...

#include <vga8controller.h>

Inheritance diagram for VGA8Controller:

Public Member Functions

void begin ()
 This is the 64 colors (8 GPIOs) initializer using default pinout. More...
 
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)
 This is the 64 colors (8 GPIOs) initializer. More...
 
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. More...
 
virtual int colorsCount ()
 Determines number of colors this display can provide. More...
 
DisplayControllerType controllerType ()
 Determines the display controller type. More...
 
uint8_t createRawPixel (RGB222 rgb)
 Creates a raw pixel to use with VGAController.setRawPixel. More...
 
void enableBackgroundPrimitiveExecution (bool value)
 Enables or disables drawings inside vertical retracing time. More...
 
void enableBackgroundPrimitiveTimeout (bool value)
 Enables or disables execution time limitation inside vertical retracing interrupt. More...
 
uint8_t getBitsPerChannel ()
 Gets number of bits allocated for each channel. More...
 
uint8_t * getScanline (int y)
 Gets a raw scanline pointer. More...
 
int getScreenHeight ()
 Determines the screen height in pixels. More...
 
int getScreenWidth ()
 Determines the screen width in pixels. More...
 
int getViewPortCol ()
 Determines horizontal position of the viewport. More...
 
int getViewPortHeight ()
 Determines vertical size of the viewport. More...
 
int getViewPortRow ()
 Determines vertical position of the viewport. More...
 
int getViewPortWidth ()
 Determines horizontal size of the viewport. More...
 
bool isDoubleBuffered ()
 Determines whether BitmappedDisplayController is on double buffered mode. More...
 
void moveScreen (int offsetX, int offsetY)
 Moves screen by specified horizontal and vertical offset. More...
 
NativePixelFormat nativePixelFormat ()
 Represents the native pixel format used by this display. More...
 
void processPrimitives ()
 Draws immediately all primitives in the queue. More...
 
void refreshSprites ()
 Forces the sprites to be updated. More...
 
void removeSprites ()
 Empties the list of active sprites. More...
 
void setMouseCursor (Cursor *cursor)
 Sets mouse cursor and make it visible. More...
 
void setMouseCursor (CursorName cursorName)
 Sets mouse cursor from a set of predefined cursors. More...
 
void setMouseCursorPos (int X, int Y)
 Sets mouse cursor position. More...
 
void setPaletteItem (int index, RGB888 const &color)
 Determines color of specified palette item. More...
 
void setProcessPrimitivesOnBlank (bool value)
 Determines the maximum time allowed to process primitives. More...
 
void setResolution (char const *modeline, int viewPortWidth=-1, int viewPortHeight=-1, bool doubleBuffered=false)
 Sets current resolution using linux-like modeline. More...
 
template<typename T >
void setSprites (T *sprites, int count)
 Sets the list of active sprites. More...
 
void shrinkScreen (int shrinkX, int shrinkY)
 Reduces or expands screen size by the specified horizontal and vertical offset. More...
 
void suspendBackgroundPrimitiveExecution ()
 Suspends drawings. More...
 

Static Public Member Functions

static VGA8Controllerinstance ()
 Returns the singleton instance of VGA8Controller class. More...
 

Static Public Attributes

static int queueSize = 1024
 Size of display controller primitives queue. More...
 

Detailed Description

Represents the VGA 8 colors bitmapped controller.

This VGA controller allows just 8 colors, but requires less (8/3) RAM than VGAController, at the same resolution. Each pixel is represented by 3 bits, which is an index to a palette of 8 colors. Every 3 bytes of the frame buffer there are 8 pixels. For example, a frame buffer of 640x480 requires about 113K of RAM.

VGA8Controller output is very CPU intensive process and consumes up to 23% of one CPU core (measured at 640x480x60Hz). Anyway this allows to have more RAM free for your application.

This example initializes VGA Controller with 64 colors (16 visible at the same time) at 640x480:

fabgl::VGA8Controller displayController;
// the default assigns GPIO22 and GPIO21 to Red, GPIO19 and GPIO18 to Green, GPIO5 and GPIO4 to Blue, GPIO23 to HSync and GPIO15 to VSync
displayController.begin();
displayController.setResolution(VGA_640x480_60Hz);

Definition at line 82 of file vga8controller.h.


The documentation for this class was generated from the following files: