App:Library:FabGL:Class:Canvas
提供: robot-jp wiki
class Canvas
一連の描画メソッドを持つクラス。
#include <canvas.h> |
Public Member Functions
void beginUpdate ()
|
void clear ()
|
void copyRect (int sourceX, int sourceY, int destX, int destY, int width, int height)
|
void drawBitmap (int X, int Y, Bitmap const *bitmap)
|
void drawChar (int X, int Y, char c)
|
void drawEllipse (int X, int Y, int width, int height)
|
void drawGlyph (int X, int Y, int width, int height, uint8_t const *data, int index=0)
|
void drawLine (int X1, int Y1, int X2, int Y2)
|
void drawPath (Point const *points, int pointsCount)
|
void drawRectangle (int X1, int Y1, int X2, int Y2)
|
void drawRectangle (Rect const &rect)
|
void drawText (int X, int Y, char const *text, bool wrap=false)
|
void drawText (FontInfo const *fontInfo, int X, int Y, char const *text, bool wrap=false)
|
void drawTextFmt (int X, int Y, const char *format,...)
|
void drawTextWithEllipsis (FontInfo const *fontInfo, int X, int Y, char const *text, int maxX)
|
void endUpdate ()
|
void fillEllipse (int X, int Y, int width, int height)
|
void fillPath (Point const *points, int pointsCount)
|
void fillRectangle (int X1, int Y1, int X2, int Y2)
|
void fillRectangle (Rect const &rect)
|
Rect getClippingRect ()
|
FontInfo const * getFontInfo ()
|
int getHeight ()
|
Point getOrigin ()
|
RGB888 getPixel (int X, int Y)
|
int getWidth ()
|
void invertRectangle (int X1, int Y1, int X2, int Y2)
|
void invertRectangle (Rect const &rect)
|
void lineTo (int X, int Y)
|
void moveTo (int X, int Y)
|
void reset ()
|
void resetGlyphOptions ()
|
void resetPaintOptions ()
|
void scroll (int offsetX, int offsetY)
|
void selectFont (FontInfo const *fontInfo)
|
void setBrushColor (uint8_t red, uint8_t green, uint8_t blue)
|
void setBrushColor (Color color)
|
void setBrushColor (RGB888 const &color)
|
void setClippingRect (Rect const &rect)
|
void setGlyphOptions (GlyphOptions options)
|
void setLineEnds (LineEnds value)
|
void setOrigin (int X, int Y)
|
void setOrigin (Point const &origin)
|
void setPaintOptions (PaintOptions options)
|
void setPenColor (uint8_t red, uint8_t green, uint8_t blue)
|
void setPenColor (Color color)
|
void setPenColor (RGB888 const &color)
|
void setPenWidth (int value)
|
void setPixel (int X, int Y)
|
void setPixel (int X, int Y, RGB888 const &color)
|
void setPixel (Point const &pos, RGB888 const &color)
|
void setScrollingRegion (int X1, int Y1, int X2, int Y2)
|
void swapBuffers ()
|
void swapRectangle (int X1, int Y1, int X2, int Y2)
|
int textExtent (FontInfo const *fontInfo, char const *text)
|
int textExtent (char const *text)
|
void waitCompletion (bool waitVSync=true)
|
Detailed Description
一連の描画メソッドを持つクラス。
このクラスは、ディスプレイコントローラに直接接続し、線や円などをペイントしたり、領域をスクロールしたり、長方形をコピーしたり、グリフを描画したりするための一連のプリミティブを提供します。
デフォルトの原点は左上にあり、 (0, 0) から (Canvas Width-1, Canvas Height-1) までです。
Example:
// Setup pins and resolution (5 GPIOs hence we have up to 8 colors)
VGAController.begin(GPIO_NUM_22, GPIO_NUM_21, GPIO_NUM_19, GPIO_NUM_18, GPIO_NUM_5); VGAController.setResolution(VGA_640x350_70Hz);
fabgl::Canvas cv(&VGAController); cv.setPenColor(Color::BrightRed); cv.setBrushColor(Color::BrightGreen); cv.fillRectangle(0, 0, cv.getWidth() - 1, cv.getHeight() - 1); cv.drawRectangle(0, 0, cv.getWidth() - 1, cv.getHeight() - 1); |
- Examples:
- ST7789_TFT/240x240/DoubleBuffer/DoubleBuffer.ino, VGA/ClassicRacer/ClassicRacer.ino, VGA/DoubleBuffer/DoubleBuffer.ino, VGA/MouseOnScreen/MouseOnScreen.ino, VGA/Songs/Songs.ino, and VGA/SpaceInvaders/SpaceInvaders.ino.
Definition at line 70 of file canvas.h.
このクラスのドキュメントは、次のファイルから生成されました。