「App:Library:FabGL:Class:Canvas」の版間の差分

提供: robot-jp wiki
ナビゲーションに移動検索に移動
8行目: 8行目:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
|void beginUpdate ()
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_afb0580e2870f3afd9ae1b1300b1c8e9a.html#afb0580e2870f3afd9ae1b1300b1c8e9a '''beginUpdate'''] ()
 
:Suspends drawings.
 
:Suspends drawings.
 
|-
 
|-
|void clear ()
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ac8bb3912a3ce86b15842e79d0b421204.html#ac8bb3912a3ce86b15842e79d0b421204 '''clear'''] ()
 
:Fills the entire canvas with the brush color.
 
:Fills the entire canvas with the brush color.
 
|-
 
|-
|void copyRect (int sourceX, int sourceY, int destX, int destY, int width, int height)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a2feb78875ca185cbdfd65987f380ef15.html#a2feb78875ca185cbdfd65987f380ef15 '''copyRect'''] (int sourceX, int sourceY, int destX, int destY, int [http://www.fabglib.org/fabutils_8h_ae0ffb42440f0305b6d22a1c6106b6e6f.html#ae0ffb42440f0305b6d22a1c6106b6e6f '''width'''], int [http://www.fabglib.org/fabutils_8h_a777dd66f9609a587ee98ad50de301662.html#a777dd66f9609a587ee98ad50de301662 '''height'''])
 
:Copies a screen rectangle to the specified position.
 
:Copies a screen rectangle to the specified position.
 
|-
 
|-
|void drawBitmap (int X, int Y, Bitmap const *bitmap)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a3447e9b59b69ead99cf3735e1bd18c02.html#a3447e9b59b69ead99cf3735e1bd18c02 '''drawBitmap'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], [http://www.fabglib.org/structfabgl_1_1_bitmap.html '''Bitmap'''] const *bitmap)
 
:Draws a bitmap at specified position.
 
:Draws a bitmap at specified position.
 
|-
 
|-
|void drawChar (int X, int Y, char c)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ace0e4720eb75f05b029c455982653ed2.html#ace0e4720eb75f05b029c455982653ed2 '''drawChar'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], char c)
 
:Draws a character at specified position.
 
:Draws a character at specified position.
 
|-
 
|-
|void drawEllipse (int X, int Y, int width, int height)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a37ccab1d5906bc2facb56457e89ee0bc.html#a37ccab1d5906bc2facb56457e89ee0bc '''drawEllipse'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], int [http://www.fabglib.org/fabutils_8h_ae0ffb42440f0305b6d22a1c6106b6e6f.html#ae0ffb42440f0305b6d22a1c6106b6e6f '''width'''], int [http://www.fabglib.org/fabutils_8h_a777dd66f9609a587ee98ad50de301662.html#a777dd66f9609a587ee98ad50de301662 '''height'''])
 
:Draws an ellipse specifying center and size, using current pen color.
 
: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)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a52cf5628da66f95d0ef2448bdfedf259.html#a52cf5628da66f95d0ef2448bdfedf259 '''drawGlyph'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], int [http://www.fabglib.org/fabutils_8h_ae0ffb42440f0305b6d22a1c6106b6e6f.html#ae0ffb42440f0305b6d22a1c6106b6e6f '''width'''], int [http://www.fabglib.org/fabutils_8h_a777dd66f9609a587ee98ad50de301662.html#a777dd66f9609a587ee98ad50de301662 '''height'''], uint8_t const *[http://www.fabglib.org/displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21 '''data'''], int index=0)
 
:Draws a glyph at specified position.
 
:Draws a glyph at specified position.
 
|-
 
|-
|void drawLine (int X1, int Y1, int X2, int Y2)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ab2ef33259e2223e00963fa402c02b064.html#ab2ef33259e2223e00963fa402c02b064 '''drawLine'''] (int [http://www.fabglib.org/fabutils_8h_a0dd601bb81c34d0e0e1c71e445d8c9ed.html#a0dd601bb81c34d0e0e1c71e445d8c9ed '''X1'''], int [http://www.fabglib.org/fabutils_8h_aefe36b84395404eaeb2fb7bc8dfa9266.html#aefe36b84395404eaeb2fb7bc8dfa9266 '''Y1'''], int [http://www.fabglib.org/fabutils_8h_aacc253365e856de8781b525223af3c52.html#aacc253365e856de8781b525223af3c52 '''X2'''], int [http://www.fabglib.org/fabutils_8h_a3e43b2629ffdaba77fe72f8f70818f07.html#a3e43b2629ffdaba77fe72f8f70818f07 '''Y2'''])
 
:Draws a line specifying initial and ending coordinates.
 
:Draws a line specifying initial and ending coordinates.
 
|-
 
|-
|void drawPath (Point const *points, int pointsCount)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a7a927cc681ff0c452115e08196dd17c5.html#a7a927cc681ff0c452115e08196dd17c5 '''drawPath'''] ([http://www.fabglib.org/structfabgl_1_1_point.html '''Point'''] const *points, int pointsCount)
 
:Draws a sequence of lines.
 
:Draws a sequence of lines.
 
|-
 
|-
|void drawRectangle (int X1, int Y1, int X2, int Y2)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a51745433bb792141ee5e66e9ff5a87e9.html#a51745433bb792141ee5e66e9ff5a87e9 '''drawRectangle'''] (int [http://www.fabglib.org/fabutils_8h_a0dd601bb81c34d0e0e1c71e445d8c9ed.html#a0dd601bb81c34d0e0e1c71e445d8c9ed '''X1'''], int [http://www.fabglib.org/fabutils_8h_aefe36b84395404eaeb2fb7bc8dfa9266.html#aefe36b84395404eaeb2fb7bc8dfa9266 '''Y1'''], int [http://www.fabglib.org/fabutils_8h_aacc253365e856de8781b525223af3c52.html#aacc253365e856de8781b525223af3c52 '''X2'''], int [http://www.fabglib.org/fabutils_8h_a3e43b2629ffdaba77fe72f8f70818f07.html#a3e43b2629ffdaba77fe72f8f70818f07 '''Y2'''])
 
:Draws a rectangle using the current pen color.
 
:Draws a rectangle using the current pen color.
 
|-
 
|-
|void drawRectangle (Rect const &rect)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_aea16684da2a97abb7296f6a44de8ce13.html#aea16684da2a97abb7296f6a44de8ce13 '''drawRectangle'''] ([http://www.fabglib.org/structfabgl_1_1_rect.html '''Rect'''] const &rect)
 
:Draws a rectangle using the current pen color.
 
:Draws a rectangle using the current pen color.
 
|-
 
|-
|void drawText (int X, int Y, char const *text, bool wrap=false)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ad38389073d9198667e74e79bb7f6dba3.html#ad38389073d9198667e74e79bb7f6dba3 '''drawText'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], char const *text, bool wrap=false)
 
:Draws a string at specified position.
 
:Draws a string at specified position.
 
|-
 
|-
|void drawText (FontInfo const *fontInfo, int X, int Y, char const *text, bool wrap=false)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a91c074829fcc23c5dc0a996e86931adf.html#a91c074829fcc23c5dc0a996e86931adf '''drawText'''] (FontInfo const *fontInfo, int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X,'''] int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], char const *text, bool wrap=false)
 
:Draws a string at specified position.
 
:Draws a string at specified position.
 
|-
 
|-
|void drawTextFmt (int X, int Y, const char *format,...)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_adac3e826c16a5abcc9a878b89afb8d86.html#adac3e826c16a5abcc9a878b89afb8d86 '''drawTextFmt'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y,'''] const char *format,...)
 
:Draws formatted text at specified position.
 
:Draws formatted text at specified position.
 
|-
 
|-
|void drawTextWithEllipsis (FontInfo const *fontInfo, int X, int Y, char const *text, int maxX)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a160b74fb568b7c9ee88db25098f7442d.html#a160b74fb568b7c9ee88db25098f7442d '''drawTextWithEllipsis'''] (FontInfo const *fontInfo, int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], char const *text, int maxX)
 
:Draws a string at specified position. Add ellipses before truncation.
 
:Draws a string at specified position. Add ellipses before truncation.
 
|-
 
|-
|void endUpdate ()
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ae75638d96ce77bea32eb76333b76cbc5.html#ae75638d96ce77bea32eb76333b76cbc5 '''endUpdate'''] ()
:Resumes drawings after beginUpdate().
+
:Resumes drawings after [http://www.fabglib.org/classfabgl_1_1_canvas_afb0580e2870f3afd9ae1b1300b1c8e9a.html#afb0580e2870f3afd9ae1b1300b1c8e9a '''beginUpdate''']().
 
|-
 
|-
|void fillEllipse (int X, int Y, int width, int height)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a8180e12aa8ac1265fa642959d1e4ffd2.html#a8180e12aa8ac1265fa642959d1e4ffd2 '''fillEllipse'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], int [http://www.fabglib.org/fabutils_8h_ae0ffb42440f0305b6d22a1c6106b6e6f.html#ae0ffb42440f0305b6d22a1c6106b6e6f '''width'''], int [http://www.fabglib.org/fabutils_8h_a777dd66f9609a587ee98ad50de301662.html#a777dd66f9609a587ee98ad50de301662 '''height'''])
 
:Fills an ellipse specifying center and size, using current brush color.
 
:Fills an ellipse specifying center and size, using current brush color.
 
|-
 
|-
|void fillPath (Point const *points, int pointsCount)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_af4ac807c623677aa49e67f413e1e6e23.html#af4ac807c623677aa49e67f413e1e6e23 '''fillPath'''] ([http://www.fabglib.org/structfabgl_1_1_point.html '''Point'''] const *points, int pointsCount)
 
:Fills the polygon enclosed in a sequence of lines.
 
:Fills the polygon enclosed in a sequence of lines.
 
|-
 
|-
|void fillRectangle (int X1, int Y1, int X2, int Y2)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a02a657b4391aa25216ff993a0569a3c5.html#a02a657b4391aa25216ff993a0569a3c5 '''fillRectangle'''] (int [http://www.fabglib.org/fabutils_8h_a0dd601bb81c34d0e0e1c71e445d8c9ed.html#a0dd601bb81c34d0e0e1c71e445d8c9ed '''X1'''], int [http://www.fabglib.org/fabutils_8h_aefe36b84395404eaeb2fb7bc8dfa9266.html#aefe36b84395404eaeb2fb7bc8dfa9266 '''Y1'''], int [http://www.fabglib.org/fabutils_8h_aacc253365e856de8781b525223af3c52.html#aacc253365e856de8781b525223af3c52 '''X2'''], int [http://www.fabglib.org/fabutils_8h_a3e43b2629ffdaba77fe72f8f70818f07.html#a3e43b2629ffdaba77fe72f8f70818f07 '''Y2'''])
 
:Fills a rectangle using the current brush color.
 
:Fills a rectangle using the current brush color.
 
|-
 
|-
|void fillRectangle (Rect const &rect)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a4ca98d4ae9195ec469544fd39a67fae5.html#a4ca98d4ae9195ec469544fd39a67fae5 '''fillRectangle'''] ([http://www.fabglib.org/structfabgl_1_1_rect.html '''Rect'''] const &rect)
 
:Fills a rectangle using the current brush color.
 
:Fills a rectangle using the current brush color.
 
|-
 
|-
|Rect getClippingRect ()
+
|[http://www.fabglib.org/structfabgl_1_1_rect.html '''Rect'''] [http://www.fabglib.org/classfabgl_1_1_canvas_a5b076ed14a6564a14dbd347cfce3a4e7.html#a5b076ed14a6564a14dbd347cfce3a4e7 '''getClippingRect'''] ()
:Gets last clipping rectangle set using setClippingRect().
+
:Gets last clipping rectangle set using [http://www.fabglib.org/classfabgl_1_1_canvas_a4163959b5395aa1394961e619bea51e4.html#a4163959b5395aa1394961e619bea51e4 '''setClippingRect''']().
 
|-
 
|-
|FontInfo const * getFontInfo ()
+
|FontInfo const * [http://www.fabglib.org/classfabgl_1_1_canvas_af6b9db28d9520b5fa9f41efad16ffd7c.html#af6b9db28d9520b5fa9f41efad16ffd7c '''getFontInfo'''] ()
 
:Gets info about currently selected font.
 
:Gets info about currently selected font.
 
|-
 
|-
|int getHeight ()
+
|int [http://www.fabglib.org/classfabgl_1_1_canvas_a07efb2a4e9a982688c8bb3c3f21d1092.html#a07efb2a4e9a982688c8bb3c3f21d1092 '''getHeight'''] ()
 
:Determines the canvas height in pixels.
 
:Determines the canvas height in pixels.
 
|-
 
|-
|Point getOrigin ()
+
|[http://www.fabglib.org/structfabgl_1_1_point.html '''Point'''] [http://www.fabglib.org/classfabgl_1_1_canvas_a96a5b38870af14b17892861338f5d069.html#a96a5b38870af14b17892861338f5d069 '''getOrigin'''] ()
:Gets last origin set using setOrigin().
+
:Gets last origin set using [http://www.fabglib.org/classfabgl_1_1_canvas_a3ec8e84f102c8ca95207a531d803b945.html#a3ec8e84f102c8ca95207a531d803b945 '''setOrigin''']().
 
|-
 
|-
|RGB888 getPixel (int X, int Y)
+
|[http://www.fabglib.org/structfabgl_1_1_r_g_b888.html '''RGB888'''] [http://www.fabglib.org/classfabgl_1_1_canvas_aa74ddfd1e6c73270086397d907057be3.html#aa74ddfd1e6c73270086397d907057be3 '''getPixel'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''])
 
:Reads the pixel at specified position.
 
:Reads the pixel at specified position.
 
|-
 
|-
|int getWidth ()
+
|int [http://www.fabglib.org/classfabgl_1_1_canvas_a67a0997183f24da19b776d96c1052998.html#a67a0997183f24da19b776d96c1052998 '''getWidth'''] ()
 
:Determines the canvas width in pixels.
 
:Determines the canvas width in pixels.
 
|-
 
|-
|void invertRectangle (int X1, int Y1, int X2, int Y2)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_aa3c3450751dc207a03b0f7f7704964ce.html#aa3c3450751dc207a03b0f7f7704964ce '''invertRectangle'''] (int [http://www.fabglib.org/fabutils_8h_a0dd601bb81c34d0e0e1c71e445d8c9ed.html#a0dd601bb81c34d0e0e1c71e445d8c9ed '''X1'''], int [http://www.fabglib.org/fabutils_8h_aefe36b84395404eaeb2fb7bc8dfa9266.html#aefe36b84395404eaeb2fb7bc8dfa9266 '''Y1'''], int [http://www.fabglib.org/fabutils_8h_aacc253365e856de8781b525223af3c52.html#aacc253365e856de8781b525223af3c52 '''X2'''], int [http://www.fabglib.org/fabutils_8h_a3e43b2629ffdaba77fe72f8f70818f07.html#a3e43b2629ffdaba77fe72f8f70818f07 '''Y2'''])
 
:Inverts a rectangle.
 
:Inverts a rectangle.
 
|-
 
|-
|void invertRectangle (Rect const &rect)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a38cea85584840dbd2149714c1e91ecc5.html#a38cea85584840dbd2149714c1e91ecc5 '''invertRectangle'''] ([http://www.fabglib.org/structfabgl_1_1_rect.html '''Rect'''] const &rect)
 
:Inverts a rectangle.
 
:Inverts a rectangle.
 
|-
 
|-
|void lineTo (int X, int Y)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_adda0fd465e10de29bbb2a9268999b75c.html#adda0fd465e10de29bbb2a9268999b75c '''lineTo'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''])
 
:Draws a line starting from current pen position.
 
:Draws a line starting from current pen position.
 
|-
 
|-
|void moveTo (int X, int Y)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ade8b482e1c154cafa15e6cce34cf4bd7.html#ade8b482e1c154cafa15e6cce34cf4bd7 '''moveTo'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''])
 
:Moves current pen position to the spcified coordinates.
 
:Moves current pen position to the spcified coordinates.
 
|-
 
|-
|void reset ()
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ad20897c5c8bd47f5d4005989bead0e55.html#ad20897c5c8bd47f5d4005989bead0e55 '''reset'''] ()
 
:Resets paint state and other display controller settings.
 
:Resets paint state and other display controller settings.
 
|-
 
|-
|void resetGlyphOptions ()
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ad20d1b20527338e032925d68bda2d517.html#ad20d1b20527338e032925d68bda2d517 '''resetGlyphOptions'''] ()
 
:Resets glyph options.
 
:Resets glyph options.
 
|-
 
|-
|void resetPaintOptions ()
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_acabff55d9d5166f90791a200ca929a1c.html#acabff55d9d5166f90791a200ca929a1c '''resetPaintOptions'''] ()
 
:Resets paint options.
 
:Resets paint options.
 
|-
 
|-
|void scroll (int offsetX, int offsetY)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_adf5beb564841faac78a85c72ba79d845.html#adf5beb564841faac78a85c72ba79d845 '''scroll'''] (int offsetX, int offsetY)
 
:Scrolls pixels horizontally and/or vertically.
 
:Scrolls pixels horizontally and/or vertically.
 
|-
 
|-
|void selectFont (FontInfo const *fontInfo)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_aed37132c2af1db5b21e26ed664d0c758.html#aed37132c2af1db5b21e26ed664d0c758 '''selectFont'''] (FontInfo const *fontInfo)
 
:Selects a font to use for the next text drawings.
 
:Selects a font to use for the next text drawings.
 
|-
 
|-
|void setBrushColor (uint8_t red, uint8_t green, uint8_t blue)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a833ec1b3a2cf47aa9fbf862b2136f2a2.html#a833ec1b3a2cf47aa9fbf862b2136f2a2 '''setBrushColor'''] (uint8_t red, uint8_t green, uint8_t blue)
 
:Sets brush (background) color specifying color components.
 
:Sets brush (background) color specifying color components.
 
|-
 
|-
|void setBrushColor (Color color)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_aa41770bb840adfd5cc6d0365b2d5eac0.html#aa41770bb840adfd5cc6d0365b2d5eac0 '''setBrushColor'''] ([http://www.fabglib.org/group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#gab87bacfdad76e61b9412d7124be44c1c '''Color'''] color)
 
:Sets brush (background) color using a color name.
 
:Sets brush (background) color using a color name.
 
|-
 
|-
|void setBrushColor (RGB888 const &color)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a779ab3ce2809871f7e453a9f5276c3a6.html#a779ab3ce2809871f7e453a9f5276c3a6 '''setBrushColor'''] ([http://www.fabglib.org/structfabgl_1_1_r_g_b888.html '''RGB888'''] const &color)
 
:Sets brush (background) color specifying color components.
 
:Sets brush (background) color specifying color components.
 
|-
 
|-
|void setClippingRect (Rect const &rect)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a4163959b5395aa1394961e619bea51e4.html#a4163959b5395aa1394961e619bea51e4 '''setClippingRect'''] ([http://www.fabglib.org/structfabgl_1_1_rect.html '''Rect'''] const &rect)
 
:Sets clipping rectangle relative to the origin.
 
:Sets clipping rectangle relative to the origin.
 
|-
 
|-
|void setGlyphOptions (GlyphOptions options)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_adfb8897a6be8008318aa02ab10f407f5.html#adfb8897a6be8008318aa02ab10f407f5 '''setGlyphOptions'''] ([http://www.fabglib.org/unionfabgl_1_1_glyph_options.html '''GlyphOptions'''] options)
 
:Sets drawing options for the next glyphs.
 
:Sets drawing options for the next glyphs.
 
|-
 
|-
|void setLineEnds (LineEnds value)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_af9e6a083d810f5ac805cd6ae8e077756.html#af9e6a083d810f5ac805cd6ae8e077756 '''setLineEnds'''] ([http://www.fabglib.org/group___enumerations_ga8ac9813c9c9df8a1e7f6ec66b346f08e.html#ga8ac9813c9c9df8a1e7f6ec66b346f08e '''LineEnds'''] value)
 
:Sets line ends shape.
 
:Sets line ends shape.
 
|-
 
|-
|void setOrigin (int X, int Y)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a3ec8e84f102c8ca95207a531d803b945.html#a3ec8e84f102c8ca95207a531d803b945 '''setOrigin'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''])
 
:Sets the axes origin.
 
:Sets the axes origin.
 
|-
 
|-
|void setOrigin (Point const &origin)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_aadd462af52040f869b0cbf29a85036dc.html#aadd462af52040f869b0cbf29a85036dc '''setOrigin'''] ([http://www.fabglib.org/structfabgl_1_1_point.html '''Point'''] const &origin)
 
:Sets the axes origin.
 
:Sets the axes origin.
 
|-
 
|-
|void setPaintOptions (PaintOptions options)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a3baa6299618be4d828b473893b50a9f1.html#a3baa6299618be4d828b473893b50a9f1 '''setPaintOptions'''] ([http://www.fabglib.org/structfabgl_1_1_paint_options.html '''PaintOptions'''] options)
 
:Sets paint options.
 
:Sets paint options.
 
|-
 
|-
|void setPenColor (uint8_t red, uint8_t green, uint8_t blue)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ac130486f79bd6cefa1bd8f33c5e5cbed.html#ac130486f79bd6cefa1bd8f33c5e5cbed '''setPenColor'''] (uint8_t red, uint8_t green, uint8_t blue)
 
:Sets pen (foreground) color specifying color components.
 
:Sets pen (foreground) color specifying color components.
 
|-
 
|-
|void setPenColor (Color color)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a2e49d466fe35b97e803dee52232a2367.html#a2e49d466fe35b97e803dee52232a2367 '''setPenColor'''] ([http://www.fabglib.org/group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#gab87bacfdad76e61b9412d7124be44c1c '''Color'''] color)
 
:Sets pen (foreground) color using a color name.
 
:Sets pen (foreground) color using a color name.
 
|-
 
|-
|void setPenColor (RGB888 const &color)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a885b0713006e7460297321b4ba317539.html#a885b0713006e7460297321b4ba317539 '''setPenColor'''] ([http://www.fabglib.org/structfabgl_1_1_r_g_b888.html '''RGB888'''] const &color)
 
:Sets pen (foreground) color specifying color components.
 
:Sets pen (foreground) color specifying color components.
 
|-
 
|-
|void setPenWidth (int value)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a43079b89e73581496cdf7623d1fb48c2.html#a43079b89e73581496cdf7623d1fb48c2 '''setPenWidth'''] (int value)
 
:Sets pen width for lines, rectangles and paths.
 
:Sets pen width for lines, rectangles and paths.
 
|-
 
|-
|void setPixel (int X, int Y)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_a3192f783a37fbc936429e81e829ac61e.html#a3192f783a37fbc936429e81e829ac61e '''setPixel'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''])
 
:Fills a single pixel with the pen color.
 
:Fills a single pixel with the pen color.
 
|-
 
|-
|void setPixel (int X, int Y, RGB888 const &color)
+
|void [http://www.fabglib.org/classfabgl_1_1_canvas_ae7e102599ba43b159d2ab11c8932f077.html#ae7e102599ba43b159d2ab11c8932f077 '''setPixel'''] (int [http://www.fabglib.org/fabutils_8h_aa6aba27bc1a89db9e350b50bbf881f57.html#aa6aba27bc1a89db9e350b50bbf881f57 '''X'''], int [http://www.fabglib.org/fabutils_8h_abe4637362df8e341470401813999dd17.html#abe4637362df8e341470401813999dd17 '''Y'''], [http://www.fabglib.org/structfabgl_1_1_r_g_b888.html '''RGB888'''] const &color)
 
:Fills a single pixel with the specified color.
 
:Fills a single pixel with the specified color.
 
|-
 
|-
185行目: 185行目:
  
 
This class interfaces directly to the display controller and provides a set of primitives to paint lines, circles, etc. and to scroll regions, copy rectangles and draw glyphs.
 
This class interfaces directly to the display controller and provides a set of primitives to paint lines, circles, etc. and to scroll regions, copy rectangles and draw glyphs.
For default origin is at the top left, starting from (0, 0) up to (Canvas Width - 1, Canvas Height - 1).
+
For default origin is at the top left, starting from (0, 0) up to ([http://www.fabglib.org/classfabgl_1_1_canvas.html '''Canvas'''] Width - 1, [http://www.fabglib.org/classfabgl_1_1_canvas.html '''Canvas'''] Height - 1).
  
 
Example:
 
Example:
210行目: 210行目:
  
 
; '''Examples:'''
 
; '''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.
+
: [http://www.fabglib.org/_s_t7789__t_f_t_2240x240_2_double_buffer_2_double_buffer_8ino-example.html#_a1 '''ST7789_TFT/240x240/DoubleBuffer/DoubleBuffer.ino'''], [http://www.fabglib.org/_v_g_a_2_classic_racer_2_classic_racer_8ino-example.html#_a1 '''VGA/ClassicRacer/ClassicRacer.ino'''], [http://www.fabglib.org/_v_g_a_2_double_buffer_2_double_buffer_8ino-example.html#_a1 '''VGA/DoubleBuffer/DoubleBuffer.ino'''], [http://www.fabglib.org/_v_g_a_2_mouse_on_screen_2_mouse_on_screen_8ino-example.html#_a1 '''VGA/MouseOnScreen/MouseOnScreen.ino'''], [http://www.fabglib.org/_v_g_a_2_songs_2_songs_8ino-example.html#_a1 '''VGA/Songs/Songs.ino'''], and [http://www.fabglib.org/_v_g_a_2_space_invaders_2_space_invaders_8ino-example.html#_a1 '''VGA/SpaceInvaders/SpaceInvaders.ino'''].
 +
:
  
 
[http://www.fabglib.org/canvas_8h_source.html#l00070 '''Definition at line 70 of file canvas.h'''].
 
[http://www.fabglib.org/canvas_8h_source.html#l00070 '''Definition at line 70 of file canvas.h'''].
 
----このクラスのドキュメントは、次のファイルから生成されました。
 
----このクラスのドキュメントは、次のファイルから生成されました。
  
* [http://www.fabglib.org/displaycontroller_8h_source.html '''displaycontroller.h''']
+
* [http://www.fabglib.org/canvas_8h_source.html '''canvas.h''']
* [http://www.fabglib.org/displaycontroller_8cpp_source.html '''displaycontroller.cpp''']
+
* [http://www.fabglib.org/canvas_8cpp_source.html '''canvas.cpp''']
 +
 
  
  
  
 
----[https://robot-jp.com/wiki/index.php/App:Library:FabGL:Class_List 戻る]
 
----[https://robot-jp.com/wiki/index.php/App:Library:FabGL:Class_List 戻る]

2022年3月22日 (火) 23:34時点における版

class Canvas

一連の描画メソッドを持つクラス。

#include <canvas.h>

Public Member Functions

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.

Detailed Description

A class with a set of drawing methods.

This class interfaces directly to the display controller and provides a set of primitives to paint lines, circles, etc. and to scroll regions, copy rectangles and draw glyphs. For default origin is at the top left, starting from (0, 0) up to (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);


// Paint a green rectangle with red border

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.


このクラスのドキュメントは、次のファイルから生成されました。




戻る