FabGL
ESP32 Display Controller and Graphics Library
VGA2Controller Class Reference

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

#include <vga2controller.h>

Inheritance diagram for VGA2Controller:

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 VGA2Controllerinstance ()
 Returns the singleton instance of VGA2Controller class. More...
 

Static Public Attributes

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

Detailed Description

Represents the VGA 2 colors bitmapped controller.

This VGA controller allows just 2 colors, but requires less (1/8) RAM than VGAController, at the same resolution. Each pixel is represented by 1 bit, which is an index to a palette of 2 colors. Each byte of the frame buffer contains eight pixels. For example, a frame buffer of 640x480 requires about 40K of RAM. This controller also allows higher resolutions, up to 1280x768.

VGA2Controller output consumes up to 10% of one CPU core (measured at 640x480x60Hz).

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

fabgl::VGA2Controller 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);
Examples
VGA/ModelineStudio/ModelineStudio.ino.

Definition at line 83 of file vga2controller.h.


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