23 #ifndef _VGACANVAS_H_INCLUDED 24 #define _VGACANVAS_H_INCLUDED 46 #define FONTINFOFLAGS_ITALIC 1 47 #define FONTINFOFLAGS_UNDERLINE 2 48 #define FONTINFODLAFS_STRIKEOUT 4 132 void scroll(int16_t offsetX, int16_t offsetY);
149 void moveTo(int16_t X, int16_t Y);
166 void setPenColor(uint8_t red, uint8_t green, uint8_t blue);
195 void setBrushColor(uint8_t red, uint8_t green, uint8_t blue);
215 void setPixel(int16_t X, int16_t Y);
235 void lineTo(int16_t X, int16_t Y);
254 void drawLine(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2);
270 void drawRectangle(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2);
292 void fillRectangle(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2);
294 #if VGAHAS_INVERTRECT 306 void invertRectangle(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2);
318 void swapRectangle(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2);
334 void drawEllipse(int16_t X, int16_t Y, uint16_t width, uint16_t height);
356 void fillEllipse(int16_t X, int16_t Y, uint16_t width, uint16_t height);
395 void drawGlyph(int16_t X, int16_t Y, uint16_t width, uint16_t height, uint8_t
const * data, uint16_t index = 0);
399 void renderGlyphsBuffer(int16_t itemX, int16_t itemY, GlyphsBuffer_t
const * glyphsBuffer);
414 void selectFont(FontInfo
const& fontInfo);
416 void drawText(int16_t X, int16_t Y,
char const * text,
bool wrap =
false);
418 void drawText(FontInfo
const& fontInfo, int16_t X, int16_t Y,
char const * text,
bool wrap =
false);
420 void drawTextFmt(int16_t X, int16_t Y,
const char *format, ...);
422 void copyRect(int16_t sourceX, int16_t sourceY, int16_t destX, int16_t destY, uint16_t width, uint16_t height);
424 #if VGAHAS_READWRITERAWDATA 426 void readRawData(int16_t sourceX, int16_t sourceY, uint16_t width, uint16_t height, uint8_t * dest);
428 void writeRawData(uint8_t * source, int16_t destX, int16_t destY, uint16_t width, uint16_t height);
434 FontInfo
const * m_fontInfo;
435 uint8_t m_textHorizRate;
void scroll(int16_t offsetX, int16_t offsetY)
Scrolls pixels horizontally and/or vertically.
Definition: VGACanvas.cpp:76
Color
This enum defines named colors.
Definition: VGAController.h:184
uint16_t getWidth()
Returns the canvas width in pixels. This is equivalent to VGA Controller viewport width...
Definition: VGACanvas.cpp:46
void drawEllipse(int16_t X, int16_t Y, uint16_t width, uint16_t height)
Draws an ellipse specifying center and size, using current pen color.
Definition: VGACanvas.cpp:220
void drawLine(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2)
Draws a line specifying initial and ending coordinates.
Definition: VGACanvas.cpp:164
void waitCompletion(bool waitVSync=true)
Waits for drawing queue to become empty.
Definition: VGACanvas.cpp:58
void setPixel(int16_t X, int16_t Y)
Fills a single pixel with the pen color.
Definition: VGACanvas.cpp:101
void fillRectangle(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2)
Fills a rectangle using the current brush color.
Definition: VGACanvas.cpp:181
void clear()
Fills the entire canvas with the brush color.
Definition: VGACanvas.cpp:67
void moveTo(int16_t X, int16_t Y)
Moves current pen position to the spcified coordinates.
Definition: VGACanvas.cpp:110
Definition: VGACanvas.cpp:29
static FontInfo const * getPresetFontInfo(uint8_t columns)
Gets the font info that best fits the specified number of columns.
Definition: VGACanvas.cpp:338
Specifies general paint options.
Definition: VGAController.h:329
A class with a set of drawing methods.
Definition: VGACanvas.h:89
void swapRectangle(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2)
Swaps pen and brush colors of the specified rectangle.
Definition: VGACanvas.cpp:201
uint16_t getHeight()
Returns the canvas height in pixels. This is equivalent to VGA Controller viewport height...
Definition: VGACanvas.cpp:52
void drawGlyph(int16_t X, int16_t Y, uint16_t width, uint16_t height, uint8_t const *data, uint16_t index=0)
Draws a glyph at specified position.
Definition: VGACanvas.cpp:230
void fillEllipse(int16_t X, int16_t Y, uint16_t width, uint16_t height)
Fills an ellipse specifying center and size, using current brush color.
Definition: VGACanvas.cpp:210
Specifies various glyph painting options.
Definition: VGAController.h:301
void setPenColor(uint8_t red, uint8_t green, uint8_t blue)
Sets pen (foreground) color specifying color components.
Definition: VGACanvas.cpp:128
This file contains VGAControllerClass definition and the VGAController instance.
void setScrollingRegion(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2)
Defines the scrolling region.
Definition: VGACanvas.cpp:92
void setBrushColor(uint8_t red, uint8_t green, uint8_t blue)
Sets brush (background) color specifying color components.
Definition: VGACanvas.cpp:146
void lineTo(int16_t X, int16_t Y)
Draws a line starting from current pen position.
Definition: VGACanvas.cpp:155
void drawRectangle(int16_t X1, int16_t Y1, int16_t X2, int16_t Y2)
Draws a rectangle using the current pen color.
Definition: VGACanvas.cpp:171