TouchGFX + 0/3 examples
CodeScope will show references to touchgfx::Canvas from the following samples and libraries:
Examples
STM32469I-Discovery
Demonstrations
STM32469I_EVAL
Demonstrations
STM324x9I_EVAL
Demonstrations
 
Symbols
loading...
Files
loading...

touchgfx::Canvas class

@class Canvas Canvas.hpp touchgfx/widgets/canvas/Canvas.hpp Class for easy rendering using CanvasWidgetRenderer. The Canvas class will make implementation of a new CanvasWidget very easy. The few simple primitives allows moving a "pen" and drawing the outline of a shape which can then be rendered. The Canvas class has been optimized to eliminate drawing unnecessary lines above and below the currently invalidated rectangle. This was chosen because CanvasWidgetRenderer works with horizontal scan lines, and eliminating unnecessary lines on the left and right does result in as good optimizations, and in some cases (as e.g. Circle) work against the desired (and expected) optimization.

Syntax

class Canvas { public:     Canvas(const CanvasWidget* _widget, const Rect& invalidatedArea);     virtual ~Canvas();     void moveTo(CWRUtil::Q5 x, CWRUtil::Q5 y);     void lineTo(CWRUtil::Q5 x, CWRUtil::Q5 y);     template <typename T>     void moveTo(T x, T y)     {         moveTo(CWRUtil::toQ5<T>(x), CWRUtil::toQ5<T>(y));     }     template <typename T>     void lineTo(T x, T y)     {         lineTo(CWRUtil::toQ5<T>(x), CWRUtil::toQ5<T>(y));     }     bool render(); private:     const CanvasWidget* widget;     CWRUtil::Q5 invalidatedAreaX;     CWRUtil::Q5 invalidatedAreaY;     CWRUtil::Q5 invalidatedAreaWidth;     CWRUtil::Q5 invalidatedAreaHeight;     RenderingBuffer rbuf;     Rasterizer ras;     int16_t offsetX, offsetY;     bool enoughMemory;     bool penUp, penHasBeenDown;     CWRUtil::Q5 previousX, previousY;     uint8_t previousOutside;     uint8_t penDownOutside;     CWRUtil::Q5 initialX, initialY;     enum     {         POINT_IS_ABOVE = 1 << 0,         POINT_IS_BELOW = 1 << 1,         POINT_IS_LEFT = 1 << 2,         POINT_IS_RIGHT = 1 << 3     };     uint8_t isOutside(const CWRUtil::Q5& x, const CWRUtil::Q5& y, const CWRUtil::Q5& width, const CWRUtil::Q5& height) const;     void transformFrameBufferToDisplay(CWRUtil::Q5& x, CWRUtil::Q5& y) const;     void close(); };

Fields

widget

No summary provided. Read more...

invalidatedAreaX

No summary provided. Read more...

invalidatedAreaY

No summary provided. Read more...

invalidatedAreaWidth

No summary provided. Read more...

invalidatedAreaHeight

No summary provided. Read more...

rbuf

No summary provided. Read more...

ras

No summary provided. Read more...

offsetX

No summary provided. Read more...

offsetY

No summary provided. Read more...

enoughMemory

No summary provided. Read more...

penUp

No summary provided. Read more...

penHasBeenDown

No summary provided. Read more...

previousX

No summary provided. Read more...

previousY

No summary provided. Read more...

previousOutside

No summary provided. Read more...

penDownOutside

No summary provided. Read more...

initialX

No summary provided. Read more...

initialY

No summary provided. Read more...

Methods

moveTo()

No summary provided. Read more...

lineTo()

No summary provided. Read more...

moveTo()

No summary provided. Read more...

lineTo()

No summary provided. Read more...

render()

@fn bool Canvas::render(); Render the drawn shape. Render the graphical shape drawn (using moveTo() and lineTo()) using the widgets Painter. The shape is automatically closed, i.e. a lineTo() is automatically inserted connecting the current pen position with the initial pen position given in the previous moveTo() command. Read more...

isOutside() const

No summary provided. Read more...

transformFrameBufferToDisplay() const

@fn void Canvas::transformFrameBufferToDisplay(CWRUtil::Q5& x, CWRUtil::Q5& y) const; Transform frame buffer coordinates to display coordinates. Transform frame buffer coordinates to display coordinates for Q5 coordinates. @see DisplayTransformation::transformFrameBufferToDisplay(). Read more...

close()

@fn void Canvas::close() Closes the path being drawn. Closes the path being drawn using moveTo and lineTo. Read more...

Examples

touchgfx::Canvas is referenced by 3 libraries and example projects.