「App:Library:FabGL:Class:Canvas」の版間の差分
提供: robot-jp wiki
ナビゲーションに移動検索に移動8行目: | 8行目: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | | | + | |void beginUpdate () |
+ | :Suspends drawings. | ||
|- | |- | ||
− | | | + | |void clear () |
+ | :Fills the entire canvas with the brush color. | ||
|- | |- | ||
− | | | + | |void copyRect (int sourceX, int sourceY, int destX, int destY, int width, int height) |
+ | :Copies a screen rectangle to the specified position. | ||
|- | |- | ||
− | | | + | |void drawBitmap (int X, int Y, Bitmap const *bitmap) |
+ | :Draws a bitmap at specified position. | ||
|- | |- | ||
− | | | + | |void drawChar (int X, int Y, char c) |
+ | :Draws a character at specified position. | ||
|- | |- | ||
− | | | + | |void drawEllipse (int X, int Y, int width, int height) |
+ | :Draws an ellipse specifying center and size, using current pen color. | ||
|- | |- | ||
− | | | + | |void drawGlyph (int X, int Y, int width, int height, uint8_t const *data, int index=0) |
+ | :Draws a glyph at specified position. | ||
|- | |- | ||
− | | | + | |void drawLine (int X1, int Y1, int X2, int Y2) |
+ | :Draws a line specifying initial and ending coordinates. | ||
|- | |- | ||
− | | | + | |void drawPath (Point const *points, int pointsCount) |
+ | :Draws a sequence of lines. | ||
|- | |- | ||
− | | | + | |void drawRectangle (int X1, int Y1, int X2, int Y2) |
+ | :Draws a rectangle using the current pen color. | ||
|- | |- | ||
− | | | + | |void drawRectangle (Rect const &rect) |
+ | :Draws a rectangle using the current pen color. | ||
|- | |- | ||
− | | | + | |void drawText (int X, int Y, char const *text, bool wrap=false) |
+ | :Draws a string at specified position. | ||
|- | |- | ||
− | | | + | |void drawText (FontInfo const *fontInfo, int X, int Y, char const *text, bool wrap=false) |
+ | :Draws a string at specified position. | ||
|- | |- | ||
− | | | + | |void drawTextFmt (int X, int Y, const char *format,...) |
+ | :Draws formatted text at specified position. | ||
|- | |- | ||
− | | | + | |void drawTextWithEllipsis (FontInfo const *fontInfo, int X, int Y, char const *text, int maxX) |
+ | :Draws a string at specified position. Add ellipses before truncation. | ||
|- | |- | ||
− | | | + | |void endUpdate () |
+ | :Resumes drawings after beginUpdate(). | ||
|- | |- | ||
− | | | + | |void fillEllipse (int X, int Y, int width, int height) |
+ | :Fills an ellipse specifying center and size, using current brush color. | ||
|- | |- | ||
− | | | + | |void fillPath (Point const *points, int pointsCount) |
+ | :Fills the polygon enclosed in a sequence of lines. | ||
|- | |- | ||
− | | | + | |void fillRectangle (int X1, int Y1, int X2, int Y2) |
+ | :Fills a rectangle using the current brush color. | ||
+ | |- | ||
+ | |void fillRectangle (Rect const &rect) | ||
+ | :Fills a rectangle using the current brush color. | ||
+ | |- | ||
+ | |Rect getClippingRect () | ||
+ | :Gets last clipping rectangle set using setClippingRect(). | ||
+ | |- | ||
+ | |FontInfo const * getFontInfo () | ||
+ | :Gets info about currently selected font. | ||
+ | |- | ||
+ | |int getHeight () | ||
+ | :Determines the canvas height in pixels. | ||
+ | |- | ||
+ | |Point getOrigin () | ||
+ | :Gets last origin set using setOrigin(). | ||
+ | |- | ||
+ | |RGB888 getPixel (int X, int Y) | ||
+ | :Reads the pixel at specified position. | ||
+ | |- | ||
+ | |int getWidth () | ||
+ | :Determines the canvas width in pixels. | ||
+ | |- | ||
+ | |void invertRectangle (int X1, int Y1, int X2, int Y2) | ||
+ | :Inverts a rectangle. | ||
+ | |- | ||
+ | |void invertRectangle (Rect const &rect) | ||
+ | :Inverts a rectangle. | ||
+ | |- | ||
+ | |void lineTo (int X, int Y) | ||
+ | :Draws a line starting from current pen position. | ||
+ | |- | ||
+ | |void moveTo (int X, int Y) | ||
+ | :Moves current pen position to the spcified coordinates. | ||
+ | |- | ||
+ | |void reset () | ||
+ | :Resets paint state and other display controller settings. | ||
+ | |- | ||
+ | |void resetGlyphOptions () | ||
+ | :Resets glyph options. | ||
+ | |- | ||
+ | |void resetPaintOptions () | ||
+ | :Resets paint options. | ||
+ | |- | ||
+ | |void scroll (int offsetX, int offsetY) | ||
+ | :Scrolls pixels horizontally and/or vertically. | ||
+ | |- | ||
+ | |void selectFont (FontInfo const *fontInfo) | ||
+ | :Selects a font to use for the next text drawings. | ||
+ | |- | ||
+ | |void setBrushColor (uint8_t red, uint8_t green, uint8_t blue) | ||
+ | :Sets brush (background) color specifying color components. | ||
+ | |- | ||
+ | |void setBrushColor (Color color) | ||
+ | :Sets brush (background) color using a color name. | ||
+ | |- | ||
+ | |void setBrushColor (RGB888 const &color) | ||
+ | :Sets brush (background) color specifying color components. | ||
+ | |- | ||
+ | |void setClippingRect (Rect const &rect) | ||
+ | :Sets clipping rectangle relative to the origin. | ||
+ | |- | ||
+ | |void setGlyphOptions (GlyphOptions options) | ||
+ | :Sets drawing options for the next glyphs. | ||
+ | |- | ||
+ | |void setLineEnds (LineEnds value) | ||
+ | :Sets line ends shape. | ||
+ | |- | ||
+ | |void setOrigin (int X, int Y) | ||
+ | :Sets the axes origin. | ||
+ | |- | ||
+ | |void setOrigin (Point const &origin) | ||
+ | :Sets the axes origin. | ||
+ | |- | ||
+ | |void setPaintOptions (PaintOptions options) | ||
+ | :Sets paint options. | ||
+ | |- | ||
+ | |void setPenColor (uint8_t red, uint8_t green, uint8_t blue) | ||
+ | :Sets pen (foreground) color specifying color components. | ||
+ | |- | ||
+ | |void setPenColor (Color color) | ||
+ | :Sets pen (foreground) color using a color name. | ||
+ | |- | ||
+ | |void setPenColor (RGB888 const &color) | ||
+ | :Sets pen (foreground) color specifying color components. | ||
+ | |- | ||
+ | |void setPenWidth (int value) | ||
+ | :Sets pen width for lines, rectangles and paths. | ||
+ | |- | ||
+ | |void setPixel (int X, int Y) | ||
+ | :Fills a single pixel with the pen color. | ||
+ | |- | ||
+ | |void setPixel (int X, int Y, RGB888 const &color) | ||
+ | :Fills a single pixel with the specified color. | ||
+ | |- | ||
+ | |void setPixel (Point const &pos, RGB888 const &color) | ||
+ | :Fills a single pixel with the specified color. | ||
+ | |- | ||
+ | |void setScrollingRegion (int X1, int Y1, int X2, int Y2) | ||
+ | :Defines the scrolling region. | ||
+ | |- | ||
+ | |void swapBuffers () | ||
+ | :Swaps screen buffer when double buffering is enabled. | ||
+ | |- | ||
+ | |void swapRectangle (int X1, int Y1, int X2, int Y2) | ||
+ | :Swaps pen and brush colors of the specified rectangle. | ||
+ | |- | ||
+ | |int textExtent (FontInfo const *fontInfo, char const *text) | ||
+ | :Calculates text extension in pixels. | ||
+ | |- | ||
+ | |int textExtent (char const *text) | ||
+ | :Calculates text extension in pixels. | ||
+ | |- | ||
+ | |void waitCompletion (bool waitVSync=true) | ||
+ | :Waits for drawing queue to become empty. | ||
|} | |} | ||
2022年3月22日 (火) 22:42時点における版
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)
|
Static Public Attributes
static int queueSize = 1024
|
Detailed Description
ビットマップ表示コントローラーの基本抽象クラスを表します。
- Examples:
- VGA/AnsiTerminal/AnsiTerminal.ino.
Definition at line 737 of file displaycontroller.h.
このクラスのドキュメントは、次のファイルから生成されました。