Manual PDF
Manual PDF
0 User’s Manual
www.st.com
www.touchgfx.com
Contents
1 Changelog 1
2 Globals 17
3 Namespace Index 19
3.1 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Hierarchical Index 21
4.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5 Class Index 27
5.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6 Namespace Documentation 35
6.1 touchgfx Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.1.1 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1.1.1 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1.1.2 EasingEquation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1.1.3 RenderingVariant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1.1.4 TextDirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1.2.1 BlitOperations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1.2.2 Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.1.2.3 DisplayOrientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.1.2.4 DisplayRotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.1.2.5 FrameBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.1.2.6 GlyphFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.1.2.7 Gradient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.1.2.8 TextRotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.1.2.9 WideTextAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.1.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.1.3.1 abs() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.1.3.2 ceil28_4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
iv CONTENTS
6.1.3.3 clz() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.1.3.4 finalizeTransition() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.1.3.5 fixed28_4Mul() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.1.3.6 fixed28_4ToFloat() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.1.3.7 floatToFixed16_16() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.1.3.8 floatToFixed28_4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.1.3.9 floorDivMod() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.1.3.10 gcd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.1.3.11 hw_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.1.3.12 LCD2getPixel() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.1.3.13 LCD2getPixel() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.1.3.14 LCD2setPixel() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.1.3.15 LCD2setPixel() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.3.16 LCD2shiftVal() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.3.17 LCD4getPixel() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.3.18 LCD4getPixel() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1.3.19 LCD4setPixel() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.1.3.20 LCD4setPixel() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.1.3.21 lookupBilinearRenderVariant() . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.1.3.22 lookupNearestNeighborRenderVariant() . . . . . . . . . . . . . . . . . . . . . . 57
6.1.3.23 makeTransition() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.1.3.24 memset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.1.3.25 muldiv() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.1.3.26 operator∗() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.1.3.27 operator∗() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.1.3.28 prepareTransition() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.1.3.29 touchgfx_generic_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.1.3.30 touchgfx_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.1.4 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.1.4.1 TYPED_TEXT_INVALID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7 Class Documentation 63
7.1 AbstractButton Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.1.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.1.2.1 AbstractButton() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.1.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.1.3.1 getPressedState() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.1.3.2 getType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.1.3.3 handleClickEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.1.3.4 setAction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7.2 AbstractButtonContainer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.2.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.2.2.1 getAlpha() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.2.2.2 getPressed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.2.2.3 setAction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.2.2.4 setAlpha() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.2.2.5 setPressed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.3 AbstractClock Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.3.1 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.3.1.1 AbstractClock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.3.1.2 ∼AbstractClock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.3.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.3.2.1 getCurrentHour() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.3.2.2 getCurrentMinute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.3.2.3 getCurrentSecond() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.3.2.4 setTime12Hour() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.3.2.5 setTime24Hour() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.3.2.6 updateClock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.4 AbstractDirectionProgress Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.4.2 Member Enumeration Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.4.2.1 DirectionType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.4.3 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.4.3.1 AbstractDirectionProgress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.4.3.2 ∼AbstractDirectionProgress() . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.4.4 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.4.4.1 getDirection() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.4.4.2 setDirection() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.5 AbstractPainter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5.2.1 AbstractPainter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5.2.2 ∼AbstractPainter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5.3.1 render() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.5.3.2 setOffset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
7.5.3.3 setWidgetAlpha() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
7.6 AbstractPainterBW Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
7.103.2.12nextPixel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
7.104LCD4bpp Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
7.104.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
7.104.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
7.104.2.1 bitDepth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
7.104.2.2 blitCopy() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
7.104.2.3 blitCopy() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
7.104.2.4 blitCopyAlphaPerPixel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
7.104.2.5 copyFrameBufferRegionToMemory() . . . . . . . . . . . . . . . . . . . . . . . 440
7.104.2.6 drawGlyph() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.104.2.7 drawPartialBitmap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.104.2.8 drawTextureMapScanLine() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
7.104.2.9 fillRect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
7.104.2.10init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
7.104.2.11nextLine() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
7.104.2.12nextPixel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
7.105LED Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
7.105.1 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
7.105.1.1 get() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
7.105.1.2 init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
7.105.1.3 off() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
7.105.1.4 on() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
7.105.1.5 toggle() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
7.106Line Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
7.106.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
7.106.2 Member Enumeration Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
7.106.2.1 LINE_ENDING_STYLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
7.106.3 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
7.106.3.1 Line() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
7.106.4 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
7.106.4.1 drawCanvasWidget() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
7.106.4.2 getEnd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
7.106.4.3 getLineEndingStyle() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
7.106.4.4 getLineWidth() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
7.106.4.5 getLineWidth() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
7.106.4.6 getMinimalRect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
7.106.4.7 getStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
7.106.4.8 setCapPrecision() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
7.106.4.9 setEnd() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
7.106.4.10setEnd() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
7.106.4.11setLine() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
7.106.4.12setLineEndingStyle() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
7.106.4.13setLineWidth() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
7.106.4.14setLineWidth() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
7.106.4.15setStart() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
7.106.4.16setStart() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
7.106.4.17updateEnd() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
7.106.4.18updateEnd() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
7.106.4.19updateLineWidth() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
7.106.4.20updateLineWidth() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
7.106.4.21updateStart() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
7.106.4.22updateStart() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
7.107LineProgress Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
7.107.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
7.107.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
7.107.2.1 LineProgress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
7.107.2.2 ∼LineProgress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
7.107.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
7.107.3.1 getAlpha() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
7.107.3.2 getEnd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
7.107.3.3 getLineEndingStyle() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
7.107.3.4 getLineWidth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
7.107.3.5 getStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
7.107.3.6 setAlpha() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
7.107.3.7 setEnd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
7.107.3.8 setLineEndingStyle() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
7.107.3.9 setLineWidth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
7.107.3.10setPainter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
7.107.3.11setProgressIndicatorPosition() . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
7.107.3.12setStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
7.107.3.13setValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
7.108ListLayout Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
7.108.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
7.108.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
7.108.2.1 ListLayout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
7.108.2.2 ∼ListLayout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
7.108.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
7.108.3.1 add() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
7.108.3.2 getDirection() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
7.108.3.3 getType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
7.153.3.15startSMOC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
7.153.3.16tearDownScreen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
7.153.3.17useSMOCDrawing() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
7.153.3.18usingSMOC() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
7.154ScrollableContainer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
7.154.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
7.154.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
7.154.2.1 ScrollableContainer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
7.154.2.2 ∼ScrollableContainer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
7.154.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
7.154.3.1 add() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
7.154.3.2 childGeometryChanged() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
7.154.3.3 doScroll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
7.154.3.4 enableHorizontalScroll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
7.154.3.5 enableVerticalScroll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
7.154.3.6 getContainedArea() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
7.154.3.7 getLastChild() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
7.154.3.8 getScrolledX() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
7.154.3.9 getScrolledY() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
7.154.3.10getType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
7.154.3.11getXBorder() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
7.154.3.12getXScrollbar() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
7.154.3.13getYBorder() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
7.154.3.14getYScrollbar() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
7.154.3.15handleClickEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
7.154.3.16handleDragEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
7.154.3.17handleGestureEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
7.154.3.18handleTickEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
7.154.3.19invalidateScrollbars() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
7.154.3.20isScrollableXY() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
7.154.3.21moveChildrenRelative() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
7.154.3.22reset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
7.154.3.23setMaxVelocity() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
7.154.3.24setScrollbarPadding() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
7.154.3.25setScrollbarsAlpha() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
7.154.3.26setScrollbarsColor() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
7.154.3.27setScrollbarsPermanentlyVisible() . . . . . . . . . . . . . . . . . . . . . . . . . 606
7.154.3.28setScrollbarsVisible() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
7.154.3.29setScrollbarWidth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
7.154.3.30setScrollThreshold() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
7.155.4.33setItemPressedCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
7.155.4.34setItemSelectedCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
7.155.4.35setMaxSwipeItems() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
7.155.4.36setNumberOfItems() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
7.155.4.37setOffset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
7.155.4.38setSwipeAcceleration() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
7.155.4.39setWidth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
7.155.4.40stopAnimation() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
7.156ScrollList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
7.156.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
7.156.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
7.156.2.1 ScrollList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
7.156.2.2 ∼ScrollList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
7.156.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
7.156.3.1 getItem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
7.156.3.2 getNearestAlignedOffset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
7.156.3.3 getPaddingAfter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
7.156.3.4 getPaddingBefore() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
7.156.3.5 getPositionForItem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
7.156.3.6 getSnapping() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
7.156.3.7 handleClickEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
7.156.3.8 keepOffsetInsideLimits() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
7.156.3.9 setDrawables() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
7.156.3.10setPadding() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
7.156.3.11setSnapping() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
7.156.3.12setWindowSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
7.157ScrollWheel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
7.157.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
7.157.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
7.157.2.1 ScrollWheel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
7.157.2.2 ∼ScrollWheel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
7.157.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
7.157.3.1 setDrawables() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
7.158ScrollWheelBase Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
7.158.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
7.158.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
7.158.2.1 ScrollWheelBase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
7.158.2.2 ∼ScrollWheelBase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
7.158.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
7.158.3.1 animateToPosition() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
7.164.2.20remove() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
7.164.2.21resetExpandedStateTimer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
7.164.2.22setAnimationDuration() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
7.164.2.23setAnimationEasingEquation() . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
7.164.2.24setExpandDirection() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
7.164.2.25setExpandedStateTimeout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
7.164.2.26setHiddenPixelsWhenExpanded() . . . . . . . . . . . . . . . . . . . . . . . . . 655
7.164.2.27setState() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
7.164.2.28setStateChangedAnimationEndedCallback() . . . . . . . . . . . . . . . . . . . 655
7.164.2.29setStateChangedCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
7.164.2.30setup() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
7.164.2.31setup() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
7.164.2.32setVisiblePixelsWhenCollapsed() . . . . . . . . . . . . . . . . . . . . . . . . . 657
7.164.2.33stateChangeButtonClickedHandler() . . . . . . . . . . . . . . . . . . . . . . . . 657
7.165Slider Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
7.165.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
7.165.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
7.165.2.1 Slider() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
7.165.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
7.165.3.1 getIndicatorMax() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
7.165.3.2 getIndicatorMin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
7.165.3.3 getIndicatorPositionRangeSize() . . . . . . . . . . . . . . . . . . . . . . . . . . 660
7.165.3.4 getIndicatorRadius() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
7.165.3.5 getMaxValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
7.165.3.6 getMinValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
7.165.3.7 getType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
7.165.3.8 getValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
7.165.3.9 getValueRangeSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
7.165.3.10handleClickEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
7.165.3.11handleDragEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
7.165.3.12positionToValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
7.165.3.13setBitmaps() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
7.165.3.14setBitmaps() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
7.165.3.15setNewValueCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
7.165.3.16setStartValueCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
7.165.3.17setStopValueCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
7.165.3.18setupHorizontalSlider() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
7.165.3.19setupVerticalSlider() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
7.165.3.20setValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
7.165.3.21setValueRange() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
7.171.3.17setColor() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
7.171.3.18setIndentation() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
7.171.3.19setLinespacing() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
7.171.3.20setRotation() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
7.171.3.21setTypedText() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
7.171.3.22setWideTextAction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
7.171.3.23setXBaselineY() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
7.172TextAreaWithOneWildcard Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
7.172.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
7.172.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
7.172.2.1 TextAreaWithOneWildcard() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
7.172.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
7.172.3.1 draw() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
7.172.3.2 getTextHeight() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
7.172.3.3 getTextWidth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
7.172.3.4 getType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
7.172.3.5 getWildcard() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
7.172.3.6 setWildcard() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
7.173TextAreaWithTwoWildcards Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
7.173.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
7.173.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
7.173.2.1 TextAreaWithTwoWildcards() . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
7.173.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
7.173.3.1 draw() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
7.173.3.2 getTextHeight() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
7.173.3.3 getTextWidth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
7.173.3.4 getType() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
7.173.3.5 getWildcard1() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
7.173.3.6 getWildcard2() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
7.173.3.7 setWildcard1() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
7.173.3.8 setWildcard2() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
7.174TextAreaWithWildcardBase Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
7.174.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
7.174.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
7.174.2.1 TextAreaWithWildcardBase() . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
7.174.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
7.174.3.1 calculateTextHeight() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
7.175TextButtonStyle< T > Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 696
7.175.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
7.175.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
Index 788
Changelog
4.10.0
======
* Requirements:
* TouchGFX is now only available for STM32 microcontrollers.
4.9.4
=====
* Bugfixes:
* Reduced the time it takes to load an application in the Designer.
4.9.3
=====
* Bugfixes:
* Designer now uses default Windows proxy settings.
* Package manager updates available packages when online.
* Improved error description when offline.
* Set text interaction works with resource texts.
* Project updater updates MSVS projects with correct image formats.
* Text size calculated wrongly in Designer in rare occasions.
* Recent files ordered by date.
* Corrected initialization of counter in Wait For interaction.
* Fixed drawing of child elements in list layout, when resized.
* Fixed loading of application with list layout widgets.
* .otf font files now correctly rendered.
* Dragging containers could in rare cases introduce wrong coordinates.
* Fixed zero termination of wildcard text buffers.
* Button With Label text rendering correction.
* tgfx.exe packager works for more complex file layouts.
* Source code included for containers.
* Additional minor Designer UI fixes and improvements.
4.9.2
=====
* Bugfixes:
* Fixed Designer issue where dragging elements on the canvas would
in some cases cause an exception.
4.9.1
=====
* Bugfixes:
* Fixed several Designer issues with TextArea widgets when placed
inside containers.
* Fixed an issue with interactions triggered by "Another interaction
is done" dissappearing when loading a project.
* On PCs with certain security policy configurations, the Designer
was not able to create new projects correctly.
* Improved error handling in Designer if the asset generation, code
compilation or post generation commands fail.
* Fixed an issue where the TouchgfxPath in Designer project files
was not interpreted correctly.
* Some typography changes in Designer did not cause new code to be
generated.
* Fixed issue with ImageConverter when assets folder was under svn
control.
* ImageConverter could in certain cases fail to detect changes in
assets.
4.9.0
=====
* New Features:
* Added a package manager for handling board support packages, demos
and examples. The Designer will now fetch these from an online
repository. Read more about this feature here:
https://touchgfx.zendesk.com/hc/en-us/articles/115002589211
* All the old examples, demos and ports for various boards have been
removed from the framework, and are now available as packages
instead.
* Substantially improved text handling in the Designer. It is now
possible to work with translations and wildcards in the Designer,
so it should no longer be necessary to edit the texts.xlsx file
manually.
* Designer is now much more flexible regarding application file
structure, and is now able to auto-update IAR and Keil IDE
projects regardless of file location.
* Added Designer support for the ScrollableContainer and ListLayout
widgets.
* Added support for the SW4STM32 IDE.
* Added support for version 8.10 of IAR Embedded Workbench.
* Image converter now has an option to operate on folders, instead
of being invoked once per .png file. This substantially speeds up
the process of converting images. This mode is the default
behavior for new projects.
* The GNU Arm Embedded toolchain (GCC cross-compiler) has been
updated to version 6-2017-q2-update (gcc version 6.3.1).
* The GNU compiler for the PC simulator has been updated to version
6.3.0.
* Added gcc core libs compiled with -mfloat-abi=hard for Cortex-M4f
and Cortex-M7.
* Increased number of widgets that can be registered as timer
widgets from 24 to 32. Also added functions for obtaining
information about which widgets are currently registered.
* Bugfixes:
* AnimationTextureMapper::cancelMoveAnimation() is renamed to
cancelAnimationTextureMapperAnimation() to avoid problems with
MoveAnimator::cancelMoveAnimation().
* Fixed bug in PainterRGB565Bitmap when rendering solid pixels from
an ARGB8888 Bitmap.
* Fixed rare bug in FontConvert if all used characters are missing
from the font.
* Fixed unitialized variables in the DMA class.
* Update procedure:
* For this release additional steps might be needed. Please refer to
the Known Issues article for details:
https://touchgfx.zendesk.com/hc/en-us/articles/207507415
4.8.0
=====
* Performance
* LCD4bpp now draws characters up to 15% faster.
* Canvas widgets now render slightly faster in certain situations.
* New Features:
* TouchGFX Designer released. The core framework, Designer and
environment shell are now bundled in a single installation.
To get started with the Designer, please see
https://touchgfx.zendesk.com/hc/en-us/articles/115001801745
* Support for Farsi and Arabic ligatures where squences of up to
three character are recognized.
* Added support for Microsoft Visual Studio 2017.
* TextArea and TextAreaWithWildcard(s) now support
setWideTextAction() to automatically break lines and insert
ellipsis at end of line, when the line is too long.
* Added getter functions to Slider.
* MoveAnimator and FadeAnimator can now clear the callback
set for animation ended.
* Errors from ImageConvert, TextConvert and FontConvert are now
shown in the Error List window of Visual Studio.
* Simulator applications are now Windows programs instead of Console
programs. To use printf() or std::out, please see
https://touchgfx.zendesk.com/hc/en-us/articles/205074511-Tips-tricks
* Bugfixes
* AbstractShape::updateAbstractShapeCache() is now a public function
and should be called after one or more calls to
AbstractShape::setCorner(), to ensure shape is correct.
* Simulator window can no longer be unintentionally resized.
* F2 to highlight invalidated areas now works with old HALSDL.
* PainterGRAY2Bitmap, PainterGRAY4Bitmap, PainterRGB565Bitmap and
PainterRGB888Bitmap all failed to validate that painting was
inside the size of the bitmap in some situations.
* HALSDL2 (simulator) now uses 24bpp on screen to make colors in
screenshots correct.
* TiledImage::setOffset() now handles an empty bitmap correctly.
* TiledImage::getSolidRect() would sometimes report wrong rect.
* If text in a TextArea was rotated, resizeToCurrentText() and
resizeHeightToCurrentText() would swap the width/height.
* Function getTextHeight() would not take line spacing into
account. Functions like resizeToCurrentText() and others that use
the getTextHeight() function would not resize correctly.
* SlideMenu::setState() did not handle EXPANDED state correctly.
* Update Procedure
* Due to the addition of TouchGFX Designer, installation is now
done via an .msi installer. For details and manual installation
refer to https://touchgfx.zendesk.com/hc/en-us/articles/206819819
* Compatible with existing 4.x applications and HAL ports.
4.7.0
=====
* New Features:
* Source code for all the standard widgets and containers is now
included. See the touchgfx/framework/source/touchgfx directory.
Note that these classes are still present in the core library, and
the source code files are not added to the IAR/Keil/gcc projects
per default. For details, see the following article:
https://touchgfx.zendesk.com/hc/en-us/articles/115000035825
* Optimized the handling of single frame buffer configuration on TFT
controller based platforms, which in many cases eliminate the need
for external RAM. For details on this feature, and how to enable
it please see the following article:
https://touchgfx.zendesk.com/hc/en-us/articles/203649441
* Substantial performance optimizations of the canvas widget system
and all the standard painters. Expect a very significant increase
in performance if many pixels are being drawn, and a smaller
increase in performance for minor shapes (e.g. graph lines). The
"PainterVerticalAlpha" used in our demos have also been
updated. If you are using custom painters please refer to the
Known Issues article:
https://touchgfx.zendesk.com/hc/en-us/articles/207507415
* The text converter tool will now combine identical translations
across all languages, resulting in reduced footprint. The result
of this process will be printed during asset generation.
NOTE: This behavior is enabled by default. If you have an existing
project where you manipulate the text data structures (e.g. load a
single language into RAM), this optimization might break your
code. The optimization can be disabled by adding the following
remap_identical_texts := no (for "make"-based generation)
<RemapIdenticalTexts>no</RemapIdenticalTexts> (for MSVS)
* Updated SDL version used by simulator from 1.2 to 2.0.4. SDL1.2 is
still present in the distribution, but all examples and projects
now use SDL2. For more details, please see:
https://touchgfx.zendesk.com/hc/en-us/articles/115000011245
* Support for skinning the simulator with .png files. If the .png
files contain non-opaque areas, the simulator window will be
shaped accordingly. See display_orientation_example for a code
example or read the following article:
https://touchgfx.zendesk.com/hc/en-us/articles/115000014669
* On ST targets with Chrom-ART, the Box widget will now be drawn by
DMA even when alpha < 255 (BLIT_OP_FILL_WITH_ALPHA support).
* TextArea and TextArea with wildcard(s) now support
setWideTextAction() to automatically wrap long lines.
* Added the ability to display a "fallback" character in case a
non-existing glyph is encountered at runtime. This is configured
in the typography sheet of the text database.
* Added options for forcing the inclusion of additional glyphs in a
font. This makes it much easier to handle dynamic texts where the
glyphs are not known at compile time. This is configured in the
typography sheet of the text database.
* Output from the TextConvert utility is now post-processed to give
significant saving by mapping identical strings to the same memory
areas.
* Added built-in BitmapId called BITMAP_ANIMATION_STORAGE which can
be used to refer to the animation storage when assigning a Bitmap
to a widget.
* Added dither algorithm selection from config/gcc/app.mk and
config/msvs/Application.props.
* It is possible to save a simulator screenshot programatically, by using:
#ifdef SIMULATOR
(static_cast<HALSDL2*>(HAL::getInstance()))->saveScreenshot();
#endif
* ScrollableContainer now properly ignores invisible elements.
* DigitalClock now supports a zero to be displayed in front of the
hour indicator (if hour < 10).
* The simulator can now highlight the areas being invalidated. Press
F2 to toggle this feature.
* Added Unicode::vsnprintf functions that take va_list arguments
instead of ellipsis.
* Bugfixes
* Unicode::sprintfFloat did not print <space> instead of ’+’ if the
format string was "% f". Also, the sign of floating point numbers
in range ]-1..0[ would not be printed with sign so for example
-0.5 would print as 0.5.
4.6.1
=====
* Performance
* Optimization improvements of core library for GCC on Cortex-M4 and
Cortex-M7, providing significant speeedup of especially TextureMapper
and Canvas widgets compared to TouchGFX 4.6.0.
* New Features
* New function in HALSDL to set title of simulator window see
HALSDL::setWindowTitle().
* BW_RLE format (1bpp displays) now compresses better. Remember to
remove old generated files and re-generate assets.
* STM32F756G-EVAL using IAR now supports flashing of external
memory.
* Bugfixes
* Added IAR linker redirect commands to fix linker errors when
compiling a Cortex-M4 based target with IAR 7.x.
* Assigning different memory buffers to CanvasWidgetRenderer using
setupBuffer() could in rare cases result in memory corruption.
* TextureMapper could in rare cases draw outside the frame buffer.
* Setting the offset of a TiledImage did not work properly.
* Fixed two issues that would in some cases cause memory corruption
when deleting dynamic bitmaps.
* Missing virtual method declarations in AnalogClock added.
* Fixed a problem in GCC linker script for LPC4088DisplayModule
which caused texts and fonts to be placed in external flash.
* For those using fontconvert.out on its own, the output directory
is now automatically created if it does not exist.
* ScrollableContainers could in rare cases send a wrong drag event
to a child.
* Monochrome (1bpp) displays with width not divisible by 8 would not
display text correctly.
* Slightly increased default touch sample rate on STM32F746G
Discovery board.
4.6.0
=====
* New features
* Added support for 2bpp grayscale displays. See
https://touchgfx.zendesk.com/hc/en-us/articles/208237889 for details.
* Bugfixes
* DMA drivers for ST boards: express DMA2D instance initialization
for STM32F7. Fixed incorrect used of CLUT_CM for F4-Discovery.
* DMA drivers for LPC17xx, LPC18xx, LPC43xx did not behave correctly
if other DMA channels are in use simulatenously. They now properly
look at flags for channel 0 only.
* Touch controller drivers for ST boards now properly checks that
initialization was OK before querying.
* Mouse clicks in the simulator would not always be detected.
* ImageConvert.exe has RGB565 as default (and sensible defaults for
other opque formats)
* ImageConvert would not work for a BW image scheduled for
compression (BW_RLE) and rotation (.90. in filename) if the image
would become too large if compressed (falling back to BW format).
* All Makefiles now use abspath instead of realpath.
* AnimatedImage now allows the animation to be restarted from the
AnimationEnded callback function.
* QSPI flash size corrected to 64MBytes for STM32756G-EVAL board.
* Added D-cache invalidation to STM32F7HAL::flushFrameBuffer. This
fixes occasional graphics errors on STM32F7 when in single frame
buffer mode and fb was located in SRAM.
* The otm8009a displays (STM32769-DISCO, STM32769-EVAL,
STM32469-DISCO, STM32469-EVAL) are now using maximum display
brightness.
* Added a workaround for a bug in IAR 7.50.x regarding va_list
name mangling.
* Update Procedure
* Compatible with existing 4.x applications and HAL ports. Please
refer to this article for details:
https://touchgfx.zendesk.com/hc/en-us/articles/206819819
4.5.1
=====
* Bugfixes
* Fixed two IAR linker issues related to resolving the va_list
symbol, which would cause some versions of IAR being unable to
link the example projects.
* STM32F4-Discovery board would draw solid rectangles with the wrong
color in 16bpp mode.
* The Canvas Widget Renderer no longer performs unaligned memory
accesses.
* vApplicationIdleHook (FreeRTOS specific) no longer blocks, which
previously prevented FreeRTOS from freeing memory if tasks were
deleted.
* Arabic words with accent in the middle would not render properly.
* Added PixelDataWidget::getAlpha().
* Unicode::strncpy() with a char* as source would not copy
characters with ascii codes above 127 properly.
4.5.0
=====
* New features
* Support for two new languages, Arabic and Hebrew, with
right-to-left text rendering. RTL strings can be mixed with LTR
texts and numbers.
* Support for 24 bits per pixel frame buffers. Images look more
detailed, but also consume more memory. See this article:
https://touchgfx.zendesk.com/hc/en-us/articles/206725849
* Bitmaps can now be created at runtime using method
Bitmap::dynamicBitmapCreate. Useful for e.g. displaying .bmp files
loaded from an SD card. See dynamic_bitmap_example and this
article: https://touchgfx.zendesk.com/hc/en-us/articles/207460605
* Frame rate compensation feature which provides smoother animations
if frame rate occasionally drops. Not enabled by default. See
article: https://touchgfx.zendesk.com/hc/en-us/articles/206430529
* Bitmap caching is enhanced to allow removal of bitmaps from the
cache to make room for caching of other bitmaps. See this article:
https://touchgfx.zendesk.com/hc/en-us/articles/205953932
* A new widget, PixelDataWidget, is introduced. This widget makes it
possible to display raw pixel data obtained at runtime (e.g. video
samples).
* The simulator executable on windows now features an icon for
easier identification in the task bar.
* ST boards supported by TouchGFX can now have just their internal
flash programmed from the command using ’make intflash’ provided
that ST-Link Utility Release 3.7+ is installed. For usage and
troubleshooting, please refer to this article:
https://touchgfx.zendesk.com/hc/en-us/articles/205264831
* Unicode::snprintf() has been improved and updated substantially to
support more of the standard format specifiers like %02d.
* Unicode::snprintfFloat() added to support floats (in separate
function because the "%f" va_args approach would force inclusion
of doubles).
* Quality of image converter dithering has been improved (floating
point arithmetics). Also added support for new types of dither
algorithms, and can take into account hardware with various wiring
of the low (unused) bits in 16/18 bit displays.
* touchgfx::ButtonWithLabel now contains a method,
updateTextPosition(), that can be used to ensure horizontal text
centering when changing label content (e.g. when changing
language).
* touchgfx::TextArea has a new method, setBaselineY(), that allows
placing texts according to a text baseline instead of upper left
corner.
* The internal format of glyph encoding now stores the first pixel
in the least significant bit instead of the most significant bit.
* Specification of color values has been switched from uint16_t to
colortype to support seamless switching between 16 and 24 bit
colors.
* The touchgfx::TextArea class now has a method, setIndentation(),
that can prevent the glyph of characters from being cut off in the
* Bugfixes
* Fixed rare crash on STM32F7 caused by speculative caching of
invalid QSPI memory region. Update your BoardConfiguration if
yours is based on 4.4.x.
* Fixed occasional display flickering on STM32F746G-DISCO board
caused by cache access on FMC bank 1.
* Handling of the character "%"" in touchgfx::TextAreaWithWildcards
has been improved to prevent inserting %% in some special cases.
* touchgfx::DragEvent and touchgfx::GestureEvent now use and report
signed coordinates instead of unsigned. This makes more sense as
drags/gestures are expressed in coordinates relative to the
drawable receiving them.
* snprintf("%x") would generate uppper case hex. Now "%X" generates
uppercase hex and "%x" generates lower case hex, just like the
standard snprintf().
* Fixed randomness for demos when running on Linux.
* Fixed redrawing when using heavily italicized fonts.
* Pointer to ModelListener in Model class for all TouchGFX
applications was not properly initialized (NULL).
* Fixed support for heavily italicized fonts in touchgfx::TextArea.
* Subtle error in the Image Converter where column 0 could get
slightly incorrect pixel colors. As a result the entire image
could be slightly wrong, probably not noticeable.
* Minor error in Slider where values were not distributed evenly.
* Deprecated
* LCD::drawGlyph() has been deprecated. Use LCD::drawString instead.
* Update Procedure
* Compatible with existing 4.x applications and HAL ports. Please
refer to this article for details:
https://touchgfx.zendesk.com/hc/en-us/articles/206819819
4.4.2
=====
* Bugfixes:
* Corrected rare GUI task hangup on STM32F7 targets when compiling
with IAR 7.x
4.4.1
=====
* Bugfixes:
* Corrected occasional GUI task hangup on STM32F7 targets when
compiling with Keil 5.x
* Fixed occasional tearing on STM32 F469 EVAL/Discovery boards when
using DSI in landscape orientation and single frame buffer mode.
* Modified IAR flash loader settings for STM32 F469 boards to enable
programming of internal flash (Note: QuadSPI flash must still be
programmed from ST-Link Utility as there are no IAR loaders for
this)
* GPIO class for perf. measurement for STM32F746G-EVAL boards now
properly uses the BSP_LED functions. Note that only two signals
are active on this board per default because LED2 and LED4 use IO
Expander, making them unsuited for measuring performance.
4.4.0
=====
* New features
* Added support for the Cortex-M7 core.
* Introduced concept of "finger size" for touch input. When used,
TouchGFX will attempt to find touchable widgets in the area
surrounding the reported x,y coordinates, so users no longer have
to click precisely on a widget. This feature makes it substantially
easier to hit small buttons.
See HAL::setFingerSize().
* Supports Visual Studio 2015
* Visual Studio projects for Demos and Examples now include
Application.props under Resources for quick access. As always a
rebuild might be required when altering the contents of
Application.props.
* Support for Bitmap Fonts in BDF format. If the requested font size
is not available in the font file, the font converter will write
the supported font size(s) in the error message. See the example
monochrome_example for usage.
* Generating assets now issues better error messages when spaces are
detected in paths and file names.
* All ST boards can now be flashed from the command line provided
that ST-Link Utility Release 3.7 has been installed. Simply use
’make -f target/ST/<board>/Makefile flash’ to build and flash
your application to the connected board. If timeouts occur during
flashing, go to Device Manager in Windows and disable "MBED
microcontroller USB Device" under "Disk drives".
* New touchgfx-env version 2.5 available with new gcc cross compiler
version 4.9.3. The older version 4.8.4 could generate invalid code
for Cortex-M7 cores in rare cases.
* Board support
* Added support for the STM32F7xx processors
* Added support for the STM32F746G-DISCO and STM32756G-EVAL boards
* Added support for the STM32F469 processor with DSI displays
* Added support for the STM32469I-EVAL and STM32469I-Discovery boards
* Bugfixes
* TextureMapper and ScaleableImage now draws images correctly when
using "rotate90".
* Fixed potential initialization order bug in STM32F4DMA.cpp
* Fixed bug that limited number of glyphs in a single font to 32768.
Now supports 65536 glyphs per font as intended.
* Fixed bug that caused hal.lockDMAToFrontPorch(false) to not have
any effect in single frame buffer mode.
* ButtonWithLabel correctly center texts vertically if text contains
newlines
4.3.0
=====
* New features
* TextureMapper widget added.
The TextureMapper is a highly optimized image renderer that can be
used for displaying an image that is scaled and/or rotated in two
or three dimensions during run time. This can be used for doing
advanced rotation animations of images. See manual or
texture_mapper_example for more information. LCD has new methods
for drawing triangles and corresponding scan lines,
drawTextureMapTriangle and drawTextureMapScanLine
* Alpha Channel Dithering
Images with alpha channel can now get the alpha channel dithered
for smoother alpha gradients, see examples or Application Development
* Update procedure
* Compatible with existing 4.X applications. Just replace the
touchgfx folder.
* Check Known Issues in the documentation.
* Info
* The evaluation version of TouchGFX is now distributed with source
code for the hardware abstraction layer instead of a precompiled
library. This makes it possible to port the evaluation version
to custom hardware instead of it being limited to the supported
eval boards only. Instead, the evaluation version now has a
TouchGFX watermark which will appear occasionally.
* Memory consumption reduced due to improved rendering algorithm.
Will typically allow GUI task stack to be reduced by around 1400
bytes compared to version 4.2.0 (depending on actual application).
Additionally the statically allocated memory is also reduced by
around 1KB.
* Maximum number of visible widgets limit of 150 removed.
* Added two new demos for 640x480 and 480x272 resolutions showcasing
new features, graphs, internationalization and custom widgets.
* Drawable.setPosition() now calls setXY(), setWidth() and
setHeight() for easier subclassing.
* AbstractPainterRGB565 and AbstractPainterBW are recommended as
base classes when implementing your own painters.
* CanvasWidgets now have setAlpha() and getAlpha() methods. Your
custom Painter classes must implement this, or inherit from the
AbstractPainterRGB565 class
* Maximum number of registered timer widgets increased from 16 to
24.
* touchgfx-env updated to 2.4. The environment does not beep anymore.
* Board Support Package for STM324x9I-EVAL is now based on the
STMCubeF4 drivers.
* Bugfixes
* Screen::handleGestureEvent now converts x/y to relative coordinates
* Fixed bug when drawing several objects on the same canvas using
moveTo() more than once.
* ZoomAnimationImage movement relative to scaling did not use
correct easing equation.
* PainterRGB565 did not blend green alpha correctly.
* RadioButtonGroup now initializes callbacks to zero.
* ScalableImage now works with bitmaps with transparancy.
* AnimatedImage would display the start and end of an animation twice.
* Default implementation of CanvasWidget::getMinimalRect() returned
coordinates relative to its parent, not itself.
* ScrollableContainer erroneously unregistered itself as a timer widget
at every tick, which made it difficult to use with other timer-based
operations.
* Performance
* ScalableImage and ZoomAnimationImage has been optimized for better
performance.
4.2.0
=====
* Performance
* Substantially improved rendering performance, which in most cases
will result in a 25% reduction of time it takes to render a frame.
* New features
* It is now possible to specify an animation start delay on
ZoomAnimationImage, MoveAnimator and FadeAnimator.
* Added Board support for 4.3" TouchGFX Demo board w. LPC4350 (No
internal flash)
* RadioButton and RadioButtonGroup widgets added. See
app/examples/radio_button_example and documentation.
* LPC43XX and LPC1788 can now fill rectangles using DMA.
* Visual Studio 2013 is now supported.
* Preliminary support for Visual Studio 2015 Preview version.
* Improved performance when generating assets.
* New canvas_widget_example added to the example directory.
* The "using namespace touchgfx" present in various header files can
now be avoided by defining the symbol NO_USING_NAMESPACE_TOUCHGFX
in your project.
* TouchGFX env
* The message displayed when starting a shell has been fixed with
correct path to examples.
* Bugfixes
* Fixed bug in simulator for 1bpp displays when width and/or height
was not not a multiple of 8.
* Fixed bug in ScrollableContainer where CANCEL events where not
always delegated to correct child, causing e.g. buttons to remain
pressed when dragging outside SC area.
* Fixed bug when rendering chromArt fonts with a rotated display.
* Fixed bug - Keyboard widget setTouchable(false) had no effect.
* Freescale K70 DMA now checks the appropriate DONE bit in TCD0_CSR.
* On ST processors fixed bug with rotated texts rendered by ChromArt
when in non-native display orientation.
* Board support
* Embedded Artists LPC4357DevKit board package: CPU clocked to
204Mhz (previously 96Mhz). Now uses SPIFI flash instead of NOR.
* Update procedure
* Compatible with existing 4.X applications. Just replace the
touchgfx folder.
* Info
* Documentation has been updated.
4.1.1
=====
* New features
* Mixin: MoveAnimator added. The MoveAnimator mixin makes the
template class T able to animate a movement from its current
position to a specified end position. See
app/example/move_fade_example.
* Mixin: FadeAnimator added. The FadeAnimator mixin makes the
template class T able to animate an alpha fade from its current
alpha value to a specified end alpha value. See
app/example/move_fade_example.
* ScalableImage and ZoomAnimationImage now support alpha per pixel
bitmaps and alpha per bitmap
* ScalableImage and ZoomAnimationImage now support ARGB8888 format
bitmaps
* Bugfixes
* Fixed a bug causing the Keyboard widget to render incorrectly in
rare cases.
* Fixed a bug causing drag event coordinates to be incorrect for
widgets when placed in a Container with coords != {0,0} which
itself was placed in a ScrollableContainer.
* The Application class now properly keeps track of number of times
registerTimerWidget vs. unregisterTimerWidget is called for a
given widget, meaning that if registered several times it now
requires same number of unregisters before widget no longer
receives tick events.
* Some ZoomAnimationImage functions were not virtual as they should
be.
* Some widgets were missing certain getter functions.
* Update procedure
* Compatible with existing 4.X applications. Just replace the
touchgfx folder.
4.1.0
=====
* New features
* Now supports monochrome 1BPP displays. See manual for details.
* Support for dynamic screen orientation change (landscape/portrait)
* Support for scaling images (See ScalableImage and
ZoomAnimationImage drawables)
* Demo
* Home Control Demo now support 640x480 mode.
* Home Control Demo now supports STM324xI-EVAL 5.7" board.
* Bugfixes
* Adding a persistent Drawable to a ScrollableContainer could cause
assertion
* Support for much larger fonts
* Update procedure
* Compatible with existing 4.X applications. Just replace the
touchgfx folder.
4.0.0
=====
* New features
* TouchEvent refactoring (API breaking):
* Drawable::setActive is renamed to Drawable::setTouchable
* Drawable::isActive is renamed to Drawable::isTouchable
* Drawable::hijackTouchEvent is deprecated
* Bugfixes
* Rendering error of images with odd width and alpha value less than
255
* Correct handling of TextArea::getTextHeight in case of non
initialized textArea
* TextAreaWithWildcard::getTextWidth now includes the width of the
wildcard text
* gcc Makefiles now includes *.BMP and *.PNG from image assets.
* Do not trim leading and trailing white space from any translations
in the texts sheet.
* Font converter did not generate font data properly for 8bpp.
* ButtonWithIcon::setBitmaps - Suppress IAR warning for intentional
virtual function override.
* ButtonWithIcon optimized draw functionality
* In extremely rare cases text could be written slightly outside the
text area
* Update procedure
* Due to the TouchEvent refactoring you have to rename functions
accordingly. You also need to state in any custom widget or
containers if they need to receive touch events. If you were using
hijackTouchEvent to prevent children of getting touch events, you
now need to make sure that all children is not touchable instead.
* Main.cpp for simulators need to be updated by replacing the line:
TypedText::registerTypedTextDatabase(TypedTextDatabase::getInstance(), TypedTextDatabase::getInstanceS
with:
Texts::setLanguage(0)
You can also specify a specific language from your text database
e.g.
Texts::setLanguage(GB)
In that case you also need to:
#include <texts/TextKeysAndLanguages.hpp>
* Rebuild entire project.
* Info
* The TouchGFX Manual has been updated considerably.
3.1.0
=====
* New features
* Added support for FDI uEZGUI-1788-70WVT eval board (NXP LPC-1788
Cortex M3).
* Added support for Mjolner TouchGFX Demo Board Rev. 1.1 eval board
(NXP LPC-4353 Cortex M4/M0 4.3").
* Bugfixes
* Visual Studio build now rebuild BitmapDatabase.h when new images
* Update procedure
* Only if using Visual Studio: Update TouchGFXReleasePath in your
Visual Studio .props file. Simply edit the file in a text editor.
The path should be extended with "touchgfx\". See the
template_application for inspiration.
* Only if using Visual Studio: Update your Visual Studio project
file (.vcxproj file). Simply edit the file in a text editor.
Replace all paths on the form
"$(TouchGFXReleasePath)\framework\config\msvs\touchgfx_prebuild.targets"
with
"$(TouchGFXReleasePath)\config\msvs\touchgfx_prebuild.targets".
* Info
* Hardware Abstraction Layer architecture has been reworked so that
all common code for various hardware components (MCUs and drivers)
is now shared across different target boards. This greatly
simplifies the porting effort for new/custom boards as long as they
contain one or more hardware components already supported by
TouchGFX.
3.0.0
=====
* New features
* Visual Studio 2010/2012 support.
* Added support for png images with alpha channel.
* Added support for subfolders in assets/bitmaps folder
* Added support for ST STM32F4X9I-EVAL eval board.
* Added support for Robert Penners Easing Equations (see
touchgfx/EasingEquations.hpp).
* Image converter: Added sanity check of input image file names,
must not start with digit and must be alphanumeric.
* Image converter: Added checking against case insensitively file
name duplicates in input list.
* Text converter: Added build stopping sanity checks for bpp and
font_size values.
* ScrollableContainer: Now supports setScrollbarPadding,
setScrollbarWidth, setScrollbarColor, and setScrollbarAlpha.
* ScrollableContainer: Set default value of ScrollThreshold to 5
pixels, instead of 1.
* Added support for alpha blending of fonts
(TextArea::setAlpha(uint8_t alpha))
* ImageConvert support two different output formats: RGB565 and ARGB8888
* ImageConvert - two options added to control output format for
images with/without an alpha channel
* Touchgfx environment under MinGW is updated due to linker errors
for large projects. g++ version is updated from 4.6.2 -> 4.8.1
* Internal RAM footprint improvements
* Structural changes of target library and hardware abstraction layers
* Bugfixes
* Fill operation (Box widget) resulted in a crash on the
lpc4357_emb_artist board
* Textconvert & fontconvert: Different typographies may now have
identical properties.
* Imageconvert & fontconvert: Better error handling for POSIX
compliant platforms
* HALSDL: Do not overflow key data type.
* LanguageXX.cpp files now end with a newline (removing warnings).
* TextArea::draw now handles non initialized TypedText correctly.
* Update procedure
* The folders assets/bitmaps and generated/bitmaps must be renamed
to assets/images and generated/images.
* Upgrade TouchGFX environment to version 2.0
* Update any application Makefile to adhere with the Makefile
specified in the updated template_application
* Rebuild entire project
* Convert bmp images that contains the former transparent color to
png images that uses alpha channels. This can be done
* Info
* The "magic" transparent color that was previously used for
transparent color in the bmp format is no longer supported.
Instead use png images with alpha channel.
2.2.0
=====
* New features
* Added support for portrait mode with landscape displays at zero
performance/resource cost.
* Added kerning support.
* Added Keyboard example (with IAR project for the Energy Micro
DK3750 eval board)
* Changed interface for blitCopy method in LCD.
* Removed SyncBackBuffer method from HAL.
* Removed clearLCD method from LCD.
* Removed fillGradientRect method from LCD.
* ScrollableContainer supports setScrollbarsVisible(bool visible).
2.1.0
=====
Globals
Namespace Index
Hierarchical Index
Drawable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
MoveAnimator< touchgfx::Container > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
AbstractButtonContainer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
ClickButtonTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
RepeatButtonTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
ToggleButtonTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
TouchButtonTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
AbstractClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
AnalogClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
DigitalClock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
AbstractProgressIndicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
AbstractDirectionProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
BoxProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
ImageProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
CircleProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
LineProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
TextProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
DrawableList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
ListLayout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
ModalWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
ScrollableContainer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
ScrollBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
ScrollList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
ScrollWheelBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
ScrollWheel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
ScrollWheelWithSelectionStyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
SlideMenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
Slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
SwipeContainer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
ZoomAnimationImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
AbstractButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
ButtonWithIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
ButtonWithLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
RepeatButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
ToggleButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
RadioButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
TouchArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
BoxWithBorder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
CanvasWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
AbstractShape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Shape< POINTS > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
CanvasWidgetRenderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
CoverTransition< templateDirection >::FullSolidRect . . . . . . . . . . . . . . . . . . . . . . . . 319
Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
AnimatedImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
TiledImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
PixelDataWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
ScalableImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
SnapshotWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
TextArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
TextAreaWithWildcardBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
TextAreaWithOneWildcard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
TextAreaWithTwoWildcards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
TextureMapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
AnimationTextureMapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
DrawableListItemsInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
DrawableListItems< TYPE, SIZE > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
DrawingSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Bitmap::DynamicBitmapData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
EasingEquations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
ClickEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
DragEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
GestureEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
ConstFont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
InternalFlashFont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
FontManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
FontProvider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
GenericCallback< T1, T2, T3 > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Callback< dest_type, T1, T2, T3 > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
GenericCallback< const T &, const touchgfx::ClickEvent &> . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::AbstractButton & > . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::AbstractButton &, void, void > . . . . . . . . . . . . . . . . . . . . . 320
Callback< touchgfx::RadioButtonGroup, const touchgfx::AbstractButton & > . . . . . . . . . . . . . . 171
Callback< touchgfx::SlideMenu, const touchgfx::AbstractButton &> . . . . . . . . . . . . . . . . . . . 171
GenericCallback< const touchgfx::AbstractButtonContainer & > . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::AnimatedImage &> . . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::AnimationTextureMapper & > . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::DragEvent &> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::FadeAnimator< T > & > . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::MoveAnimator< T > & > . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::MoveAnimator< touchgfx::Container > & > . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::MoveAnimator< touchgfx::Container > &, void, void > . . . . . . . . 320
Callback< touchgfx::SlideMenu, const touchgfx::MoveAnimator< touchgfx::Container > &> . . . . . . 171
GenericCallback< const touchgfx::SlideMenu & > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::Slider &, int > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< const touchgfx::ZoomAnimationImage &> . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< int16_t > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< T1 > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Callback< dest_type, T1, void, void > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
GenericCallback< T1, T2 > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Callback< dest_type, T1, T2, void > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
GenericCallback< T1, T2, void > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
GenericCallback< T1, void, void > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
GenericCallback< touchgfx::Drawable &, void, void > . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Callback< touchgfx::CoverTransition, touchgfx::Drawable &> . . . . . . . . . . . . . . . . . . . . . . 171
Callback< touchgfx::SlideTransition, touchgfx::Drawable &> . . . . . . . . . . . . . . . . . . . . . . . 171
GenericCallback< touchgfx::DrawableListItemsInterface ∗, int16_t, int16_t > . . . . . . . . . . . . . . . 320
GenericCallback< Unicode::UnicodeChar > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< void > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
GenericCallback<> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Callback< dest_type, void, void, void > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Gestures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
GlyphNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Gradients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
HAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
HALSDL2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Scanline::iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
JSMOCHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
KerningNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Keyboard::Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Keyboard::KeyMapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Keyboard::KeyMappingList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Keyboard::Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
LCD16bpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
LCD1bpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
LCD24bpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
LCD2bpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
LCD4bpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Matrix4x4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
MCUInstrumentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
MVPHeap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
OSWrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Pair< T1, T2 > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Pair< int16_t, int16_t > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Point3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Presenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
CWRUtil::Q10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
CWRUtil::Q15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
CWRUtil::Q5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Quadruple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
Point4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Vector4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
RadioButtonGroup< CAPACITY > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Rasterizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Rect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
Renderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
RenderingBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Scanline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
View< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
AbstractShape::ShapePoint< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
LCD::StringVisuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
TextProvider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
TextureSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
TouchCalibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
TouchController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
I2CTouchController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
NoTouchController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
SDL2TouchController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
SDLTouchController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
CoverTransition< templateDirection > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
NoTransition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
SlideTransition< templateDirection > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
TypedText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
TypedText::TypedTextData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
UIEventListener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
MVPApplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Unicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
Vector< T, capacity > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Vector< touchgfx::Drawable ∗, MAX_TIMER_WIDGETS > . . . . . . . . . . . . . . . . . . . . . . . . 765
Vector< touchgfx::Rect, 8 > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
T
AnimatedImageButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
BoxWithBorderButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
ClickListener< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Draggable< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Snapper< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
FadeAnimator< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
IconButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
ImageButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
MoveAnimator< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
PreRenderable< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
TextButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
TiledImageButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
TwoWildcardTextButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
WildcardTextButtonStyle< T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
Class Index
Here are the classes, structs, unions and interfaces with brief descriptions:
AbstractButton
This class defines an abstract interface for button-like elements . . . . . . . . . . . . . . . . . 63
AbstractButtonContainer
An abstract button container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
AbstractClock
Superclass of clock widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
AbstractDirectionProgress
An abstract direction progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
AbstractPainter
An abstract class for creating painter classes for drawing canvas widgets . . . . . . . . . . . . 71
AbstractPainterBW
A Painter that will paint using a color on a LCD1bpp display . . . . . . . . . . . . . . . . . . . 74
AbstractPainterGRAY2
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 76
AbstractPainterGRAY4
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 78
AbstractPainterRGB565
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 81
AbstractPainterRGB888
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 84
AbstractPartition
This type defines an abstract interface to a storage partition for allocating memory slots of equal
size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
AbstractProgressIndicator
An abstract progress indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
AbstractShape
Simple widget capable of drawing a abstractShape . . . . . . . . . . . . . . . . . . . . . . . 98
AnalogClock
An analog clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
AnimatedImage
A widget capable of basic animation using a range of bitmaps . . . . . . . . . . . . . . . . . . 115
AnimatedImageButtonStyle< T >
An animated image button style. An animated image button style. This class is supposed to be
used with one of the ButtonTrigger classes to create a functional button. This class will show
the first or last image of an animated image depending on the state of the button (pressed or
released). When the state changes the button will show the sequence of images in forward or
reversed order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
28 Class Index
AnimationTextureMapper::AnimationSetting
Information about how a specific animation parameter should be animated . . . . . . . . . . . 122
AnimationTextureMapper
A texture mapper with animation capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Application
Main interface for manipulating screen contents . . . . . . . . . . . . . . . . . . . . . . . . . 126
Bitmap
This class provides a proxy object for a bitmap image . . . . . . . . . . . . . . . . . . . . . . 134
Bitmap::BitmapData
Data of a bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
BlitOp
BlitOp instances carry the required information for performing operations on the LCD (frame
buffer) using DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Box
Simple widget capable of showing a rectangle of a specific color and an optional alpha . . . . 145
BoxProgress
A box progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
BoxWithBorder
A box with border . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
BoxWithBorderButtonStyle< T >
A box with border button style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Button
A button with two states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
ButtonController
Interface for sampling external key events . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Buttons
A buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
ButtonWithIcon
A Button specialization that also displays an icon on top of the button bitmap . . . . . . . . . . 163
ButtonWithLabel
A Button specialization that also displays a text on top of the button bitmap . . . . . . . . . . . 167
Bitmap::CacheTableEntry
Cache bookkeeping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Callback< dest_type, T1, T2, T3 >
A Callback is basically a wrapper of a pointer-to-member-function . . . . . . . . . . . . . . . 171
Callback< dest_type, T1, T2, void >
A Callback is basically a wrapper of a pointer-to-member-function . . . . . . . . . . . . . . . 173
Callback< dest_type, T1, void, void >
A Callback is basically a wrapper of a pointer-to-member-function . . . . . . . . . . . . . . . 175
Callback< dest_type, void, void, void >
A Callback is basically a wrapper of a pointer-to-member-function . . . . . . . . . . . . . . . 177
Keyboard::CallbackArea
Mapping from rectangle to a callback method to execute . . . . . . . . . . . . . . . . . . . . 178
Canvas
Class for easy rendering using CanvasWidgetRenderer . . . . . . . . . . . . . . . . . . . . . 179
CanvasWidget
Class for drawing complex polygons on the LCD using CanvasWidgetRenderer . . . . . . . . 182
CanvasWidgetRenderer
Class for supporting drawing of figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Cell
A pixel cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Circle
Simple widget capable of drawing a circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
CircleProgress
A circle progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
ClickButtonTrigger
A click button trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
ClickEvent
A click event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
ClickListener< T >
Mix-in class that extends a class with a click action event . . . . . . . . . . . . . . . . . . . . 216
Color
Contains functionality for color conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
colortype
Type for representing a color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
ConstFont
A ConstFont is a Font implementation that has its contents defined at compile-time and usually
placed in read-only memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Container
A Container is a Drawable that can have child nodes . . . . . . . . . . . . . . . . . . . . . . 224
CoverTransition< templateDirection >
A Transition that slides from one screen to the next . . . . . . . . . . . . . . . . . . . . . . . 230
CWRUtil
Helper classes and functions for CanvasWidget . . . . . . . . . . . . . . . . . . . . . . . . . 233
DigitalClock
A digital clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
DisplayTransformation
Defines transformations from display space to frame buffer space . . . . . . . . . . . . . . . . 244
DMA_Interface
DMA_Interface provides basic functionality and structure for processing "blit" operations using
DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
DMA_Queue
This class provides an interface for a FIFO (circular) list used by DMA_Interface and descendants
for storing BlitOp's . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
DragEvent
A drag event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Draggable< T >
Mix-in class that extends a class to become draggable . . . . . . . . . . . . . . . . . . . . . 258
Drawable
Abstract definition of something that can be drawn . . . . . . . . . . . . . . . . . . . . . . . . 259
DrawableList
A container able to display many items using only a few drawables . . . . . . . . . . . . . . . 273
DrawableListItems< TYPE, SIZE >
An array of drawables used by DrawableList . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
DrawableListItemsInterface
A drawable list items interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
DrawingSurface
The destination of a draw operation. Contains a pointer to where to draw and the stride of the
drawing surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Bitmap::DynamicBitmapData
Data of a dynamic bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
EasingEquations
Defines the "Penner easing functions", which are a de facto standard computing aesthetically
pleasing motion animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Edge
An edge contains information about one edge, between two points, of a triangle, as well as
information about how to interpolate values when moving in the vertical direction . . . . . . . . 303
Event
Simple base class for events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
FadeAnimator< T >
A FadeAnimator makes the template class T able to animate an alpha fade . . . . . . . . . . . 306
Font
The font base class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
FontManager
This class is the entry point for looking up a font based on a font id . . . . . . . . . . . . . . . 318
FontProvider
A generic pure virtual definition of a FontProvider . . . . . . . . . . . . . . . . . . . . . . . . 319
CoverTransition< templateDirection >::FullSolidRect
A Widget that returns a solid rect of the same size as the application . . . . . . . . . . . . . . 319
GenericCallback< T1, T2, T3 >
GenericCallback is the base class for callbacks . . . . . . . . . . . . . . . . . . . . . . . . . 320
GenericCallback< T1, T2, void >
GenericCallback is the base class for callbacks . . . . . . . . . . . . . . . . . . . . . . . . . 322
GenericCallback< T1, void, void >
GenericCallback is the base class for callbacks . . . . . . . . . . . . . . . . . . . . . . . . . 324
GenericCallback< void >
GenericCallback is the base class for callbacks . . . . . . . . . . . . . . . . . . . . . . . . . 325
GestureEvent
A gesture event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Gestures
This class implements the detection of gestures . . . . . . . . . . . . . . . . . . . . . . . . . 329
GlyphNode
Struct providing information about a glyph . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
GPIO
Interface class for manipulating GPIOs in order to do performance measurements on target . . 333
Gradients
Gradients contains all the data to interpolate u,v texture coordinates and z coordinates across a
planar surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
HAL
Hardware Abstraction Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
HALSDL2
HAL implementation for the TouchGFX simulator . . . . . . . . . . . . . . . . . . . . . . . . 359
I2C
Platform independent interface for I2C drivers . . . . . . . . . . . . . . . . . . . . . . . . . . 368
I2CTouchController
Specific I2C-enabled type of Touch Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 370
IconButtonStyle< T >
An icon button style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Image
Simple widget capable of showing a bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
ImageButtonStyle< T >
An image button style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
ImageProgress
An image progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
InternalFlashFont
An InternalFlashFont has both glyph table and glyph data placed in a flash which supports ran-
dom access read (i.e. not a NAND flash) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Scanline::iterator
An iterator to help go through all the elements that make up a Scanline . . . . . . . . . . . . . 385
JSMOCHelper
Helper class providing caching of certain information while the JSMOC algorithm runs during
draw operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
KerningNode
Structure providing information about a kerning for a given char pair . . . . . . . . . . . . . . 389
Keyboard::Key
Mapping from rectangle to key id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Keyboard
The keyboard provides text input for touch devices . . . . . . . . . . . . . . . . . . . . . . . 389
Keyboard::KeyMapping
Mapping from key id to Unicode character . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Keyboard::KeyMappingList
List of KeyMappings to use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Keyboard::Layout
Definition of the keyboard layout. The keyboard can handle changing layouts, so different key-
board modes can be implemented by changing layouts and key mappings . . . . . . . . . . . 397
LCD
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectan-
gles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
LCD16bpp
This class contains the various low-level drawing routines for drawing bitmaps . . . . . . . . . 411
LCD1bpp
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectan-
gles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
LCD24bpp
This class contains the various low-level drawing routines for drawing bitmaps . . . . . . . . . 424
LCD2bpp
This class contains the various low-level drawing routines for drawing bitmaps . . . . . . . . . 431
LCD4bpp
This class contains the various low-level drawing routines for drawing bitmaps . . . . . . . . . 437
LED
A led . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Line
Simple CanvasWidget capable of drawing a line . . . . . . . . . . . . . . . . . . . . . . . . . 445
LineProgress
A line progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
ListLayout
This class provides a layout mechanism for arranging Drawable instances adjacently in the spec-
ified Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
LockFreeDMA_Queue
This implements a simple lock-free FIFO queue (single producer, single consumer) . . . . . . 465
Matrix4x4
This class represents row major 4x4 homogeneous matrices . . . . . . . . . . . . . . . . . . 468
MCUInstrumentation
Interface for instrumenting processors to measure MCU load via measured CPU cycles . . . . 473
ModalWindow
Container for displaying a modal window and hijacking touch event to underlaying view and
widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
MoveAnimator< T >
A MoveAnimator makes the template class T able to animate a movement . . . . . . . . . . . 480
MVPApplication
A specialization of the TouchGFX Application class . . . . . . . . . . . . . . . . . . . . . . . 484
MVPHeap
Generic heap class for MVP applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
NoDMA
This is an "empty" DMA subclass that does nothing except assert if accidentally used . . . . . 486
NoTouchController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
NoTransition
The most simple Transition without any visual effects . . . . . . . . . . . . . . . . . . . . . . 490
OSWrappers
This class specifies OS wrappers for dealing with the frame buffer semaphore and the VSYNC
signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Outline
An internal class that implements the main rasterization algorithm . . . . . . . . . . . . . . . 493
PainterBW
A Painter that will paint using a color on a LCD1bpp display . . . . . . . . . . . . . . . . . . . 496
PainterBWBitmap
A Painter that will paint using a bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
PainterGRAY2
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 501
PainterGRAY2Bitmap
A Painter that will paint using a bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
PainterGRAY4
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 507
PainterGRAY4Bitmap
A Painter that will paint using a bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
PainterRGB565
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 513
PainterRGB565Bitmap
A Painter that will paint using a bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
PainterRGB888
A Painter that will paint using a color and an alpha value . . . . . . . . . . . . . . . . . . . . 520
PainterRGB888Bitmap
A Painter that will paint using a bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Pair< T1, T2 >
A simple struct for holding pairs of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Partition< ListOfTypes, NUMBER_OF_ELEMENTS >
This type provides a concrete Partition of memory-slots capable of holding any of the specified
list of types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
PixelDataWidget
A widget for displaying a buffer of pixel data . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Point
A simple struct containing coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Point3D
A 3D point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Point4
This class represents a homogeneous 3D point . . . . . . . . . . . . . . . . . . . . . . . . . 535
PreRenderable< T >
This mixin can be used on any Drawable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Presenter
The Presenter base class that all application-specific presenters should derive from . . . . . . 538
CWRUtil::Q10
Defines a number with 10 bits reserved for fraction . . . . . . . . . . . . . . . . . . . . . . . 539
CWRUtil::Q15
Defines a number with 15 bits reserved for fraction . . . . . . . . . . . . . . . . . . . . . . . 541
CWRUtil::Q5
Defines a number with 5 bits reserved for fraction . . . . . . . . . . . . . . . . . . . . . . . . 543
Quadruple
Base class for homogeneous vectors and points . . . . . . . . . . . . . . . . . . . . . . . . . 548
RadioButton
Radio button with two states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
RadioButtonGroup< CAPACITY >
Class for handling a collection of RadioButtons . . . . . . . . . . . . . . . . . . . . . . . . . 558
Rasterizer
Polygon Rasterizer that is used to render filled polygons with high-quality Anti- Aliasing . . . . 563
Rect
Class representing a Rectangle with a few convenient methods . . . . . . . . . . . . . . . . . 567
Renderer
This class template is used basically for rendering scan lines . . . . . . . . . . . . . . . . . . 572
RenderingBuffer
Rendering buffer wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
RepeatButton
A button with two states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
RepeatButtonTrigger
A repeat button trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
ScalableImage
Widget for representing a scaled version of a bitmap . . . . . . . . . . . . . . . . . . . . . . 582
Scanline
This class is used to transfer data from class Outline (or a similar one) to the rendering buffer . 586
Screen
A Screen represents a full-screen drawable area. Applications create specific screens by sub-
classing this class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
ScrollableContainer
A ScrollableContainer is a container that allows its contents to be scrolled . . . . . . . . . . . 596
ScrollBase
A scroll base class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
ScrollList
A scrolling menu of drawables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
ScrollWheel
A scroll wheel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
ScrollWheelBase
A scroll wheel base class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
ScrollWheelWithSelectionStyle
A scroll wheel with selection style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
SDL2TouchController
TouchController for the simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
SDLTouchController
TouchController for the simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
Shape< POINTS >
Simple widget capable of drawing a shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
AbstractShape::ShapePoint< T >
Defines an alias representing the array of points making up the abstract shape . . . . . . . . . 647
SlideMenu
SlideMenu is a container that has the functionality of being either collapsed or expanded . . . 647
Slider
A slider is a graphical element with which the user may set a value by moving an indicator or by
clicking the slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
SlideTransition< templateDirection >
A Transition that slides from one screen to the next . . . . . . . . . . . . . . . . . . . . . . . 667
Snapper< T >
A mix-in that will make class T draggable and able to snap to a position . . . . . . . . . . . . 670
SnapshotWidget
A widget that is able to make a snapshot of the area the SnapshotWidget covers . . . . . . . . 672
LCD::StringVisuals
The visual elements when writing a string . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
SwipeContainer
A swipe container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
TextArea
This widget is capable of showing a text area on the screen . . . . . . . . . . . . . . . . . . . 681
TextAreaWithOneWildcard
TextArea with one wildcard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
TextAreaWithTwoWildcards
TextArea with two wildcards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
TextAreaWithWildcardBase
Base class for TextAreas displaying texts with one or more wildcards . . . . . . . . . . . . . . 695
TextButtonStyle< T >
A text button style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
TextProgress
A text progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
TextProvider
The TextProvider is used in drawing basic and wildcard strings . . . . . . . . . . . . . . . . . 703
Texts
Class for setting language and getting texts . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
TextureMapper
Widget capable of drawing a transformed image . . . . . . . . . . . . . . . . . . . . . . . . . 706
TextureSurface
A texture source. Contains a pointer to the data and the width and height of the texture. The
alpha channel is used in 565 rendering with alpha. The stride is the width used when moving to
the next line of the texture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
TiledImage
Simple widget capable of showing a tiled bitmap . . . . . . . . . . . . . . . . . . . . . . . . . 722
TiledImageButtonStyle< T >
A tiled image button style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
ToggleButton
A ToggleButton is a Button specialization that swaps the two bitmaps when clicked . . . . . . . 731
ToggleButtonTrigger
A toggle button trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
TouchArea
Invisible widget used to capture touch events . . . . . . . . . . . . . . . . . . . . . . . . . . 735
TouchButtonTrigger
A touch button trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
TouchCalibration
Calibrates a touch coordinate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
TouchController
Basic Touch Controller interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
Transition
Base class for Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
TwoWildcardTextButtonStyle< T >
A wildcard text button style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
TypedText
TypedText represents text (as in characters) and typography (as in font and alignment) . . . . . 746
TypedText::TypedTextData
The data structure for typed texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
UIEventListener
This class declares a handler interface for user interface events . . . . . . . . . . . . . . . . . 750
Unicode
This class provides simple helper functions for working with 16-bit strings . . . . . . . . . . . 752
Vector< T, capacity >
A very simple container class using pre-allocated memory . . . . . . . . . . . . . . . . . . . 765
Vector4
This class represents a homogeneous 3D vector . . . . . . . . . . . . . . . . . . . . . . . . 769
View< T >
This is a generic touchgfx::Screen specialization for normal applications . . . . . . . . . . . . 770
Widget
A Widget is a Drawable leaf (i.e. not a container) . . . . . . . . . . . . . . . . . . . . . . . . 772
WildcardTextButtonStyle< T >
A wildcard text button style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
ZoomAnimationImage
Class for optimizing and wrapping move and zoom operations on ScalableImages . . . . . . . 777
Namespace Documentation
The global touchgfx namespace. All TouchGFX framework classes and global functions are placed in this names-
pace.
Classes
• class AbstractButton
This class defines an abstract interface for button-like elements.
• class AbstractButtonContainer
An abstract button container.
• class AbstractClock
Superclass of clock widgets.
• class AbstractDirectionProgress
An abstract direction progress.
• class AbstractPainter
An abstract class for creating painter classes for drawing canvas widgets.
• class AbstractPainterBW
A Painter that will paint using a color on a LCD1bpp display.
• class AbstractPainterGRAY2
A Painter that will paint using a color and an alpha value.
• class AbstractPainterGRAY4
A Painter that will paint using a color and an alpha value.
• class AbstractPainterRGB565
A Painter that will paint using a color and an alpha value.
• class AbstractPainterRGB888
A Painter that will paint using a color and an alpha value.
• class AbstractPartition
This type defines an abstract interface to a storage partition for allocating memory slots of equal size.
• class AbstractProgressIndicator
An abstract progress indicator.
• class AbstractShape
Simple widget capable of drawing a abstractShape.
• class AnalogClock
An analog clock.
• class AnimatedImage
36 Namespace Documentation
A circle progress.
• class ClickButtonTrigger
A click button trigger.
• class ClickEvent
A click event.
• class ClickListener
Mix-in class that extends a class with a click action event.
• class Color
Contains functionality for color conversion.
• struct colortype
Type for representing a color.
• class ConstFont
A ConstFont is a Font implementation that has its contents defined at compile-time and usually placed in read-only
memory.
• class Container
A Container is a Drawable that can have child nodes.
• class CoverTransition
A Transition that slides from one screen to the next.
• struct CWRUtil
Helper classes and functions for CanvasWidget.
• class DigitalClock
A digital clock.
• class DisplayTransformation
Defines transformations from display space to frame buffer space.
• class DMA_Interface
DMA_Interface provides basic functionality and structure for processing "blit" operations using DMA.
• class DMA_Queue
This class provides an interface for a FIFO (circular) list used by DMA_Interface and descendants for storing BlitOp's.
• class DragEvent
A drag event.
• class Draggable
Mix-in class that extends a class to become draggable.
• class Drawable
The Drawable class is an abstract definition of something that can be drawn.
• class DrawableList
A container able to display many items using only a few drawables.
• class DrawableListItems
An array of drawables used by DrawableList.
• class DrawableListItemsInterface
A drawable list items interface.
• struct DrawingSurface
The destination of a draw operation. Contains a pointer to where to draw and the stride of the drawing surface.
• class EasingEquations
Defines the "Penner easing functions", which are a de facto standard computing aesthetically pleasing motion anima-
tions.
• struct Edge
An edge contains information about one edge, between two points, of a triangle, as well as information about how to
interpolate values when moving in the vertical direction.
• class Event
Simple base class for events.
• class FadeAnimator
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles.
• class LCD16bpp
This class contains the various low-level drawing routines for drawing bitmaps.
• class LCD1bpp
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles.
• class LCD24bpp
This class contains the various low-level drawing routines for drawing bitmaps.
• class LCD2bpp
This class contains the various low-level drawing routines for drawing bitmaps.
• class LCD4bpp
This class contains the various low-level drawing routines for drawing bitmaps.
• class LED
A led.
• class Line
Simple CanvasWidget capable of drawing a line.
• class LineProgress
A line progress.
• class ListLayout
This class provides a layout mechanism for arranging Drawable instances adjacently in the specified Direction.
• class LockFreeDMA_Queue
This implements a simple lock-free FIFO queue (single producer, single consumer).
• class Matrix4x4
This class represents row major 4x4 homogeneous matrices.
• class MCUInstrumentation
Interface for instrumenting processors to measure MCU load via measured CPU cycles.
• class ModalWindow
Container for displaying a modal window and hijacking touch event to underlaying view and widgets.
• class MoveAnimator
A MoveAnimator makes the template class T able to animate a movement.
• class MVPApplication
A specialization of the TouchGFX Application class.
• class MVPHeap
Generic heap class for MVP applications.
• class NoDMA
This is an "empty" DMA subclass that does nothing except assert if accidentally used.
• class NoTouchController
• class NoTransition
The most simple Transition without any visual effects.
• class OSWrappers
This class specifies OS wrappers for dealing with the frame buffer semaphore and the VSYNC signal.
• class Outline
An internal class that implements the main rasterization algorithm.
• class PainterBW
A Painter that will paint using a color on a LCD1bpp display.
• class PainterBWBitmap
A Painter that will paint using a bitmap.
• class PainterGRAY2
A Painter that will paint using a color and an alpha value.
• class PainterGRAY2Bitmap
A Painter that will paint using a bitmap.
• class PainterGRAY4
• class ScrollableContainer
A ScrollableContainer is a container that allows its contents to be scrolled.
• class ScrollBase
A scroll base class.
• class ScrollList
A scrolling menu of drawables.
• class ScrollWheel
A scroll wheel.
• class ScrollWheelBase
A scroll wheel base class.
• class ScrollWheelWithSelectionStyle
A scroll wheel with selection style.
• class SDL2TouchController
TouchController for the simulator.
• class SDLTouchController
TouchController for the simulator.
• class Shape
Simple widget capable of drawing a shape.
• class SlideMenu
SlideMenu is a container that has the functionality of being either collapsed or expanded.
• class Slider
A slider is a graphical element with which the user may set a value by moving an indicator or by clicking the slider.
• class SlideTransition
A Transition that slides from one screen to the next.
• class Snapper
A mix-in that will make class T draggable and able to snap to a position.
• class SnapshotWidget
A widget that is able to make a snapshot of the area the SnapshotWidget covers.
• class SwipeContainer
A swipe container.
• class TextArea
This widget is capable of showing a text area on the screen.
• class TextAreaWithOneWildcard
TextArea with one wildcard.
• class TextAreaWithTwoWildcards
TextArea with two wildcards.
• class TextAreaWithWildcardBase
Base class for TextAreas displaying texts with one or more wildcards.
• class TextButtonStyle
A text button style.
• class TextProgress
A text progress.
• class TextProvider
The TextProvider is used in drawing basic and wildcard strings.
• class Texts
Class for setting language and getting texts.
• class TextureMapper
The TextureMapper class is a widget capable of drawing a transformed image.
• struct TextureSurface
A texture source. Contains a pointer to the data and the width and height of the texture. The alpha channel is used in
565 rendering with alpha. The stride is the width used when moving to the next line of the texture.
• class TiledImage
Simple widget capable of showing a tiled bitmap.
• class TiledImageButtonStyle
A tiled image button style.
• class ToggleButton
A ToggleButton is a Button specialization that swaps the two bitmaps when clicked.
• class ToggleButtonTrigger
A toggle button trigger.
• class TouchArea
Invisible widget used to capture touch events.
• class TouchButtonTrigger
A touch button trigger.
• class TouchCalibration
Calibrates a touch coordinate.
• class TouchController
Basic Touch Controller interface.
• class Transition
The Transition class is the base class for Transitions.
• class TwoWildcardTextButtonStyle
A wildcard text button style.
• class TypedText
TypedText represents text (as in characters) and typography (as in font and alignment).
• class UIEventListener
This class declares a handler interface for user interface events.
• class Unicode
This class provides simple helper functions for working with 16-bit strings.
• class Vector
A very simple container class using pre-allocated memory.
• class Vector4
This class represents a homogeneous 3D vector.
• class View
This is a generic touchgfx::Screen specialization for normal applications.
• class Widget
A Widget is a Drawable leaf (i.e. not a container).
• class WildcardTextButtonStyle
A wildcard text button style.
• class ZoomAnimationImage
Class for optimizing and wrapping move and zoom operations on ScalableImages.
Typedefs
Enumerations
Functions
Multiplication operator.
• float fixed28_4ToFloat (fixed28_4 value)
Fixed 28 4 to float.
• fixed28_4 floatToFixed28_4 (float value)
Float to fixed 28 4.
• fixed16_16 floatToFixed16_16 (float value)
Float to fixed 16.
• fixed28_4 fixed28_4Mul (fixed28_4 a, fixed28_4 b)
Fixed 28 4 mul.
• int32_t ceil28_4 (fixed28_4 value)
Ceiling 28 4.
• void floorDivMod (int32_t numerator, int32_t denominator, int32_t &floor, int32_t &mod)
Floor div modifier.
• void memset (void ∗data, uint8_t c, uint32_t size)
Simple implementation of the standard memset function.
• RenderingVariant lookupNearestNeighborRenderVariant (const Bitmap &bitmap)
Returns the associated nearest neighbor render variant based on the bitmap format.
• RenderingVariant lookupBilinearRenderVariant (const Bitmap &bitmap)
Returns the associated bilinear render variant based on the bitmap format.
• template<typename T >
T abs (T d)
Simple implementation of the standard abs function.
• template<typename T >
T gcd (T a, T b)
Find greatest common divisor.
• int32_t clz (int32_t x)
Count leading zeros.
• int32_t muldiv (int32_t factor1, int32_t factor2, int32_t divisor, int32_t &remainder)
Multiply and divide.
Variables
6.1.1.1 Alignment
uint8_t Alignment
6.1.1.2 EasingEquation
This function pointer typedef matches the signature for all easing equations. Thereby EasingEquation is a conve-
nient shorthand for a pointer to any easing equation.
6.1.1.3 RenderingVariant
uint16_t RenderingVariant
Describes a combination of rendering algorithm, image format, and alpha information. The lowest bit is 0 for "←-
Nearest neighbor", 1 for "Bilinear". The next bit is "0" for "no alpha", "2" for "alpha". The rest is the Bitmap::Format
shifted up by 2.
6.1.1.4 TextDirection
uint8_t TextDirection
6.1.2.1 BlitOperations
enum BlitOperations
Enumerator
Enumerator
6.1.2.2 Direction
Enumerator
6.1.2.3 DisplayOrientation
Enumerator
ORIENTATION_LANDSCAPE The display has more pixels from left to right than from top to bottom.
ORIENTATION_PORTRAIT The display has more pixels from top to bottom than from right to left.
6.1.2.4 DisplayRotation
See also
DisplayOrientation
Enumerator
6.1.2.5 FrameBuffer
Enumerator
6.1.2.6 GlyphFlags
enum GlyphFlags
Enumerator
GLYPH_DATA_FORMAT_A4 Indicates whether or not glyph data was generated in A4 data format for
an ST platform.
GLYPH_DATA_WIDTH_BIT8 The 9th bit of "width".
GLYPH_DATA_HEIGHT_BIT8 The 9th bit of "height".
GLYPH_DATA_TOP_BIT8 The 9th bit of "top".
GLYPH_DATA_TOP_BIT9 The sign bit of "top".
GLYPH_DATA_ADVANCE_BIT8 The 9th bit of "advance".
6.1.2.7 Gradient
Enumerator
6.1.2.8 TextRotation
Defines a rotation of text. Each enumeration option specifies the number of degrees the text is turned clockwise.
Enumerator
6.1.2.9 WideTextAction
See also
TextArea::setWideTextAction
Enumerator
6.1.3.1 abs()
Template Parameters
Parameters
Returns
6.1.3.2 ceil28_4()
int32_t ceil28_4 (
fixed28_4 value ) [inline]
Parameters
value The value.
Returns
6.1.3.3 clz()
Parameters
Returns
An int32_t.
6.1.3.4 finalizeTransition()
Parameters
6.1.3.5 fixed28_4Mul()
fixed28_4 fixed28_4Mul (
fixed28_4 a,
fixed28_4 b ) [inline]
Parameters
Returns
the result.
6.1.3.6 fixed28_4ToFloat()
float fixed28_4ToFloat (
fixed28_4 value ) [inline]
Parameters
value The value.
Returns
6.1.3.7 floatToFixed16_16()
fixed16_16 floatToFixed16_16 (
float value ) [inline]
Parameters
value The value.
Returns
6.1.3.8 floatToFixed28_4()
fixed28_4 floatToFixed28_4 (
float value ) [inline]
Parameters
value The value.
Returns
6.1.3.9 floorDivMod()
void floorDivMod (
int32_t numerator,
int32_t denominator,
int32_t & floor,
int32_t & mod ) [inline]
Parameters
numerator The numerator.
denominator The denominator.
in,out floor The floor.
in,out mod The modifier.
6.1.3.10 gcd()
Template Parameters
Parameters
Returns
A T.
6.1.3.11 hw_init()
void hw_init ( )
Function to perform generic hardware initialization of the board. This function prototype is only provided as a
convention.
Parameters
addr The address.
offset The offset.
Returns
Parameters
addr The address.
offset The offset.
Returns
Parameters
in addr The address.
offset The offset.
value The value.
Parameters
in addr The address.
offset The offset.
value The value.
6.1.3.16 LCD2shiftVal()
Parameters
Returns
Parameters
addr The address.
offset The offset.
Returns
Parameters
addr The address.
offset The offset.
Returns
Parameters
in addr The address.
offset The offset.
value The value.
Parameters
in addr The address.
offset The offset.
value The value.
6.1.3.21 lookupBilinearRenderVariant()
RenderingVariant lookupBilinearRenderVariant (
const Bitmap & bitmap )
Returns the associated bilinear render variant based on the bitmap format.
Parameters
bitmap The bitmap.
Returns
6.1.3.22 lookupNearestNeighborRenderVariant()
RenderingVariant lookupNearestNeighborRenderVariant (
const Bitmap & bitmap )
Returns the associated nearest neighbor render variant based on the bitmap format.
Parameters
bitmap The bitmap.
Returns
6.1.3.23 makeTransition()
template< class ScreenType, class PresenterType, class TransType, class ModelType > Presenter←-
Type ∗ makeTransition (
Screen ∗∗ currentScreen,
Presenter ∗∗ currentPresenter,
MVPHeap & heap,
Transition ∗∗ currentTrans,
ModelType ∗ model )
Will properly clean up old screen (tearDownScreen, Presenter::deactivate) and call setupScreen/activate on new
view/presenter pair. Will also make sure the view, presenter and model are correctly bound to each other.
Template Parameters
Parameters
Returns
Pointer to the new Presenter of the requested type. Incidentally it will be the same value as the old presenter
due to memory reuse.
6.1.3.24 memset()
void memset (
void ∗ data,
uint8_t c,
uint32_t size )
Parameters
6.1.3.25 muldiv()
Multiply and divide without causing overflow. Multiplying two large values and subsequently dividing the result with
another large value might cause an overflow in the intermediate result. The function muldiv() will multiply the two
first values and divide the result by the third value without causing overflow (unless the final result would overflow).
The remainder from the calculation is also returned.
Parameters
Returns
An int32_t.
Matrix4x4 operator∗ (
Multiplication operator.
Parameters
Returns
Point4 operator∗ (
const Matrix4x4 & multiplicand,
const Point4 & multiplier )
Multiplication operator.
Parameters
Returns
6.1.3.28 prepareTransition()
Parameters
6.1.3.29 touchgfx_generic_init()
Functions
Template Parameters
HALType The class type of the HAL subclass used for this port.
Parameters
Returns
6.1.3.30 touchgfx_init()
void touchgfx_init ( )
Function to perform touchgfx initialization. This function prototype is only provided as a convention.
6.1.4.1 TYPED_TEXT_INVALID
This type shall be used by the application to define unique IDs for all typed texts in the system. The application shall
define typed text IDs in the range [0,number of typed texts - 1].
Class Documentation
• AbstractButton ()
Constructor.
• virtual void handleClickEvent (const ClickEvent &event)
Updates the current state of the button.
• void setAction (GenericCallback< const AbstractButton & > &callback)
Associates an action to be performed when the AbstractButton is clicked.
• virtual bool getPressedState () const
Function to determine whether this AbstractButton is currently pressed.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
This class defines an abstract interface for button-like elements. A button is a clickable element that has two states
- pressed or released - and executes an action when the pressed->released transition is made.
See also
Widget
64 Class Documentation
7.1.2.1 AbstractButton()
AbstractButton ( ) [inline]
7.1.3.1 getPressedState()
Returns
7.1.3.2 getType()
Returns
TYPE_ABSTRACTBUTTON.
7.1.3.3 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [virtual]
Updates the current state of the button - pressed or released - and invalidates it.
If a transition from the pressed to the released state was made, the associated action is executed and then the
Widget is invalidated.
Parameters
See also
Drawable::handleClickEvent()
7.1.3.4 setAction()
void setAction (
GenericCallback< const AbstractButton & > & callback ) [inline]
Parameters
callback The callback to be executed. The callback will be given a reference to the AbstractButton.
See also
GenericCallback
• AbstractButtonContainer ()
Default constructor.
• virtual ∼AbstractButtonContainer ()
Destructor.
• void setPressed (bool isPressed)
Sets the pressed state.
• bool getPressed ()
Gets the pressed state.
• void setAlpha (uint8_t newAlpha)
Sets an alpha value.
• uint8_t getAlpha () const
Gets the alpha.
• void setAction (GenericCallback< const AbstractButtonContainer & > &callback)
Sets an action callback.
Protected Attributes
• bool pressed
True if pressed.
• uint8_t alpha
The current alpha value. 255 denotes solid, 0 denotes completely transparent.
• GenericCallback< const AbstractButtonContainer &> ∗ action
The action.
An abstract button container. It defines pressed/not pressed state, the alpha value, and the action Callback of a
button. AbstractButtonContainer is used as superclass for classes defining a specific button behaviour.
See also
7.2.2.1 getAlpha()
Returns
7.2.2.2 getPressed()
Returns
7.2.2.3 setAction()
void setAction (
GenericCallback< const AbstractButtonContainer & > & callback ) [inline]
Parameters
callback The callback.
7.2.2.4 setAlpha()
void setAlpha (
uint8_t newAlpha ) [inline]
Parameters
newAlpha The new alpha.
7.2.2.5 setPressed()
void setPressed (
bool isPressed ) [inline]
Parameters
• AbstractClock ()
Default constructor.
• virtual ∼AbstractClock ()
Destructor.
• virtual void setTime24Hour (uint8_t hour, uint8_t minute, uint8_t second)
Sets the time with input format as 24H.
• virtual void setTime12Hour (uint8_t hour, uint8_t minute, uint8_t second, bool am)
Sets the time with input format as 12H.
• uint8_t getCurrentHour () const
Gets the current hour.
• uint8_t getCurrentMinute () const
Gets the current minute.
• uint8_t getCurrentSecond () const
Gets the current second.
Protected Attributes
• uint8_t currentHour
Local copy of the current hour.
• uint8_t currentMinute
Local copy of the current minute.
• uint8_t currentSecond
Local copy of the current second.
7.3.1.1 AbstractClock()
AbstractClock ( )
Default constructor.
7.3.1.2 ∼AbstractClock()
Destructor.
7.3.2.1 getCurrentHour()
Returns
7.3.2.2 getCurrentMinute()
Returns
7.3.2.3 getCurrentSecond()
Returns
7.3.2.4 setTime12Hour()
void setTime12Hour (
uint8_t hour,
uint8_t minute,
uint8_t second,
bool am ) [virtual]
Sets the time with input format as 12H. Note that this does not affect any selected presentation formats.
Parameters
7.3.2.5 setTime24Hour()
void setTime24Hour (
uint8_t hour,
uint8_t minute,
uint8_t second ) [virtual]
Sets the time with input format as 24H. Note that this does not affect any selected presentation formats.
Parameters
7.3.2.6 updateClock()
Public Types
• AbstractDirectionProgress ()
Default constructor.
• virtual ∼AbstractDirectionProgress ()
Destructor.
• virtual void setDirection (DirectionType direction)
Sets a direction.
• virtual DirectionType getDirection () const
Gets the direction.
Protected Attributes
• DirectionType progressDirection
The progress direction.
An abstract direction progress for progress indicators that need a direction to be specified.
7.4.2.1 DirectionType
7.4.3.1 AbstractDirectionProgress()
AbstractDirectionProgress ( )
Default constructor.
7.4.3.2 ∼AbstractDirectionProgress()
∼AbstractDirectionProgress ( ) [virtual]
Destructor.
7.4.4.1 getDirection()
Returns
The direction.
7.4.4.2 setDirection()
void setDirection (
DirectionType direction ) [virtual]
Sets a direction.
Parameters
direction The direction.
An abstract class for creating painter classes for drawing canvas widgets.
#include <touchgfx/widgets/canvas/AbstractPainter.hpp>
• AbstractPainter ()
Default constructor.
• virtual ∼AbstractPainter ()
Destructor.
• void setOffset (uint16_t offsetX, uint16_t offsetY)
Sets the offset of the area being drawn.
• virtual void render (uint8_t ∗ptr, int x, int xAdjust, int y, unsigned count, const uint8_t ∗covers)=0
Paint a designated part of the RenderingBuffer.
Protected Attributes
• int16_t areaOffsetX
The offset x coordinate of the area being drawn.
• int16_t areaOffsetY
The offset y coordinate of the area being drawn.
• uint8_t widgetAlpha
The alpha of the widget using the painter.
An abstract class for creating painter classes for drawing canvas widgets.
7.5.2.1 AbstractPainter()
AbstractPainter ( )
Default constructor.
7.5.2.2 ∼AbstractPainter()
∼AbstractPainter ( ) [virtual]
Destructor.
7.5.3.1 render()
void render (
uint8_t ∗ ptr,
int x,
int xAdjust,
int y,
unsigned count,
const uint8_t ∗ covers ) [pure virtual]
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.5.3.2 setOffset()
void setOffset (
uint16_t offsetX,
uint16_t offsetY )
Sets the offset of the area being drawn. This allows render() to calculate the x, y relative to the widget, and not just
relative to the invalidated area.
Parameters
offsetX The offset x coordinate of the invalidated area relative to the widget.
offsetY The offset y coordinate of the invalidated area relative to the widget.
7.5.3.3 setWidgetAlpha()
void setWidgetAlpha (
uint8_t alpha ) [protected]
Sets the widget alpha to allow an entire canvas widget to easily be faded without changing the painter of the widget.
Parameters
alpha The alpha.
Note
• virtual void render (uint8_t ∗ptr, int x, int xAdjust, int y, unsigned count, const uint8_t ∗covers)
Paint a designated part of the RenderingBuffer.
Protected Attributes
• uint16_t currentX
Current x coordinate relative to the widget.
• uint16_t currentY
Current y coordinate relative to the widget.
AbstractPainterBW is used for drawing one 1bpp displays. The color is either on or off No transparency is supported.
See also
AbstractPainter
7.6.2.1 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
Implements AbstractPainter.
Reimplemented in PainterBW, and PainterBWBitmap.
7.6.2.2 renderInit()
Returns
Reimplemented in PainterBWBitmap.
7.6.2.3 renderNext()
bool renderNext (
uint8_t & color ) [protected], [pure virtual]
Parameters
Returns
• virtual void render (uint8_t ∗ptr, int x, int xAdjust, int y, unsigned count, const uint8_t ∗covers)
Paint a designated part of the RenderingBuffer.
Protected Attributes
• int currentX
Current x coordinate relative to the widget.
• int currentY
Current y coordinate relative to the widget.
The AbstractPainterGRAY2 class allows a shape to be filled with a given color and alpha value. This allows trans-
parent, anti-aliased elements to be drawn.
See also
AbstractPainter
7.7.2.1 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
Implements AbstractPainter.
Reimplemented in PainterGRAY2, and PainterGRAY2Bitmap.
7.7.2.2 renderInit()
Returns
Reimplemented in PainterGRAY2Bitmap.
7.7.2.3 renderNext()
bool renderNext (
uint8_t & gray,
uint8_t & alpha ) [protected], [pure virtual]
Parameters
Returns
7.7.2.4 renderPixel()
void renderPixel (
uint8_t ∗ p,
uint16_t offset,
uint8_t gray ) [protected], [virtual]
Parameters
in p pointer into the frame buffer line where the given pixel should be written.
offset The offset to the pixel from the given pointer.
gray The green color.
• virtual void render (uint8_t ∗ptr, int x, int xAdjust, int y, unsigned count, const uint8_t ∗covers)
Protected Attributes
• int currentX
Current x coordinate relative to the widget.
• int currentY
Current y coordinate relative to the widget.
The AbstractPainterGRAY4 class allows a shape to be filled with a given color and alpha value. This allows trans-
parent, anti-aliased elements to be drawn.
See also
AbstractPainter
7.8.2.1 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
Implements AbstractPainter.
Reimplemented in PainterGRAY4, and PainterGRAY4Bitmap.
7.8.2.2 renderInit()
Returns
Reimplemented in PainterGRAY4Bitmap.
7.8.2.3 renderNext()
bool renderNext (
uint8_t & gray,
uint8_t & alpha ) [protected], [pure virtual]
Parameters
Returns
7.8.2.4 renderPixel()
void renderPixel (
uint8_t ∗ p,
uint16_t offset,
uint8_t gray ) [protected], [virtual]
Parameters
in p pointer into the frame buffer line where the given pixel should be written.
offset The offset to the pixel from the given pointer.
gray The green color.
• virtual void render (uint8_t ∗ptr, int x, int xAdjust, int y, unsigned count, const uint8_t ∗covers)
Paint a designated part of the RenderingBuffer.
• FORCE_INLINE_FUNCTION uint16_t mixColors (uint16_t newpix, uint16_t bufpix, uint16_t alpha, uint16_t
shift)
Mix colors.
• FORCE_INLINE_FUNCTION uint16_t mixColors (uint16_t R, uint16_t G, uint16_t B, uint16_t bufpix, uint16←-
_t alpha, uint16_t shift)
Mix colors.
Protected Attributes
• int currentX
Current x coordinate relative to the widget.
• int currentY
Current y coordinate relative to the widget.
The AbstractPainterRGB565 class allows a shape to be filled with a given color and alpha value. This allows
transparent, anti-aliased elements to be drawn.
See also
AbstractPainter
Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel.
Parameters
newpix The newpix value.
bufpix The bufpix value.
alpha The alpha of the newpix.
shift The shift, 8 if alpha is [0..255], 16 if alpha is [0..255∗255].
Returns
Mix colors from a new pixel and a buffer pixel with the given alpha applied to the new pixel.
Parameters
Returns
7.9.2.3 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
Implements AbstractPainter.
Reimplemented in PainterRGB565, and PainterRGB565Bitmap.
7.9.2.4 renderInit()
Returns
Reimplemented in PainterRGB565Bitmap.
7.9.2.5 renderNext()
bool renderNext (
uint8_t & red,
uint8_t & green,
uint8_t & blue,
uint8_t & alpha ) [protected], [pure virtual]
Parameters
out red The red.
out green The green.
out blue The blue.
out alpha The alpha.
Returns
7.9.2.6 renderPixel()
void renderPixel (
uint16_t ∗ p,
uint8_t red,
uint8_t green,
uint8_t blue ) [protected], [virtual]
Renders the pixel into the frame buffer. The colors are reduced from 8,8,8 to 5,6, 5.
Parameters
in p pointer into the frame buffer where the given color should be written.
red The red color.
green The green color.
blue The blue color.
• virtual void render (uint8_t ∗ptr, int x, int xAdjust, int y, unsigned count, const uint8_t ∗covers)
Paint a designated part of the RenderingBuffer.
Protected Attributes
• int currentX
Current x coordinate relative to the widget.
• int currentY
Current y coordinate relative to the widget.
The AbstractPainterRGB888 class allows a shape to be filled with a given color and alpha value. This allows
transparent, anti-aliased elements to be drawn.
See also
AbstractPainter
7.10.2.1 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
Implements AbstractPainter.
Reimplemented in PainterRGB888, and PainterRGB888Bitmap.
7.10.2.2 renderInit()
Returns
Reimplemented in PainterRGB888Bitmap.
7.10.2.3 renderNext()
bool renderNext (
uint8_t & red,
uint8_t & green,
uint8_t & blue,
uint8_t & alpha ) [protected], [pure virtual]
Parameters
out red The red.
out green The green.
out blue The blue.
out alpha The alpha.
Returns
7.10.2.4 renderPixel()
void renderPixel (
uint16_t ∗ p,
uint8_t red,
uint8_t green,
uint8_t blue ) [protected], [virtual]
Renders the pixel into the frame buffer. The colors are reduced from 8,8,8 to 5,6, 5.
Parameters
in p pointer into the frame buffer where the given color should be written.
red The red color.
green The green color.
blue The blue color.
This type defines an abstract interface to a storage partition for allocating memory slots of equal size.
#include <touchgfx/common/AbstractPartition.hpp>
• virtual ∼AbstractPartition ()
Virtual destructor.
• virtual void ∗ allocate (uint16_t size)
This type defines an abstract interface to a storage partition for allocating memory slots of equal size. The "partition"
is not aware of the actual types stored in the partition memory, hence it provides no mechanism for deleting C++
objects when clear()'ed.
7.11.2.1 ∼AbstractPartition()
∼AbstractPartition ( ) [virtual]
Virtual destructor.
7.11.2.2 AbstractPartition()
AbstractPartition ( ) [protected]
Default constructor.
void ∗ allocate (
uint16_t size ) [virtual]
Gets the address of the next available storage slot. The slot size is compared with the specified size.
Note
Parameters
size The size.
Returns
The address of an empty storage slot which contains minimum 'size' bytes.
Gets the address of the next available storage slot. The slot size is determined from the size of type T.
Note
Template Parameters
Returns
void ∗ allocateAt (
uint16_t index,
uint16_t size ) [virtual]
Note
Parameters
Returns
The address of the appropriate storage slot which contains minimum 'size' bytes.
Gets the address of the specified storage slot. The slot size is determined from the size of type T.
Note
Template Parameters
Parameters
Returns
Template Parameters
Parameters
index The index into the Partition storage where the returned object is located.
Returns
Template Parameters
Parameters
Returns
A T&
7.11.3.7 capacity()
Returns
7.11.3.8 clear()
Prepares the Partition for new allocations. Any objects present in the Partition shall not be used after invoking this
method.
7.11.3.9 dec()
void ∗ element (
uint16_t index ) [protected], [pure virtual]
Parameters
Returns
Parameters
Returns
7.11.3.12 element_size()
Returns
An uint32_t.
7.11.3.13 find()
Determines if the specified object could have been previously allocated in the partition. Since the Partition concept
is loosely typed this method shall be used with care. The method does not guarantee that the found object at the
returned index is a valid object. It only tests whether or not the object is within the bounds of the current partition
allocations.
Template Parameters
Parameters
pT Pointer to the object to lookup.
Returns
If the object seems to be allocated in the Partition, a Pair object containing a typed pointer to the object and
an index into the Partition storage is returned. Otherwise, a Pair< 0, 0 > is returned.
7.11.3.14 getAllocationCount()
Returns
7.11.3.15 indexOf()
uint16_t indexOf (
const void ∗ address ) [virtual]
Determines index of previously allocated location. Since the Partition concept is loosely typed this method shall be
used with care. The method does not guarantee that the found object at the returned index is a valid object. It only
tests whether or not the object is within the bounds of the current partition allocations.
Parameters
address The location address to lookup.
Returns
An uint16_t.
• AbstractProgressIndicator ()
Default constructor.
• virtual ∼AbstractProgressIndicator ()
Destructor.
• virtual void setBackground (const Bitmap &bmpBackground)
Sets the background image.
• virtual void setProgressIndicatorPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the position and dimension of the actual progress indicator.
• virtual int16_t getProgressIndicatorX () const
Gets progress indicator x coordinate.
• virtual int16_t getProgressIndicatorY () const
Gets progress indicator y coordinate.
• virtual int16_t getProgressIndicatorWidth () const
Gets progress indicator width.
• virtual int16_t getProgressIndicatorHeight () const
Gets progress indicator height.
• virtual void setRange (int16_t min, int16_t max, uint16_t steps=0, uint16_t minStep=0)
Sets the range for the progress indicator.
• virtual void getRange (int16_t &min, int16_t &max, uint16_t &steps, uint16_t &minStep) const
Gets the range.
• virtual void getRange (int16_t &min, int16_t &max, uint16_t &steps) const
Gets the range.
• virtual void getRange (int16_t &min, int16_t &max) const
Gets the range.
• virtual void setValue (int value)
Sets a value.
• virtual int getValue () const
Gets the value.
• virtual uint16_t getProgress (uint16_t range=100) const
Gets the progress.
Protected Attributes
• Image background
The background image.
• Container progressIndicatorContainer
The container that holds the actual progress indicator.
• int16_t rangeMin
The AbstractProgressIndicator declares methods that provides the basic mechanisms and tools to implement a
progress indicator. For more specific implementations see classes that inherit from AbstractProgressIndicator.
See also
BoxProgess
CircleProgress
ImageProgress
LineProgress
TextProgress
7.12.2.1 AbstractProgressIndicator()
AbstractProgressIndicator ( )
See also
setRange
7.12.2.2 ∼AbstractProgressIndicator()
∼AbstractProgressIndicator ( ) [virtual]
Destructor.
7.12.3.1 getProgress()
uint16_t getProgress (
uint16_t range = 100 ) const [virtual]
Gets the current progress based on the range set by setRange() and the value set by setValue().
Parameters
range The range.
Returns
The progress.
See also
setRange, setValue
7.12.3.2 getProgressIndicatorHeight()
Returns
7.12.3.3 getProgressIndicatorWidth()
Returns
7.12.3.4 getProgressIndicatorX()
Returns
7.12.3.5 getProgressIndicatorY()
Returns
void getRange (
int16_t & min,
int16_t & max,
uint16_t & steps,
uint16_t & minStep ) const [virtual]
Parameters
out min The minimum input value.
out max The maximum input value.
out steps The steps in which to report progress.
out minStep The step which the minimum input value is mapped to.
void getRange (
int16_t & min,
int16_t & max,
uint16_t & steps ) const [virtual]
Parameters
out min The minimum input value.
out max The maximum input value.
out steps The steps in which to report progress.
void getRange (
int16_t & min,
int16_t & max ) const [virtual]
Parameters
out min The minimum input value.
out max The maximum input value.
7.12.3.9 getValue()
Returns
The value.
7.12.3.10 setBackground()
void setBackground (
const Bitmap & bmpBackground ) [virtual]
Sets the background image. The width and height of the widget is updated according to the dimension of the image.
Parameters
bmpBackground The background bitmap.
7.12.3.11 setProgressIndicatorPosition()
void setProgressIndicatorPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [virtual]
Sets the position and dimension of the actual progress indicator relative to the background image.
Parameters
x The x coordinate.
y The y coordinate.
width The width of the box progress indicator.
height The height of the box progress indicator.
7.12.3.12 setRange()
void setRange (
int16_t min,
int16_t max,
uint16_t steps = 0,
uint16_t minStep = 0 ) [virtual]
Sets the range for the progress indicator. The range is the values that are given to the progress indicator while
progressing through the task at hand. If an app needs to work through 237 items to finish a task, the range should
be set to (0, 237) assuming that 0 items is the minimum. Though the minimum is often 0, it is possible to customize
this.
The steps parameter, is used to specify at what granularity you want the progress indicator to report a new progress
value. If the 237 items to be reported as 0%, 10%, 20%, ... 100%, the steps should be set to 10 as there are ten
steps from 0% to 100%. If you want to update a widget which is 150 pixels wide, you might want to set steps to 150
to get a new progress value for every pixel. If you are updating a clock and want this to resemble an analog clock,
you might want to use 12 or perhaps 60 as number of steps.
The minStep parameter is used when the value min should give a progress different from 0. For example, if progress
is a clock face, you want to count from 0..1000 and you want progress per minute, but want to make sure that 0
is not a blank clock face, but instead you want 1 minute to show, the setRange(0, 1000, 60, 1) will make sure that
as values progress from 0 to 1000, getProgress() start from 1 and goes up to 60. Another example could be a
BoxProgress with a TextProgress on top and you want to make sure that "0%" will always show in the box, use
something like setRange(0, 1000, 200, 40) if your box is 200 wide and "0%" is 40 wide.
Parameters
min The minimum input value.
max The maximum input value.
steps The steps in which to report progress.
minStep The step which the minimum input value is mapped to.
See also
setValue, getProgress
7.12.3.13 setValue()
void setValue (
int value ) [virtual]
Sets the current value in the range (min..max) set by setRange(). Values lower than min are mapped to min, values
higher than max are mapped to max.
Parameters
value The value.
#include <touchgfx/widgets/canvas/AbstractShape.hpp>
Classes
• struct ShapePoint
Defines an alias representing the array of points making up the abstract shape.
• AbstractShape ()
Constructs a new AbstractShape.
• virtual ∼AbstractShape ()
Virtual Destructor.
• virtual int getNumPoints () const =0
Gets number points used to make up the shape.
• virtual void setCorner (int i, CWRUtil::Q5 x, CWRUtil::Q5 y)=0
Sets a corner of the shape.
• virtual CWRUtil::Q5 getCornerX (int i) const =0
Gets the x coordinate of a corner.
• virtual CWRUtil::Q5 getCornerY (int i) const =0
Gets the y coordinate of a corner.
• template<typename T >
void setShape (ShapePoint< T > ∗points)
Sets a shape the struct Points.
• template<typename T >
void setOrigin (T x, T y)
Sets the position of (0,0).
• template<typename T >
void moveOrigin (T x, T y)
Moves the start point for this AbstractShape.
• template<typename T >
void getOrigin (T &dx, T &dy) const
Gets the start coordinates for the line.
• template<typename T >
void setAngle (T angle)
Sets the angle to turn the abstractShape.
• template<typename T >
void updateAngle (T angle)
Sets the angle to turn the abstractShape.
• int getAngle () const
Gets the current angle of the abstractShape.
• template<typename T >
void setScale (T newXScale, T newYScale)
Scale the AbstractShape.
• template<typename T >
void setScale (T scale)
Scale the AbstractShape.
• template<typename T >
void getScale (T &x, T &y) const
Gets the x scale and y scale.
• virtual bool drawCanvasWidget (const Rect &invalidatedArea) const
Draws the AbstractShape.
• void updateAbstractShapeCache ()
Updates the abstractShape cache.
Simple widget capable of drawing a abstractShape. The abstractShape can be scaled and rotated around 0,0. Note
that the y axis goes down, so a abstractShape that goes up must be given negative coordinates.
See also
CanvasWidget
tparam T The type of the points used for the abstractShape. Must be int or float.
7.13.2.1 AbstractShape()
AbstractShape ( )
7.13.2.2 ∼AbstractShape()
∼AbstractShape ( ) [virtual]
Virtual Destructor.
7.13.3.1 drawCanvasWidget()
bool drawCanvasWidget (
const Rect & invalidatedArea ) const [virtual]
Draws the AbstractShape. This class supports partial drawing, so only the area described by the rectangle will be
drawn.
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
Returns
Implements CanvasWidget.
7.13.3.2 getAngle()
Returns
7.13.3.3 getCacheX()
CWRUtil::Q5 getCacheX (
int i ) const [protected], [pure virtual]
Parameters
Returns
7.13.3.4 getCacheY()
CWRUtil::Q5 getCacheY (
int i ) const [protected], [pure virtual]
Parameters
Returns
7.13.3.5 getCornerX()
CWRUtil::Q5 getCornerX (
int i ) const [pure virtual]
Parameters
Returns
7.13.3.6 getCornerY()
CWRUtil::Q5 getCornerY (
int i ) const [pure virtual]
Parameters
Returns
7.13.3.7 getMinimalRect()
Gets minimal rectangle containing the abstractShape. Used for invalidating only the required part of the screen.
Returns
7.13.3.8 getNumPoints()
Returns
7.13.3.9 getOrigin()
Template Parameters
Parameters
out dx The x coordinate.
out dy The y coordinate.
7.13.3.10 getScale()
Gets the x scale and y scale of the shape as previously set using setScale. Default is 1 for both x scale and y scale.
Template Parameters
Parameters
See also
setScale
7.13.3.11 moveOrigin()
T y ) [inline]
Moves the start point for this AbstractShape. The rectangle that surrounds the old and new area covered by the
shape will be invalidated.
Template Parameters
Parameters
Note
The area containing the AbstractShape is invalidated before and after the change.
See also
setOrigin()
7.13.3.12 setAngle()
Sets the angle to turn the abstractShape. 0 degrees is straight up and 90 degrees is 3 o'clock.
Template Parameters
Parameters
angle The angle to turn the abstractShape to relative to 0 (straight up), not relative to the previous angle.
Note
See also
updateAngle()
7.13.3.13 setCache()
void setCache (
int i,
CWRUtil::Q5 x,
CWRUtil::Q5 y ) [protected], [pure virtual]
Sets the cached coordinates of a given corner. The coordinates in the cache are the coordinates from the corners
after rotating and scaling the coordinate.
Parameters
7.13.3.14 setCorner()
void setCorner (
int i,
CWRUtil::Q5 x,
CWRUtil::Q5 y ) [pure virtual]
Parameters
Note
Remember to call updateAbstractShapeCache() to make sure that the cached outline of the shape is correct.
See also
updateAbstractShapeCache
7.13.3.15 setOrigin()
Sets the position of (0,0) used when the abstractShape was created. This means that all coordinates initially used
when created the shape are moved relative to these given offsets. Calling setOrigin() again, will not add to the
previous settings of setOrigin() but will replace the old values for origin.
Template Parameters
Parameters
Note
See also
moveOrigin()
Scale the AbstractShape the given amounts in the x direction and the y direction.
Template Parameters
Parameters
Note
See also
getScale, updateScale
Scale the AbstractShape the given amount in the x direction and the y direction.
Template Parameters
Parameters
scale The scale in the x direction.
Note
See also
getScale
7.13.3.18 setShape()
Sets a shape the struct Points. The cached outline of the shape is automatically updated.
Template Parameters
Parameters
in points The points that make up the shape.
Note
7.13.3.19 updateAbstractShapeCache()
void updateAbstractShapeCache ( )
Updates the abstractShape cache. The cache is used to be able to quickly redraw the AbstractShape without
calculating the points that make up the abstractShape (with regards to scaling and rotation).
7.13.3.20 updateAngle()
Sets the angle to turn the abstractShape. 0 degrees is straight up and 90 degrees is 3 o'clock.
Template Parameters
Parameters
Note
The area containing the AbstractShape is invalidated before and after the change.
See also
setAngle()
An analog clock.
#include <touchgfx/containers/clock/AnalogClock.hpp>
• AnalogClock ()
Default constructor.
• virtual ∼AnalogClock ()
Destructor.
• virtual void setBackground (const BitmapId backgroundBitmapId)
Sets the background image of the clock.
• virtual void setBackground (const BitmapId backgroundBitmapId, int16_t rotationCenterX, int16_t rotation←-
CenterY)
Sets the background image of the clock and the rotation center of the clock.
• virtual void setRotationCenter (int16_t rotationCenterX, int16_t rotationCenterY)
Sets the rotation center of the clock.
• virtual void setupHourHand (const BitmapId hourHandBitmapId, int16_t rotationCenterX, int16_t rotation←-
CenterY)
Sets up the hour hand.
• virtual void setupMinuteHand (const BitmapId minuteHandBitmapId, int16_t rotationCenterX, int16_←-
t rotationCenterY)
Sets up the minute hand.
• virtual void setupSecondHand (const BitmapId secondHandBitmapId, int16_t rotationCenterX, int16_←-
t rotationCenterY)
Sets up the second hand.
• virtual void setHourHandMinuteCorrection (bool active)
Sets hour hand minute correction.
• virtual bool getHourHandMinuteCorrection () const
Gets hour hand minute correction.
• virtual void setMinuteHandSecondCorrection (bool active)
Sets minute hand second correction.
• virtual bool getMinuteHandSecondCorrection () const
Gets minute hand second correction.
• virtual void setAnimation (uint16_t duration=10, EasingEquation animationProgressionEquation=Easing←-
Equations::backEaseInOut)
Setup the clock to use animation for hand movements.
Protected Attributes
• Image background
The background image of the AnalogClock.
• AnimationTextureMapper hourHand
TextureMapper that represents the hourHand.
• AnimationTextureMapper minuteHand
TextureMapper that represents the minuteHand.
• AnimationTextureMapper secondHand
TextureMapper that represents the secondHand.
• EasingEquation animationEquation
The easing equation used by hand animations.
• uint16_t animationDuration
The duration of hand animations. If 0 animations are disabled.
• int16_t clockRotationCenterX
The rotation point (X) of the hands.
• int16_t clockRotationCenterY
The rotation point (Y) of the hands.
• uint8_t lastHour
The last know hour value.
• uint8_t lastMinute
The last know minute value.
• uint8_t lastSecond
The last know second value.
• bool hourHandMinuteCorrectionActive
Is hour hand minute correction active.
• bool minuteHandSecondCorrectionActive
Is minute hand second correction active.
An analog clock. Should be supplied with images for the background, hour hand, minute hand and the optional
second hand. You setup the AnalogClock by specifying the rotation point of each hand as well as the global rotation
point of the clock.
You can customize the behavior of the AnalogClock in respect to animations and relations between the hands
e.g. the hour hand moves gradually towards the next hour as the minute hand progresses (setHourHandMinute←-
Correction())
7.14.2.1 animationEnabled()
Is animation enabled.
Returns
7.14.2.2 convertHandValueToAngle()
float convertHandValueToAngle (
uint8_t steps,
uint8_t handValue,
uint8_t secondHandValue = 0 ) const [protected], [virtual]
Parameters
steps Number of steps the primary hand value is divided into (e.g. 60 for minutes/seconds and
12 for hour).
handValue The actual value for the hand in question (in the range [0;steps]).
secondHandValue (Optional) If the angle should be corrected for a secondary hand its value should be
specified here (in the range [0;60]). This is the case when
setHourHandMinuteCorrection(true) or setMinuteHandSecondCorrection(true) is selected.
Returns
7.14.2.3 getAnimationDuration()
Returns
7.14.2.4 getHourHandMinuteCorrection()
Returns
See also
setHourHandMinuteCorrection
7.14.2.5 getMinuteHandSecondCorrection()
Returns
See also
setHourHandMinuteCorrection
7.14.2.6 initializeTime12Hour()
void initializeTime12Hour (
uint8_t hour,
uint8_t minute,
uint8_t second,
bool am ) [virtual]
Sets the time with input format as 12H. No animations are performed regardless of the animation settings. This is
often useful when setting up the AnalogClock where you do not want an initial animation. Note that this does not
affect any selected presentation formats.
Parameters
7.14.2.7 initializeTime24Hour()
void initializeTime24Hour (
uint8_t hour,
uint8_t minute,
uint8_t second ) [virtual]
Sets the time with input format as 24H. No animations are performed regardless of the animation settings. This is
often useful when setting up the AnalogClock where you do not want an initial animation. Note that this does not
affect any selected presentation formats.
Parameters
7.14.2.8 setAnimation()
void setAnimation (
uint16_t duration = 10,
EasingEquation animationProgressionEquation = EasingEquations::backEaseInOut )
[virtual]
Parameters
void setBackground (
const BitmapId backgroundBitmapId ) [virtual]
Sets the background image of the clock. The clock rotation center is set to the background image center. The clock
rotation center is the point that the clock hands rotates around.
Parameters
void setBackground (
Sets the background image of the clock and the rotation center of the clock. The clock rotation center is the point
that the clock hands rotates around.
Parameters
7.14.2.11 setHourHandMinuteCorrection()
void setHourHandMinuteCorrection (
bool active ) [virtual]
If set to true the hour hand will be positioned between the current hour and the next depending on the minute hands
position.
Parameters
active true to use hour hand correction.
See also
getHourHandMinuteCorrection
7.14.2.12 setMinuteHandSecondCorrection()
void setMinuteHandSecondCorrection (
bool active ) [virtual]
If set to true the minute hand will be positioned between the current minute and the next depending on the second
hands position.
Parameters
active true to use.
See also
setMinuteHandSecondCorrection
7.14.2.13 setRotationCenter()
void setRotationCenter (
int16_t rotationCenterX,
int16_t rotationCenterY ) [virtual]
Sets the rotation center of the clock. The clock rotation center is the point that the clock hands rotates around.
Parameters
7.14.2.14 setupHand()
void setupHand (
TextureMapper & hand,
const BitmapId bitmapId,
int16_t rotationCenterX,
int16_t rotationCenterY ) [protected], [virtual]
Parameters
7.14.2.15 setupHourHand()
void setupHourHand (
const BitmapId hourHandBitmapId,
int16_t rotationCenterX,
int16_t rotationCenterY ) [virtual]
Sets up the hour hand. The specified rotation center is the point of the hand that is to be placed on top of the clock
rotation center. That is the point that the hand rotates around. The rotation point is relative to the supplied bitmap
but can be placed outside it.
If not called the hour hand will just be omitted.
Parameters
7.14.2.16 setupMinuteHand()
void setupMinuteHand (
const BitmapId minuteHandBitmapId,
int16_t rotationCenterX,
int16_t rotationCenterY ) [virtual]
Sets up the minute hand. The specified rotation center is the point of the hand that is to be placed on top of the
clock rotation center. That is the point that the hand rotates around. The rotation point is relative to the supplied
bitmap but can be placed outside it.
If not called the minute hand will just be omitted.
Parameters
7.14.2.17 setupSecondHand()
void setupSecondHand (
const BitmapId secondHandBitmapId,
int16_t rotationCenterX,
int16_t rotationCenterY ) [virtual]
Sets up the second hand. The specified rotation center is the point of the hand that is to be placed on top of the
clock rotation center. That is the point that the hand rotates around. The rotation point is relative to the supplied
bitmap but can be placed outside it.
If not called the second hand will just be omitted.
Parameters
7.14.2.18 updateClock()
• AnimatedImage (const BitmapId &start, const BitmapId &end, const uint8_t &updateInterval=1)
Constructs an AnimatedImage.
• AnimatedImage (const uint8_t &updateInterval=1)
Constructor.
• virtual void startAnimation (const bool &rev, const bool &reset=false, const bool &loop=false)
Starts the animation.
• virtual void stopAnimation ()
Stops and resets the animation.
• virtual void pauseAnimation ()
Toggles the running state of an animation.
• virtual void handleTickEvent ()
Called periodically by the framework if the Drawable instance has subscribed to timer ticks.
• void setDoneAction (GenericCallback< const AnimatedImage & > &callback)
Associates an action to be performed when the animation of the AnimatedImage is done.
• bool isRunning ()
Gets the running state of the AnimatedImage.
• bool isAnimatedImageRunning ()
Gets the running state of the AnimatedImage.
• bool isReverse ()
Query if this object is running in reverse.
• void setBitmaps (BitmapId start, BitmapId end)
Sets the bitmaps that are used by the animation.
• void setUpdateTicksInterval (uint8_t updateInterval)
Sets the update interval.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
The AnimatedImage is capable of running the animation from start to end or in reverse order, end to start. It is
capable doing a single animation or looping the animation until stopped or paused. See animation_example far a
demonstration of how to use of this widget.
AnimatedImage (
const BitmapId & start,
const BitmapId & end,
const uint8_t & updateInterval = 1 ) [inline]
The start and the end specifies the range of bitmaps to be used for animation. The update interval defines how
often the animation should be updated. The animation will iterate over the bitmaps that lies between the IDs of start
and end, both included.
Parameters
AnimatedImage (
const uint8_t & updateInterval = 1 ) [inline]
Note
The bitmaps to display must be configured through set setBitmaps function before this widget displays any-
thing.
Parameters
updateInterval Defines the number of ticks between each animation step. Higher value results in a slower
animation.
7.15.3.1 getType()
Returns
TYPE_ANIMATEDIMAGE.
7.15.3.2 handleTickEvent()
Called periodically by the framework if the Drawable instance has subscribed to timer ticks.
See also
Application::registerTimerWidget
7.15.3.3 isAnimatedImageRunning()
Returns
7.15.3.4 isReverse()
Returns
7.15.3.5 isRunning()
Returns
7.15.3.6 pauseAnimation()
Toggles the running state of an animation. Pauses the animation if the animation is running. Continues the animation
if previously paused.
7.15.3.7 setBitmap()
void setBitmap (
const Bitmap & bmp ) [inline], [protected], [virtual]
Is not public available. Use setBitmaps instead. Internally in AnimatedImage use Image::setBitmap(...).
Parameters
bmp The bitmap.
7.15.3.8 setBitmaps()
void setBitmaps (
BitmapId start,
BitmapId end )
Parameters
7.15.3.9 setDoneAction()
void setDoneAction (
GenericCallback< const AnimatedImage & > & callback ) [inline]
Parameters
callback The callback is executed when done. The callback is given the animated image.
7.15.3.10 setUpdateTicksInterval()
void setUpdateTicksInterval (
uint8_t updateInterval )
Parameters
updateInterval Defines the number of ticks between each animation step. Higher value results in a slower
animation.
7.15.3.11 startAnimation()
void startAnimation (
const bool & rev,
const bool & reset = false,
const bool & loop = false ) [virtual]
Parameters
7.15.3.12 stopAnimation()
An animated image button style. An animated image button style. This class is supposed to be used with one of
the ButtonTrigger classes to create a functional button. This class will show the first or last image of an animated
image depending on the state of the button (pressed or released). When the state changes the button will show the
sequence of images in forward or reversed order.
#include <touchgfx/containers/buttons/AnimatedImageButtonStyle.hpp>
• AnimatedImageButtonStyle ()
Default constructor.
• virtual ∼AnimatedImageButtonStyle ()
Destructor.
• void setBitmaps (const Bitmap &bmpStart, const Bitmap &bmpEnd)
Sets the bitmaps.
• void setBitmapXY (uint16_t x, uint16_t y)
Sets bitmap xy.
• void setUpdateTicksInterval (uint8_t updateInterval)
Sets update ticks interval.
Protected Attributes
• AnimatedImage buttonAnimatedImage
The button animated image.
template<class T>
class touchgfx::AnimatedImageButtonStyle< T >
The AnimatedImageButtonStyle will set the size of the enclosing container (normally AbstractButtonContainer) to
the size of the first Bitmap. This can be overridden by calling setWidth/setHeight after setting the bitmaps.
The position of the bitmap can be adjusted with setBitmapXY (default is upper left corner).
Template Parameters
See also
AbstractButtonContainer
7.16.2.1 setBitmaps()
void setBitmaps (
const Bitmap & bmpStart,
const Bitmap & bmpEnd ) [inline]
Parameters
7.16.2.2 setBitmapXY()
void setBitmapXY (
uint16_t x,
uint16_t y ) [inline]
Parameters
x An uint16_t to process.
y An uint16_t to process.
7.16.2.3 setUpdateTicksInterval()
void setUpdateTicksInterval (
uint8_t updateInterval ) [inline]
Parameters
updateInterval The update interval.
Public Attributes
• bool animationActive
Should this animation be performed.
• float animationStart
The animation start value.
• float animationEnd
The animation end value.
• uint16_t animationDelay
A delay that is applied before animation start. Expressed in ticks.
• uint16_t animationDuration
The complete duration of the animation. Expressed in ticks.
• EasingEquation animationProgressionEquation
EasingEquation expressing the development of the value during the animation.
Classes
• struct AnimationSetting
Information about how a specific animation parameter should be animated.
Public Types
• AnimationTextureMapper ()
Default constructor.
• virtual ∼AnimationTextureMapper ()
Destructor.
• void setTextureMapperAnimationStepAction (GenericCallback< const AnimationTextureMapper & > &call-
back)
Associates an action to be performed when the animation steps.
• void setTextureMapperAnimationEndedAction (GenericCallback< const AnimationTextureMapper & > &call-
back)
Associates an action to be performed when the animation ends.
• virtual bool isTextureMapperAnimationRunning () const
Gets whether or not the animation is running.
• virtual void setupAnimation (AnimationParameter parameter, float endValue, uint16_t duration, uint16_t delay,
EasingEquation progressionEquation=&EasingEquations::linearEaseNone)
Sets up the animation for a specific parameter (angle/scale) for the next animation.
• virtual void startAnimation ()
Starts the animation.
• virtual void cancelAnimationTextureMapperAnimation ()
Cancel move animation.
• virtual uint16_t getAnimationStep ()
Gets the current animation step.
Protected Attributes
A texture mapper with animation capabilities. Note that the angles of the TextureMapper is moved to the [0; 2PI]
range at the beginning at the animation. The end angles should be relative to this and are limited to values in the
range [-32.7; 32.7].
See also
TextureMapper
7.18.2.1 AnimationParameter
enum AnimationParameter
Enumerator
7.18.3.1 AnimationTextureMapper()
AnimationTextureMapper ( )
Default constructor.
7.18.3.2 ∼AnimationTextureMapper()
∼AnimationTextureMapper ( ) [virtual]
7.18.4.1 cancelAnimationTextureMapperAnimation()
7.18.4.2 getAnimationStep()
Returns
7.18.4.3 handleTickEvent()
7.18.4.4 isTextureMapperAnimationRunning()
Returns
7.18.4.5 setTextureMapperAnimationEndedAction()
void setTextureMapperAnimationEndedAction (
GenericCallback< const AnimationTextureMapper & > & callback )
Parameters
callback The callback to be executed. The callback will be given a reference to the AnimationTextureMapper.
See also
GenericCallback
7.18.4.6 setTextureMapperAnimationStepAction()
void setTextureMapperAnimationStepAction (
GenericCallback< const AnimationTextureMapper & > & callback )
Associates an action to be performed when the animation steps. Will not be called during delay period.
Parameters
callback The callback to be executed. The callback will be given a reference to the AnimationTextureMapper.
See also
GenericCallback
7.18.4.7 setupAnimation()
void setupAnimation (
AnimationParameter parameter,
float endValue,
uint16_t duration,
uint16_t delay,
EasingEquation progressionEquation = &EasingEquations::linearEaseNone ) [virtual]
Sets up the animation for a specific parameter (angle/scale) for the next animation. The specific parameter is chosen
using the AnimationType enum. AnimationTypes that are not setup using this method will keep their value during
the animation.
Parameters
7.18.4.8 startAnimation()
Starts the animation from the current position to the specified end angles/scale. The progression of the angles/scale
during the animation is described by the supplied EasingEquations.
The Application class is the main interface for manipulating screen contents.
#include <touchgfx/Application.hpp>
• Screen ∗ getCurrentScreen ()
Gets the current screen.
• virtual void switchScreen (Screen ∗newScreen)
Switch to another Screen.
• virtual void appSwitchScreen (uint8_t screenId)
Protected Attributes
The Application class is the main interface for manipulating screen contents. It holds a pointer to the currently
displayed Screen, and delegates draw requests and events to that Screen. Additionally it contains some global
application settings.
A user-defined application subclass can be defined to override standard functionality.
See also
UIEventListener
7.19.2.1 Application()
Application ( ) [protected]
Procected constructor.
7.19.3.1 appSwitchScreen()
void appSwitchScreen (
uint8_t screenId ) [inline], [virtual]
An application specific function for switching screen. Overloading this can provide a means to switch screen from
places that does not have access to a pointer to the new screen. Base implementation is empty.
Parameters
screen←- An id that maps to the desired screen.
Id
7.19.3.2 cacheDrawOperations()
void cacheDrawOperations (
bool enableCache ) [virtual]
This functions allows for deferring draw operations to a later time. If active, calls to draw will simply note that the
specified area is dirty, but not perform any actual drawing. When disabling the draw cache, the dirty area will be
flushed (drawn) immediately.
Parameters
enableCache if true, all future draw operations will be cached. If false draw caching is disabled, and the
current cache (if not empty) is drawn immediately.
7.19.3.3 clearAllTimerWidgets()
void clearAllTimerWidgets ( )
Initiate a draw operation of the entire screen. Standard implementation is to delegate draw request to the current
Screen.
void draw (
Rect & rect ) [virtual]
Initiate a draw operation of the specified region of the screen. Standard implementation is to delegate draw request
to the current Screen.
Note
Unlike Widget::draw this is safe to call from user code as it will properly traverse widgets in z-order.
The coordinates given must be absolute coordinates.
Parameters
in rect The area to draw.
7.19.3.6 getCurrentScreen()
Returns
7.19.3.7 getInstance()
Returns
7.19.3.8 getNumberOfRegisteredTimerWidgets()
Returns
7.19.3.9 getTimerWidgetCountForDrawable()
uint16_t getTimerWidgetCountForDrawable (
Drawable ∗ w ) const
Gets the number of timer events registered to a widget, i.e. how many times a drawable must be unregistered until
it no longer receives timer ticks.
Parameters
Returns
0 if the drawable is not registered as a timer widget, otherwise returns how many times the drawable is currently
registered.
7.19.3.10 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [virtual]
Handle a click event. Standard implementation is to delegate the event to the current screen. Called by the frame-
work when a click is detected by some platform specific means.
Parameters
7.19.3.11 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [virtual]
Handle drag events. Called by the framework when a drag is detected by some platform specific means. Standard
implementation is to delegate drag event to current screen.
Parameters
evt The drag event, expressed in absolute coordinates.
7.19.3.12 handleGestureEvent()
void handleGestureEvent (
const GestureEvent & evt ) [virtual]
Handle gestures. Called by the framework when a gesture is detected by some platform specific means. Standard
implementation is to delegate drag event to current screen.
Parameters
evt The gesture event.
7.19.3.13 handleKeyEvent()
void handleKeyEvent (
uint8_t c ) [virtual]
Handle an incoming character received by the HAL layer. Standard implementation delegates to current screen
(which, in turn, does nothing).
Parameters
c The incomming character to handle.
7.19.3.14 handlePendingScreenTransition()
Evaluates the pending Callback instances. If a callback is valid, it is executed and a Screen transition is executed.
This base implementation is empty and does nothing.
Reimplemented from UIEventListener.
Reimplemented in MVPApplication.
7.19.3.15 handleTickEvent()
Handle tick. Standard implementation is to delegate tick to the widgets that have registered to receive one. Called
by some platform specific means.
Reimplemented from UIEventListener.
7.19.3.16 invalidateArea()
void invalidateArea (
Rect area ) [protected]
Parameters
area The area to invalidate.
7.19.3.17 registerTimerWidget()
void registerTimerWidget (
Drawable ∗ w )
Adds a widget to the list of widgets receiving ticks every frame (typically 16.67ms)
Note
The framework keeps track of the number of times a specific widget is registered.
Parameters
in w The widget to add.
See also
unregisterTimerWidget
7.19.3.18 switchScreen()
void switchScreen (
Screen ∗ newScreen ) [virtual]
Switch to another Screen. Will call tearDownScreen on current Screen before switching, and subsequently call
setupScreen and draw automatically for the new Screen.
Parameters
7.19.3.19 unregisterTimerWidget()
void unregisterTimerWidget (
const Drawable ∗ w )
Removes a widget from the list of widgets receiving ticks every frame (typically 16.67ms) milliseconds.
Note
If widget has been registered multiple times, an equal number of calls to unregister are required to stop widget
from receiving tick events.
Parameters
in w The widget to remove.
7.19.4.1 instance
Note
7.19.4.2 MAX_TIMER_WIDGETS
Remarks
Classes
• struct BitmapData
Data of a bitmap.
• struct CacheTableEntry
Cache bookkeeping.
• struct DynamicBitmapData
Data of a dynamic bitmap.
Public Types
• static void registerBitmapDatabase (const BitmapData ∗data, const uint16_t n, uint16_t ∗cachep=0, uint32_t
csize=0, uint32_t numberOfDynamicBitmaps=0)
Registers an array of bitmaps.
• static bool cache (BitmapId id)
Cache this bitmap into RAM.
• static bool cacheReplaceBitmap (BitmapId out, BitmapId in)
Replace a bitmap in RAM with another Bitmap.
• static bool cacheRemoveBitmap (BitmapId id)
Remove this bitmap from the RAM cache.
• static uint8_t ∗ cacheGetAddress (BitmapId id)
Get address of cache buffer for this bitmap.
• static bool cacheIsCached (BitmapId id)
Check if the Bitmap is cached.
• static bool cacheAll ()
Cache all bitmaps from the Bitmap Database into RAM.
• static void clearCache ()
Clears the cached bitmaps from RAM.
• static BitmapId dynamicBitmapCreate (const uint16_t width, const uint16_t height, BitmapFormat format)
Create a dynamic bitmap.
• static bool dynamicBitmapDelete (BitmapId id)
Delete a dynamic bitmap.
• static uint8_t ∗ dynamicBitmapGetAddress (BitmapId id)
Get the address of the dynamic bitmap data.
• static bool dynamicBitmapSetSolidRect (BitmapId id, const Rect &solidRect)
Set the solid rectangle of a dynamic bitmap.
• static void setCache (uint16_t ∗cachep, uint32_t csize, uint32_t numberOfDynamicBitmaps=0)
Register a memory region in which bitmap data can be cached.
This class provides a proxy object for a bitmap image stored in the application specific bitmap database. The proxy
provides access to the raw bitmap data as well as metadata.
7.20.2.1 BitmapFormat
enum BitmapFormat
Enumerator
RGB565 16-bit, 5 bits for red, 6 bits for green, 5 bits for blue, no alpha channel
RGB888 24-bit, 8 bits for each of red, green and blue, no alpha channel
ARGB8888 32-bit, 8 bits for each of red, green, blue and alpha channel
BW 1-bit, black / white, no alpha channel
BW_RLE 1-bit, black / white, no alpha channel compressed with horizontal RLE
GRAY2 2-bit grayscale
GRAY4 4.bit grayscale
7.20.3.1 Bitmap()
Bitmap (
const BitmapId id = BITMAP_INVALID ) [inline], [explicit]
Creates and binds a Bitmap instance to the corresponding entry in the BitmapData array.
Parameters
7.20.4.1 cache()
Note
A memory region large enough to hold this bitmap must be configured and a large enough part of it must
be available. Caching of a bitmap may involve a defragmentation of the bitmap cache. See TouchGFX
documentation for details on caching.
Parameters
Returns
See also
registerBitmapDatabase
7.20.4.2 cacheAll()
Note
A memory region large enough to hold all bitmaps must be configured. See TouchGFX documentation for
details on caching.
Returns
See also
cache.
7.20.4.3 cacheGetAddress()
Get address of cache buffer for this bitmap. Note: The address is only valid until next Bitmap::cache() call.
Parameters
Returns
7.20.4.4 cacheIsCached()
Parameters
Returns
7.20.4.5 cacheRemoveBitmap()
Note
The bitmap will be removed from the RAM cache. Unless the bitmap is otherwise stored in (slow) RAM it can
not be drawn anymore and must be cached again before use. The RAM freed can be used for caching of
another bitmap. See TouchGFX documentation for details on caching.
Parameters
Returns
See also
registerBitmapDatabase
7.20.4.6 cacheReplaceBitmap()
Replace a bitmap in RAM with another Bitmap. The Bitmaps must have same size.
Parameters
Returns
7.20.4.7 clearCache()
7.20.4.8 dynamicBitmapCreate()
Parameters
Returns
Note
Creation of a new dynamic bitmap may cause existing dynamic bitmaps to be moved in memory. Do not
rely on bitmap memory addresses of dynamic bitmaps obtained from dynamicBitmapGetAddress() to be valid
across calls to dynamicBitmapCreate().
See also
dynamicBitmapAddress
7.20.4.9 dynamicBitmapDelete()
Parameters
Returns
7.20.4.10 dynamicBitmapGetAddress()
Get the address of the dynamic bitmap data. It is important that the address of a dynamic bitmap is not stored
elsewhere as a dynamic bitmap may be moved in memory when other bitmaps are added and removed. Only store
the BitmapId and ask for the address of the bitmap data when needed.
Parameters
Returns
Note
The address of a dynamic bitmap may change when other dynamic bitmaps are added and removed. Never
store the address of dynamic images, only store the BitmapId as that will not change.
7.20.4.11 dynamicBitmapSetSolidRect()
Set the solid rectangle of a dynamic bitmap. Only relevant for RGBA8888 bitmaps. The solid part of the bitmap is
drawn faster than the transparent parts.
Parameters
id The identifier.
solidRect The solid rectangle.
Returns
7.20.4.12 getAlphaData()
Note
If this bitmap is cached, it will return the cached version of alpha data for this bitmap.
Returns
A pointer to the raw alpha channel data. If no alpha channel exist 0 is returned.
7.20.4.13 getData()
Note
If this bitmap is cached, it will return the cached version of bitmap data.
Returns
7.20.4.14 getFormat()
Returns
7.20.4.15 getHeight()
Returns
7.20.4.16 getId()
Returns
7.20.4.17 getRect()
Returns
7.20.4.18 getSolidRect()
Gets the largest solid, i.e. not transparent, rectangle in the bitmap.
Returns
7.20.4.19 getWidth()
Returns
7.20.4.20 hasTransparentPixels()
Returns
7.20.4.21 isAlphaPerPixel()
Returns
True if the bitmap contains an alpha channel (an alpha value for each pixel)
7.20.4.22 operator"!=()
bool operator!= (
const Bitmap & other ) const [inline]
Inequality operator.
Parameters
other The bitmap to compare with.
Returns
7.20.4.23 operator==()
bool operator== (
const Bitmap & other ) const [inline]
Equality operator.
Parameters
other The bitmap to compare with.
Returns
7.20.4.24 registerBitmapDatabase()
Registers an array of bitmaps. All Bitmap instances are bound to this database.
Parameters
7.20.4.25 setCache()
Parameters
in,out cachep Pointer to memory region in which bitmap data can be cached.
csize Size of cache memory region in bytes.
numberOfDynamicBitmaps Number of dynamic bitmaps to be allowed in the cache.
Data of a bitmap.
#include <touchgfx/Bitmap.hpp>
Public Attributes
Data of a bitmap.
BlitOp instances carry the required information for performing operations on the LCD (frame buffer) using DMA.
#include <touchgfx/hal/BlitOp.hpp>
Public Attributes
• uint32_t operation
The operation to perform.
• const uint16_t ∗ pSrc
Pointer to the source.
• uint16_t ∗ pDst
Pointer to the destination.
• uint16_t nSteps
The number of pixels in a line.
• uint16_t nLoops
The number of lines.
• uint16_t srcLoopStride
The number of bytes to stride the source after every loop.
• uint16_t dstLoopStride
The number of bytes to stride the destination after every loop.
• colortype color
Color to fill.
• uint8_t alpha
The alpha to use.
BlitOp instances carry the required information for performing operations on the LCD (frame buffer) using DMA.
7.22.2.1 operation
uint32_t operation
See also
BlitOperations
Simple widget capable of showing a rectangle of a specific color and an optional alpha.
#include <touchgfx/widgets/Box.hpp>
• Box ()
Constructor.
• Box (uint16_t width, uint16_t height, colortype color, uint8_t alpha=255)
Constructor.
• virtual ∼Box ()
Destructor.
Protected Attributes
• uint8_t alpha
The alpha value used for this Box.
• colortype color
The fill color for this Box.
• bool reportAsSolid
Simple widget capable of showing a rectangle of a specific color and an optional alpha.
See also
Widget
Box ( ) [inline]
Box (
uint16_t width,
uint16_t height,
colortype color,
uint8_t alpha = 255 ) [inline]
Construct a Box.
Parameters
7.23.2.3 ∼Box()
Destructor.
7.23.3.1 draw()
void draw (
const Rect & area ) const [virtual]
Parameters
area The rectangle to draw, with coordinates relative to the containing layer.
Implements Drawable.
7.23.3.2 forceReportAsSolid()
void forceReportAsSolid (
bool solid ) [inline]
If this is set, getSolidRect() will report the widget as completely solid even if is (semi-)transparent.
Note
Parameters
solid true if this Box should report as solid, even when not.
7.23.3.3 getAlpha()
Returns
7.23.3.4 getColor()
Returns
7.23.3.5 getSolidRect()
Pure virtual function for obtaining the largest possible rectangle that is guaranteed to be solid (non-transparent).
Used by JSMOC to prune the draw graph.
Note
The rectangle returned must be relative to (0, 0), meaning that to indicate a completely solid widget, Rect(0,
0, getWidth(), getHeight()) must be returned.
Returns
Implements Drawable.
7.23.3.6 getType()
Returns
TYPE_BOX.
7.23.3.7 setAlpha()
void setAlpha (
uint8_t alpha ) [inline]
Parameters
alpha The alpha value. 255 = completely solid.
7.23.3.8 setColor()
void setColor (
colortype color ) [inline]
Parameters
7.23.4.1 reportAsSolid
See also
forceReportAsSolid.
A box progress.
#include <touchgfx/containers/progress_indicators/BoxProgress.hpp>
• BoxProgress ()
Default constructor.
• virtual ∼BoxProgress ()
Destructor.
• virtual void setProgressIndicatorPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the position and dimension of the box progress indicator.
• virtual void setColor (colortype color)
Sets the color.
• virtual colortype getColor () const
Gets the color.
• virtual void setAlpha (uint8_t alpha)
Sets the alpha.
• virtual uint8_t getAlpha () const
Gets the alpha.
Protected Attributes
• Box box
The box.
A Box progress which shows the current progress using a simple Box. It is possible to set the color and the alpha
of the box. It is also possible to control in what direction the box will progress (up, down, to the left or to the right).
See also
Box
7.24.2.1 BoxProgress()
BoxProgress ( )
Default constructor.
7.24.2.2 ∼BoxProgress()
∼BoxProgress ( ) [virtual]
Destructor.
7.24.3.1 getAlpha()
Returns
The alpha.
See also
Box
7.24.3.2 getColor()
Returns
The color.
See also
Box
7.24.3.3 setAlpha()
void setAlpha (
uint8_t alpha ) [virtual]
Parameters
alpha The alpha.
See also
Box
7.24.3.4 setColor()
void setColor (
colortype color ) [virtual]
Parameters
color The color.
See also
Box
7.24.3.5 setProgressIndicatorPosition()
void setProgressIndicatorPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [virtual]
Sets the position and dimension of the box progress indicator relative to the background image.
Parameters
x The x coordinate.
y The y coordinate.
width The width of the box progress indicator.
height The height of the box progress indicator.
7.24.3.6 setValue()
Sets the current value in the range (min..max) set by setRange(). Values lower than min are mapped to min, values
higher than max are mapped to max.
Parameters
value The value.
• BoxWithBorder ()
Default constructor.
• BoxWithBorder (uint16_t width, uint16_t height, colortype color, colortype borderColor, uint8_t borderSize,
uint8_t alpha=255)
Constructor.
• virtual ∼BoxWithBorder ()
Destructor.
• virtual Rect getSolidRect () const
Gets solid rectangle.
• void setColor (colortype color)
Sets a color.
• colortype getColor () const
Gets the color.
• void setBorderColor (colortype color)
Sets border color.
Protected Attributes
• uint8_t alpha
The alpha.
• colortype color
The color.
• colortype borderColor
The border color.
• uint8_t borderSize
Size of the border.
7.25.1.1 BoxWithBorder()
BoxWithBorder (
uint16_t width,
uint16_t height,
colortype color,
colortype borderColor,
uint8_t borderSize,
uint8_t alpha = 255 ) [inline]
Parameters
width The width.
height The height.
color The color.
borderColor The border color.
borderSize Size of the border.
alpha (Optional) The alpha.
7.25.2.1 draw()
void draw (
const Rect & area ) const [virtual]
Parameters
area The area.
Implements Drawable.
7.25.2.2 getAlpha()
Returns
The alpha.
7.25.2.3 getBorderColor()
Returns
7.25.2.4 getBorderSize()
Returns
7.25.2.5 getColor()
Returns
The color.
7.25.2.6 getSolidRect()
Returns
Implements Drawable.
7.25.2.7 getType()
Returns
The type.
7.25.2.8 setAlpha()
void setAlpha (
uint8_t alpha ) [inline]
Parameters
alpha The alpha.
7.25.2.9 setBorderColor()
void setBorderColor (
colortype color ) [inline]
Parameters
color The color.
7.25.2.10 setBorderSize()
void setBorderSize (
uint8_t size ) [inline]
Parameters
size The size.
7.25.2.11 setColor()
void setColor (
colortype color ) [inline]
Parameters
color The color.
• BoxWithBorderButtonStyle ()
Default constructor.
• virtual ∼BoxWithBorderButtonStyle ()
Destructor.
• void setBoxWithBorderPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the size and position of this BoxWithBorderButtonStyle.
• void setBoxWithBorderWidth (int16_t width)
Sets a width.
• void setBoxWithBorderHeight (int16_t height)
Sets a height.
• void setBoxWithBorderColors (const colortype colorReleased, const colortype colorPressed, const colortype
borderColorReleased, const colortype borderColorPressed)
Sets the colors.
• void setBorderSize (uint8_t size)
Sets border size.
Protected Attributes
• BoxWithBorder borderBox
The border box.
• colortype up
The up.
• colortype down
The down.
• colortype borderUp
The border up.
• colortype borderDown
The border down.
template<class T>
class touchgfx::BoxWithBorderButtonStyle< T >
A box with border button style. This class is supposed to be used with one of the ButtonTrigger classes to create a
functional button. This class will show a box with a border in different colors depending on the state of the button
(pressed or released).
An image button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional
button. This class will show one of two images depending on the state of the button (pressed or released).
Template Parameters
See also
AbstractButtonContainer, BoxWithBorder
7.26.2.1 setBorderSize()
void setBorderSize (
uint8_t size ) [inline]
Parameters
size The size.
7.26.2.2 setBoxWithBorderColors()
void setBoxWithBorderColors (
const colortype colorReleased,
const colortype colorPressed,
const colortype borderColorReleased,
const colortype borderColorPressed ) [inline]
Parameters
colorReleased The color released.
colorPressed The color pressed.
Parameters
7.26.2.3 setBoxWithBorderHeight()
void setBoxWithBorderHeight (
int16_t height ) [inline]
Parameters
height The height.
7.26.2.4 setBoxWithBorderPosition()
void setBoxWithBorderPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [inline]
Sets the size and position of this BoxWithBorderButtonStyle, relative to its parent.
Note
Parameters
7.26.2.5 setBoxWithBorderWidth()
void setBoxWithBorderWidth (
int16_t width ) [inline]
Parameters
width The width.
• Button ()
Default constructor.
• virtual ∼Button ()
Destructor.
• virtual void draw (const Rect &invalidatedArea) const
Draws the given invalidated area.
• virtual void setBitmaps (const Bitmap &bmpReleased, const Bitmap &bmpPressed)
Sets the bitmaps used by this button.
• virtual Rect getSolidRect () const
Gets solid rectangle.
• void setAlpha (uint8_t alpha)
Sets the alpha value for the image.
• uint8_t getAlpha () const
Gets the current alpha value.
• Bitmap getCurrentlyDisplayedBitmap () const
Gets currently displayed bitmap.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
• Bitmap up
The image to display when button is released.
• Bitmap down
The image to display when button is pressed.
• uint8_t alpha
The current alpha value. 255 denotes solid, 0 denotes completely transparent.
A button consists of two images, one for its normal state and one when it is pressed down.
See also
AbstractButton
7.27.2.1 Button()
Button ( ) [inline]
Default constructor.
7.27.2.2 ∼Button()
Destructor.
7.27.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
See also
Drawable::draw()
Implements Drawable.
Reimplemented in ButtonWithLabel, and ButtonWithIcon.
7.27.3.2 getAlpha()
Returns
7.27.3.3 getCurrentlyDisplayedBitmap()
Function to obtain the currently displayed bitmap, which depends on the button's pressed state.
Returns
7.27.3.4 getSolidRect()
Returns
largest possible solid rect. Delegated to the largest solid rect of the button bitmap(s).
Implements Drawable.
Reimplemented in ButtonWithLabel.
7.27.3.5 getType()
Returns
TYPE_BUTTON.
7.27.3.6 setAlpha()
void setAlpha (
uint8_t alpha ) [inline]
Parameters
alpha The alpha value. 255 = completely solid.
7.27.3.7 setBitmaps()
void setBitmaps (
const Bitmap & bmpReleased,
const Bitmap & bmpPressed ) [virtual]
Parameters
bmpReleased Bitmap to use when button is released.
bmpPressed Bitmap to use when button is pressed.
Reimplemented in ToggleButton.
• virtual ∼ButtonController ()
Destructor.
• virtual void init ()=0
Initializes button controller.
• virtual bool sample (uint8_t &key)=0
Sample external key events.
• virtual void reset ()
Resets button controller.
7.28.2.1 ∼ButtonController()
Destructor.
7.28.3.1 init()
7.28.3.2 reset()
7.28.3.3 sample()
bool sample (
uint8_t & key ) [pure virtual]
Parameters
in,out key Output parameter that will be set to the key value if a keypress was detected.
Returns
True if a keypress was detected and the "key" parameter is set to a value.
A buttons.
#include <touchgfx/hal/Buttons.hpp>
7.29.1.1 init()
7.29.1.2 sample()
Returns
A Button specialization that also displays an icon on top of the button bitmap.
#include <touchgfx/widgets/ButtonWithIcon.hpp>
Protected Attributes
• Bitmap iconReleased
Icon to display when button is not pressed.
• Bitmap iconPressed
Icon to display when button is pressed.
• int16_t iconX
x coordinate offset for icon.
• int16_t iconY
y coordinate offset for icon.
A Button specialization that also displays an icon on top of the button bitmap.
See also
Button
7.30.2.1 draw()
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
See also
Drawable::draw()
7.30.2.2 getCurrentlyDisplayedIcon()
Function to obtain the currently displayed icon, which depends on the button's pressed state.
Returns
7.30.2.3 getIconX()
Returns
7.30.2.4 getIconY()
Returns
7.30.2.5 getType()
Returns
TYPE_BUTTONWITHICON.
7.30.2.6 setBitmaps()
void setBitmaps (
const Bitmap & newBackgroundReleased,
const Bitmap & newBackgroundPressed,
const Bitmap & newIconReleased,
const Bitmap & newIconPressed ) [virtual]
Parameters
newBackgroundReleased Bitmap to use when button is released.
newBackgroundPressed Bitmap to use when button is pressed.
newIconReleased The bitmap for the icon in the released/unpressed button state.
newIconPressed The bitmap for the icon in the pressed button state.
7.30.2.7 setIconX()
void setIconX (
int16_t x ) [inline]
Note
Parameters
x The new x value, relative to the background bitmap. A negative value is allowed.
7.30.2.8 setIconXY()
void setIconXY (
int16_t x,
int16_t y ) [inline]
Note
Parameters
x The new x value, relative to the background bitmap. A negative value is allowed.
y The new y value, relative to the background bitmap. A negative value is allowed.
7.30.2.9 setIconY()
void setIconY (
int16_t y ) [inline]
Note
Parameters
y The new y value, relative to the background bitmap. A negative value is allowed.
A Button specialization that also displays a text on top of the button bitmap.
#include <touchgfx/widgets/ButtonWithLabel.hpp>
• ButtonWithLabel ()
Default constructor.
• void setLabelText (TypedText t)
Sets the text to display on the button.
• TypedText getLabelText () const
Gets the text used for the label.
• void setLabelColor (colortype col, bool performInvalidate=false)
Sets label color.
• void setLabelColorPressed (colortype col, bool performInvalidate=false)
Sets label color when the button is pressed.
• void setLabelRotation (TextRotation rotation)
Sets the rotation of the text on the label.
• TextRotation getLabelRotation ()
Gets the current rotation of the text on the label.
• void updateTextPosition ()
Positions the label text as horizontally centered.
• virtual Rect getSolidRect () const
Gets solid rectangle.
• virtual void draw (const Rect &area) const
Draws the given invalidated area.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
• TypedText typedText
The TypedText used for the button label.
• colortype color
The color used for the label when not pressed.
• colortype colorPressed
The color used for the label when pressed.
• TextRotation rotation
The rotation used for the label.
• uint8_t textHeightIncludingSpacing
Total height of the label (text height + spacing).
A Button specialization that also displays a text on top of the button bitmap.
See also
Button
7.31.2.1 ButtonWithLabel()
ButtonWithLabel ( )
Default constructor.
7.31.3.1 draw()
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
See also
Drawable::draw()
7.31.3.2 getLabelRotation()
Returns
7.31.3.3 getLabelText()
Returns
7.31.3.4 getSolidRect()
Returns
largest possible solid rect. Delegated to the largest solid rect of the button bitmap(s).
7.31.3.5 getType()
Returns
TYPE_BUTTONWITHLABEL.
7.31.3.6 setLabelColor()
void setLabelColor (
colortype col,
bool performInvalidate = false ) [inline]
Parameters
col The color with which the text label should be drawn.
performInvalidate Optional parameter. If true, performs an instant invalidation of the button.
7.31.3.7 setLabelColorPressed()
void setLabelColorPressed (
colortype col,
bool performInvalidate = false ) [inline]
Parameters
col The color with which the text label should be drawn when the button is pressed.
performInvalidate Optional parameter. If true, performs an instant invalidation of the button.
7.31.3.8 setLabelRotation()
void setLabelRotation (
TextRotation rotation ) [inline]
Sets the rotation of the text on the label. Please note that this will not rotate the bitmap of the label, only the text.
Parameters
7.31.3.9 setLabelText()
void setLabelText (
TypedText t ) [inline]
Sets the text to display on the button. Texts with wildcards are not supported.
Parameters
t The text to display.
7.31.3.10 updateTextPosition()
If the text changes due to a language change you may need to reposition the label text to stay horizontally centered.
Note
The method does not invalidate the button. This must be done manually.
Cache bookkeeping.
#include <touchgfx/Bitmap.hpp>
Public Attributes
• uint8_t ∗ data
Pointer to location of image data for this bitmap in the cache. 0 if bitmap not cached.
Cache bookkeeping.
• Callback ()
Default constructor.
• Callback (dest_type ∗pobject, void(dest_type::∗pmemfun_3)(T1, T2, T3))
Initializes a Callback with an object and a pointer to the member function in that object to call.
• virtual void execute (T1 t1, T2 t2, T3 t3)
Calls the member function.
• virtual bool isValid () const
Function to check whether the Callback has been initialized with values.
Note
The member function to call must return void. The function can have zero, one, two or three arguments of any
type.
Template Parameters
dest_type The type of the class in which the member function resides.
T1 The type of the first argument in the member function, or void if none.
T2 The type of the second argument in the member function, or void if none.
T3 The type of the third argument in the member function, or void if none.
Callback ( ) [inline]
Callback (
dest_type ∗ pobject,
void(dest_type::∗)(T1, T2, T3) pmemfun_3 ) [inline]
Initializes a Callback with an object and a pointer to the member function in that object to call.
Parameters
7.33.3.1 execute()
void execute (
T1 t1,
T2 t2,
T3 t3 ) [inline], [virtual]
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
Parameters
t1 This value will be passed as the first argument in the function call.
Parameters
t2 This value will be passed as the second argument in the function call.
t3 This value will be passed as the third argument in the function call.
7.33.3.2 isValid()
Function to check whether the Callback has been initialized with values.
Returns
7.34 Callback< dest_type, T1, T2, void > Struct Template Reference
• Callback ()
Default constructor.
• Callback (dest_type ∗pobject, void(dest_type::∗pmemfun_2)(T1, T2))
Initializes a Callback with an object and a pointer to the member function in that object to call.
• virtual void execute (T1 t1, T2 t2)
Calls the member function.
• virtual bool isValid () const
Function to check whether the Callback has been initialized with values.
Note
The member function to call must return void. The function can have zero, one, two or three arguments of any
type.
Template Parameters
dest_type The type of the class in which the member function resides.
T1 The type of the first argument in the member function, or void if none.
T2 The type of the second argument in the member function, or void if none.
Callback ( ) [inline]
Callback (
dest_type ∗ pobject,
void(dest_type::∗)(T1, T2) pmemfun_2 ) [inline]
Initializes a Callback with an object and a pointer to the member function in that object to call.
Parameters
7.34.3.1 execute()
void execute (
T1 t1,
T2 t2 ) [inline], [virtual]
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
Parameters
t1 This value will be passed as the first argument in the function call.
t2 This value will be passed as the second argument in the function call.
7.34.3.2 isValid()
Function to check whether the Callback has been initialized with values.
Returns
7.35 Callback< dest_type, T1, void, void > Struct Template Reference
• Callback ()
Default constructor.
• Callback (dest_type ∗pobject, void(dest_type::∗pmemfun_1)(T1))
Initializes a Callback with an object and a pointer to the member function in that object to call.
• virtual void execute (T1 t1)
Calls the member function.
• virtual bool isValid () const
Query if this object is valid.
Note
The member function to call must return void. The function can have zero, one, two or three arguments of any
type.
Template Parameters
dest_type The type of the class in which the member function resides.
T1 The type of the first argument in the member function, or void if none.
Callback ( ) [inline]
Callback (
dest_type ∗ pobject,
void(dest_type::∗)(T1) pmemfun_1 ) [inline]
Initializes a Callback with an object and a pointer to the member function in that object to call.
Parameters
7.35.3.1 execute()
void execute (
T1 t1 ) [inline], [virtual]
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
Parameters
t1 This value will be passed as the first argument in the function call.
See also
isValid()
7.35.3.2 isValid()
Returns
7.36 Callback< dest_type, void, void, void > Struct Template Reference
• Callback ()
Default constructor.
• Callback (dest_type ∗pobject, void(dest_type::∗pmemfun_0)())
Initializes a Callback with an object and a pointer to the member function in that object to call.
• virtual void execute ()
Calls the member function.
• virtual bool isValid () const
Function to check whether the Callback has been initialized with values.
template<class dest_type>
struct touchgfx::Callback< dest_type, void, void, void >
Note
The member function to call must return void. The function can have zero, one, two or three arguments of any
type.
Template Parameters
dest_type The type of the class in which the member function resides.
Callback ( ) [inline]
Callback (
dest_type ∗ pobject,
void(dest_type::∗)() pmemfun_0 ) [inline]
Initializes a Callback with an object and a pointer to the member function in that object to call.
Parameters
7.36.3.1 execute()
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
7.36.3.2 isValid()
Function to check whether the Callback has been initialized with values.
Returns
Implements GenericCallback<>.
Public Attributes
• Rect keyArea
The area occupied by a key.
• GenericCallback ∗ callback
The callback to execute, when the area is "pressed". The callback should be a Callback<YourClass> member in the
class using the keyboard.
• BitmapId highlightBitmapId
A bitmap to show when the area is "pressed".
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 invali-
dated rectangle. This was chosen because CanvasWidgetRenderer works with horizontal scan lines, and eliminat-
ing 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.
7.38.2.1 Canvas()
Canvas (
const CanvasWidget ∗ _widget,
const Rect & invalidatedArea )
Canvas Constructor. Locks the frame buffer and prepares for drawing only in the allowed area which has been
invalidated. The color depth of the LCD is taken into account.
Parameters
_widget a pointer to the CanvasWidget using this Canvas. Used for getting the canvas dimensions.
invalidatedArea the are which should be updated.
7.38.2.2 ∼Canvas()
∼Canvas ( ) [virtual]
void lineTo (
CWRUtil::Q5 x,
CWRUtil::Q5 y )
Mark the line from the current (x, y) to the new (x, y) as part of the shape being drawn. As for moveTo, moveTo and
lineTo commands completely outside the drawing are are discarded.
Parameters
See also
CWRUtil::Q5
moveTo
Mark the line from the current (x, y) to the new (x, y) as part of the shape being drawn. As for moveTo, moveTo and
lineTo commands completely outside the drawing are are discarded.
Template Parameters
Parameters
Parameters
void moveTo (
CWRUtil::Q5 x,
CWRUtil::Q5 y )
Move the current pen position to (x, y). If the pen is outside (above or below) the drawing area, nothing is done, but
the coordinates are saved in case the next operation is lineTo a coordinate which is inside (or on the opposite side
of) the drawing area.
Parameters
See also
CWRUtil::Q5
lineTo
Move the current pen position to (x, y). If the pen is outside (above or below) the drawing area, nothing is done, but
the coordinates are saved in case the next operation is lineTo a coordinate which is inside (or on the opposite side
of) the drawing area.
Template Parameters
Parameters
7.38.3.5 render()
bool render ( )
Render the graphical shape drawn (using moveTo() and lineTo()) using the widgets Painter. The shape is automati-
cally closed, i.e. a lineTo() is automatically inserted connecting the current pen position with the initial pen position
given in the previous moveTo() command.
Returns
true if the widget was rendered, false if insufficient memory was available to render the widget.
• CanvasWidget ()
Constructor.
• virtual ∼CanvasWidget ()
Destructor.
• virtual void setPainter (AbstractPainter &painter)
Sets the painter for the CanvasWidget.
• virtual AbstractPainter & getPainter () const
Gets the current painter for the CanvasWidget.
• virtual void setAlpha (uint8_t alpha)
Sets the alpha channel for the CanvasWidget.
• virtual uint8_t getAlpha () const
Gets the current alpha value.
• virtual void draw (const Rect &invalidatedArea) const
Draws the given invalidated area.
• virtual void invalidate () const
Invalidates the area covered by this CanvasWidget.
• virtual Rect getMinimalRect () const
Gets minimal rectangle containing the shape drawn by this widget.
• virtual Rect getSolidRect () const
Gets the largest solid (non-transparent) rectangle.
• virtual bool drawCanvasWidget (const Rect &invalidatedArea) const =0
Draw canvas widget for the given invalidated area.
See also
Widget
7.39.2.1 CanvasWidget()
CanvasWidget ( )
Constructor.
7.39.2.2 ∼CanvasWidget()
∼CanvasWidget ( ) [virtual]
7.39.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Draws the given invalidated area. If the underlying CanvasWidgetRenderer fail to render the widget (due to memory
limitations), the invalidated area is cut into smaller slices which are then drawn separately. If drawing a single raster
line fails, that line is skipped (left blank/transparent) and drawing continues on the next raster line.
If drawing has failed at least once, the number of successfully drawn lines is remembered for the next time. If a
future draw would need to draw more lines, the area is automatically divided into smaller areas to prevent drawing
the canvas widget in vain.
Parameters
invalidatedArea The invalidated area.
See also
drawCanvasWidget()
Implements Drawable.
7.39.3.2 drawCanvasWidget()
bool drawCanvasWidget (
const Rect & invalidatedArea ) const [pure virtual]
Draw canvas widget for the given invalidated area. Similar to draw(), but might be invoked with several times with
smaller areas to due to memory constraints from the underlying CanvasWidgetRenderer.
Parameters
invalidatedArea The invalidated area.
Returns
See also
draw()
7.39.3.3 getAlpha()
Returns
7.39.3.4 getMinimalRect()
Gets minimal rectangle containing the shape drawn by this widget. Default implementation returns the size of the
entire widget, but this function should be overwritten in subclasses and return the minimal rectangle containing the
shape. See classes such as Circle for example implementations.
Returns
7.39.3.5 getPainter()
Returns
The painter.
See also
AbstractPainter
7.39.3.6 getSolidRect()
Gets the largest solid (non-transparent) rectangle. Since canvas widgets typically do not have a solid rect, it is
recommended to return an empty rectangle.
Returns
Implements Drawable.
7.39.3.7 invalidate()
Invalidates the area covered by this CanvasWidget. Since many widgets are a lot smaller than the actual size of the
canvas widget, each widget must be able to tell the smallest rectangle completely containing the shape drawn by
the widget. For example a circle arc is typically much smaller than the widget containing the circle.
See also
getMinimalRect()
7.39.3.8 setAlpha()
void setAlpha (
uint8_t alpha ) [inline], [virtual]
Parameters
alpha The alpha value. 255 = completely solid.
7.39.3.9 setPainter()
void setPainter (
AbstractPainter & painter ) [virtual]
Note
Parameters
See also
AbstractPainter
Class for supporting drawing of figures. This class holds the memory which is used by the underlying algorithms.
CanvasWidget will not allocate memory dynamically, but will use memory from the buffer kept in CanvasWidget←-
Renderer. When using the TouchGFX simulator, it is also possible to get a report on the actual amount of memory
used for the drawings to help adjusting the buffer size.
See also
Widget
7.40.2.1 getMissingBufferSize()
Calculate how much memory was required by CanvasWidgets, but was unavailable. If the value returned is greater
than 0 it means the This can be used to fine tune the size of the buffer passed to CanvasWidgetRenderer upon
initialization.
Returns
7.40.2.2 getOutlineBuffer()
Returns
7.40.2.3 getOutlineBufferSize()
Returns
7.40.2.4 getScanlineCounts()
Returns
7.40.2.5 getScanlineCovers()
Returns
7.40.2.6 getScanlineStartIndices()
Returns
7.40.2.7 getScanlineWidth()
The width of a scanline. This is the same as the width of the invalidated area. Used to optimize the memory layout
of the buffer.
Returns
7.40.2.8 getUsedBufferSize()
Calculate how much memory has been required by CanvasWidgets. This can be used to fine tune the size of the
buffer passed to CanvasWidgetRenderer upon initialization.
Returns
7.40.2.9 getWriteMemoryUsageReport()
Returns
7.40.2.10 hasBuffer()
Returns
7.40.2.11 numCellsMissing()
Called by the destructor in Outline to help keep track of the memory requirements of CanvasWidgets.
Parameters
7.40.2.12 numCellsUsed()
Called by the destructor in Outline to help keep track of the memory requirements of CanvasWidgets.
Parameters
7.40.2.13 setScanlineWidth()
Sets scanline width. Setting the scanline width will initialize the buffers for scanline and outline. If the width set is
too large to fit the scanline buffers in the allocated memory buffer, false will be returned and all buffer pointers will
be cleared.
Parameters
Returns
7.40.2.14 setupBuffer()
Parameters
7.40.2.15 setWriteMemoryUsageReport()
Memory reporting can be turned on (and off) using this method. CWR will try to work with the given amount of
memory passed when calling setupBuffer(). If the outline of the figure is too complex, this will be reported.
"CWR requires X bytes" means that X bytes is the highest number of bytesd requied by CWR so far, but since the
size of the invalidated area and the shape of things draw can influence this, this may be reported several times with
a higher and higher number. Leave your app running for a long time to find out what the memory requirements are.
"CWR requires X bytes (Y bytes missing)" means the same as the report above, but there as was not enough
memory to render the entire shape. To get around this, CWR will split the shape into two separate drawings of half
size. This means that less memory is required, but drawing will be (somewhat) slower. After you see this message
all future draws will be split into smaller chunks, so memory requirements might not get as high. This is followed by:
"CWR will split draw into multiple draws due to limited memory." actually just means that CWR will try to work with
a smaller amount of memory.
In general, if there is enough memory available to run the simulation and never see the message "CWR will split
draw ...", this is preferred. The size of the buffer required will be the highest number X reported as "CWR requires
X bytes". Good numbers can also be around half of X.
Parameters
writeUsageReport true to write report.
See also
setupBuffer
A pixel cell.
#include <touchgfx/canvas_widget_renderer/Cell.hpp>
• void set (int _x, int _y, int _cover, int _area)
Sets all the Cell parameters.
Public Attributes
• int16_t x
The x coordinate.
• int16_t y
The y coordinate.
• int16_t cover
The cover (see http://projects.tuxee.net/cl-vectors/section-the-cl-aa-algorithm for
further information).
• int16_t area
The area (see http://projects.tuxee.net/cl-vectors/section-the-cl-aa-algorithm for
further information).
A pixel cell. There are no constructors defined and it was done intentionally in order to avoid extra overhead when
allocating an array of cells.
7.41.2.1 addCover()
void addCover (
int _cover,
int _area ) [inline]
Parameters
7.41.2.2 packedCoord()
Packed coordinates of the Cell. By packing the x coordinate and y coordinate into one int, it is possible to sort Cells
using a single comparison.
Returns
The packed coordinates with y in the high part and x in the low part.
7.41.2.3 set()
void set (
int _x,
int _y,
int _cover,
int _area ) [inline]
Parameters
_x The x coordinate.
_y The y coordinate.
_cover The cover.
_area The area.
7.41.2.4 setCoord()
void setCoord (
int _x,
int _y ) [inline]
Parameters
7.41.2.5 setCover()
void setCover (
int _cover,
int _area ) [inline]
Parameters
_cover The cover.
_area The area.
• Circle ()
Constructs a new Circle.
• template<typename T >
void setCircle (const T x, const T y, const T r)
Sets the center and radius of the Circle.
• void setCircle (const int16_t x, const int16_t y, const int16_t r)
Sets the center and radius of the Circle.
• template<typename T >
void setCenter (const T x, const T y)
Sets the center of the Circle.
• void setCenter (const int16_t x, const int16_t y)
Sets the center of the Circle.
• template<typename T >
void getCenter (T &x, T &y) const
Gets the center coordinates of the Circle.
• template<typename T >
void setRadius (const T r)
Sets the radius of the Circle.
• template<typename T >
void getRadius (T &r) const
Gets the radius of the Circle.
• template<typename T >
void setArc (const T startAngle, const T endAngle)
Sets the start and end angles in degrees of the Circle arc.
• void setArc (const int16_t startAngle, const int16_t endAngle)
Sets the start and end angles in degrees of the Circle arc.
• template<typename T >
void getArc (T &startAngle, T &endAngle) const
Gets the start and end angles in degrees for the circle arc.
• int16_t getArcStart () const
Gets the start angle in degrees for the arc.
• template<typename T >
void getArcStart (T &angle) const
Gets the start angle in degrees for the arc.
• int16_t getArcEnd () const
Gets the end angle in degrees for the arc.
• template<typename T >
void getArcEnd (T &angle) const
Gets the end angle in degrees for the arc.
• template<typename T >
void updateArcStart (const T startAngle)
Updates the start angle in degrees for this Circle arc.
• template<typename T >
void updateArcEnd (const T endAngle)
Simple widget capable of drawing a circle. By tweaking the parameters of the circle, several parameters of the circle
can be changed. Center, radius, line width, line cap and partial circle arc. This opens for creation of fascinating
graphics.
See also
CanvasWidget
7.42.2.1 Circle()
Circle ( )
7.42.3.1 drawCanvasWidget()
bool drawCanvasWidget (
const Rect & invalidatedArea ) const [virtual]
Draws the Circle. This class supports partial drawing, so only the area described by the rectangle will be drawn.
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
Returns
Implements CanvasWidget.
7.42.3.2 getArc()
Gets the start and end angles in degrees for the circle arc.
Template Parameters
Parameters
out startAngle The start.
out endAngle The end.
See also
setArc
Template Parameters
Returns
See also
getArc
setArc
Template Parameters
Parameters
in,out angle The angle.
Returns
See also
getArc
setArc
Template Parameters
Parameters
in,out angle The angle.
See also
getArc
setArc
7.42.3.7 getCapPrecision()
Returns
See also
getCapPrecision
7.42.3.8 getCenter()
Template Parameters
Parameters
7.42.3.9 getLineWidth()
Template Parameters
Parameters
out width The width.
See also
setLineWidth
Returns
Rect getMinimalRect (
int16_t arcStart,
int16_t arcEnd ) const
Parameters
Returns
Rect getMinimalRect (
CWRUtil::Q5 arcStart,
CWRUtil::Q5 arcEnd ) const
Parameters
Returns
7.42.3.13 getPrecision()
Gets the precision of the circle drawing function. The precision is the number of degrees used as step counter when
drawing smaller line fragments around the circumference of the circle, the default being being 5.
Returns
The precision.
See also
setPrecision
7.42.3.14 getRadius()
Template Parameters
Parameters
out r The radius.
Sets the start and end angles in degrees of the Circle arc. 0 degrees is straight up (12 o'clock) and 90 degrees is to
the left (3 o'clock). Any positive or negative degrees can be used to specify the part of the Circle to draw.
Template Parameters
Parameters
startAngle The start degrees.
endAngle The end degrees.
Note
See also
getArc
updateArcStart
updateArcEnd
void setArc (
const int16_t startAngle,
const int16_t endAngle ) [inline]
Sets the start and end angles in degrees of the Circle arc. 0 degrees is straight up (12 o'clock) and 90 degrees is to
the left (3 o'clock). Any positive or negative degrees can be used to specify the part of the Circle to draw.
Parameters
startAngle The start degrees.
endAngle The end degrees.
Note
See also
getArc
updateArcStart
updateArcEnd
7.42.3.17 setCapPrecision()
void setCapPrecision (
const int precision )
Sets a precision of the ends of the Circle arc. The precision is given in degrees where 180 is the default which
results in a square ended arc (aka "butt cap"). 90 will draw "an arrow head" and smaller values gives a round cap.
Larger values of precision results in faster rendering of the circle.
Parameters
precision The new cap precision.
Note
Template Parameters
Parameters
Note
void setCenter (
const int16_t x,
const int16_t y ) [inline]
Parameters
Note
Template Parameters
Parameters
Note
void setCircle (
const int16_t x,
const int16_t y,
const int16_t r ) [inline]
Parameters
Note
7.42.3.22 setLineWidth()
Sets the line width for this Circle. If the line width is set to zero, the circle will be filled.
Template Parameters
Parameters
Note
7.42.3.23 setPrecision()
void setPrecision (
const int precision )
Sets a precision of the Circle drawing function. The number given as precision is the number of degrees used
as step counter when drawing smaller line fragments around the circumference of the circle, five being a sensible
value. Higher values results in less nice circles but faster rendering. Large circles might need a precision smaller
than five.
Parameters
precision The precision measured in degrees.
Note
7.42.3.24 setRadius()
Template Parameters
Parameters
r The radius.
Note
7.42.3.25 updateArcEnd()
Template Parameters
Parameters
endAngle The end angle in degrees.
Note
See also
setArc
updateArcStart
7.42.3.26 updateArcStart()
Template Parameters
Parameters
startAngle The start angle in degrees.
Note
See also
setArc
updateArcEnd
A circle progress.
#include <touchgfx/containers/progress_indicators/CircleProgress.hpp>
• CircleProgress ()
Default constructor.
• virtual ∼CircleProgress ()
Destructor.
• virtual void setProgressIndicatorPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the position and dimension of the circle progress indicator.
• virtual void setPainter (AbstractPainter &painter)
Sets the painter.
• virtual void setCenter (int x, int y)
Sets the center.
• virtual void getCenter (int &x, int &y) const
Gets the center coordinates.
• virtual void setRadius (int r)
Sets the radius.
• virtual int getRadius () const
Gets the radius.
• virtual void setLineWidth (int width)
Sets line width.
• virtual int getLineWidth () const
Gets line width.
• virtual void setCapPrecision (int precision)
Sets the cap precision.
• virtual int getCapPrecision () const
Gets the cap precision.
• virtual void setStartEndAngle (int startAngle, int endAngle)
Sets start and end angle.
• virtual int getStartAngle () const
Gets start angle.
• virtual int getEndAngle () const
Gets end angle.
• virtual void setAlpha (uint8_t alpha)
Sets the alpha.
• virtual uint8_t getAlpha () const
Gets the alpha.
• virtual void setValue (int value)
Sets a value.
Protected Attributes
• Circle circle
The circle.
• int circleEndAngle
The circle end angle.
A circle progress indicator uses CWR for drawing the arc of a circle to show progress, and so the user must create
a painter for painting the circle. The circle progress is defined by setting the minimum and maximum angle of the
arc.
See also
Circle
7.43.2.1 CircleProgress()
CircleProgress ( )
Default constructor.
7.43.2.2 ∼CircleProgress()
∼CircleProgress ( ) [virtual]
Destructor.
7.43.3.1 getAlpha()
Returns
The alpha.
See also
setAlpha
7.43.3.2 getCapPrecision()
Returns
7.43.3.3 getCenter()
void getCenter (
int & x,
int & y ) const [virtual]
Parameters
out x The x coordinate.
out y The y coordinate.
7.43.3.4 getEndAngle()
Gets end angle. Beware that the value returned is not related to the current progress of the circle but rather the end
point of the circle when it is at 100%.
Returns
See also
setStartEndAngle
setEndAngle
7.43.3.5 getLineWidth()
Returns
See also
setLineWidth
7.43.3.6 getRadius()
Returns
The radius.
7.43.3.7 getStartAngle()
Returns
See also
setStartEndAngle
getEndAngle
7.43.3.8 setAlpha()
void setAlpha (
uint8_t alpha ) [virtual]
Sets the alpha of the Circle. Please note, that the alpha can also be set on the Painter, but this can be controlled
directly from the user app, setting alpha for the CircleProgress will set the alpha of the actual circle.
Parameters
alpha The alpha.
See also
getAlpha
7.43.3.9 setCapPrecision()
void setCapPrecision (
int precision ) [virtual]
Sets the cap precision of the circle arc. This is not used if line width is zero.
Parameters
precision The cap precision.
See also
Circle::setCapPrecision
7.43.3.10 setCenter()
void setCenter (
int x,
int y ) [virtual]
Parameters
x The int to process.
y The int to process.
7.43.3.11 setLineWidth()
void setLineWidth (
int width ) [virtual]
Sets line width of the circle. If a line width of zero is specified, it has a special meaning of drawing a filled circle
instead of just the circle arc.
Parameters
width The width.
See also
Circle::setLineWidth
7.43.3.12 setPainter()
void setPainter (
AbstractPainter & painter ) [virtual]
Parameters
in,out painter The painter.
See also
Circle::setPainter
AbstractPainter
7.43.3.13 setProgressIndicatorPosition()
void setProgressIndicatorPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [virtual]
Sets the position and dimension of the circle progress indicator relative to the background image.
Parameters
x The x coordinate.
y The y coordinate.
width The width of the circle progress indicator.
height The height of the circle progress indicator.
7.43.3.14 setRadius()
void setRadius (
int r ) [virtual]
Parameters
r The int to process.
See also
Circle::setRadius
7.43.3.15 setStartEndAngle()
void setStartEndAngle (
int startAngle,
int endAngle ) [virtual]
Sets start and end angle. By swapping end and start angles, circles can be drawn backwards.
Parameters
startAngle The start angle.
endAngle The end angle.
7.43.3.16 setValue()
Sets the current value in the range (min..max) set by setRange(). Values lower than min are mapped to min, values
higher than max are mapped to max.
Parameters
value The value.
• ClickButtonTrigger ()
Default constructor.
• virtual ∼ClickButtonTrigger ()
Destructor.
• virtual void handleClickEvent (const ClickEvent &event)
Handles the click event described by event.
A click button trigger. This trigger will create a button that reacts on clicks. This means it will call the action when it
gets a touch released event.
The ClickButtonTrigger can be combined with one or more of the ButtonStyle classes to create a functional button.
7.44.2.1 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [inline], [virtual]
Handles the click event described by event. The action callback is called when receiving a REALEASED event in
PRESSED state.
Parameters
event The event.
A click event.
#include <touchgfx/events/ClickEvent.hpp>
Public Types
A click event. The semantics of this event is slightly depending on hardware platform. ClickEvents are generated by
the HAL layer.
See also
Event
7.45.2.1 ClickEventType
Enumerator
7.45.3.1 ClickEvent()
ClickEvent (
ClickEventType type,
int16_t x,
int16_t y,
int16_t force = 0 ) [inline]
Constructor.
Parameters
7.45.3.2 ∼ClickEvent()
Destructor.
7.45.4.1 getEventType()
Returns
Implements Event.
7.45.4.2 getForce()
Gets the force of the click. On touch displays this usually means how hard the user pressed on the display. On the
windows platform, this will always be zero.
Returns
7.45.4.3 getType()
Returns
7.45.4.4 getX()
Returns
7.45.4.5 getY()
Returns
7.45.4.6 setType()
void setType (
ClickEventType type ) [inline]
Parameters
type The type to set.
7.45.4.7 setX()
void setX (
int16_t x ) [inline]
Parameters
7.45.4.8 setY()
void setY (
int16_t y ) [inline]
Parameters
• ClickListener ()
Default constructor.
• virtual ∼ClickListener ()
Destructor.
• virtual void handleClickEvent (const ClickEvent &event)
Ensures that the clickEvent is propagated to the super class.
• void setClickAction (GenericCallback< const T &, const ClickEvent & > &callback)
Associates an action to be performed when the class T is clicked.
Protected Attributes
template<class T>
class touchgfx::ClickListener< T >
Mix-in class that extends a class with a click action event that is called when the class receives a click event.
Template Parameters
7.46.2.1 ClickListener()
ClickListener ( ) [inline]
Default constructor.
7.46.3.1 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [inline], [virtual]
Ensures that the clickEvent is propagated to the super class T and to the clickAction listener.
Parameters
See also
Drawable::handleClickEvent()
7.46.3.2 setClickAction()
void setClickAction (
GenericCallback< const T &, const ClickEvent & > & callback ) [inline]
Parameters
See also
GenericCallback
7.47.2.1 getBlueColor()
Gets the blue color part of a color. As this function must work for all color depths, it can be somewhat slow if used
in speed critical sections. Consider finding the color in another way, if possible.
Parameters
color The 16 bit color value.
Returns
7.47.2.2 getColorFrom24BitRGB()
uint8_t green,
uint8_t blue ) [static]
Generates a color representation to be used on the LCD, based on 24 bit RGB values. Depending on your chosen
color bit depth, the color will be interpreted internally as either a 16 bit or 24 bit color value. This function can be
safely used regardless of whether your application is configured for 16 or 24 bit colors.
Parameters
Returns
The color, encoded in a 16- or 24-bit representation depending on LCD color depth.
7.47.2.3 getGreenColor()
Gets the green color part of a color. As this function must work for all color depths, it can be somewhat slow if used
in speed critical sections. Consider finding the color in another way, if possible.
Parameters
color The 16 bit color value.
Returns
7.47.2.4 getRedColor()
Gets the red color part of a color. As this function must work for all color depths, it can be somewhat slow if used in
speed critical sections. Consider finding the color in another way, if possible.
Parameters
color The color value.
Returns
• colortype ()
Default constructor.
• colortype (uint32_t col)
Constructor.
• uint32_t getColor32 () const
Gets color 32 as a 32bit value suitable for passing to Color::getRedColor(), Color::getGreenColor() and Color::get←-
BlueColor() which will handle both 16 bit colortypes and 24 bit colortypes.
• operator uint16_t () const
Cast that converts the given colortype to an uint16_t.
Public Attributes
• uint32_t color
The color.
This type can contain a color value. Note that in order to maintain backwards compatibility, casting this type to an
integral value will yield a 16-bit value. To extract a 24/32-bit color from this type, use the getColor32 function.
colortype ( ) [inline]
colortype (
uint32_t col ) [inline]
Contructor which creates a colortype with the given color. Use Color::getColorFrom24BitRGB() to create a color
that will work on both 16 bit LCD and 24 bit LCD.
Parameters
col The color.
See also
Color::getColorFrom24BitRGB()
7.48.3.1 getColor32()
Returns
See also
Color::getRedColor()
Color::getGreenColor()
Color::getBlueColor()
Cast that converts the given colortype to an uint16_t. Provided only for backward compatibility. Not recommended
to use.
Returns
A ConstFont is a Font implementation that has its contents defined at compile-time and usually placed in read-only
memory.
#include <touchgfx/ConstFont.hpp>
• ConstFont (const GlyphNode ∗list, uint16_t size, uint16_t height, uint8_t pixBelowBase, uint8_t bitsPerPixel,
uint8_t maxLeft, uint8_t maxRight, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar
ellipsisChar)
Creates a font instance.
• virtual const GlyphNode ∗ getGlyph (Unicode::UnicodeChar unicode, const uint8_t ∗&pixelData, uint8_←-
t &bitsPerPixel) const
Gets the glyph data associated with the specified unicode.
• virtual const uint8_t ∗ getPixelData (const GlyphNode ∗glyph) const =0
Gets the pixel date associated with this glyph.
• virtual int8_t getKerning (Unicode::UnicodeChar prevChar, const GlyphNode ∗glyph) const =0
Gets the kerning distance between two characters.
Protected Attributes
A ConstFont is a Font implementation that has its contents defined at compile-time and usually placed in read-only
memory.
Note
See also
Font
7.49.2.1 ConstFont()
ConstFont (
const GlyphNode ∗ list,
uint16_t size,
uint16_t height,
uint8_t pixBelowBase,
uint8_t bitsPerPixel,
uint8_t maxLeft,
uint8_t maxRight,
const Unicode::UnicodeChar fallbackChar,
const Unicode::UnicodeChar ellipsisChar )
Parameters
Parameters
maxRight The maximum a character extends to the right.
fallbackChar The fallback character for the typography in case no glyph is available.
ellipsisChar The ellipsis character used for truncating long texts.
7.49.3.1 find()
Parameters
unicode The character to look up.
Returns
A pointer to the glyph node or null if the glyph was not found.
7.49.3.2 getGlyph()
Gets the glyph data associated with the specified unicode. An implementation of Font::getGlyph. Searches the
glyph list for the specified font.
Complexity O(log n)
Parameters
unicode The character to look up.
pixelData Pointer to the pixel data for the glyph if the glyph is found. This is set by this method.
out bitsPerPixel Reference where to place the number of bits per pixel.
Returns
A pointer to the glyph node or null if the glyph was not found.
Implements Font.
7.49.3.3 getKerning()
int8_t getKerning (
Unicode::UnicodeChar prevChar,
const GlyphNode ∗ glyph ) const [pure virtual]
Parameters
Returns
7.49.3.4 getPixelData()
Parameters
Returns
Implemented in InternalFlashFont.
• Container ()
Default constructor.
• virtual ∼Container ()
Destructor.
• virtual void add (Drawable &d)
Adds a Drawable instance as child to this Container.
Protected Attributes
• Drawable ∗ firstChild
Pointer to the first child of this container. Subsequent children can be found through firstChild->nextSibling.
A Container is a Drawable that can have child nodes. The z-order of children is determined by the order in which
Drawables are added to the container - the Drawable added last will be front-most on the screen.
This class overrides a few functions in Drawable in order to traverse child nodes.
Note that containers act as view ports - that is, only the parts of children that intersect with the geometry of the
container will be visible (e.g. setting a container's width to 0 will render all children invisible).
See also
Drawable
7.50.2.1 Container()
Container ( ) [inline]
Default constructor.
7.50.2.2 ∼Container()
Destructor.
7.50.3.1 add()
void add (
Drawable & d ) [virtual]
Note
Parameters
in d The Drawable to add.
7.50.3.2 contains()
bool contains (
const Drawable & d ) [virtual]
Parameters
Returns
True if the specified Drawable instance is direct child of this container, false otherwise.
7.50.3.3 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Draws the children of this container. Only used when JSMOC is disabled.
Parameters
invalidatedArea The area to draw.
Implements Drawable.
Reimplemented in Keyboard.
7.50.3.4 forEachChild()
void forEachChild (
GenericCallback< Drawable &> ∗ function ) [virtual]
Calls the specified function for each child in the container. Function to call must have the following prototype: void
T::func(Drawable&)
Parameters
See also
7.50.3.5 getContainedArea()
Gets a rectangle describing the total area covered by the children of this container.
Returns
Reimplemented in ScrollableContainer.
7.50.3.6 getFirstChild()
Useful if you want to manually iterate the children added to this container.
Returns
Pointer to the first drawable added to this container. If nothing has been added return zero.
7.50.3.7 getLastChild()
void getLastChild (
int16_t x,
int16_t y,
Drawable ∗∗ last ) [virtual]
Gets the last (=highest Z-order) child of this container that is enabled, visible and intersects with the specified point.
Recursive function.
Parameters
See also
Drawable::getLastChild
Implements Drawable.
Reimplemented in ScrollableContainer.
7.50.3.8 getSolidRect()
Gets solid rectangle of a Container. JSMOC does not operate directly on containers.
Returns
Implements Drawable.
7.50.3.9 getType()
Returns
TYPE_CONTAINER.
7.50.3.10 insert()
void insert (
Drawable ∗ previous,
Drawable & d ) [virtual]
Inserts a Drawable instance after the specified child node. If previous is null, the drawable will be inserted as the
first element in the list.
Note
Parameters
Reimplemented in ListLayout.
7.50.3.11 moveChildrenRelative()
void moveChildrenRelative (
int16_t deltaX,
int16_t deltaY ) [protected], [virtual]
Parameters
deltaX Horizontal displacement.
deltaY Vertical displacement.
Reimplemented in ScrollableContainer.
7.50.3.12 remove()
void remove (
Drawable & d ) [virtual]
Note
This is safe to call even if d is not a child (in which case nothing happens).
Parameters
in d The Drawable to remove.
7.50.3.13 removeAll()
7.50.3.14 setupDrawChain()
Note
Parameters
invalidatedArea Include drawables that intersect with this area only.
in,out nextPreviousElement Modifiable element in linked list.
7.50.3.15 unlink()
Removes all children by unlinking the first child. The parent and sibling pointers of the children are not reset.
Classes
• class FullSolidRect
A Widget that returns a solid rect of the same size as the application.
Tear down.
• virtual void init ()
Initializes this object.
template<Direction templateDirection>
class touchgfx::CoverTransition< templateDirection >
Template Parameters
See also
Transition
7.51.2.1 CoverTransition()
CoverTransition (
const uint8_t transitionSteps = 20 ) [inline]
Constructor.
Parameters
7.51.2.2 ∼CoverTransition()
Destructor.
7.51.3.1 handleTickEvent()
Handles the tick event when transitioning. It moves the contents of the Screen's container. The direction of the
transition determines the direction the contents of the container moves.
Reimplemented from Transition.
7.51.3.2 init()
See also
Transition::init()
7.51.3.3 initMoveDrawable()
void initMoveDrawable (
Drawable & d ) [inline], [protected], [virtual]
Moves the Drawable to its initial position outside of the visible area.
Parameters
in d The Drawable to move.
7.51.3.4 tearDown()
Tear down.
See also
Transition::tearDown()
7.51.3.5 tickMoveDrawable()
void tickMoveDrawable (
Parameters
in d The Drawable to move.
Classes
• class Q10
Defines a number with 10 bits reserved for fraction.
• class Q15
Defines a number with 15 bits reserved for fraction.
• class Q5
Defines a number with 5 bits reserved for fraction.
• template<typename T >
static FORCE_INLINE_FUNCTION Q5 toQ5 (T value)
Convert an integer to a fixed point number.
• template<typename T >
static FORCE_INLINE_FUNCTION Q10 toQ10 (T value)
Convert an integer to a fixed point number.
• static Q15 sine (int i)
Find the value of sin(i) with 15 bits precision.
• static Q15 sine (Q5 i)
Find the value of sin(i) with 15 bits precision.
• static Q15 cosine (int i)
Find the value of cos(i) with 15 bits precision.
• static Q15 cosine (Q5 i)
Find the value of cos(i) with 15 bits precision.
• static int8_t arcsine (Q10 q10)
Gets the arcsine of the given fraction (given as Q10).
• template<typename T >
static int angle (T x, T y)
Find angle of a coordinate.
• template<typename T >
static int angle (T x, T y, T &d)
Find angle of a coordinate.
• static int angle (Q5 x, Q5 y)
Find angle of a coordinate.
• static int angle (Q5 x, Q5 y, Q5 &d)
Find the angle of the coordinate (x, y).
Helper classes and functions for CanvasWidget. A handful of utility functions can be found here. These include
helper functions for converting between float, int and Q5/Q10/Q15 format. There are also functions for calculating
sin() and cos() in integers with a high number of bits reserved for fraction. Having sin() and cos() pre- calculated in
this way allows very fast drawing of circles without the need for floating point arithmetic.
Using Q5, numbers from -1024.00000 to +1024.96875 with a precision of 1/32 = 0.03125 can be represented.
See also
http://en.wikipedia.org/wiki/Q_%28number_format%29
Widget
Template Parameters
Parameters
x The x coordinate.
y The y coordinate.
Returns
Template Parameters
Parameters
x The x coordinate.
y The y coordinate.
out d The distance from (0,0) to (x,y).
Returns
Parameters
x The x coordinate.
y The y coordinate.
Returns
Parameters
x The x coordinate.
y The y coordinate.
out d The distance from (0,0) to (x,y).
Returns
The angle.
7.52.2.5 arcsine()
Gets the arcsine of the given fraction (given as Q10). The function is most precise for angles 0-45. To limit memory
requirements, values above sqrt(1/2) is calculated as 90-arcsine(sqrt(1-q10∧ 2)). Internally.
Parameters
q10 The 10.
Returns
An int8_t.
Find the value of cos(i) with 15 bits precision using the fact that cos(i)=sin(90- i).
Parameters
i the angle in degrees. The angle follows the angles of the clock, 0 being straight up and 90 being 3 o'clock.
Returns
See also
sine()
Find the value of cos(i) with 15 bits precision using the fact that cos(i)=sin(90-i).
Parameters
i the angle in degrees. The angle follows the angles of the clock, 0 being straight up and 90 being 3 o'clock.
Returns
See also
sine()
7.52.2.8 muldivQ5()
static Q5 muldivQ5 (
Q5 factor1,
Q5 factor2,
Q5 divisor ) [inline], [static]
Multiply two Q5's and divide by a Q5 without overflowing the multiplication (assuming that the final result can be
stored in a Q5).
Parameters
Returns
7.52.2.9 mulQ5()
static Q5 mulQ5 (
Q5 factor1,
Q5 factor2 ) [inline], [static]
Parameters
Returns
factor1 ∗ factor2.
Find the value of sin(i) with 15 bits precision. The returned value can be converted to a floating point number and
divided by (1<<15) to get the rounded value of of sin(i). By using this function, a complete circle can be drawn
without the need for using floating point math.
Parameters
i the angle in degrees. The angle follows the angles of the clock, 0 being straight up and 90 being 3 o'clock.
Returns
Find the value of sin(i) with 15 bits precision. The returned value can be converted to a floating point number and
divided by (1<<15) to get the rounded value of of sin(i). By using this function, a complete circle can be drawn
without the need for using floating point math.
If the given degree is not an integer, the value is approximated by interpolation between sin(floor(i)) and sin(ceil(i)).
Parameters
i the angle in degrees. The angle follows the angles of the clock, 0 being straight up and 90 being 3 o'clock.
Returns
7.52.2.12 sqrtQ10()
static Q5 sqrtQ10 (
Q10 value ) [inline], [static]
Parameters
Returns
7.52.2.13 toQ10()
Convert an integer to a fixed point number. This is done by shifting the integer value 10 places to the left, or
multiplying the floating point value by (1 < < 510.
Template Parameters
Parameters
value the integer to convert.
Returns
7.52.2.14 toQ5()
Convert an integer to a fixed point number. This is done by shifting the integer value 5 places to the left, or multiplying
the floating point value by (1 << 5)
Template Parameters
Parameters
value the integer to convert.
Returns
A digital clock.
#include <touchgfx/containers/clock/DigitalClock.hpp>
Public Types
• DigitalClock ()
Default constructor.
• virtual ∼DigitalClock ()
Destructor.
• virtual void setWidth (int16_t width)
Sets the width of the DigitalClock.
• virtual void setHeight (int16_t height)
Sets the height of the DigitalClock.
• virtual void setBaselineY (int16_t baselineY)
Adjusts the digital clocks y coordinate to place the text at the specified baseline.
• virtual void setTypedText (TypedText typedText)
Sets the typed text of the DigitalClock.
• virtual void setColor (colortype color)
Sets the color of the text.
• virtual void setDisplayMode (DisplayMode dm)
Sets the display mode.
• virtual DisplayMode getDisplayMode () const
Gets the display mode.
• void displayLeadingZeroForHourIndicator (bool displayLeadingZero)
Sets whether to display a leading zero for the hour indicator or not.
• virtual void setAlpha (uint8_t alpha)
Sets the alpha value of the digital clock.
• virtual uint8_t getAlpha () const
Gets the alpha value of the digital clock.
• virtual uint16_t getTextWidth () const
Gets text width.
Protected Attributes
• DisplayMode displayMode
The current display mode.
• bool useLeadingZeroForHourIndicator
Print a leading zero if the hour is less than 10.
• TextAreaWithOneWildcard text
The clock text.
• Unicode::UnicodeChar buffer [BUFFER_SIZE]
Wild card buffer for the clock text.
A digital clock. Can be set in either 12 or 24 hour mode. Seconds are optional. Width and height must be
set manually to match the typography and alignment specified in the text database. The Digital Clock requires a
typedText with one wildcard and uses the following characters (not including quotes) "AMP :0123456789" These
must be present in the text database with the same typography as the wildcard text. Leading zero for the hour
indicator can be enabled/disable by the displayLeadingZeroForHourIndicator method.
7.53.2.1 DisplayMode
enum DisplayMode
Enumerator
7.53.3.1 DigitalClock()
DigitalClock ( )
Default constructor.
7.53.3.2 ∼DigitalClock()
∼DigitalClock ( ) [virtual]
Destructor.
7.53.4.1 displayLeadingZeroForHourIndicator()
void displayLeadingZeroForHourIndicator (
bool displayLeadingZero )
Sets whether to display a leading zero for the hour indicator or not. That is the if an hour value less than 10 will be
displayed as "8:" or "08:".
Default value for this setting is false.
Parameters
displayLeadingZero true = show leading zero. false = do not show leading zero.
7.53.4.2 getAlpha()
Returns
7.53.4.3 getDisplayMode()
Returns
7.53.4.4 getTextWidth()
Returns
7.53.4.5 setAlpha()
void setAlpha (
uint8_t alpha ) [virtual]
Parameters
alpha The alpha value. 255 = completely solid. 0 = invisible.
7.53.4.6 setBaselineY()
void setBaselineY (
int16_t baselineY ) [virtual]
Adjusts the digital clocks y coordinate so the text will have its baseline at the specified value. The placements is
relative to the specified TypedText so if this changes you have to set the baseline again.
Note that setTypedText must be called prior to setting the baseline.
Parameters
Parameters
7.53.4.7 setColor()
void setColor (
colortype color ) [virtual]
Parameters
color The new text color.
7.53.4.8 setDisplayMode()
void setDisplayMode (
DisplayMode dm ) [inline], [virtual]
Parameters
dm The new DisplayMode.
7.53.4.9 setHeight()
void setHeight (
int16_t height ) [virtual]
Sets the height of the DigitalClock. The text area that displays the clock is expanded to match the dimension of the
DigitalClock.
Parameters
height The height.
7.53.4.10 setTypedText()
void setTypedText (
TypedText typedText ) [virtual]
Sets the typed text of the DigitalClock. Expects a typed text with one wildcard and that the following characters are
Parameters
typedText Describes the typed text to use.
7.53.4.11 setWidth()
void setWidth (
int16_t width ) [virtual]
Sets the width of the DigitalClock. The text area that displays the clock is expanded to match the dimension of the
DigitalClock.
Parameters
width The width.
7.53.4.12 updateClock()
Defines transformations from display space to frame buffer space. The display might be (considered) in portrait
mode from 0,0 to 272,480, while the actual frame buffer is from 0,0 to 480,272. This class handles the transforma-
tions.
Parameters
in,out x the x part to translate.
in,out y the y part to translate.
Parameters
in,out x the x part to translate.
in,out y the y part to translate.
Transform x,y from coordinates relative to the in rect to frame buffer coordinates.
Parameters
in,out x the x part to translate.
in,out y the y part to translate.
in the rectangle defining the coordinate space.
Transform x,y from coordinates relative to the in rect to frame buffer coordinates.
Parameters
in,out x the x part to translate.
in,out y the y part to translate.
in the rectangle defining the coordinate space.
Parameters
in,out r the rectangle to translate.
Transform rectangle r from coordinates relative to the in rect to frame buffer coordinates.
Parameters
in,out r the rectangle to translate.
in the rectangle defining the coordinate space.
7.54.2.7 transformFrameBufferToDisplay()
Parameters
in,out x the x part to translate.
in,out y the y part to translate.
DMA_Interface provides basic functionality and structure for processing "blit" operations using DMA.
#include <touchgfx/hal/DMA.hpp>
Protected Attributes
DMA_Interface provides basic functionality and structure for processing "blit" operations using DMA.
7.55.2.1 ∼DMA_Interface()
Destructor.
7.55.2.2 DMA_Interface()
DMA_Interface (
DMA_Queue & dmaQueue ) [inline], [protected]
Parameters
7.55.3.1 addToQueue()
void addToQueue (
const BlitOp & op ) [virtual]
Inserts a BlitOp for processing. This also potentially starts the DMA controller, if not already running.
Parameters
op The operation to add.
7.55.3.2 disableAlpha()
7.55.3.3 enableAlpha()
void enableAlpha (
uint8_t alpha ) [protected], [virtual]
Parameters
alpha The alpha-blending value to apply.
7.55.3.4 enableCopyWithTransparentPixels()
void enableCopyWithTransparentPixels (
uint8_t alpha ) [protected], [virtual]
Configures blit-op hardware for alpha-blending while simultaneously skipping transparent pixels.
Parameters
alpha The alpha-blending value to apply.
7.55.3.5 execute()
7.55.3.6 executeCompleted()
7.55.3.7 flush()
This function blocks until all DMA transfers in the queue have been completed.
Reimplemented in NoDMA.
7.55.3.8 getAllowed()
Gets whether a DMA operation is allowed to begin. Used in single-buffering to avoid changing the frame buffer while
display is being updated.
Returns
7.55.3.9 getBlitCaps()
Returns
Implemented in NoDMA.
7.55.3.10 initialize()
7.55.3.11 isDmaQueueEmpty()
uint8_t isDmaQueueEmpty ( )
Returns
7.55.3.12 isDmaQueueFull()
uint8_t isDmaQueueFull ( )
Returns
7.55.3.13 isDMARunning()
Returns
7.55.3.14 seedExecution()
Note
The frame buffer must be locked before this method returns if the DMA-queue is non- empty.
7.55.3.15 setAllowed()
void setAllowed (
bool allowed ) [inline]
Sets whether or not a DMA operation is allowed to begin. Used in single-buffering to avoid changing the frame
buffer while display is being updated.
Parameters
7.55.3.16 setupDataCopy()
void setupDataCopy (
const BlitOp & blitOp ) [protected], [pure virtual]
Parameters
Implemented in NoDMA.
7.55.3.17 setupDataFill()
void setupDataFill (
const BlitOp & blitOp ) [protected], [pure virtual]
Parameters
Implemented in NoDMA.
7.55.3.18 signalDMAInterrupt()
This function is called automatically by the framework when a DMA interrupt has been received.
Implemented in NoDMA.
7.55.3.19 start()
Signals that DMA transfers can start. If any elements are in the queue, start it.
7.55.3.20 waitForFrameBufferSemaphore()
Waits until frame buffer semaphore is available (i.e. neither DMA or application is accessing the frame buffer).
This class provides an interface for a FIFO (circular) list used by DMA_Interface and descendants for storing Blit←-
Op's.
#include <touchgfx/hal/DMA.hpp>
• DMA_Queue ()
Default constructor.
• virtual void pop ()=0
Pops an element from the queue.
• virtual const BlitOp ∗ first ()=0
Gets the first element in the queue.
This class provides an interface for a FIFO (circular) list used by DMA_Interface and descendants for storing Blit←-
Op's.
7.56.2.1 ∼DMA_Queue()
Destructor.
7.56.2.2 DMA_Queue()
Default constructor.
7.56.3.1 first()
Returns
Implemented in LockFreeDMA_Queue.
7.56.3.2 isEmpty()
Returns
Implemented in LockFreeDMA_Queue.
7.56.3.3 isFull()
Returns
Implemented in LockFreeDMA_Queue.
7.56.3.4 pop()
7.56.3.5 pushCopyOf()
void pushCopyOf (
const BlitOp & op ) [pure virtual]
Parameters
op The blitop to add.
Implemented in LockFreeDMA_Queue.
A drag event.
#include <touchgfx/events/DragEvent.hpp>
Public Types
• DragEvent (DragEventType type, int16_t oldX, int16_t oldY, int16_t newX, int16_t newY)
Constructor.
• virtual ∼DragEvent ()
Destructor.
• int16_t getOldX () const
Gets the x coordinate where the drag operation was started (dragged from).
• int16_t getOldY () const
Gets the y coordinate where the drag operation was started (dragged from).
• int16_t getNewX () const
Gets the new x coordinate (dragged to).
• int16_t getNewY () const
Gets the new x coordinate (dragged to).
• DragEventType getType () const
Gets the type of this drag event.
• int16_t getDeltaX () const
Gets the distance in x coordinates (how long was the drag).
• int16_t getDeltaY () const
Gets the distance in y coordinates (how long was the drag).
• virtual Event::EventType getEventType ()
Gets event type.
A drag event. The only drag event currently supported is DRAGGED, which will be issued every time the input
system detects a drag.
See also
Event
7.57.2.1 DragEvent()
DragEvent (
DragEventType type,
int16_t oldX,
int16_t oldY,
int16_t newX,
int16_t newY ) [inline]
Constructor. Create a drag event of the specified type with the specified coordinates.
Parameters
7.57.2.2 ∼DragEvent()
Destructor.
7.57.3.1 getDeltaX()
Returns
7.57.3.2 getDeltaY()
Returns
7.57.3.3 getEventType()
Returns
Implements Event.
7.57.3.4 getNewX()
Returns
7.57.3.5 getNewY()
Returns
7.57.3.6 getOldX()
Gets the x coordinate where the drag operation was started (dragged from).
Returns
The x coordinate where the drag operation was started (dragged from).
7.57.3.7 getOldY()
Gets the y coordinate where the drag operation was started (dragged from).
Returns
The y coordinate where the drag operation was started (dragged from).
7.57.3.8 getType()
Returns
• Draggable ()
Default constructor.
• virtual ∼Draggable ()
Destructor.
• virtual void handleDragEvent (const DragEvent &evt)
Called when dragging the draggable object.
template<class T>
class touchgfx::Draggable< T >
Template Parameters
7.58.2.1 Draggable()
Draggable ( ) [inline]
Default constructor.
7.58.2.2 ∼Draggable()
Destructor.
7.58.3.1 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [inline], [virtual]
Called when dragging the draggable object. The object is moved according to the drag event.
Parameters
evt The drag event.
Public Types
• enum DrawableType {
TYPE_DRAWABLE, TYPE_WIDGET, TYPE_ABSTRACTBUTTON, TYPE_ANIMATEDIMAGE, TYPE_B←-
OX, TYPE_BUTTON, TYPE_BUTTONWITHICON,
TYPE_BUTTONWITHLABEL, TYPE_IMAGE, TYPE_TILEDIMAGE, TYPE_KEYBOARD, TYPE_SCALA←-
BLEIMAGE, TYPE_SNAPSHOTWIDGET, TYPE_TEXTAREA,
TYPE_TEXTAREAWITHONEWILDCARD, TYPE_TEXTAREAWITHTWOWILDCARDS, TYPE_TOGGLE←-
BUTTON, TYPE_TOUCHAREA, TYPE_CONTAINER, TYPE_LISTLAYOUT, TYPE_SCROLLABLECON←-
TAINER,
TYPE_ZOOMANIMATIONIMAGE, TYPE_RADIOBUTTON, TYPE_TEXTUREMAPPER, TYPE_SLIDER,
TYPE_CUSTOMTYPESBEGIN, TYPE_CLICKABLECONTAINER }
Enum defining Drawable types.
• Drawable ()
Default constructor.
• virtual ∼Drawable ()
Destructor.
• virtual void draw (const Rect &invalidatedArea) const =0
Pure virtual function for drawing this drawable.
• virtual Rect getSolidRect () const =0
Pure virtual function for obtaining the largest possible rectangle that is guaranteed to be solid (non-transparent).
• virtual void invalidateRect (Rect &invalidatedArea) const
Request that a subregion of this drawable is redrawn.
• virtual void invalidate () const
Tell the framework that this entire drawable needs to be redrawn.
• Drawable ∗ getNextSibling ()
Gets the next sibling.
• virtual Rect getSolidRectAbsolute ()
Helper function for obtaining the largest solid rect.
• virtual void getLastChild (int16_t x, int16_t y, Drawable ∗∗last)=0
Function for obtaining the the last child of this drawable that intersects with the specified point.
• virtual void getVisibleRect (Rect &rect) const
JSMOC Function for obtaining the visible part of this drawable.
• const Rect & getRect () const
Gets the rectangle this Drawable covers.
• Rect getAbsoluteRect () const
Helper function for obtaining the rectangle this Drawable covers.
• virtual void translateRectToAbsolute (Rect &r) const
Helper function for converting a specified subregion of this Drawable to absolute coordinates.
• virtual void setPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the size and position of this Drawable.
• int16_t getX () const
Gets the x coordinate of this drawable.
• int16_t getY () const
Gets the y coordinate of this drawable.
• int16_t getWidth () const
Gets the width of this drawable.
• int16_t getHeight () const
Gets the height of this drawable.
• virtual void setX (int16_t x)
Sets the x coordinate of this drawable.
• virtual void setY (int16_t y)
Sets the y coordinate of this drawable.
• virtual void setXY (int16_t x, int16_t y)
Sets the x and y coordinates of this drawable.
• virtual void setWidth (int16_t width)
Sets the width of this drawable.
• virtual void setHeight (int16_t height)
Sets the height of this drawable.
• virtual void childGeometryChanged ()
This function can be called on parent nodes to signal that the size of one or more of its children has changed.
• virtual void handleClickEvent (const ClickEvent &evt)
Defines the event handler interface for ClickEvents.
• virtual void handleGestureEvent (const GestureEvent &evt)
Defines the event handler interface for GestureEvents.
• virtual void handleDragEvent (const DragEvent &evt)
• void resetDrawChainCache ()
For TouchGFX internal use only.
• Rect & getCachedVisibleRect ()
For TouchGFX internal use only.
• int16_t getCachedAbsX ()
For TouchGFX internal use only.
• int16_t getCachedAbsY ()
For TouchGFX internal use only.
• virtual void setupDrawChain (const Rect &invalidatedArea, Drawable ∗∗nextPreviousElement)
For TouchGFX internal use only.
Protected Attributes
• Rect rect
The coordinates of this drawable, relative to its parent.
• Rect cachedVisibleRect
Cached representation of currently visible area. For TouchGFX internal use.
• Drawable ∗ parent
Pointer to this drawable's parent.
• Drawable ∗ nextSibling
Pointer to the next drawable. Maintained by containers.
• Drawable ∗ nextDrawChainElement
Next in draw chain. For TouchGFX internal use.
• int16_t cachedAbsX
Cached value of absolute X-coord. For TouchGFX internal use.
• int16_t cachedAbsY
Cached value of absolute Y-coord. For TouchGFX internal use.
• bool touchable
True if this drawable should receive touch events.
• bool visible
True if this drawable should be drawn.
The Drawable class is an abstract definition of something that can be drawn. In the composite design pattern, the
Drawable is the component interface. Drawables can be added to a screen as a tree structure through the leaf node
class Widget and the Container class. A Drawable contains a pointer to its next sibling and a pointer to its parent
node. These are maintained by the Container to which the Drawable is added.
The Drawable interface contains two pure virtual functions which must be implemented by widgets, namely draw()
and getSolidRect(). In addition it contains general functionality for receiving events and navigating the tree structure.
The coordinates of a Drawable are always relative to its parent node.
See also
Widget
Container
7.59.2.1 DrawableType
Enum defining Drawable types. To be used by automated GUI testing to determine class type of a Drawable object.
7.59.3.1 Drawable()
Drawable ( ) [inline]
Default constructor.
7.59.3.2 ∼Drawable()
Destructor.
7.59.4.1 childGeometryChanged()
This function can be called on parent nodes to signal that the size of one or more of its children has changed.
Currently only used in ScrollableContainer to redraw scrollbars when the size of the scrolling contents changes.
Reimplemented in ScrollableContainer.
7.59.4.2 draw()
void draw (
const Rect & invalidatedArea ) const [pure virtual]
Pure virtual function for drawing this drawable. It is a requirement that the draw implementation does not draw
outside the region specified by invalidatedArea.
Parameters
invalidatedArea The subregion of this drawable that needs to be redrawn, expressed in coordinates relative
to its parent (e.g. for a complete redraw, invalidatedArea will be (0, 0, width, height).
7.59.4.3 getAbsoluteRect()
Helper function for obtaining the rectangle this Drawable covers, expressed in absolute coordinates.
Returns
7.59.4.4 getCachedAbsX()
Note
Returns
7.59.4.5 getCachedAbsY()
Note
Returns
7.59.4.6 getCachedVisibleRect()
Note
Returns
7.59.4.7 getHeight()
Returns
7.59.4.8 getLastChild()
void getLastChild (
int16_t x,
int16_t y,
Drawable ∗∗ last ) [pure virtual]
Function for obtaining the the last child of this drawable that intersects with the specified point. Used in input
event handling for obtaining the appropriate drawable that should receive the event. Note that input events must be
delegated to the last drawable of the tree (meaning highest z-order / front-most drawable).
Parameters
7.59.4.9 getNextSibling()
Returns the next sibling node. This will be the next Drawable that has been added to the same Container as this
Drawable.
Returns
The next sibling. If this is the last sibling, the return value is 0.
7.59.4.10 getParent()
Returns the parent node. For the root container, the return value is 0.
Returns
The parent node. For the root container, the return value is 0.
7.59.4.11 getRect()
Gets the rectangle this Drawable covers, in coordinates relative to its parent.
Returns
The rectangle this Drawable covers expressed in coordinates relative to its parent.
7.59.4.12 getSolidRect()
Pure virtual function for obtaining the largest possible rectangle that is guaranteed to be solid (non-transparent).
Used by JSMOC to prune the draw graph.
Note
The rectangle returned must be relative to (0, 0), meaning that to indicate a completely solid widget, Rect(0,
0, getWidth(), getHeight()) must be returned.
Returns
7.59.4.13 getSolidRectAbsolute()
Helper function for obtaining the largest solid rect (as implemented by getSolidRect()) expressed in absolute coor-
dinates. Will recursively traverse to the root of the tree.
Returns
7.59.4.14 getType()
For GUI testing only. Call this virtual function to determine the class type of this Drawable object. Can be used in
automated GUI testing. Otherwise this function is unused.
Note
If creating custom drawables that need to be manipulated by a test framework, override this function and return
a custom value higher than or equal to TYPE_CUSTOMTYPESBEGIN.
Returns
An integer describing the class type of this object, corresponding to the DrawableType enum for built-in Draw-
ables.
7.59.4.15 getVisibleRect()
void getVisibleRect (
Rect & rect ) const [virtual]
JSMOC Function for obtaining the visible part of this drawable. If the parent node has a smaller area than this
Drawable, the parent will act as a viewport, cutting off the parts of this Drawable that are outside the region.
Traverses the tree and yields a result expressed in absolute coordinates.
Parameters
out rect The subregion of the drawable on which to perform the operation.
7.59.4.16 getWidth()
Returns
7.59.4.17 getX()
Returns
7.59.4.18 getY()
Returns
7.59.4.19 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [inline], [virtual]
Defines the event handler interface for ClickEvents. The default implementation ignores the event. The event is only
received if the drawable is touchable.
Parameters
7.59.4.20 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [inline], [virtual]
Defines the event handler interface for DragEvents. The event is only received if the drawable is touchable.
Parameters
7.59.4.21 handleGestureEvent()
void handleGestureEvent (
const GestureEvent & evt ) [inline], [virtual]
Defines the event handler interface for GestureEvents. The default implementation ignores the event. The event is
only received if the drawable is touchable.
Parameters
7.59.4.22 handleTickEvent()
Called periodically by the framework if the Drawable instance has subscribed to timer ticks.
See also
Application::registerTimerWidget
7.59.4.23 invalidate()
See also
invalidateRect
Reimplemented in CanvasWidget.
7.59.4.24 invalidateRect()
void invalidateRect (
Rect & invalidatedArea ) const [virtual]
Request that a subregion of this drawable is redrawn. Will recursively traverse the tree towards the root, and once
reached, issue a draw operation. When this function returns, the specified invalidated area has been redrawn for all
appropriate Drawables covering the region.
Parameters
in invalidatedArea The area of this drawable to redraw expressed in coordinates relative to its parent (e.g.
to request a complete redraw, invalidatedArea will be (0, 0, width, height).
7.59.4.25 isTouchable()
Returns
See also
setTouchable
7.59.4.26 isVisible()
Returns
See also
setVisible
7.59.4.27 moveRelative()
void moveRelative (
int16_t x,
int16_t y ) [virtual]
Note
Parameters
x The relative position to move to.
y The relative position to move to.
7.59.4.28 moveTo()
void moveTo (
int16_t x,
int16_t y ) [inline], [virtual]
Note
Parameters
x The absolute position to move to.
y The absolute position to move to.
7.59.4.29 resetDrawChainCache()
Note
7.59.4.30 setHeight()
void setHeight (
int16_t height ) [inline], [virtual]
Note
Parameters
height The new height.
7.59.4.31 setPosition()
void setPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [inline], [virtual]
Sets the size and position of this Drawable, relative to its parent.
Note
Parameters
Reimplemented in ZoomAnimationImage.
7.59.4.32 setTouchable()
void setTouchable (
bool touch ) [inline]
Parameters
7.59.4.33 setupDrawChain()
void setupDrawChain (
const Rect & invalidatedArea,
Drawable ∗∗ nextPreviousElement ) [inline], [protected], [virtual]
Note
Parameters
invalidatedArea Include drawables that intersect with this area only.
in,out nextPreviousElement Modifiable element in linked list.
7.59.4.34 setVisible()
void setVisible (
bool vis ) [inline]
Controls whether this Drawable should be visible. Only visible Drawables will have their draw function called.
Additionally, invisible drawables will not receive input events.
Note
Parameters
vis true if this Drawable should be visible. By default, drawables are visible unless this function has been
called with false as argument.
7.59.4.35 setWidth()
void setWidth (
int16_t width ) [inline], [virtual]
Note
Parameters
width The new width.
7.59.4.36 setX()
void setX (
int16_t x ) [inline], [virtual]
Note
Parameters
x The new x value, relative to the parent. A negative value is allowed.
7.59.4.37 setXY()
void setXY (
int16_t x,
int16_t y ) [inline], [virtual]
Note
Parameters
x The new x value, relative to the parent. A negative value is allowed.
y The new y value, relative to the parent. A negative value is allowed.
7.59.4.38 setY()
void setY (
int16_t y ) [inline], [virtual]
Note
Parameters
y The new y value, relative to the parent. A negative value is allowed.
7.59.4.39 translateRectToAbsolute()
void translateRectToAbsolute (
Rect & r ) const [virtual]
Helper function for converting a specified subregion of this Drawable to absolute coordinates.
Parameters
in,out r The Rect to translate.
#include <touchgfx/containers/DrawableList.hpp>
• DrawableList ()
Default constructor.
• virtual ∼DrawableList ()
Destructor.
• virtual void setWidth (int16_t width)
Sets the width of the DrawableList.
• virtual void setHeight (int16_t height)
Sets the height of the DrawableList. If the list is horizontal, the height is also propagated to all drawables in the list.
• virtual void setHorizontal (bool horizontal)
Sets a horizontal layout.
• virtual bool getHorizontal () const
Gets the orientation of the drawables.
• virtual void setCircular (bool circular)
Sets whether the list is circular or not.
• virtual bool getCircular () const
Gets the circular setting.
• void setDrawableSize (int16_t drawableSize, int16_t drawableMargin)
Sets drawable size.
• virtual int16_t getItemSize () const
Gets size of each item.
• virtual int16_t getDrawableSize () const
Gets drawable size.
• virtual int16_t getDrawableMargin () const
Gets drawable margin.
• virtual void setDrawables (DrawableListItemsInterface &drawableListItems, int16_t drawableItemIndexOffset,
GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > &updateDrawableCallback)
Sets the drawables parameters.
• int16_t getNumberOfDrawables () const
Gets number of drawables.
• void setNumberOfItems (int16_t numberOfItems)
Sets number of items in the list.
• int16_t getNumberOfItems () const
Gets number of items in the DrawableList.
• int16_t getRequiredNumberOfDrawables () const
Gets required number of drawables.
• void setOffset (int32_t ofs)
Sets virtual coordinate.
• int32_t getOffset () const
Gets offset.
• int16_t getItemIndex (int16_t drawableIndex)
Gets item stored in a given Drawable.
• int16_t getDrawableIndices (int16_t itemIndex, int16_t ∗drawableIndexArray, int16_t arraySize)
Gets drawable indices.
• int16_t getDrawableIndex (int16_t itemIndex, int16_t prevDrawableIndex=-1)
Gets the drawable index of an item.
• void refreshDrawables ()
Refresh drawables.
• void itemChanged (int16_t itemIndex)
Item changed.
A container able to display many items using only a few drawables. This is done by only having drawables for visible
items, and populating these drawables with new content when the drawable becomes visible.
This means that all drawables must have an identical structure in some way, for example an Image or a Container
with a button and a text.
7.60.2.1 DrawableList()
DrawableList ( )
Default constructor.
7.60.2.2 ∼DrawableList()
Destructor.
7.60.3.1 getCircular()
Returns
True if the list is circular (infinite), false if the list is not circular.
See also
setCircular
7.60.3.2 getDrawableIndex()
int16_t getDrawableIndex (
int16_t itemIndex,
int16_t prevDrawableIndex = -1 )
Gets the drawable index of an item. If the number of items is smaller than the number of drawables and the
DrawableList is circular, the same item can be in more than one drawable. In that case, calling this function again
with the previously returned index as second parameter, the index of the next drawable containing the item will be
returned.
Parameters
Returns
The first drawable index with the given item. Returns -1 if the item is not in a drawable.
See also
getDrawableIndices
7.60.3.3 getDrawableIndices()
int16_t getDrawableIndices (
int16_t itemIndex,
int16_t ∗ drawableIndices,
int16_t num )
Gets drawable indices. Useful when the number of items is smaller than the number of drawables as the same item
might be in more than one drawable on the screen (if the DrawableList is circular). The passed array will be filled
with the drawable indices and the number of indices found is returned.
Parameters
Returns
See also
getFirstDrawableIndex
setCircular
getDrawbleIndex
7.60.3.4 getDrawableMargin()
Returns
7.60.3.5 getDrawableSize()
Returns
See also
setDrawables
7.60.3.6 getHorizontal()
Returns
See also
setHorizontal
7.60.3.7 getItemIndex()
int16_t getItemIndex (
int16_t drawableIndex )
Parameters
Returns
7.60.3.8 getItemSize()
Gets size of each item. This equals the drawable size plus the drawable margin as set in setDrawables(). Equals
getDrawableSize() + getDrawableMargin().
Returns
Note
See also
setDrawables
setDrawableSize
getDrawableMargin
7.60.3.9 getNumberOfDrawables()
Returns
See also
setDrawables
7.60.3.10 getNumberOfItems()
Returns
See also
setNumberOfItems
7.60.3.11 getOffset()
Returns
See also
setOffset
7.60.3.12 getRequiredNumberOfDrawables()
Gets required number of drawables. After setting up the DrawableList it is possible to request how many drawables
are needed to ensure that the list can always be drawn properly. If the DrawableList has been setup with fewer
Drawables than the required number of drawables, part of the lower part of the DrawableList will look wrong.
The number of required drawables depend on the size of the widget and the size of the drawables and the margin
around drawables. If there are fewer drawables than required, the widget will not display correctly. If there are more
drawables than required, some will be left unused.
Returns
See also
setDrawables
7.60.3.13 itemChanged()
void itemChanged (
int16_t itemIndex )
Item changed and drawables containing this item must be updated. This function can be called when an item has
changed and needs to be updated on screen. If the given item is displayed on screen, possible more than once for
cyclic lists, each drawable is request to refresh its content to reflect the new value.
Parameters
7.60.3.14 refreshDrawables()
void refreshDrawables ( )
Refresh drawables. Useful to call if the number or items, their size or other properties have changed.
7.60.3.15 setCircular()
void setCircular (
bool circular ) [virtual]
Sets whether the list is circular (infinite) or not. A circular list is a list where the first drawable re-appears after the
last item in the list.
Parameters
circular True if the list should be circular, false if the list should not be circular.
See also
getCircular
7.60.3.16 setDrawables()
void setDrawables (
DrawableListItemsInterface & drawableListItems,
int16_t drawableItemIndexOffset,
GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > & update←-
DrawableCallback ) [virtual]
Parameters
See also
getRequiredNumberOfDrawables
7.60.3.17 setDrawableSize()
void setDrawableSize (
int16_t drawableSize,
int16_t drawableMargin )
Sets drawable size. The total size of each drawable is the drawableSize + 2∗drawableMargin as margin will be
added before and after each drawable.
Parameters
7.60.3.18 setHeight()
void setHeight (
int16_t height ) [virtual]
Parameters
height The height.
7.60.3.19 setHorizontal()
void setHorizontal (
bool horizontal ) [virtual]
Sets a horizontal layout. If horizontal is set true, all drawables are arranged side by side. If horizontal is set false,
the drawables are arranged above and below each other (vertically).
Parameters
Note
See also
getHorizontal
7.60.3.20 setNumberOfItems()
void setNumberOfItems (
int16_t numberOfItems )
Sets number of items in the list. This forces all drawables to be updated to ensure that the content is correct.
Parameters
Note
7.60.3.21 setOffset()
void setOffset (
int32_t ofs )
Sets virtual coordinate. Does not move to the given coordinate, but places the drawables and fill correct content into
the drawables to give the impression that everything has been scrolled to the given coordinate.
Setting a value of 0 means that item 0 is at the start of the DrawableList. Setting a value of "-getItemSize()" places
item 0 outside the start of the DrawableList and item 1 at the start of it.
Items that are completely outside of view, will be updated with new content using the provided callback from set←-
Drawables(). Care is taken to not fill drawables more than strictly required.
Parameters
See also
getOffset
setDrawables
7.60.3.22 setWidth()
void setWidth (
int16_t width ) [virtual]
Sets the width of the DrawableList. If the list is vertical, the width is also propagated to all drawables in the list.
Parameters
width The width.
• DrawableListItems ()
Default constructor.
• virtual ∼DrawableListItems ()
Destructor.
• virtual Drawable ∗ getDrawable (int16_t index)
Gets the address of an element.
• TYPE & operator[ ] (int index)
Array indexer operator.
• virtual int16_t getNumberOfDrawables ()
Gets number of drawables.
Public Attributes
An array of drawables used by DrawableList. This class is primarily used to ease the setup of a callback function to
get access to a specific drawable in the array.
Example usage:
Template Parameters
TYPE Type of the drawables. Can be a simple drawable, such as Image or a more complex container.
SIZE Size of the array. This is the number of drawables to allocate and should be all visible drawables on
the screen at any given time.
7.61.2.1 DrawableListItems()
DrawableListItems ( ) [inline]
Default constructor.
7.61.2.2 ∼DrawableListItems()
Destructor.
7.61.3.1 getDrawable()
Drawable ∗ getDrawable (
int16_t index ) [inline], [virtual]
Parameters
Returns
Implements DrawableListItemsInterface.
7.61.3.2 getNumberOfDrawables()
Returns
Implements DrawableListItemsInterface.
7.61.3.3 operator[]()
Parameters
Returns
• virtual ∼DrawableListItemsInterface ()
Destructor.
• virtual Drawable ∗ getDrawable (int16_t index)=0
Gets a drawable.
• virtual int16_t getNumberOfDrawables ()=0
Gets number of drawables.
A drawable list items interface. Used to pass the allocated array of drawable elements to setDrawables function in
either ScrollList, ScrollWheel or ScrollWheelWithSelectionStyle. Provides easy access to each element in the array
See also
ScrollList::setDrawables
ScrollWheel::setDrawables
ScrollWheelWithSelectionStyle::setDrawables
7.62.2.1 ∼DrawableListItemsInterface()
Destuctor.
7.62.3.1 getDrawable()
Drawable ∗ getDrawable (
int16_t index ) [pure virtual]
Parameters
Returns
7.62.3.2 getNumberOfDrawables()
Returns
The destination of a draw operation. Contains a pointer to where to draw and the stride of the drawing surface.
#include <touchgfx/hal/Types.hpp>
Public Attributes
• uint16_t ∗ address
The bits.
• int32_t stride
The stride.
Public Attributes
• Rect solid
The solidRect of this bitmap.
• uint16_t width
The width of the bitmap.
• uint16_t height
The height of the bitmap.
• uint16_t format
Determine the format of the data.
• uint8_t inuse
zero if not in use
• uint8_t alpha
true if separate alpha for 565 format (always false)
Defines the "Penner easing functions", which are a de facto standard computing aesthetically pleasing motion
animations.
#include <touchgfx/EasingEquations.hpp>
Defines the "Penner easing functions", which are a de facto standard computing aesthetically pleasing motion
animations. See http://easings.net/ for visual illustrations of the easing equations.
See also
http://easings.net/
7.65.2.1 backEaseIn()
Back easing in: Overshooting cubic easing: (s+1)∗t∧ 3 - s∗t∧ 2. Backtracking slightly, then reversing direction and
moving to target.
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.2 backEaseInOut()
int16_t b,
int16_t c,
uint16_t d ) [static]
Back easing in/out: Overshooting cubic easing: (s+1)∗t∧ 3 - s∗t∧ 2. Backtracking slightly, then reversing direction
and moving to target, then overshooting target, reversing, and finally coming back to target.
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.3 backEaseOut()
Back easing out: Overshooting cubic easing: (s+1)∗t∧ 3 - s∗t∧ 2. Moving towards target, overshooting it slightly, then
reversing and coming back to target.
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.4 bounceEaseIn()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.5 bounceEaseInOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.6 bounceEaseOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.7 circEaseIn()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.8 circEaseInOut()
Circular easing in/out: sqrt(1-t∧ 2). Acceleration until halfway, then deceleration.
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.9 circEaseOut()
uint16_t t,
int16_t b,
int16_t c,
uint16_t d ) [static]
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.10 cubicEaseIn()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.11 cubicEaseInOut()
Parameters
t Time. The current time or step.
Parameters
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.12 cubicEaseOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.13 elasticEaseIn()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.14 elasticEaseInOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.15 elasticEaseOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.16 expoEaseIn()
uint16_t t,
int16_t b,
int16_t c,
uint16_t d ) [static]
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.17 expoEaseInOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.18 expoEaseOut()
Parameters
t Time. The current time or step.
Parameters
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.19 linearEaseIn()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.20 linearEaseInOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.21 linearEaseNone()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.22 linearEaseOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.23 quadEaseIn()
int16_t b,
int16_t c,
uint16_t d ) [static]
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.24 quadEaseInOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.25 quadEaseOut()
Parameters
t Time. The current time or step.
Parameters
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.26 quartEaseIn()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.27 quartEaseInOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.28 quartEaseOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.29 quintEaseIn()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.30 quintEaseInOut()
uint16_t t,
int16_t b,
int16_t c,
uint16_t d ) [static]
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.31 quintEaseOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.32 sineEaseIn()
Parameters
t Time. The current time or step.
Parameters
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.33 sineEaseInOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
7.65.2.34 sineEaseOut()
Parameters
t Time. The current time or step.
b Beginning. The beginning value.
c Change. The change between the beginning value and the destination value.
d Duration. The total time or total number of steps.
Returns
An edge contains information about one edge, between two points, of a triangle, as well as information about how
to interpolate values when moving in the vertical direction.
#include <touchgfx/TextureMapTypes.hpp>
• Edge (const Gradients &gradients, const Point3D ∗vertices, int top, int bottom)
Constructor.
• int step ()
Perform a step along the edge.
• int step (int steps)
Performs a number of steps along the edge.
Public Attributes
• int32_t X
The X coordinate.
• int32_t XStep
Amount to increment x.
• int32_t numerator
The numerator.
• int32_t denominator
The denominator.
• int32_t errorTerm
The error term.
• int Y
The Y coordinate.
• int height
The height.
• float oneOverZ
The one over z coordinate.
• float oneOverZStep
The one over z coordinate step.
• float oneOverZStepExtra
The one over z coordinate step extra.
• float UOverZ
The over z coordinate.
• float UOverZStep
The over z coordinate step.
• float UOverZStepExtra
The over z coordinate step extra.
• float VOverZ
The over z coordinate.
• float VOverZStep
7.66.1.1 Edge()
Edge (
const Gradients & gradients,
const Point3D ∗ vertices,
int top,
int bottom )
Construct the edge between two vertices and using the gradients for calculating the interpolation values.
Parameters
Returns
the Height.
int step (
int steps ) [inline]
Parameters
Returns
height.
Public Types
7.67.2.1 EventType
Enumerator
EVENT_CLICK A click.
EVENT_DRAG A drag.
EVENT_GESTURE A gesture.
7.67.3.1 ∼Event()
Destructor.
7.67.4.1 getEventType()
Returns
• FadeAnimator ()
Default constructor.
• virtual ∼FadeAnimator ()
Destructor.
• void setFadeAnimationEndedAction (GenericCallback< const FadeAnimator< T > & > &callback)
Associates an action to be performed when the animation ends.
• void clearFadeAnimationEndedAction ()
Clears the fade animation ended action previously set by setFadeAnimationEndedAction.
• virtual void setFadeAnimationDelay (uint16_t delay)
Sets a delay on animations done by the FadeAnimator.
• virtual uint16_t getFadeAnimationDelay () const
Gets the current animation delay.
• virtual bool isRunning () const
Gets whether or not the fade animation is running.
• virtual bool isFadeAnimationRunning () const
Gets whether or not the fade animation is running.
• void startFadeAnimation (uint8_t endAlpha, uint16_t duration, EasingEquation alphaProgression←-
Equation=&EasingEquations::linearEaseNone)
Starts the fade animation.
• void cancelFadeAnimation ()
Cancel fade animation.
Protected Attributes
• bool fadeAnimationRunning
Boolean that is true if the animation is running.
• uint16_t fadeAnimationCounter
Counter that is equal to the current step in the animation.
• uint16_t fadeAnimationDelay
A delay that is applied before animation start. Expressed in ticks.
• uint16_t fadeAnimationDuration
The complete duration of the animation. Expressed in ticks.
• int16_t fadeAnimationStartAlpha
The alpha value at the beginning of the animation.
• int16_t fadeAnimationEndAlpha
The alpha value at the end of the animation.
• EasingEquation fadeAnimationAlphaEquation
EasingEquation expressing the development of the alpha value during the animation.
• GenericCallback< const FadeAnimator< T > &> ∗ fadeAnimationEndedCallback
Animation ended Callback.
template<class T>
class touchgfx::FadeAnimator< T >
A FadeAnimator makes the template class T able to animate an alpha fade from its current alpha value to a specified
end alpha value. The alpha development can be described by supplying an EasingEquation. The FadeAnimator
performs a callback when the animation has finished.
This mixin can be used on any Drawable that has a 'void setAlpha(uint8_t)' and a 'uint8_t getAlpha()' method.
Template Parameters
7.68.2.1 FadeAnimator()
FadeAnimator ( ) [inline]
7.68.2.2 ∼FadeAnimator()
7.68.3.1 clearFadeAnimationEndedAction()
See also
setFadeAnimationEndedAction
7.68.3.2 getFadeAnimationDelay()
Returns
7.68.3.3 handleTickEvent()
7.68.3.4 isFadeAnimationRunning()
Returns
7.68.3.5 isRunning()
Returns
7.68.3.6 nextFadeAnimationStep()
Execute next step in fade animation and stop the timer if necessary.
7.68.3.7 setFadeAnimationDelay()
void setFadeAnimationDelay (
uint16_t delay ) [inline], [virtual]
Parameters
delay The delay in ticks.
7.68.3.8 setFadeAnimationEndedAction()
void setFadeAnimationEndedAction (
GenericCallback< const FadeAnimator< T > & > & callback ) [inline]
Parameters
callback The callback to be executed. The callback will be given a reference to the FadeAnimator.
See also
GenericCallback
7.68.3.9 startFadeAnimation()
void startFadeAnimation (
uint8_t endAlpha,
uint16_t duration,
EasingEquation alphaProgressionEquation = &EasingEquations::linearEaseNone )
[inline]
Starts the fade animation from the current alpha value to the specified end alpha value. The development of the
alpha value during the animation is described by the supplied EasingEquation.
Parameters
• virtual const GlyphNode ∗ getGlyph (Unicode::UnicodeChar unicode, const uint8_t ∗&pixelData, uint8_←-
t &bitsPerPixel) const =0
Gets the glyph data associated with the specified unicode.
• virtual const GlyphNode ∗ getGlyph (Unicode::UnicodeChar unicode) const
Gets the glyph data associated with the specified unicode.
• virtual Unicode::UnicodeChar getFallbackChar () const
Gets fallback character.
• virtual Unicode::UnicodeChar getEllipsisChar () const
Gets ellipsis character.
• virtual uint16_t getStringWidth (const Unicode::UnicodeChar ∗text,...) const
Gets the width in pixels of the specified string.
• virtual uint16_t getStringWidth (TextDirection textDirection, const Unicode::UnicodeChar ∗text,...) const
Gets the width in pixels of the specified string.
• virtual uint16_t getCharWidth (const Unicode::UnicodeChar c) const
Gets the width in pixels of the specified character.
• virtual uint8_t getSpacingAbove (const Unicode::UnicodeChar ∗text,...) const
Gets the number of blank pixels at the top of the given text.
• virtual uint16_t getMaxTextHeight (const Unicode::UnicodeChar ∗text,...) const
Gets the height of the highest character in a given string.
• virtual uint16_t getFontHeight () const
Returns the height in pixels of this font.
• virtual uint16_t getMinimumTextHeight () const
Returns the minimum height needed for a text field that uses this font.
• virtual uint8_t getBitsPerPixel () const
Gets bits per pixel for this font.
• uint8_t getMaxPixelsLeft () const
Gets maximum pixels left.
• uint8_t getMaxPixelsRight () const
Gets maximum pixels right.
• virtual int8_t getKerning (Unicode::UnicodeChar prevChar, const GlyphNode ∗glyph) const
Gets the kerning distance between two characters.
• virtual uint16_t getNumberOfLines (const Unicode::UnicodeChar ∗text,...) const
Gets number of lines.
Protected Types
Protected Attributes
• uint16_t fontHeight
The font height in pixels.
• uint8_t pixelsBelowBaseline
The number of pixels below the base line.
• uint8_t bPerPixel
The number of bits per pixel.
• uint8_t maxPixelsLeft
The maximum number of pixels a glyph extends to the left.
• uint8_t maxPixelsRight
The maximum number of pixels a glyph extends to the right.
• Unicode::UnicodeChar falllbackCharacter
The fallback character to use when no glyph exists for the wanted character.
• Unicode::UnicodeChar ellipsisCharacter
The ellipsis character used for truncating long texts.
The font base class. This class is abstract and requires the implementation of getGlyph.
It provides utility functions such as obtaining string width and font height.
7.69.2.1 Font()
Font (
uint16_t height,
uint8_t pixBelowBase,
uint8_t bitsPerPixel,
uint8_t maxLeft,
uint8_t maxRight,
const Unicode::UnicodeChar fallbackChar,
const Unicode::UnicodeChar ellipsisChar ) [inline], [protected]
Parameters
7.69.3.1 getBitsPerPixel()
Returns
7.69.3.2 getCharWidth()
uint16_t getCharWidth (
const Unicode::UnicodeChar c ) const [virtual]
Parameters
c The unicode character.
Returns
7.69.3.3 getEllipsisChar()
Gets ellipsis character for the given font. This is the character which is used when truncating long lines.
Returns
7.69.3.4 getFallbackChar()
Gets fallback character for the given font. In case there is no glyph for a character, use the glyph for the character
returned by this function. If 0 (zero) is returned, there is no default character.
Returns
7.69.3.5 getFontHeight()
Returns the height in pixels of this font. The returned value corresponds to the maximum height occupied by a
character in the font.
Note
It is not sufficient to allocate text areas with this height. Use getMinimumTextHeight for this.
Returns
Parameters
unicode The character to look up.
pixelData Pointer to the pixel data for the glyph if the glyph is found. This is set by this method.
out bitsPerPixel Reference where to place the number of bits per pixel.
Returns
A pointer to the glyph node or null if the glyph was not found.
Implemented in ConstFont.
Parameters
unicode The character to look up.
Returns
A pointer to the glyph node or null if the glyph was not found.
7.69.3.8 getKerning()
int8_t getKerning (
Unicode::UnicodeChar prevChar,
const GlyphNode ∗ glyph ) const [inline], [virtual]
Parameters
Returns
7.69.3.9 getMaxPixelsLeft()
Gets maximum pixels left for any glyph in the font. This is the max value of "left" for all glyphs. The value is negated
so if a "g" has left=-6 maxPixelsLeft is 6. This value is calculated by the font converter.
Returns
7.69.3.10 getMaxPixelsRight()
Gets maximum pixels right for any glyph in the font. This is the max value of "width+left-advance" for all glyphs. The
is the number of pixels a glyph reaches to the right of its normal area. This value is calculated by the font converter.
Returns
7.69.3.11 getMaxTextHeight()
uint16_t getMaxTextHeight (
const Unicode::UnicodeChar ∗ text,
... ) const [virtual]
Gets the height of the highest character in a given string. The height includes the spacing above the text which is
included in the font.
Parameters
text A zero-terminated unicode string.
... Variable arguments providing additional information.
Returns
7.69.3.12 getMinimumTextHeight()
Returns the minimum height needed for a text field that uses this font. Takes into account that certain characters
(eg 'g') have pixels below the baseline, thus making the text height larger than the font height.
Returns
The minimum height needed for a text field that uses this font.
7.69.3.13 getNumberOfLines()
uint16_t getNumberOfLines (
const Unicode::UnicodeChar ∗ text,
... ) const [virtual]
Parameters
text The text.
... Variable arguments providing additional information.
Returns
7.69.3.14 getSpacingAbove()
uint8_t getSpacingAbove (
const Unicode::UnicodeChar ∗ text,
... ) const [virtual]
Gets the number of blank pixels at the top of the given text.
Parameters
text A zero-terminated unicode string.
... Variable arguments providing additional information.
Returns
uint16_t getStringWidth (
const Unicode::UnicodeChar ∗ text,
... ) const [virtual]
Gets the width in pixels of the specified string. If the string contains multiple lines, the width of the widest line is
found. Please note that the correct number of arguments must be given if the text contains wildcards.
It is recommended to use the getStringWidth() implementation with the TextDirection parameter to ensure correct
calculation of the width. Kerning could result in different results depending on the TextDirection. This method
assumes TextDirection to be TEXT_DIRECTION_LTR.
Parameters
text A zero-terminated unicode string with arguments to insert if the text contains wildcards.
... Variable arguments providing additional information.
Returns
uint16_t getStringWidth (
TextDirection textDirection,
const Unicode::UnicodeChar ∗ text,
... ) const [virtual]
Gets the width in pixels of the specified string. If the string contains multiple lines, the width of the widest line is
found. Please note that the correct number of arguments must be given if the text contains wildcards.
The TextDirection should be set correctly for the text supplied. For example the string "10 20 30" will be calculated
differently depending on the TextDirection. If TextDirection is TEXT_DIRECTION_LTR the width is calculated as the
with of "10 20 30" (with kerning between all characters) but for TEXT_DIRECTION_RTL it is calculated as "10"+"
"+"20"+" "+"30" (with kerning only between characters in the substrings and not between substrings). For most fonts
there might not be a difference between the two calculations, but some fonts might cause different results.
Parameters
textDirection The text direction.
text A zero-terminated unicode string with arguments to insert if the text contains wildcards.
... Variable arguments providing additional information.
Returns
7.69.3.17 getStringWidthLTR()
uint16_t getStringWidthLTR (
TextDirection textDirection,
const Unicode::UnicodeChar ∗ text,
va_list pArg ) const [protected]
Gets the width in pixels of the specified string. If the string contains multiple lines, the width of the widest line is
found. Please note that the correct number of arguments must be given if the text contains wildcards.
The string is assumed to be purely left-to-right.
Parameters
textDirection The text direction.
text A zero-terminated unicode string with arguments to insert if the text contains wildcards.
pArg Variable arguments providing additional information.
Returns
7.69.3.18 getStringWidthRTL()
uint16_t getStringWidthRTL (
TextDirection textDirection,
const Unicode::UnicodeChar ∗ text,
va_list pArg ) const [protected]
Gets the width in pixels of the specified string. If the string contains multiple lines, the width of the widest line is
found. Please note that the correct number of arguments must be given if the text contains wildcards.
The string is handled as a right-to-left string and subdivided into smaller text strings to correctly handle mixing of
left-to-right and right-to-left strings.
Parameters
textDirection The text direction.
text A zero-terminated unicode string with arguments to insert if the text contains wildcards.
pArg The argument.
Returns
This class is the entry point for looking up a font based on a font id.
#include <touchgfx/FontManager.hpp>
This class is the entry point for looking up a font based on a font id. Must be initialized with the appropriate Font←-
Provider by the application.
7.70.2.1 getFont()
Gets a font.
Parameters
Returns
7.70.2.2 setFontProvider()
Sets the font provider. Must be initialized with the appropriate FontProvider by the application.
Parameters
in fontProvider Sets the font provider. Must be initialized with the appropriate FontProvider by the application.
A generic pure virtual definition of a FontProvider, which is a class capable of returning a font based on a font id.
An application-specific derivation of this class must be implemented.
7.71.2.1 ∼FontProvider()
Destructor.
7.71.3.1 getFont()
Font ∗ getFont (
FontId fontId ) [pure virtual]
Gets a font.
Parameters
Returns
A Widget that returns a solid rect of the same size as the application.
#include <CoverTransition.hpp>
7.72.1.1 draw()
Pure virtual function for drawing this drawable. It is a requirement that the draw implementation does not draw
outside the region specified by invalidatedArea.
Parameters
invalidatedArea The subregion of this drawable that needs to be redrawn, expressed in coordinates relative
to its parent (e.g. for a complete redraw, invalidatedArea will be (0, 0, width, height).
Implements Drawable.
7.72.1.2 getSolidRect()
Pure virtual function for obtaining the largest possible rectangle that is guaranteed to be solid (non-transparent).
Used by JSMOC to prune the draw graph.
Note
The rectangle returned must be relative to (0, 0), meaning that to indicate a completely solid widget, Rect(0,
0, getWidth(), getHeight()) must be returned.
Returns
Implements Drawable.
• virtual ∼GenericCallback ()
Destructor.
• virtual void execute (T1 val1, T2 val2, T3 val3)=0
Calls the member function.
• virtual bool isValid () const =0
Function to check whether the Callback has been initialized with values.
See also
The reason this base class exists, is that a normal Callback requires the class type where the callback function
resides to be known. This is problematic for ie. framework widgets like AbstractButton, on which it should be
possible to register a callback on object types that are user-specific and thus unknown to AbstractButton. This is
solved by having AbstractButton contain a pointer to a GenericCallback instead. This pointer must then be initialized
to point on an instance of Callback, created by the user, which is initialized with the appropriate object type.
Note
As with Callback, this class exists in four versions to support callback functions taking zero, one, two or three
arguments.
Template Parameters
T1 The type of the first argument in the member function, or void if none.
T2 The type of the second argument in the member function, or void if none.
T3 The type of the third argument in the member function, or void if none.
7.73.2.1 ∼GenericCallback()
7.73.3.1 execute()
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
Parameters
val1 This value will be passed as the first argument in the function call.
val2 This value will be passed as the second argument in the function call.
val3 This value will be passed as the third argument in the function call.
Implemented in Callback< dest_type, T1, T2, T3 >, Callback< touchgfx::SlideTransition, touchgfx::Drawable &>,
Callback< touchgfx::RadioButtonGroup, const touchgfx::AbstractButton & >, Callback< touchgfx::CoverTransition,
touchgfx::Drawable &>, Callback< touchgfx::SlideMenu, const touchgfx::AbstractButton &>, and Callback<
touchgfx::SlideMenu, const touchgfx::MoveAnimator< touchgfx::Container > &>.
7.73.3.2 isValid()
Function to check whether the Callback has been initialized with values.
Returns
Implemented in Callback< dest_type, void, void, void >, Callback< dest_type, T1, void, void >, Callback<
dest_type, T1, T2, void >, Callback< dest_type, T1, T2, T3 >, Callback< touchgfx::SlideTransition, touchgfx::←-
Drawable &>, Callback< touchgfx::RadioButtonGroup, const touchgfx::AbstractButton & >, Callback< touchgfx::←-
CoverTransition, touchgfx::Drawable &>, Callback< touchgfx::SlideMenu, const touchgfx::AbstractButton &>, and
Callback< touchgfx::SlideMenu, const touchgfx::MoveAnimator< touchgfx::Container > &>.
• virtual ∼GenericCallback ()
Destructor.
• virtual void execute (T1 val1, T2 val2)=0
Calls the member function.
• virtual bool isValid () const =0
Function to check whether the Callback has been initialized with values.
See also
The reason this base class exists, is that a normal Callback requires the class type where the callback function
resides to be known. This is problematic for ie. framework widgets like AbstractButton, on which it should be
possible to register a callback on object types that are user-specific and thus unknown to AbstractButton. This is
solved by having AbstractButton contain a pointer to a GenericCallback instead. This pointer must then be initialized
to point on an instance of Callback, created by the user, which is initialized with the appropriate object type.
Note
As with Callback, this class exists in four versions to support callback functions taking zero, one, two or three
arguments.
Template Parameters
T1 The type of the first argument in the member function, or void if none.
T2 The type of the second argument in the member function, or void if none.
7.74.2.1 ∼GenericCallback()
7.74.3.1 execute()
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
Parameters
val1 This value will be passed as the first argument in the function call.
val2 This value will be passed as the second argument in the function call.
7.74.3.2 isValid()
Function to check whether the Callback has been initialized with values.
Returns
• virtual ∼GenericCallback ()
Destructor.
• virtual void execute (T1 val1)=0
Calls the member function.
• virtual bool isValid () const =0
Function to check whether the Callback has been initialized with values.
template<class T1>
class touchgfx::GenericCallback< T1, void, void >
See also
The reason this base class exists, is that a normal Callback requires the class type where the callback function
resides to be known. This is problematic for ie. framework widgets like AbstractButton, on which it should be
possible to register a callback on object types that are user-specific and thus unknown to AbstractButton. This is
solved by having AbstractButton contain a pointer to a GenericCallback instead. This pointer must then be initialized
to point on an instance of Callback, created by the user, which is initialized with the appropriate object type.
Note
As with Callback, this class exists in four versions to support callback functions taking zero, one, two or three
arguments.
Template Parameters
T1 The type of the first argument in the member function, or void if none.
7.75.2.1 ∼GenericCallback()
7.75.3.1 execute()
void execute (
T1 val1 ) [pure virtual]
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
Parameters
val1 This value will be passed as the first argument in the function call.
7.75.3.2 isValid()
Function to check whether the Callback has been initialized with values.
Returns
• virtual ∼GenericCallback ()
Destructor.
• virtual void execute ()=0
Calls the member function.
• virtual bool isValid () const =0
Function to check whether the Callback has been initialized with values.
template<>
class touchgfx::GenericCallback< void >
See also
The reason this base class exists, is that a normal Callback requires the class type where the callback function
resides to be known. This is problematic for ie. framework widgets like AbstractButton, on which it should be
possible to register a callback on object types that are user-specific and thus unknown to AbstractButton. This is
solved by having AbstractButton contain a pointer to a GenericCallback instead. This pointer must then be initialized
to point on an instance of Callback, created by the user, which is initialized with the appropriate object type.
Note
As with Callback, this class exists in four versions to support callback functions taking zero, one, two or three
arguments.
7.76.2.1 ∼GenericCallback()
7.76.3.1 execute()
Calls the member function. Do not call execute unless isValid() returns true (ie. a pointer to the object and the
function has been set).
7.76.3.2 isValid()
Function to check whether the Callback has been initialized with values.
Returns
A gesture event.
#include <touchgfx/events/GestureEvent.hpp>
Public Types
A gesture event. The only gesture events currently supported is SWIPE_HORIZONTAL and SWIPE_VERTICAL,
which will be issued every time the input system detects a swipe.
See also
Event
7.77.2.1 GestureType
Enumerator
7.77.3.1 GestureEvent()
GestureEvent (
GestureType t,
int16_t v,
int16_t x_coord,
int16_t y_coord ) [inline]
Constructor. Create a gesture event of the specified type with the specified coordinates.
Parameters
7.77.4.1 getEventType()
Returns
Implements Event.
7.77.4.2 getType()
Returns
7.77.4.3 getVelocity()
Returns
7.77.4.4 getX()
Returns
7.77.4.5 getY()
Returns
• Gestures ()
Default constructor.
• void registerEventListener (UIEventListener &l)
Register the event listener.
• void tick ()
Has to be called during the timer tick.
• bool registerDragEvent (uint16_t oldX, uint16_t oldY, uint16_t newX, uint16_t newY)
Register a drag event.
• void registerClickEvent (ClickEvent::ClickEventType evt, uint16_t x, uint16_t y)
Register a click event and figure out if this is a drag event, too.
• void setDragThreshold (uint16_t val)
Configure the threshold for reporting drag events.
7.78.2.1 Gestures()
Gestures ( ) [inline]
7.78.3.1 registerClickEvent()
void registerClickEvent (
ClickEvent::ClickEventType evt,
uint16_t x,
uint16_t y )
Register a click event and figure out if this is a drag event, too.
Parameters
7.78.3.2 registerDragEvent()
bool registerDragEvent (
uint16_t oldX,
uint16_t oldY,
uint16_t newX,
uint16_t newY )
Parameters
Returns
True if the drag exceeds threshold value (and therefore was reported as a drag), or false if the drag did not
exceed threshold (and therefore was discarded).
7.78.3.3 registerEventListener()
void registerEventListener (
UIEventListener & l )
Parameters
in l The EventListener to register.
7.78.3.4 setDragThreshold()
void setDragThreshold (
uint16_t val ) [inline]
Configure the threshold for reporting drag events. A touch input movement must exceed this value in either axis in
order to report a drag. Default value is 0.
Parameters
val New threshold value.
7.78.3.5 tick()
void tick ( )
Public Attributes
• uint32_t dataOffset
7.79.2.1 advance()
Gets the "advance" value where the 9th bit is stored in flags.
Returns
7.79.2.2 height()
Gets the "height" value where the 9th bit is stored in flags.
Returns
7.79.2.3 top()
Gets the "top" value where the 9th bit and the sign bit are stored in flags.
Returns
7.79.2.4 width()
Gets the "width" value where the 9th bit is stored in flags.
Returns
Public Types
Interface class for manipulating GPIOs in order to do performance measurements on target. Not used on the PC
simulator.
7.80.2.1 GPIO_ID
Enumerator
7.80.3.1 clear()
Parameters
id the pin to set.
7.80.3.2 get()
Parameters
id the pin to get.
Returns
7.80.3.3 init()
7.80.3.4 set()
Parameters
id the pin to set.
7.80.3.5 toggle()
Toggles a pin.
Parameters
id the pin to toggle.
Gradients contains all the data to interpolate u,v texture coordinates and z coordinates across a planar surface.
#include <touchgfx/TextureMapTypes.hpp>
Public Attributes
• float dVOverZdX
d(v/z)/dX
• float dVOverZdY
d(v/z)/dY
• fixed16_16 dUdXModifier
The dUdX x coordinate modifier.
• fixed16_16 dVdXModifier
The dVdX x coordinate modifier.
7.81.1.1 Gradients()
Gradients (
const Point3D ∗ vertices )
Parameters
vertices The vertices.
See also
Point3D
Public Types
• HAL (DMA_Interface &dmaInterface, LCD &display, TouchController &touchCtrl, uint16_t width, uint16_←-
t height)
Creates a HAL instance.
• virtual ∼HAL ()
Destructor.
• virtual void setDisplayOrientation (DisplayOrientation orientation)
Sets the desired display orientation (landscape or portrait).
• DisplayOrientation getDisplayOrientation () const
Gets the current display orientation.
• void signalDMAInterrupt ()
Protected Attributes
Contains functions that are specific to the hardware platform the code is running on.
7.82.2.1 FrameRefreshStrategy
See also
bool setFrameRefreshStrategy(FrameRefreshStrategy s)
Enumerator
7.82.3.1 HAL()
HAL (
DMA_Interface & dmaInterface,
LCD & display,
TouchController & touchCtrl,
uint16_t width,
uint16_t height ) [inline]
Parameters
7.82.3.2 ∼HAL()
Destructor.
7.82.4.1 allowDMATransfers()
Allow the DMA to start transfers. Front Porch Entry is a good place to call this.
7.82.4.2 backPorchExited()
Has to be called from within the LCD IRQ rutine when the Back Porch Exit is reached.
7.82.4.3 beginFrame()
Returns
7.82.4.4 blitCopy()
void blitCopy (
const uint16_t ∗ pSrc,
uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height,
uint16_t srcWidth,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the frame buffer performing alpha-blending(and transparency keying) as specified.
Note
Alpha=255 is assumed "solid" and shall be used if HAL does not support BLIT_OP_COPY_WITH_ALPHA.
Parameters
7.82.4.5 blitCopyARGB8888()
void blitCopyARGB8888 (
const uint16_t ∗ pSrc,
uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height,
uint16_t srcWidth,
uint8_t alpha ) [virtual]
Parameters
7.82.4.6 blitCopyGlyph()
void blitCopyGlyph (
const uint8_t ∗ pSrc,
uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height,
uint16_t srcWidth,
colortype color,
uint8_t alpha,
BlitOperations operation ) [virtual]
Blits a 4bpp or 8bpp glyph - maybe use the same method and supply additional color mode arg.
Parameters
7.82.4.7 blitFill()
void blitFill (
colortype color,
uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height,
uint8_t alpha ) [virtual]
Blits a color value to the frame buffer performing alpha-blending (and transparency keying) as specified.
Note
Alpha=255 is assumed "solid" and shall be used if HAL does not support BLIT_OP_FILL_WITH_ALPHA.
Parameters
7.82.4.8 blitSetTransparencyKey()
void blitSetTransparencyKey (
uint16_t key ) [virtual]
Only present for backwards compatibility in TouchGFX 4.x. Will be removed in TouchGFX 5.
Parameters
key The "transparent" color value.
Reimplemented in HALSDL2.
7.82.4.9 blockCopy()
bool blockCopy (
void ∗RESTRICT dest,
const void ∗RESTRICT src,
uint32_t numBytes ) [virtual]
Parameters
out dest Pointer to destination memory.
Parameters
in src Pointer to source memory.
numBytes Number of bytes to copy.
Returns
Reimplemented in HALSDL2.
7.82.4.10 cacheTextString()
This function can be used to cache a given string in a platform specific way to e.g. speed up access or in case the
string is placed in a memory type that does not support random access such as NAND flash.
Parameters
str A pointer to the string which may be in external memory.
Returns
A pointer to an identical string which is guaranteed to be directly readable (ie. a copy if the original string was
placed in NAND flash).
7.82.4.11 configureInterrupts()
Configures the interrupts relevant for TouchGFX. This primarily entails setting the interrupt priorities for the DMA
and LCD interrupts.
Implemented in HALSDL2.
uint16_t ∗ copyFBRegionToMemory (
Rect meAbs ) [virtual]
Copies a region of the currently displayed frame buffer to memory. Used for e.g. SlideTransition and for displaying
pre-rendered drawables e.g. in animations where redrawing the drawable is not necessary.
Note
Parameters
Returns
A pointer to the memory address containing the copy of the frame buffer.
uint16_t ∗ copyFBRegionToMemory (
Rect meAbs,
uint16_t ∗ dst,
uint32_t stride ) [virtual]
Copies a region of the currently displayed frame buffer to a buffer. Used for e.g. SlideTransition and for displaying
pre-rendered drawables e.g. in animations where redrawing the drawable is not necessary. The buffer can e.g. be
a dynamic bitmap.
Note
Parameters
Returns
A pointer to the memory address containing the copy of the frame buffer.
7.82.4.14 disableInterrupts()
7.82.4.15 enableInterrupts()
7.82.4.16 enableLCDControllerInterrupt()
Configure the LCD controller to fire interrupts at VSYNC. Called automatically once TouchGFX initialization has
completed.
Implemented in HALSDL2.
7.82.4.17 enableMCULoadCalculation()
void enableMCULoadCalculation (
bool enabled ) [inline]
This method sets a flag that determines if generic HAL should calculate MCU load based on concrete MCU instru-
mentation.
Parameters
7.82.4.18 endFrame()
7.82.4.19 flushDMA()
This function blocks until the DMA queue (containing BlitOps) is empty.
On some platforms, a local frame buffer needs to be pushed to the display through a SPI channel or similar.
Implement that functionality here. This function is called whenever the framework has performed a complete draw.
Reimplemented in HALSDL2.
void flushFrameBuffer (
const Rect & rect ) [virtual]
This function is called whenever the framework has performed a partial draw.
Parameters
rect The area of the screen that has been drawn, expressed in absolute coordinates.
See also
flushFrameBuffer().
Reimplemented in HALSDL2.
7.82.4.22 frontPorchEntered()
Has to be called from within the LCD IRQ routine when the Front Porch Entry is reached.
7.82.4.23 getAnimationStorage()
Returns
7.82.4.24 getBlitCaps()
Function for obtaining the blit capabilities of the concrete HAL implementation. As default, will return whatever
blitcaps are reported by the associated DMA object.
Returns
7.82.4.25 getButtonController()
Returns
7.82.4.26 getClientFrameBuffer()
Returns
The address of the framebuffer currently used by the framework to draw in.
7.82.4.27 getCPUCycles()
uint32_t getCPUCycles ( )
Returns
7.82.4.28 getDisplayHeight()
Returns
7.82.4.29 getDisplayOrientation()
Gets the current display orientation. Will be equal to the native orientation of the display unless setDisplayOrientation
has been explicitly called earlier.
Returns
7.82.4.30 getDisplayWidth()
Returns
7.82.4.31 getFingerSize()
Returns
7.82.4.32 getFrameRefreshStrategy()
Returns
See also
bool setFrameRefreshStrategy(FrameRefreshStrategy s)
7.82.4.33 getInstance()
Returns
7.82.4.34 getLCDRefreshCount()
Returns the number of VSync interrupts between the current drawing operation and the last drawing operation, i.e.
the number of lost frames.
Returns
7.82.4.35 getMCULoadPct()
Returns
7.82.4.36 getTFTCurrentLine()
This function is used to obtain the progress of the TFT controller. More specifically, the line (or Y-value) currently
being transferred.
Note: The value must be adjusted to account for vertical back porch before returning, such that the value is always
within the range of 0 <= value < actual display height in pixels
It is used for the REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL frame refresh strategy in order to
synchronize frame buffer drawing with TFT controller progress. If this strategy is used, the concrete HAL subclass
must provide an override of this function that returns correct line value. If this strategy is not used, then the getTF←-
TCurrentLine function is never called and can be disregarded.
Returns
7.82.4.37 getTFTFrameBuffer()
Returns
The address of the frame buffer currently being displayed on the TFT.
Implemented in HALSDL2.
7.82.4.38 getTouchSampleRate()
Returns
7.82.4.39 initialize()
void initialize ( )
7.82.4.40 lcd()
Returns
7.82.4.41 lockDMAToFrontPorch()
void lockDMAToFrontPorch (
bool enableLock ) [inline]
Function to set whether the DMA transfers are locked to the TFT update cycle. If locked, DMA transfer will not begin
until the TFT controller has finished updating the display. If not locked, DMA transfers will begin as soon as possible.
Default is true (DMA is locked with TFT).
Disabling the lock will in most cases significantly increase rendering performance. It is therefore strongly recom-
mended to disable it. Depending on platform this may in rare cases cause rendering problems (visible tearing on
display). Please see the chapter "Optimizing DMA During TFT Controller Access" for details on this setting.
Note
Parameters
enableLock True to lock DMA transfers to the front porch signal. Conservative, default setting. False to
disable, which will normally yield substantial performance improvement.
7.82.4.42 lockFrameBuffer()
Waits for the frame buffer to become available for use (i.e. not used by DMA transfers).
Note
Function blocks until frame buffer is available. Client code MUST call unlockFrameBuffer() when frame buffer
operation has completed.
Returns
7.82.4.43 noTouch()
7.82.4.44 performDisplayOrientationChange()
7.82.4.45 registerEventListener()
void registerEventListener (
UIEventListener & listener ) [virtual]
Registers an event handler implementation with the underlying event system. The actual HAL implementation
decides whether or not multiple UIEventListener instances are allowed (including execution order).
Parameters
in listener The listener to register.
7.82.4.46 registerTaskDelayFunction()
void registerTaskDelayFunction (
void(∗)(uint16_t) delayF ) [inline]
In order to make use of the HAL::taskDelay function, a delay function must be registered by calling this function.
Usually the delay function would be OSWrappers::taskDelay.
Parameters
in,out delayF A pointer to a function returning void with an uint16_t parameter specifying number of
milliseconds to delay.
Note
The task delay capability is only used when the frame refresh strategy REFRESH_STRATEGY_OPTIM_SI←-
NGLE_BUFFER_TFT_CTRL is selected. Otherwise it is not necessary to register a delay function.
7.82.4.47 registerTextCache()
void registerTextCache (
Unicode::UnicodeChar ∗ str,
uint16_t length ) [virtual]
Configures HAL to use the supplied buffer as text string cache. The buffer must be large enough to hold the longest
string in the system. Setting this buffer is only required if cacheTextString() is actually used and its implementation
requires a buffer.
Parameters
See also
cacheTextString
7.82.4.48 sampleKey()
bool sampleKey (
uint8_t & key ) [inline], [virtual]
Parameters
out key Output parameter that will be set to the key value if a keypress was detected.
Returns
True if a keypress was detected and the "key" parameter is set to a value.
Reimplemented in HALSDL2.
7.82.4.49 setButtonController()
void setButtonController (
ButtonController ∗ btnCtrl ) [inline]
Parameters
7.82.4.50 setDisplayOrientation()
void setDisplayOrientation (
DisplayOrientation orientation ) [inline], [virtual]
Sets the desired display orientation (landscape or portrait). If desired orientation is different from the native orienta-
tion of the display, a rotation is automatically applied. The rotation does not incur any performance cost.
Note
Parameters
orientation The desired display orientation.
7.82.4.51 setDragThreshold()
void setDragThreshold (
uint8_t value ) [inline]
Configure the threshold for reporting drag events. A touch input movement must exceed this value in either axis in
Note
Parameters
value New threshold value.
7.82.4.52 setFingerSize()
void setFingerSize (
uint8_t size ) [inline]
Parameters
7.82.4.53 setFrameBufferStartAddress()
void setFrameBufferStartAddress (
void ∗ adr,
uint16_t depth = 16,
bool useDoubleBuffering = true,
bool useAnimationStorage = true ) [inline], [virtual]
Sets the address used for frame buffers, usually located in external memory. Will reserve memory for one or two
frame buffers based on display size. Will optionally also reserve memory for a third frame buffer used for animation←-
Storage.
Parameters
7.82.4.54 setFrameBufferStartAddresses()
void setFrameBufferStartAddresses (
void ∗ frameBuffer,
void ∗ doubleBuffer,
void ∗ animationStorage ) [inline], [virtual]
Parameters
7.82.4.55 setFrameRateCompensation()
void setFrameRateCompensation (
bool enabled ) [inline]
Enables or disables compensation for lost frames. See knowledge base article.
Parameters
7.82.4.56 setFrameRefreshStrategy()
bool setFrameRefreshStrategy (
FrameRefreshStrategy s ) [inline]
By setting a different frame refresh strategy, the internals of how TouchGFX interacts with the frame buffer can be
modified.
Currently there are two strategies available. This will increase over time.
• REFRESH_STRATEGY_DEFAULT: This is a general strategy that works for all target configurations.
Parameters
s The desired strategy to use.
Returns
7.82.4.57 setMCUActive()
void setMCUActive (
bool active )
Register if MCU is active by measuring cpu cycles. If user wishes to track MCU load, this method should be called
whenever the OS Idle task is scheduled in or out. This method makes calls to a concrete implementation of GPIO
functionality and a concrete implementation of cpu cycles.
Parameters
7.82.4.58 setMCUInstrumentation()
void setMCUInstrumentation (
MCUInstrumentation ∗ mcuInstr ) [inline]
Parameters
7.82.4.59 setTFTFrameBuffer()
void setTFTFrameBuffer (
uint16_t ∗ address ) [protected], [pure virtual]
Parameters
Implemented in HALSDL2.
7.82.4.60 setTouchSampleRate()
void setTouchSampleRate (
int8_t sampleRateInTicks ) [inline]
Parameters
7.82.4.61 signalDMAInterrupt()
7.82.4.62 swapFrameBuffers()
void swapFrameBuffers ( )
7.82.4.63 taskDelay()
void taskDelay (
uint16_t ms ) [inline], [virtual]
This function requires the presence of a task delay function. If a task delay function has not been registered, it
returns immediately. Otherwise it returns when number of milliseconds has passed.
Parameters
See also
7.82.4.64 taskEntry()
Main event loop. Will wait for VSYNC signal, and then process next frame. Call this function from your GUI task.
Note
Reimplemented in HALSDL2.
7.82.4.65 tick()
7.82.4.66 touch()
void touch (
int32_t x,
int32_t y ) [protected], [virtual]
Parameters
7.82.4.67 unlockFrameBuffer()
Unlocks the frame buffer (MUST be called exactly once for each call to lockFrameBuffer()).
7.82.4.68 vSync()
• HALSDL2 (DMA_Interface &dma, LCD &lcd, TouchController &touchCtrl, uint16_t width, uint16_t height)
Constructor. Initializes members.
• virtual void taskEntry ()
Main event loop.
• virtual bool sampleKey (uint8_t &key)
Sample key event from keyboard.
• virtual void flushFrameBuffer ()
This function is called whenever the framework has performed a complete draw.
• virtual void flushFrameBuffer (const Rect &rect)
This function is called whenever the framework has performed a partial draw.
• virtual bool blockCopy (void ∗RESTRICT dest, const void ∗RESTRICT src, uint32_t numBytes)
This function performs a platform-specific memcpy.
• virtual void blitSetTransparencyKey (uint16_t key)
If Blit-operations are supported, transparency-keying support is implicitly assumed.
• void setVsyncInterval (float ms)
Sets vsync interval.
• bool doSampleTouch (int32_t &x, int32_t &y) const
Samples the position of the mouse cursor.
See also
HAL
7.83.2.1 HALSDL2()
HALSDL2 (
DMA_Interface & dma,
LCD & lcd,
TouchController & touchCtrl,
uint16_t width,
uint16_t height ) [inline]
Parameters
7.83.3.1 blitSetTransparencyKey()
void blitSetTransparencyKey (
uint16_t key ) [virtual]
Parameters
key The "transparent" color value.
7.83.3.2 blockCopy()
bool blockCopy (
void ∗RESTRICT dest,
const void ∗RESTRICT src,
uint32_t numBytes ) [virtual]
Parameters
out dest Pointer to destination memory.
src Pointer to source memory.
Parameters
Returns
7.83.3.3 configureInterrupts()
Configures the interrupts relevant for TouchGFX. This primarily entails setting the interrupt priorities for the DMA
and LCD interrupts.
Implements HAL.
7.83.3.4 configureLCDInterrupt()
7.83.3.5 copyScreenshotToClipboard()
7.83.3.6 disableInterrupts()
7.83.3.7 doSampleTouch()
bool doSampleTouch (
int32_t & x,
int32_t & y ) const
Parameters
out x The x coordinate.
out y The y coordinate.
Returns
7.83.3.8 enableInterrupts()
7.83.3.9 enableLCDControllerInterrupt()
On some platforms, a local frame buffer needs to be pushed to the display through a SPI channel or similar.
Implement that functionality here. This function is called whenever the framework has performed a complete draw.
Reimplemented from HAL.
void flushFrameBuffer (
const Rect & rect ) [virtual]
This function is called whenever the framework has performed a partial draw.
Parameters
rect The area of the screen that has been drawn, expressed in absolute coordinates.
See also
flushFrameBuffer(). This function is called whenever the framework has performed a partial draw.
7.83.3.12 getArgv()
Parameters
Returns
7.83.3.13 getTFTFrameBuffer()
Returns
Implements HAL.
7.83.3.14 getWindowTitle()
Returns
See also
setWindowTitle
7.83.3.15 loadSkin()
void loadSkin (
touchgfx::DisplayOrientation orientation,
int x,
int y )
Loads a skin for a given display orientation that will be rendered in the simulator window with the the TouchGFX
framebuffer placed inside the bitmap at the given coordinates. Different bitmaps can be loaded in landscape and
portrait mode. If the provided bitmap cannot be loaded, the TouchGFX framebuffer will be displayed as normal. If
the png files contain areas with alpha < 255, this will be used to create a shaped window.
Parameters
orientation The orientation.
x The x coordinate.
y The y coordinate.
TouchGFX v4.10.0 (C)opyright STMicroelectronics 2014-2018
7.83 HALSDL2 Class Reference 365
Note
The skins must be named "portrait.png" and "landscape.png" and placed inside the "simulator/" folder. The
build process of the simulator will automatically copy the skins to the folder where the executable simulator is
generated.
When as skin is set, the entire framebuffer is rendered through SDL whenever there is a change. Without a
skin, only the areas with changes is rendered through SDL.
7.83.3.16 performDisplayOrientationChange()
7.83.3.17 renderLCD_FrameBufferToMemory()
void renderLCD_FrameBufferToMemory (
const Rect & _rectToUpdate,
uint8_t ∗ frameBuffer ) [protected], [virtual]
Parameters
_rectToUpdate Area to update.
in frameBuffer Target frame buffer.
7.83.3.18 sampleKey()
bool sampleKey (
uint8_t & key ) [virtual]
Parameters
out key Output parameter that will be set to the key value if a key press was detected.
Returns
True if a key press was detected and the "key" parameter is set to a value.
7.83.3.19 saveNextScreenshots()
void saveNextScreenshots (
int n ) [virtual]
Copy the next N screenshots to disk. On each screen update, the new screen is saved to disk.
Parameters
n Number of screenshots to save. These are added to any ongoing amount of screenshots in queue.
void saveScreenshot ( )
void saveScreenshot (
char ∗ folder,
char ∗ filename ) [virtual]
Saves a screenshot.
Parameters
7.83.3.22 sdl_init()
bool sdl_init (
int argcount,
char ∗∗ args ) [virtual]
Initializes SDL.
Parameters
Returns
7.83.3.23 setTFTFrameBuffer()
void setTFTFrameBuffer (
uint16_t ∗ addr ) [protected], [virtual]
Parameters
Implements HAL.
7.83.3.24 setVsyncInterval()
void setVsyncInterval (
float ms )
Sets vsync interval for simulating same tick speed as the real hardware. Due to limitations in the granularity of
SDL, the generated ticks in the simulator might not occur at the exact time, but accumulated over several ticks, the
precision is very good.
Parameters
ms The milliseconds between ticks.
Note
That you can also use HAL::setFrameRateCompensation() in the simulator. The effect of this can easily be
demonstrated by dragging the console output window of the simulator (when running from Visual Studio) as
this will pause the SDL and generate a lot of ticks when the console window is released. Beware that since the
missed vsyncs are accumulated in an 8 bit counter, only up to 255 ticks may be missed, so at VsyncInterval
= 16.6667, dragging the windows for more than 255 ∗ 16.6667ms = 4250ms = 4.25s will not generate all
the ticks that were actually missed. This situation is, however, not very realistic, as normally just a couple of
vsyncs are skipped.
7.83.3.25 setWindowTitle()
void setWindowTitle (
const char ∗ title )
Parameters
title The title, if null the original "TouchGFX simulator" will be used.
See also
getWindowTitle
7.83.3.26 taskEntry()
Main event loop. Will wait for VSYNC signal, and then process next frame. Call this function from your GUI task.
Note
Protected Attributes
• uint8_t channel
I2c channel is stored in order to initialize and recover a specific I2C channel.
7.84.2.1 I2C()
I2C (
uint8_t ch ) [inline]
Parameters
ch I2C channel.
7.84.2.2 ∼I2C()
Destructor.
7.84.3.1 init()
7.84.3.2 readRegister()
bool readRegister (
uint8_t addr,
uint8_t reg,
uint8_t ∗ data,
uint32_t cnt ) [pure virtual]
Reads the specified register on the device with the specified address.
Parameters
Returns
7.84.3.3 writeRegister()
bool writeRegister (
uint8_t addr,
uint8_t reg,
uint8_t val ) [pure virtual]
Parameters
Returns
Protected Attributes
See also
TouchController
7.85.2.1 I2CTouchController()
I2CTouchController (
I2C & i2c ) [inline]
Parameters
7.85.2.2 ∼I2CTouchController()
Destructor.
7.85.3.1 init()
7.85.3.2 sampleTouch()
bool sampleTouch (
int32_t & x,
int32_t & y ) [pure virtual]
Checks whether the touch screen is being touched, and if so, what coordinates.
Parameters
Returns
Implements TouchController.
• IconButtonStyle ()
Default constructor.
• virtual ∼IconButtonStyle ()
Destructor.
• virtual void setIconBitmaps (const Bitmap &newIconReleased, const Bitmap &newIconPressed)
Sets icon bitmaps.
• void setIconX (int16_t x)
Protected Attributes
• Bitmap iconReleased
Icon to display when button is not pressed.
• Bitmap iconPressed
Icon to display when button is pressed.
• Image iconImage
The icon image.
template<class T>
class touchgfx::IconButtonStyle< T >
An icon button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional
button. This class will show one of two icons depending on the state of the button (pressed or released).
To get a background behind the icon, use IconButtonStyle together with e.g. ImageButtonStyle: IconButton←-
Style<ImageButtonStyle<ClickButtonTrigger> > myButton;
The IconButtonStyle will center the icon on the enclosing container (normally AbstractButtonContainer). Set the
size of the button before setting the icons.
The position of the icon can be adjusted with setIconXY.
Template Parameters
See also
AbstractButtonContainer
7.86.2.1 getCurrentlyDisplayedIcon()
Returns
7.86.2.2 getIconX()
Returns
7.86.2.3 getIconY()
Returns
7.86.2.4 setIconBitmaps()
void setIconBitmaps (
const Bitmap & newIconReleased,
const Bitmap & newIconPressed ) [inline], [virtual]
Parameters
newIconReleased The new icon released.
newIconPressed The new icon pressed.
7.86.2.5 setIconX()
void setIconX (
int16_t x ) [inline]
Parameters
x The x coordinate.
7.86.2.6 setIconXY()
void setIconXY (
int16_t x,
int16_t y ) [inline]
Parameters
x The x coordinate.
y The y coordinate.
7.86.2.7 setIconY()
void setIconY (
int16_t y ) [inline]
Parameters
y The y coordinate.
Protected Attributes
• Bitmap bitmap
The Bitmap to display.
• uint8_t alpha
The Alpha for this image.
• bool hasTransparentPixels
true if this object has transparent pixels
Simple widget capable of showing a bitmap. The bitmap can be alpha-blended with the background and have areas
of transparency.
See also
Widget
7.87.2.1 Image()
Image (
const Bitmap & bmp = Bitmap() ) [inline]
Constructs a new Image with a default alpha value of 255 (solid) and a default Bitmap if none is specified.
Parameters
bmp The bitmap to display.
7.87.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Draws the image. This class supports partial drawing, so only the area described by the rectangle will be drawn.
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
Implements Drawable.
Reimplemented in TiledImage.
7.87.3.2 getAlpha()
Returns
7.87.3.3 getBitmap()
Returns
7.87.3.4 getSolidRect()
Gets the largest solid (non-transparent) rectangle. This value is pre-calculated by the imageconverter tool.
Returns
Implements Drawable.
Reimplemented in TiledImage.
7.87.3.5 getType()
Returns
TYPE_IMAGE.
7.87.3.6 setAlpha()
void setAlpha (
uint8_t alpha ) [inline]
Parameters
alpha The alpha value. 255 = completely solid.
7.87.3.7 setBitmap()
void setBitmap (
const Bitmap & bmp ) [virtual]
Sets the bitmap ID for this Image. Updates the width and height of this widget to match that of the bitmap.
Parameters
bmp The bitmap instance.
See also
Bitmap
• ImageButtonStyle ()
Default constructor.
• virtual ∼ImageButtonStyle ()
Destructor.
• virtual void setBitmaps (const Bitmap &bmpReleased, const Bitmap &bmpPressed)
Sets the bitmaps.
• void setBitmapXY (uint16_t x, uint16_t y)
Protected Attributes
• Image buttonImage
The button image.
• Bitmap up
The image to display when button is released.
• Bitmap down
The image to display when button is pressed.
template<class T>
class touchgfx::ImageButtonStyle< T >
An image button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional
button. This class will show one of two images depending on the state of the button (pressed or released).
The ImageButtonStyle will set the size of the enclosing container (normally AbstractButtonContainer) to the size of
the pressed Bitmap. This can be overridden by calling setWidth/setHeight after setting the bitmaps.
The position of the bitmap can be adjusted with setBitmapXY (default is upper left corner).
Template Parameters
See also
AbstractButtonContainer
7.88.2.1 getCurrentlyDisplayedBitmap()
Returns
7.88.2.2 setBitmaps()
void setBitmaps (
const Bitmap & bmpReleased,
const Bitmap & bmpPressed ) [inline], [virtual]
Parameters
bmpReleased The bitmap released.
bmpPressed The bitmap pressed.
7.88.2.3 setBitmapXY()
void setBitmapXY (
uint16_t x,
uint16_t y ) [inline]
Parameters
x An uint16_t to process.
y An uint16_t to process.
An image progress.
#include <ImageProgress.hpp>
• ImageProgress ()
Default constructor.
• virtual ∼ImageProgress ()
Destructor.
• virtual void setProgressIndicatorPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the position and dimension of the image progress indicator.
• virtual void setAnchorAtZero (bool anchorAtZero)
Sets anchor at zero.
• virtual bool getAnchorAtZero () const
Gets anchor at zero.
• virtual void setBitmap (touchgfx::BitmapId bitmapId)
Sets the bitmap id.
• virtual touchgfx::BitmapId getBitmap () const
Gets the image.
• virtual void setAlpha (uint8_t alpha)
Sets the alpha.
• virtual uint8_t getAlpha () const
Gets the alpha.
• virtual void setValue (int value)
Sets a value.
Protected Attributes
• Container container
The container.
• TiledImage image
The image.
• bool fixedPosition
true if the image should not move during progress
touchgfx/containers/progress_indicators/ImageProgress.hpp
An image progress will show parts of an image as a progress indicator. The image can
progress from the left, the right, the bottom or the top of the given area, and can
visually be fixed with a larger and larger portion of the image showing, or it can be
moved into view.
7.89.2.1 ImageProgress()
ImageProgress ( )
Default constructor.
7.89.2.2 ∼ImageProgress()
∼ImageProgress ( ) [virtual]
Destructor.
7.89.3.1 getAlpha()
Returns
See also
setAlpha
Image::getAlpha
7.89.3.2 getAnchorAtZero()
Returns
See also
setAnchorAtZero
7.89.3.3 getBitmap()
Returns
The image.
See also
setBitmap
7.89.3.4 setAlpha()
void setAlpha (
uint8_t alpha ) [virtual]
Parameters
alpha The alpha.
See also
getAlpha
Image::setAlpha
7.89.3.5 setAnchorAtZero()
void setAnchorAtZero (
bool anchorAtZero ) [virtual]
Sets anchor at zero will control whether the image will be placed so that it is not moving during progress, only more
and more of the image will become visible, or if the image is anchored at the current progress and will appear to
Parameters
See also
getAnchoredAtZero
7.89.3.6 setBitmap()
void setBitmap (
touchgfx::BitmapId bitmapId ) [virtual]
Sets the bitmap id to use for progress. Please note that the bitmap is tiled which will allow smaller bitmaps to repeat
and save memory.
Parameters
bitmap←- The bitmap id.
Id
See also
getBitmap
TiledImage
7.89.3.7 setProgressIndicatorPosition()
void setProgressIndicatorPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [virtual]
Sets the position and dimension of the image progress indicator relative to the background image.
Parameters
x The x coordinate.
y The y coordinate.
width The width of the image progress indicator.
height The height of the image progress indicator.
7.89.3.8 setValue()
Sets the current value in the range (min..max) set by setRange(). Values lower than min are mapped to min, values
higher than max are mapped to max.
Parameters
value The value.
An InternalFlashFont has both glyph table and glyph data placed in a flash which supports random access read (i.e.
not a NAND flash).
#include <touchgfx/InternalFlashFont.hpp>
• InternalFlashFont (const GlyphNode ∗list, uint16_t size, uint16_t height, uint8_t pixBelowBase, uint8_←-
t bitsPerPixel, uint8_t maxLeft, uint8_t maxRight, const uint8_t ∗glyphDataInternalFlash, const KerningNode
∗kerningList, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar)
Constructor.
• virtual const uint8_t ∗ getPixelData (const GlyphNode ∗glyph) const
Obtains a RAM-based pointer to the pixel data for the specified glyph.
• virtual int8_t getKerning (Unicode::UnicodeChar prevChar, const GlyphNode ∗glyph) const
Gets the kerning distance between two characters.
An InternalFlashFont has both glyph table and glyph data placed in a flash which supports random access read (i.e.
not a NAND flash)
See also
ConstFont
7.90.2.1 InternalFlashFont()
InternalFlashFont (
const GlyphNode ∗ list,
uint16_t size,
uint16_t height,
uint8_t pixBelowBase,
uint8_t bitsPerPixel,
uint8_t maxLeft,
uint8_t maxRight,
const uint8_t ∗ glyphDataInternalFlash,
const KerningNode ∗ kerningList,
const Unicode::UnicodeChar fallbackChar,
const Unicode::UnicodeChar ellipsisChar )
Parameters
7.90.3.1 getKerning()
int8_t getKerning (
Unicode::UnicodeChar prevChar,
const GlyphNode ∗ glyph ) const [virtual]
Parameters
Returns
Implements ConstFont.
7.90.3.2 getPixelData()
Obtains a RAM-based pointer to the pixel data for the specified glyph.
Parameters
Returns
Implements ConstFont.
An iterator to help go through all the elements that make up a Scanline. Each part of the Scanline has a different
Cover.
7.91.2.1 iterator()
iterator (
const Scanline & scanline ) [inline]
Constructor. Creates an iterator to help go through all the Scanline parts of the polygon on a single Scanline.
Parameters
scanline The scanline to iterate.
7.91.3.1 getCovers()
Returns
7.91.3.2 getNumPix()
Returns
7.91.3.3 next()
Returns
Helper class providing caching of certain information while the JSMOC algorithm runs during draw operations.
#include <touchgfx/JSMOCHelper.hpp>
• JSMOCHelper ()
Default constructor.
• void setWidget (Drawable ∗newWidget)
Sets a widget.
• Drawable ∗ getWidget ()
Gets the widget.
• Rect & getCachedVisibleRect ()
Gets the visible rect for the widget of this helper.
• int16_t getCachedAbsX ()
Helper class providing caching of certain information while the JSMOC algorithm runs during draw operations. Not
intented for application-level use.
7.92.2.1 JSMOCHelper()
JSMOCHelper ( ) [inline]
Default constructor.
7.92.3.1 draw()
void draw (
const Rect & invalidatedArea ) [inline]
Parameters
7.92.3.2 getCachedAbsX()
Returns
The absolute x coordinate for the widget of this helper. Only calculated once.
7.92.3.3 getCachedAbsY()
Returns
The absolute y coordinate for the widget of this helper. Only calculated once.
7.92.3.4 getCachedVisibleRect()
Returns
The visible rect for the widget of this helper. Only calculated once.
7.92.3.5 getHeight()
Returns
7.92.3.6 getWidget()
Returns
7.92.3.7 getWidth()
Returns
7.92.3.8 setWidget()
void setWidget (
Drawable ∗ newWidget ) [inline]
Sets a widget.
Parameters
in newWidget The widget to operate on.
Public Attributes
• Unicode::UnicodeChar unicodePrevChar
The unicode for the first character in the kerning pair.
• int8_t distance
The kerning distance.
Structure providing information about a kerning for a given char pair. Used by LCD when rendering.
Public Attributes
• uint8_t keyId
The id of a key.
• Rect keyArea
The area occupied by the key.
• BitmapId highlightBitmapId
A bitmap to show when the area is "pressed".
Classes
• struct CallbackArea
Mapping from rectangle to a callback method to execute.
• struct Key
Mapping from rectangle to key id.
• struct KeyMapping
Mapping from key id to Unicode character.
• struct KeyMappingList
List of KeyMappings to use.
• struct Layout
Definition of the keyboard layout. The keyboard can handle changing layouts, so different keyboard modes can be
implemented by changing layouts and key mappings.
• Keyboard ()
Default Constructor.
• virtual ∼Keyboard ()
Destructor.
• void setBuffer (Unicode::UnicodeChar ∗newBuffer, uint16_t newBufferSize)
Sets the buffer to be used by the keyboard.
• void setLayout (const Layout ∗newLayout)
Set/change the Keyboard::Layout to use.
• void setTextIndentation ()
Sets text indentation.
• const Layout ∗ getLayout () const
Gets the layout.
• void setKeymappingList (const KeyMappingList ∗newKeyMappingList)
Set/change the KeyMappingList to use.
• const KeyMappingList ∗ getKeyMappingList () const
Gets key mapping list.
• void setBufferPosition (uint16_t newPos)
Change the buffer position.
• uint16_t getBufferPosition ()
Gets buffer position.
• Unicode::UnicodeChar ∗ getBuffer () const
Gets the buffer.
• virtual void draw (const Rect &invalidatedArea) const
Overrides the draw implementation on the Container.
• virtual void handleClickEvent (const ClickEvent &evt)
Overrides the handleClickEvent on the container.
• virtual void handleDragEvent (const DragEvent &evt)
Overrides the handleDragEvent on the container.
• void setKeyListener (GenericCallback< Unicode::UnicodeChar > &callback)
Sets the callback for the keyboard.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
The keyboard provides text input for touch devices. It is configured using a Layout and a KeyMappingList, which
both can be changed at runtime. The class using the keyboard must provide a buffer where the entered text is
placed. The Layout contains a bitmap id for the image to display and two mappings: rectangles to key ids and
rectangles to callback methods.
The KeyMappingList maps key ids to unicode characters. When the user presses a key, the keyboard looks in its
layout for a rectangle containing the coordinates pressed. If it finds a mapping to a callback method, it will invoke
that method. If it finds a mapping to a key it will look up the unicode character for that key and place it in a text
buffer. The sequence is: (x,y) -> KeyId -> UnicodeChar.
A keyboard with multiple key mappings e.g. lower case alpha, upper case alpha and numeric mappings can be
created by implementing callback methods for shift and mode areas in the provided bitmap and then changing the
KeyMappingList when those areas are pressed.
See also
Container
7.95.2.1 Keyboard()
Keyboard ( )
7.95.2.2 ∼Keyboard()
Destructor.
7.95.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Overrides the draw implementation on the Container. First invokes the container draw implementation to draw the
keyboard bitmap and text area holding the entered text. If additional drawables have been added to the keyboard,
they will also be draw. After invoking the container draw, the glyphs mapped to keys are drawn and if a key has
been pressed, it will be highlighted.
Parameters
invalidatedArea The area to draw.
7.95.3.2 getBuffer()
Returns
7.95.3.3 getBufferPosition()
Returns
the buffer position, i.e. the current index where new characters will be placed.
7.95.3.4 getCallbackAreaForCoordinates()
CallbackArea getCallbackAreaForCoordinates (
int16_t x,
int16_t y ) const [protected]
Gets the callback area defined by the layout for the specified coordinates.
Parameters
Returns
7.95.3.5 getCharForKey()
Unicode::UnicodeChar getCharForKey (
uint8_t keyId ) const [protected]
Parameters
Returns
7.95.3.6 getKeyForCoordinates()
Key getKeyForCoordinates (
int16_t x,
int16_t y ) const [protected]
Parameters
Returns
7.95.3.7 getKeyMappingList()
Returns
7.95.3.8 getLayout()
Returns
7.95.3.9 getType()
Returns
TYPE_KEYBOARD.
7.95.3.10 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [virtual]
Overrides the handleClickEvent on the container. The keyboard handles all click events internally and click events
are not propagated to drawables added to the keyboard.
Parameters
7.95.3.11 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [virtual]
Overrides the handleDragEvent on the container. The keyboard handles drag events to enable the container to,
emit a CANCEL, if the user drags outside the currently pressed key.
Parameters
evt The DragEvent.
7.95.3.12 setBuffer()
void setBuffer (
Unicode::UnicodeChar ∗ newBuffer,
uint16_t newBufferSize )
Parameters
in newBuffer Pointer to a buffer holding the text edited by the keyboard. If the buffer is not empty, the
edit position for the keyboard will be set to the end of the provided text.
newBufferSize Length of the buffer, i.e. number of UnicodeChar's.
7.95.3.13 setBufferPosition()
void setBufferPosition (
uint16_t newPos )
Change the buffer position i.e. the next index to place a character when a key is pressed. This can be used to
implement backspace functionality if the class using the Keyboard implements a callback and maps it to a backspace
implementation. Setting the position will cause the TextArea displaying the text to be invalidated to request a redraw.
Parameters
7.95.3.14 setKeyListener()
void setKeyListener (
GenericCallback< Unicode::UnicodeChar > & callback ) [inline]
Sets the callback for the keyboard. The callback will be executed every time a key is clicked. The callback argument
Note
Parameters
7.95.3.15 setKeymappingList()
void setKeymappingList (
const KeyMappingList ∗ newKeyMappingList )
Set/change the KeyMappingList to use. The Keyboard will invalidate the space it occupies to request a redraw.
Parameters
newKeyMappingList The new KeyMappingList.
7.95.3.16 setLayout()
void setLayout (
const Layout ∗ newLayout )
Set/change the Keyboard::Layout to use.The Keyboard will invalidate the space it occupies to request a redraw.
Parameters
newLayout The new layout.
7.95.3.17 setTextIndentation()
void setTextIndentation ( )
Sets text indentation by making the area for entered text slightly larger. The result is that some characters (often
'j' and '_') will not be cut off. Indentation is added to both sides of the text area in case the text is right-to- left.
Indentation is automatically set so all characters will display properly.
7.95.3.18 setupDrawChain()
void setupDrawChain (
const Rect & invalidatedArea,
Drawable ∗∗ nextPreviousElement ) [protected], [virtual]
Note
Parameters
invalidatedArea Include drawables that intersect with this area only.
in,out nextPreviousElement Modifiable element in linked list.
Public Attributes
• uint8_t keyId
Id of a key.
• Unicode::UnicodeChar keyValue
Unicode equivalent of the key id.
Public Attributes
Definition of the keyboard layout. The keyboard can handle changing layouts, so different keyboard modes can be
implemented by changing layouts and key mappings.
#include <touchgfx/widgets/Keyboard.hpp>
Public Attributes
• BitmapId bitmap
The bitmap used for the keyboard layout.
• const Key ∗ keyArray
The keys on the keyboard layout.
• uint8_t numberOfKeys
The number of keys on this keyboard layout.
• CallbackArea ∗ callbackAreaArray
The array of areas and corresponding callbacks.
• uint8_t numberOfCallbackAreas
The number of areas and corresponding callbacks.
• Rect textAreaPosition
The area where text is written.
• TypedText textAreaFont
The font used for typing text.
• colortype textAreaFontColor
The color used for the typing text.
• FontId keyFont
The font used for the keys.
• colortype keyFontColor
The color used for the keys.
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles.
#include <touchgfx/lcd/LCD.hpp>
Classes
• struct StringVisuals
The visual elements when writing a string.
• virtual ∼LCD ()
Destructor.
• virtual void init ()
Performs initialization.
• void drawGlyph (int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, int16_t maxX, int16_t maxY, const
GlyphNode ∗glyph, const uint8_t ∗glyphData, colortype color, uint8_t bitsPerPixel, uint8_t alpha=255)
This method is deprecated and will be removed.
• virtual void drawPartialBitmap (const Bitmap &bitmap, int16_t x, int16_t y, const Rect &rect, uint8_t al-
pha=255, bool useOptimized=true)=0
Draws a portion of a bitmap.
• virtual void blitCopy (const uint16_t ∗sourceData, const Rect &source, const Rect &blitRect, uint8_t alpha,
bool hasTransparentPixels)=0
Blits a 2D source-array to the framebuffer.
• virtual void blitCopy (const uint8_t ∗sourceData, Bitmap::BitmapFormat sourceFormat, const Rect &source,
const Rect &blitRect, uint8_t alpha, bool hasTransparentPixels)=0
Blits a 2D source-array to the frame buffer while converting the format.
• virtual uint16_t ∗ copyFrameBufferRegionToMemory (const Rect ®ion, const BitmapId bitmap=BITMAP←-
_ANIMATION_STORAGE)=0
Copies a part of the frame buffer.
• virtual void fillRect (const Rect &rect, colortype color, uint8_t alpha=255)=0
• virtual void drawTextureMapScanLine (const DrawingSurface &dest, const Gradients &gradients, const Edge
∗leftEdge, const Edge ∗rightEdge, const TextureSurface &texture, const Rect &absoluteRect, const Rect
&dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionLength)=0
Draw scan line. Draw one horizontal line of the texture map on screen. The scan line will be drawn using perspective
correct texture mapping. The appearance of the line is determined by the left and right edge and the gradients
structure. The edges contain the information about the x,y,z coordinates of the left and right side respectively and
also information about the u,v coordinates of the texture map used. The gradients structure contains information about
how to interpolate all the values across the scan line. The data drawn should be present in the texture argument.
• virtual void drawGlyph (uint16_t ∗wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_←-
t offsetY, const Rect &invalidatedArea, const GlyphNode ∗glyph, const uint8_t ∗glyphData, colortype color,
uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation=TEXT_ROTATE_0)=0
Private version of draw-glyph.
• void drawStringLTR (const Rect &widgetArea, const Rect &invalidatedArea, const StringVisuals &visuals,
const Unicode::UnicodeChar ∗format, va_list pArg)
Draws the specified unicode string.
• void drawStringRTL (const Rect &widgetArea, const Rect &invalidatedArea, const StringVisuals &visuals,
const Unicode::UnicodeChar ∗format, va_list pArg)
Draws the specified unicode string.
• static void rotateRect (Rect &rect, const Rect &canvas, const TextRotation rotation)
Rotate a rectangle inside another rectangle.
• static int realX (const Rect &widgetArea, int16_t x, int16_t y, TextRotation rotation)
Find the real, absolute x coordinate of a point inside a widget.
• static int realY (const Rect &widgetArea, int16_t x, int16_t y, TextRotation rotation)
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles.
Note
7.99.2.1 ∼LCD()
Destructor.
7.99.3.1 bitDepth()
Returns
void blitCopy (
const uint16_t ∗ sourceData,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [pure virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified. Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored in a format suitable for the selected display.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
void blitCopy (
const uint8_t ∗ sourceData,
Bitmap::BitmapFormat sourceFormat,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [pure virtual]
Blits a 2D source-array to the frame buffer performing alpha-blending (and transparency keying) as specified. Per-
forms a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored in a format suitable for the selected display.
sourceFormat The bitmap format used in the source data.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
7.99.3.4 copyFrameBufferRegionToMemory()
uint16_t ∗ copyFrameBufferRegionToMemory (
const Rect & region,
const BitmapId bitmap = BITMAP_ANIMATION_STORAGE ) [pure virtual]
Copies a part of the frame buffer to a bitmap. The bitmap must be a dynamic bitmap. Only the part specified with
by parameter region is copied.
Parameters
region The part to copy.
bitmap The bitmap to store the data in. Default parameter is Animation Storage.
Returns
Note
There is only one instance of animation storage. The content of the animation storage outside the given region
is undefined.
See also
blitCopy
7.99.3.5 drawBorder()
void drawBorder (
const Rect & rect,
uint16_t lineWidth,
colortype color,
uint8_t alpha = 255 )
Parameters
rect The rectangle x, y, width, height in absolute coordinates.
lineWidth The width of the line.
color The color to use.
alpha The alpha value to use (default=solid)
void drawGlyph (
int16_t x,
int16_t y,
uint16_t offsetX,
uint16_t offsetY,
int16_t maxX,
int16_t maxY,
const GlyphNode ∗ glyph,
const uint8_t ∗ glyphData,
colortype color,
uint8_t bitsPerPixel,
uint8_t alpha = 255 )
This method is deprecated and will be removed. Use drawString() instead. This function might not correctly render
glyphs with negative value for "left" and could draw outside the allowed rectangle.
Draws a glyph with support for gray-map glyphs i.e. anti-aliasing using the gray color to determine the actual color
to draw. Supports 1, 2, 4 and 8 bits per pixel.
Parameters
void drawGlyph (
uint16_t ∗ wbuf,
Rect widgetArea,
int16_t x,
int16_t y,
uint16_t offsetX,
uint16_t offsetY,
const Rect & invalidatedArea,
const GlyphNode ∗ glyph,
const uint8_t ∗ glyphData,
colortype color,
uint8_t bitsPerPixel,
uint8_t alpha,
TextRotation rotation = TEXT_ROTATE_0 ) [protected], [pure virtual]
Private version of draw-glyph with explicit destination buffer pointer argument. For all parameters (except the buffer
pointer) see the public version of drawGlyph()
Parameters
Parameters
7.99.3.8 drawHorizontalLine()
void drawHorizontalLine (
int16_t x,
int16_t y,
uint16_t width,
uint16_t lineWidth,
colortype color,
uint8_t alpha = 255 )
Parameters
7.99.3.9 drawPartialBitmap()
void drawPartialBitmap (
const Bitmap & bitmap,
int16_t x,
int16_t y,
const Rect & rect,
uint8_t alpha = 255,
bool useOptimized = true ) [pure virtual]
Parameters
bitmap The bitmap to draw.
Parameters
7.99.3.10 drawRect()
void drawRect (
const Rect & rect,
colortype color,
uint8_t alpha = 255 )
Draws a rectangle using the specified line color. Same as calling drawBorder with a line width of 1.
Parameters
rect The rectangle x, y, width, height in absolute coordinates.
color The color to use.
alpha The alpha value to use (default=solid)
7.99.3.11 drawString()
void drawString (
Rect widgetArea,
const Rect & invalidatedArea,
StringVisuals & stringVisuals,
const Unicode::UnicodeChar ∗ format,
... )
Parameters
widgetArea The area covered by the drawing widget in absolute coordinates.
invalidatedArea The (sub)region of the widget area to draw, expressed relative to the widget area. If
the widgetArea is (x, y, width, height) = (10, 10, 20, 20) and invalidatedArea is (x, y,
width, height) = (5, 5, 6, 6) the widgetArea drawn on the LCD is (x, y, width, height) =
(15, 15, 6, 6).
in stringVisuals The string visuals (font, alignment, line space, color) with which to draw this string.
format A pointer to a zero terminated text string with optional additional wildcard arguments.
... Variable arguments providing additional information.
7.99.3.12 drawStringLTR()
void drawStringLTR (
const Rect & widgetArea,
const Rect & invalidatedArea,
const StringVisuals & visuals,
const Unicode::UnicodeChar ∗ format,
va_list pArg ) [protected]
Draws the specified unicode string. Breaks line on newline. The string is assumed to contain only latin characters
written left-to-right.
Parameters
widgetArea The area covered by the drawing widget in absolute coordinates.
invalidatedArea The (sub)region of the widget area to draw, expressed relative to the widget area. If
the widgetArea is (x, y, width, height) = (10, 10, 20, 20) and invalidatedArea is (x, y,
width, height) = (5, 5, 6, 6) the widgetArea drawn on the LCD is (x, y, width, height) =
(15, 15, 6, 6).
in visuals The string visuals (font, alignment, line space, color) with which to draw this string.
format A pointer to a zero terminated text string with optional additional wildcard arguments.
pArg Variable arguments providing additional information.
See also
drawString
7.99.3.13 drawStringRTL()
void drawStringRTL (
const Rect & widgetArea,
const Rect & invalidatedArea,
const StringVisuals & visuals,
const Unicode::UnicodeChar ∗ format,
va_list pArg ) [protected]
Draws the specified unicode string. Breaks line on newline. The string can be either right-to-left or left-to-right and
may contain sequences of Arabic /Hebrew and Latin characters.
Parameters
widgetArea The area covered by the drawing widget in absolute coordinates.
invalidatedArea The (sub)region of the widget area to draw, expressed relative to the widget area. If
the widgetArea is (x, y, width, height) = (10, 10, 20, 20) and invalidatedArea is (x, y,
width, height) = (5, 5, 6, 6) the widgetArea drawn on the LCD is (x, y, width, height) =
(15, 15, 6, 6).
in visuals The string visuals (font, alignment, line space, color) with which to draw this string.
format A pointer to a zero terminated text string with optional additional wildcard arguments.
pArg Variable arguments providing additional information.
See also
drawString
7.99.3.14 drawTextureMapScanLine()
void drawTextureMapScanLine (
const DrawingSurface & dest,
const Gradients & gradients,
const Edge ∗ leftEdge,
const Edge ∗ rightEdge,
const TextureSurface & texture,
const Rect & absoluteRect,
const Rect & dirtyAreaAbsolute,
RenderingVariant renderVariant,
uint8_t alpha,
uint16_t subDivisionLength ) [protected], [pure virtual]
The scan line will be drawn using the additional arguments. The scan line will be placed and clipped using the
absolute and dirty rectangles The alpha will determine how the scan line should be alpha blended. The sub←-
DivisionSize will determine the size of the piecewise affine texture mapped lines.
Parameters
dest The description of where the texture is drawn - can be used to issue a draw off screen.
gradients The gradients using in interpolation across the scan line.
leftEdge The left edge of the scan line.
rightEdge The right edge of the scan line.
texture The texture.
absoluteRect The containing rectangle in absolute coordinates.
dirtyAreaAbsolute The dirty area in absolute coordinates.
renderVariant The render variant - includes the algorithm and the pixel format.
alpha The alpha.
subDivisionLength The size of the subdivisions of the scan line. A value of 1 will give a completely
perspective correct texture mapped scan line. A large value will give an affine texture
mapped scan line.
7.99.3.15 drawTextureMapTriangle()
void drawTextureMapTriangle (
const DrawingSurface & dest,
const Point3D ∗ vertices,
const TextureSurface & texture,
const Rect & absoluteRect,
const Rect & dirtyAreaAbsolute,
RenderingVariant renderVariant,
uint8_t alpha = 255,
uint16_t subDivisionSize = 12 )
Parameters
dest The description of where the texture is drawn - can be used to issue a draw off screen.
vertices The vertices of the triangle.
texture The texture.
absoluteRect The containing rectangle in absolute coordinates.
dirtyAreaAbsolute The dirty area in absolute coordinates.
renderVariant The render variant - includes the algorithm and the pixel format.
alpha the alpha. Default = 255.
subDivisionSize the size of the subdivisions of the scan line. Default = 12.
7.99.3.16 drawVerticalLine()
void drawVerticalLine (
int16_t x,
int16_t y,
uint16_t height,
uint16_t lineWidth,
colortype color,
uint8_t alpha = 255 )
Parameters
7.99.3.17 fillRect()
void fillRect (
const Rect & rect,
colortype color,
uint8_t alpha = 255 ) [pure virtual]
Parameters
rect The rectangle to draw in absolute coordinates.
color The rectangle color.
alpha The rectangle opacity (255=solid)
7.99.3.18 getNumLines()
Gets number of lines for a given text taking word wrap into consideration. The font and width are required to find
the number of lines in case word wrap is true.
Parameters
in textProvider The text provider.
wideTextAction The wide text action in case lines are longer than the width of the text area.
textDirection The text direction (LTR or RTL).
font The font.
width The width.
Returns
7.99.3.19 init()
Performs initialization.
Reimplemented in LCD2bpp, LCD4bpp, LCD16bpp, and LCD24bpp.
7.99.3.20 realX()
Find the real, absolute x coordinate of a point inside a widget with regards to rotation.
Parameters
in widgetArea The widget containing the point.
x The x coordinate.
y The y coordinate.
rotation Rotation to perform.
Returns
7.99.3.21 realY()
Find the real, absolute y coordinate of a point inside a widget with regards to rotation.
Parameters
in widgetArea The widget containing the point.
x The x coordinate.
y The y coordinate.
rotation Rotation to perform.
Returns
7.99.3.22 rotateRect()
Parameters
in,out rect The rectangle to rotate.
canvas The rectangle containing the rect to rotate.
rotation Rotation to perform on rect.
7.99.3.23 stringWidth()
Find string with of the given number of characters read from the given TextProvider.
Parameters
in,out textProvider The text provider.
font The font.
numChars Number of characters.
textDirection The text direction.
Returns
An int16_t.
This class contains the various low-level drawing routines for drawing bitmaps.
#include <platform/driver/lcd/LCD16bpp.hpp>
• virtual void drawTextureMapScanLine (const DrawingSurface &dest, const Gradients &gradients, const Edge
∗leftEdge, const Edge ∗rightEdge, const TextureSurface &texture, const Rect &absoluteRect, const Rect
&dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize)
Draw scan line. Draw one horizontal line of the texture map on screen. The scan line will be drawn using perspective
correct texture mapping. The appearance of the line is determined by the left and right edge and the gradients
structure. The edges contain the information about the x,y,z coordinates of the left and right side respectively and
also information about the u,v coordinates of the texture map used. The gradients structure contains information about
how to interpolate all the values across the scan line. The data drawn should be present in the texture argument.
• virtual void drawGlyph (uint16_t ∗wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_←-
t offsetY, const Rect &invalidatedArea, const GlyphNode ∗glyph, const uint8_t ∗glyphData, colortype color,
uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation=TEXT_ROTATE_0)
Private version of draw-glyph with explicit destination buffer pointer argument.
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles on 16 bits per
pixel displays.
Note
See also
LCD
7.100.2.1 bitDepth()
Returns
Implements LCD.
void blitCopy (
const uint16_t ∗ sourceData,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored as 16-bits RGB565 values.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
void blitCopy (
const uint8_t ∗ sourceData,
Bitmap::BitmapFormat sourceFormat,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified. Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255. LCD16 supports source
data formats: RGB565 and ARGB8888.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored in a format suitable for the selected display.
sourceFormat The bitmap format used in the source data.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
7.100.2.4 blitCopyAlphaPerPixel()
Blits a 2D source-array to the framebuffer perfoming alpha-blending per pixel as specified Performs always a soft-
ware blend.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must be stored
as 16- bits RGB565 values.
alphaData The alpha channel array pointer (points to the beginning of the data)
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending applied to the whole image (255 = solid, no blending)
7.100.2.5 blitCopyARGB8888()
Blits a 2D source-array to the framebuffer perfoming alpha-blending per pixel as specified if ARGB8888 is not
supported by the DMA a software blend is performed.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must be stored
as 32- bits ARGB8888 values.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending applied to the whole image (255 = solid, no blending)
7.100.2.6 copyFrameBufferRegionToMemory()
uint16_t ∗ copyFrameBufferRegionToMemory (
const Rect & region,
const BitmapId bitmap = BITMAP_ANIMATION_STORAGE ) [virtual]
Parameters
region The part to copy.
bitmap The bitmap to store the data in. Default parameter is Animation Storage.
Returns
Implements LCD.
7.100.2.7 drawGlyph()
void drawGlyph (
uint16_t ∗ wbuf,
Rect widgetArea,
int16_t x,
int16_t y,
uint16_t offsetX,
uint16_t offsetY,
const Rect & invalidatedArea,
const GlyphNode ∗ glyph,
const uint8_t ∗ glyphData,
colortype color,
uint8_t bitsPerPixel,
uint8_t alpha,
TextRotation rotation = TEXT_ROTATE_0 ) [protected], [virtual]
Private version of draw-glyph with explicit destination buffer pointer argument. For all parameters (except the buffer
pointer) see the public version of drawGlyph()
Parameters
Implements LCD.
7.100.2.8 drawPartialBitmap()
void drawPartialBitmap (
const Bitmap & bitmap,
int16_t x,
int16_t y,
const Rect & rect,
Parameters
bitmap The bitmap to draw.
x The absolute x coordinate to place pixel (0, 0) on the screen.
y The absolute y coordinate to place pixel (0, 0) on the screen.
rect A rectangle describing what region of the bitmap is to be drawn.
alpha Optional alpha value. Default is 255 (solid).
useOptimized if false, do not attempt to substitute (parts of) this bitmap with faster fillrects.
Implements LCD.
7.100.2.9 drawTextureMapScanLine()
void drawTextureMapScanLine (
const DrawingSurface & dest,
const Gradients & gradients,
const Edge ∗ leftEdge,
const Edge ∗ rightEdge,
const TextureSurface & texture,
const Rect & absoluteRect,
const Rect & dirtyAreaAbsolute,
RenderingVariant renderVariant,
uint8_t alpha,
uint16_t subDivisionSize ) [protected], [virtual]
The scan line will be drawn using the additional arguments. The scan line will be placed and clipped using the
absolute and dirty rectangles The alpha will determine how the scan line should be alpha blended. The sub←-
DivisionSize will determine the size of the piecewise affine texture mapped lines.
Parameters
dest The description of where the texture is drawn - can be used to issue a draw off screen.
gradients The gradients using in interpolation across the scan line.
leftEdge The left edge of the scan line.
rightEdge The right edge of the scan line.
texture The texture.
absoluteRect The containing rectangle in absolute coordinates.
dirtyAreaAbsolute The dirty area in absolute coordinates.
renderVariant The render variant - includes the algorithm and the pixel format.
alpha The alpha.
subDivisionSize The size of the subdivisions of the scan line. A value of 1 will give a completely
perspective correct texture mapped scan line. A large value will give an affine texture
mapped scan line.
Implements LCD.
7.100.2.10 fillRect()
void fillRect (
const Rect & rect,
colortype color,
uint8_t alpha = 255 ) [virtual]
Parameters
rect The rectangle to draw in absolute coordinates.
color The rectangle color.
alpha The rectangle opacity (255=solid)
Implements LCD.
7.100.2.11 init()
Performs initialization.
Reimplemented from LCD.
7.100.2.12 nextLine()
Find out how much to advance in the display buffer to get to the next line.
Parameters
Returns
7.100.2.13 nextPixel()
Find out how much to advance in the display buffer to get to the next pixel.
Parameters
Returns
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles.
#include <platform/driver/lcd/LCD1bpp.hpp>
• virtual void drawPartialBitmap (const Bitmap &bitmap, int16_t x, int16_t y, const Rect &rect, uint8_t al-
pha=255, bool useOptimized=true)
Draws a portion of a bitmap.
• virtual void blitCopy (const uint16_t ∗sourceData, const Rect &source, const Rect &blitRect, uint8_t alpha,
bool hasTransparentPixels)
Blits a 2D source-array to the frame buffer.
• virtual void blitCopy (const uint8_t ∗sourceData, Bitmap::BitmapFormat sourceFormat, const Rect &source,
const Rect &blitRect, uint8_t alpha, bool hasTransparentPixels)
Blits a 2D source-array to the framebuffer while converting the format.
• virtual uint16_t ∗ copyFrameBufferRegionToMemory (const Rect ®ion, const BitmapId bitmap=BITMAP←-
_ANIMATION_STORAGE)
Copies a part of the frame buffer.
• virtual void fillRect (const Rect &rect, colortype color, uint8_t alpha=255)
Draws a filled rectangle in the specified color.
• virtual uint8_t bitDepth () const
Number of bits per pixel used by the display.
• virtual void drawTextureMapScanLine (const DrawingSurface &dest, const Gradients &gradients, const Edge
∗leftEdge, const Edge ∗rightEdge, const TextureSurface &texture, const Rect &absoluteRect, const Rect
&dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize)
Draw scan line. Not supported for 1bpp.
• virtual void drawGlyph (uint16_t ∗wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_←-
t offsetY, const Rect &invalidatedArea, const GlyphNode ∗glyph, const uint8_t ∗glyphData, colortype color,
uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation=TEXT_ROTATE_0)
Private version of draw-glyph with explicit destination buffer pointer argument.
• virtual void blitCopyRLE (const uint16_t ∗_sourceData, const Rect &source, const Rect &blitRect, uint8_t
alpha)
Blits a run-length encoded 2D source-array to the frame buffer.
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles on 1 bits per
pixel displays.
Note
See also
LCD
7.101.2.1 bitDepth()
Returns
1.
Implements LCD.
void blitCopy (
const uint16_t ∗ sourceData,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored as 16-bits RGB565 values.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (0 = invisible, otherwise solid).
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
void blitCopy (
const uint8_t ∗ sourceData,
Bitmap::BitmapFormat sourceFormat,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified. Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored in a format suitable for the selected display.
sourceFormat The bitmap format used in the source data.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels Ignored
Implements LCD.
7.101.2.4 blitCopyRLE()
void blitCopyRLE (
const uint16_t ∗ _sourceData,
const Rect & source,
const Rect & blitRect,
uint8_t alpha ) [protected], [virtual]
Blits a run-length encoded2D source-array to the frame buffer unless alpha is zero.
Parameters
_sourceData The source-array pointer (points to the beginning of the data). Data stored in RLE format,
where each byte indicates number of pixels with certain color, alternating between black and
white. First byte represents black.
Parameters
7.101.2.5 copyFrameBufferRegionToMemory()
uint16_t ∗ copyFrameBufferRegionToMemory (
const Rect & region,
const BitmapId bitmap = BITMAP_ANIMATION_STORAGE ) [virtual]
Parameters
region The part to copy.
bitmap The bitmap to store the data in. Default value is Animation Storage.
Returns
Implements LCD.
7.101.2.6 drawGlyph()
void drawGlyph (
uint16_t ∗ wbuf,
Rect widgetArea,
int16_t x,
int16_t y,
uint16_t offsetX,
uint16_t offsetY,
const Rect & invalidatedArea,
const GlyphNode ∗ glyph,
const uint8_t ∗ glyphData,
colortype color,
uint8_t bitsPerPixel,
uint8_t alpha,
TextRotation rotation = TEXT_ROTATE_0 ) [protected], [virtual]
Private version of draw-glyph with explicit destination buffer pointer argument. For all parameters (except the buffer
pointer) see the public version of drawGlyph()
Parameters
Parameters
Implements LCD.
7.101.2.7 drawPartialBitmap()
void drawPartialBitmap (
const Bitmap & bitmap,
int16_t x,
int16_t y,
const Rect & rect,
uint8_t alpha = 255,
bool useOptimized = true ) [virtual]
Parameters
bitmap The bitmap to draw.
x The absolute x coordinate to place pixel (0, 0) on the screen.
y The absolute y coordinate to place pixel (0, 0) on the screen.
rect A rectangle describing what region of the bitmap is to be drawn.
alpha Optional alpha value (0 = invisible, otherwise solid). Default is 255 (solid).
useOptimized if false, do not attempt to substitute (parts of) this bitmap with faster fillrects.
Implements LCD.
7.101.2.8 drawTextureMapScanLine()
void drawTextureMapScanLine (
const DrawingSurface & dest,
const Gradients & gradients,
const Edge ∗ leftEdge,
const Edge ∗ rightEdge,
const TextureSurface & texture,
const Rect & absoluteRect,
const Rect & dirtyAreaAbsolute,
RenderingVariant renderVariant,
uint8_t alpha,
uint16_t subDivisionSize ) [inline], [protected], [virtual]
Parameters
dest The description of where the texture is drawn - can be used to issue a draw off screen.
gradients The gradients using in interpolation across the scan line.
leftEdge The left edge of the scan line.
rightEdge The right edge of the scan line.
texture The texture.
absoluteRect The containing rectangle in absolute coordinates.
dirtyAreaAbsolute The dirty area in absolute coordinates.
renderVariant The render variant - includes the algorithm and the pixel format.
alpha The alpha.
subDivisionSize The size of the subdivisions of the scan line. A value of 1 will give a completely
perspective correct texture mapped scan line. A large value will give an affine texture
mapped scan line.
Implements LCD.
7.101.2.9 fillMemory()
Fill memory efficiently. Try to get 32bit aligned or 16bit aligned and then copy as quickly as possible.
Parameters
7.101.2.10 fillRect()
void fillRect (
const Rect & rect,
colortype color,
uint8_t alpha = 255 ) [virtual]
Parameters
rect The rectangle to draw in absolute coordinates.
color The rectangle color (values other than 0 or 1 are treated as being 1).
alpha The rectangle opacity (0 = invisible, otherwise solid). Default is 255 (solid).
Implements LCD.
7.101.2.11 nextLine()
Find out how much to advance in the display buffer to get to the next line.
Parameters
Returns
7.101.2.12 nextPixel()
Find out how much to advance in the display buffer to get to the next pixel.
Parameters
Returns
This class contains the various low-level drawing routines for drawing bitmaps.
#include <platform/driver/lcd/LCD24bpp.hpp>
• virtual void drawTextureMapScanLine (const DrawingSurface &dest, const Gradients &gradients, const Edge
∗leftEdge, const Edge ∗rightEdge, const TextureSurface &texture, const Rect &absoluteRect, const Rect
&dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize)
Draw scan line. Draw one horizontal line of the texture map on screen. The scan line will be drawn using perspective
correct texture mapping. The appearance of the line is determined by the left and right edge and the gradients
structure. The edges contain the information about the x,y,z coordinates of the left and right side respectively and
also information about the u,v coordinates of the texture map used. The gradients structure contains information about
how to interpolate all the values across the scan line. The data drawn should be present in the texture argument.
• virtual void drawGlyph (uint16_t ∗wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_←-
t offsetY, const Rect &invalidatedArea, const GlyphNode ∗glyph, const uint8_t ∗glyphData, colortype color,
uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation=TEXT_ROTATE_0)
Private version of draw-glyph with explicit destination buffer pointer argument.
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles on 16 bits per
pixel displays.
Note
See also
LCD
7.102.2.1 bitDepth()
Returns
Implements LCD.
void blitCopy (
const uint16_t ∗ sourceData,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored as 16-bits RGB565 values.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
void blitCopy (
const uint8_t ∗ sourceData,
Bitmap::BitmapFormat sourceFormat,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified. Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255. LCD16 supports source
data formats: RGB888 and ARGB8888.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored in a format suitable for the selected display.
sourceFormat The bitmap format used in the source data.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
7.102.2.4 blitCopyARGB8888()
Blits a 2D source-array to the framebuffer perfoming alpha-blending per pixel as specified if ARGB8888 is not
supported by the DMA a software blend is performed.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must be stored
as 32- bits ARGB8888 values.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending applied to the whole image (255 = solid, no blending)
7.102.2.5 copyFrameBufferRegionToMemory()
uint16_t ∗ copyFrameBufferRegionToMemory (
const Rect & region,
const BitmapId bitmap = BITMAP_ANIMATION_STORAGE ) [virtual]
Parameters
region The part to copy.
bitmap The bitmap to store the data in. Default parameter is Animation Storage.
Returns
Implements LCD.
7.102.2.6 drawGlyph()
void drawGlyph (
uint16_t ∗ wbuf,
Rect widgetArea,
int16_t x,
int16_t y,
uint16_t offsetX,
uint16_t offsetY,
const Rect & invalidatedArea,
const GlyphNode ∗ glyph,
const uint8_t ∗ glyphData,
colortype color,
uint8_t bitsPerPixel,
uint8_t alpha,
TextRotation rotation = TEXT_ROTATE_0 ) [protected], [virtual]
Private version of draw-glyph with explicit destination buffer pointer argument. For all parameters (except the buffer
pointer) see the public version of drawGlyph()
Parameters
Implements LCD.
7.102.2.7 drawPartialBitmap()
void drawPartialBitmap (
const Bitmap & bitmap,
int16_t x,
int16_t y,
const Rect & rect,
uint8_t alpha = 255,
bool useOptimized = true ) [virtual]
Parameters
bitmap The bitmap to draw.
x The absolute x coordinate to place pixel (0, 0) on the screen.
Parameters
Implements LCD.
7.102.2.8 drawTextureMapScanLine()
void drawTextureMapScanLine (
const DrawingSurface & dest,
const Gradients & gradients,
const Edge ∗ leftEdge,
const Edge ∗ rightEdge,
const TextureSurface & texture,
const Rect & absoluteRect,
const Rect & dirtyAreaAbsolute,
RenderingVariant renderVariant,
uint8_t alpha,
uint16_t subDivisionSize ) [protected], [virtual]
The scan line will be drawn using the additional arguments. The scan line will be placed and clipped using the
absolute and dirty rectangles The alpha will determine how the scan line should be alpha blended. The sub←-
DivisionSize will determine the size of the piecewise affine texture mapped lines.
Parameters
dest The description of where the texture is drawn - can be used to issue a draw off screen.
gradients The gradients using in interpolation across the scan line.
leftEdge The left edge of the scan line.
rightEdge The right edge of the scan line.
texture The texture.
absoluteRect The containing rectangle in absolute coordinates.
dirtyAreaAbsolute The dirty area in absolute coordinates.
renderVariant The render variant - includes the algorithm and the pixel format.
alpha The alpha.
subDivisionSize The size of the subdivisions of the scan line. A value of 1 will give a completely
perspective correct texture mapped scan line. A large value will give an affine texture
mapped scan line.
Implements LCD.
7.102.2.9 fillRect()
void fillRect (
const Rect & rect,
colortype color,
uint8_t alpha = 255 ) [virtual]
Parameters
rect The rectangle to draw in absolute coordinates.
color The rectangle color.
alpha The rectangle opacity (255=solid)
Implements LCD.
7.102.2.10 init()
Performs initialization.
Reimplemented from LCD.
7.102.2.11 nextLine()
Find out how much to advance in the display buffer to get to the next line.
Parameters
Returns
7.102.2.12 nextPixel()
Find out how much to advance in the display buffer to get to the next pixel.
Parameters
Returns
This class contains the various low-level drawing routines for drawing bitmaps.
#include <platform/driver/lcd/LCD2bpp.hpp>
• virtual void drawTextureMapScanLine (const DrawingSurface &dest, const Gradients &gradients, const Edge
∗leftEdge, const Edge ∗rightEdge, const TextureSurface &texture, const Rect &absoluteRect, const Rect
&dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize)
Draw scan line. Draw one horizontal line of the texture map on screen. The scan line will be drawn using perspective
correct texture mapping. The appearance of the line is determined by the left and right edge and the gradients
structure. The edges contain the information about the x,y,z coordinates of the left and right side respectively and
also information about the u,v coordinates of the texture map used. The gradients structure contains information about
how to interpolate all the values across the scan line. The data drawn should be present in the texture argument.
• virtual void drawGlyph (uint16_t ∗wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_←-
t offsetY, const Rect &invalidatedArea, const GlyphNode ∗glyph, const uint8_t ∗glyphData, colortype color,
uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation=TEXT_ROTATE_0)
Private version of draw-glyph with explicit destination buffer pointer argument.
• static void blitCopyAlphaPerPixel (const uint16_t ∗sourceData16, const uint8_t ∗sourceAlphaData, const Rect
&source, const Rect &blitRect, uint8_t alpha)
Blits a 2D source-array to the framebuffer.
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles on 2 bits per
pixel grayscale displays.
Note
See also
LCD
7.103.2.1 bitDepth()
Returns
Implements LCD.
void blitCopy (
const uint16_t ∗ sourceData,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored as 16-bits RGB565 values.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
void blitCopy (
const uint8_t ∗ sourceData,
Bitmap::BitmapFormat sourceFormat,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified. Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255. LCD2 supports source data
formats: RGB565 and ARGB8888.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored in a format suitable for the selected display.
sourceFormat The bitmap format used in the source data.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
7.103.2.4 blitCopyAlphaPerPixel()
Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified Performs always a
software blend.
Parameters
sourceData16 The source-array pointer (points to the beginning of the data). The sourceData must be
stored as 2bpp GREY2 values.
sourceAlphaData The alpha channel array pointer (points to the beginning of the data)
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending applied to the whole image (255 = solid, no blending)
7.103.2.5 copyFrameBufferRegionToMemory()
uint16_t ∗ copyFrameBufferRegionToMemory (
const Rect & region,
const BitmapId bitmap = BITMAP_ANIMATION_STORAGE ) [virtual]
Parameters
region The part to copy.
bitmap The bitmap to store the data in. Default parameter is Animation Storage.
Returns
Implements LCD.
7.103.2.6 drawGlyph()
void drawGlyph (
uint16_t ∗ wbuf,
Rect widgetArea,
int16_t x,
int16_t y,
uint16_t offsetX,
uint16_t offsetY,
const Rect & invalidatedArea,
const GlyphNode ∗ glyph,
const uint8_t ∗ glyphData,
colortype color,
uint8_t bitsPerPixel,
uint8_t alpha,
TextRotation rotation = TEXT_ROTATE_0 ) [protected], [virtual]
Private version of draw-glyph with explicit destination buffer pointer argument. For all parameters (except the buffer
pointer) see the public version of drawGlyph()
Parameters
Parameters
Implements LCD.
7.103.2.7 drawPartialBitmap()
void drawPartialBitmap (
const Bitmap & bitmap,
int16_t x,
int16_t y,
const Rect & rect,
uint8_t alpha = 255,
bool useOptimized = true ) [virtual]
Parameters
bitmap The bitmap to draw.
x The absolute x coordinate to place pixel (0, 0) on the screen.
y The absolute y coordinate to place pixel (0, 0) on the screen.
rect A rectangle describing what region of the bitmap is to be drawn.
alpha Optional alpha value. Default is 255 (solid).
useOptimized if false, do not attempt to substitute (parts of) this bitmap with faster fillrects.
Implements LCD.
7.103.2.8 drawTextureMapScanLine()
void drawTextureMapScanLine (
const DrawingSurface & dest,
const Gradients & gradients,
const Edge ∗ leftEdge,
const Edge ∗ rightEdge,
const TextureSurface & texture,
const Rect & absoluteRect,
const Rect & dirtyAreaAbsolute,
RenderingVariant renderVariant,
uint8_t alpha,
The scan line will be drawn using the additional arguments. The scan line will be placed and clipped using the
absolute and dirty rectangles The alpha will determine how the scan line should be alpha blended. The sub←-
DivisionSize will determine the size of the piecewise affine texture mapped lines.
Parameters
dest The description of where the texture is drawn - can be used to issue a draw off screen.
gradients The gradients using in interpolation across the scan line.
leftEdge The left edge of the scan line.
rightEdge The right edge of the scan line.
texture The texture.
absoluteRect The containing rectangle in absolute coordinates.
dirtyAreaAbsolute The dirty area in absolute coordinates.
renderVariant The render variant - includes the algorithm and the pixel format.
alpha The alpha.
subDivisionSize The size of the subdivisions of the scan line. A value of 1 will give a completely
perspective correct texture mapped scan line. A large value will give an affine texture
mapped scan line.
Implements LCD.
7.103.2.9 fillRect()
void fillRect (
const Rect & rect,
colortype color,
uint8_t alpha = 255 ) [virtual]
Parameters
rect The rectangle to draw in absolute coordinates.
color The rectangle color.
alpha The rectangle opacity (255=solid)
Implements LCD.
7.103.2.10 init()
Performs initialization.
Reimplemented from LCD.
7.103.2.11 nextLine()
Find out how much to advance in the display buffer to get to the next line.
Parameters
Returns
7.103.2.12 nextPixel()
Find out how much to advance in the display buffer to get to the next pixel.
Parameters
Returns
This class contains the various low-level drawing routines for drawing bitmaps.
#include <platform/driver/lcd/LCD4bpp.hpp>
• virtual void drawTextureMapScanLine (const DrawingSurface &dest, const Gradients &gradients, const Edge
∗leftEdge, const Edge ∗rightEdge, const TextureSurface &texture, const Rect &absoluteRect, const Rect
&dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize)
Draw scan line. Draw one horizontal line of the texture map on screen. The scan line will be drawn using perspective
correct texture mapping. The appearance of the line is determined by the left and right edge and the gradients
structure. The edges contain the information about the x,y,z coordinates of the left and right side respectively and
also information about the u,v coordinates of the texture map used. The gradients structure contains information about
how to interpolate all the values across the scan line. The data drawn should be present in the texture argument.
• virtual void drawGlyph (uint16_t ∗wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_←-
t offsetY, const Rect &invalidatedArea, const GlyphNode ∗glyph, const uint8_t ∗glyphData, colortype color,
uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation=TEXT_ROTATE_0)
Private version of draw-glyph with explicit destination buffer pointer argument.
This class contains the various low-level drawing routines for drawing bitmaps, texts and rectangles on 4 bits per
pixel grayscale displays.
Note
See also
LCD
7.104.2.1 bitDepth()
Returns
Implements LCD.
void blitCopy (
const uint16_t ∗ sourceData,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored as 16-bits RGB565 values.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
void blitCopy (
const uint8_t ∗ sourceData,
Bitmap::BitmapFormat sourceFormat,
const Rect & source,
const Rect & blitRect,
uint8_t alpha,
bool hasTransparentPixels ) [virtual]
Blits a 2D source-array to the framebuffer perfoming alpha-blending (and tranparency keying) as specified. Performs
a software blend if HAL does not support BLIT_COPY_WITH_ALPHA and alpha != 255. LCD4 supports source data
formats: RGB565 and ARGB8888.
Parameters
sourceData The source-array pointer (points to the beginning of the data). The sourceData must
be stored in a format suitable for the selected display.
sourceFormat The bitmap format used in the source data.
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending (255 = solid, no blending)
hasTransparentPixels If true, this data copy contains transparent pixels and require hardware support for that
to be enabled.
Implements LCD.
7.104.2.4 blitCopyAlphaPerPixel()
Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as specified Performs always a
software blend.
Parameters
sourceData16 The source-array pointer (points to the beginning of the data). The sourceData must be
stored as 4bpp GREY4 values.
sourceAlphaData The alpha channel array pointer (points to the beginning of the data)
source The location and dimension of the source.
blitRect A rectangle describing what region is to be drawn.
alpha The alpha value to use for blending applied to the whole image (255 = solid, no blending)
7.104.2.5 copyFrameBufferRegionToMemory()
uint16_t ∗ copyFrameBufferRegionToMemory (
const Rect & region,
const BitmapId bitmap = BITMAP_ANIMATION_STORAGE ) [virtual]
Parameters
region The part to copy.
bitmap The bitmap to store the data in. Default value is Animation Storage.
Returns
Implements LCD.
7.104.2.6 drawGlyph()
void drawGlyph (
uint16_t ∗ wbuf,
Rect widgetArea,
int16_t x,
int16_t y,
uint16_t offsetX,
uint16_t offsetY,
const Rect & invalidatedArea,
const GlyphNode ∗ glyph,
const uint8_t ∗ glyphData,
colortype color,
uint8_t bitsPerPixel,
uint8_t alpha,
TextRotation rotation = TEXT_ROTATE_0 ) [protected], [virtual]
Private version of draw-glyph with explicit destination buffer pointer argument. For all parameters (except the buffer
pointer) see the public version of drawGlyph()
Parameters
Implements LCD.
7.104.2.7 drawPartialBitmap()
void drawPartialBitmap (
const Bitmap & bitmap,
int16_t x,
int16_t y,
const Rect & rect,
Parameters
bitmap The bitmap to draw.
x The absolute x coordinate to place pixel (0, 0) on the screen.
y The absolute y coordinate to place pixel (0, 0) on the screen.
rect A rectangle describing what region of the bitmap is to be drawn.
alpha Optional alpha value. Default is 255 (solid).
useOptimized if false, do not attempt to substitute (parts of) this bitmap with faster fillrects.
Implements LCD.
7.104.2.8 drawTextureMapScanLine()
void drawTextureMapScanLine (
const DrawingSurface & dest,
const Gradients & gradients,
const Edge ∗ leftEdge,
const Edge ∗ rightEdge,
const TextureSurface & texture,
const Rect & absoluteRect,
const Rect & dirtyAreaAbsolute,
RenderingVariant renderVariant,
uint8_t alpha,
uint16_t subDivisionSize ) [protected], [virtual]
The scan line will be drawn using the additional arguments. The scan line will be placed and clipped using the
absolute and dirty rectangles The alpha will determine how the scan line should be alpha blended. The sub←-
DivisionSize will determine the size of the piecewise affine texture mapped lines.
Parameters
dest The description of where the texture is drawn - can be used to issue a draw off screen.
gradients The gradients using in interpolation across the scan line.
leftEdge The left edge of the scan line.
rightEdge The right edge of the scan line.
texture The texture.
absoluteRect The containing rectangle in absolute coordinates.
dirtyAreaAbsolute The dirty area in absolute coordinates.
renderVariant The render variant - includes the algorithm and the pixel format.
alpha The alpha.
subDivisionSize The size of the subdivisions of the scan line. A value of 1 will give a completely
perspective correct texture mapped scan line. A large value will give an affine texture
mapped scan line.
Implements LCD.
7.104.2.9 fillRect()
void fillRect (
const Rect & rect,
colortype color,
uint8_t alpha = 255 ) [virtual]
Parameters
rect The rectangle to draw in absolute coordinates.
color The rectangle color.
alpha The rectangle opacity (255=solid)
Implements LCD.
7.104.2.10 init()
Performs initialization.
Reimplemented from LCD.
7.104.2.11 nextLine()
Find out how much to advance in the display buffer to get to the next line.
Parameters
Returns
7.104.2.12 nextPixel()
Find out how much to advance in the display buffer to get to the next pixel.
Parameters
Returns
A led.
#include <touchgfx/hal/LED.hpp>
7.105.1.1 get()
Parameters
Returns
7.105.1.2 init()
7.105.1.3 off()
Parameters
7.105.1.4 on()
static void on (
uint8_t nr ) [static]
Turn on a LED.
Parameters
7.105.1.5 toggle()
Toggles a LED.
Parameters
Public Types
• Line ()
Construct a new Line.
• template<typename T >
void setLine (T x1, T y1, T x2, T y2)
Sets the endpoints of the line.
• template<typename T >
void setStart (T x, T y)
Sets the start point for this Line.
• void setStart (CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5)
Sets the start point for this Line.
• template<typename T >
void updateStart (T x, T y)
Update the start point for this Line.
• void updateStart (CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5)
Update the start point for this Line.
• template<typename T >
void getStart (T &x, T &y) const
Gets the start coordinates for the line.
• template<typename T >
void setEnd (T x, T y)
Sets the end point for this Line.
• void setEnd (CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5)
Sets the end point for this Line.
• template<typename T >
void updateEnd (T x, T y)
Update the end point for this Line.
• void updateEnd (CWRUtil::Q5 xQ5, CWRUtil::Q5 yQ5)
Update the end point for this Line.
• template<typename T >
void getEnd (T &x, T &y) const
Gets the end coordinates for the line.
• template<typename T >
void setLineWidth (T width)
Sets the width for this Line.
• void setLineWidth (CWRUtil::Q5 widthQ5)
Sets the width for this Line.
• template<typename T >
void updateLineWidth (T width)
Update the width for this Line.
• void updateLineWidth (CWRUtil::Q5 widthQ5)
Update the width for this Line.
• template<typename T >
void getLineWidth (T &width) const
Gets line width.
• template<typename T >
T getLineWidth () const
Gets line width.
• void setLineEndingStyle (LINE_ENDING_STYLE lineEnding)
Sets line ending style.
• LINE_ENDING_STYLE getLineEndingStyle () const
Simple CanvasWidget capable of drawing a line from one point to another point. The end points can be moved to
new locations and the line width can easily be set and changed. A 10 pixel long line along the top of the screen with
a width on 1 pixel has endpoints in (0, 0.5) and (10, 0.5) and line width 1. The Line class calculates the corners of
the shape, which in this case would be (0, 0), (10, 0), (10, 1) and (0, 1) and tells CWR to moveTo the first coordinate
and then lineTo the next coordinates in order. Finally it tells CWR to render the inside of the shape using a Painter
object.
The Line class caches the four corners of the shape to speed up redrawing. In general, drawing lines involve some
extra mathematics for calculating the normal vector of the line and this computation would slow down re-draws if not
cached.
See also
CanvasWidget
7.106.2.1 LINE_ENDING_STYLE
enum LINE_ENDING_STYLE
Enumerator
BUTT_CAP_ENDING The line ending is cut 90 degrees at the end of the line.
ROUND_CAP_ENDING The line ending is rounded as a circle with center at the end of the line.
SQUARE_CAP_ENDING The line ending is cut 90 degrees, but extends half the width of the line.
7.106.3.1 Line()
Line ( )
7.106.4.1 drawCanvasWidget()
bool drawCanvasWidget (
const Rect & invalidatedArea ) const [virtual]
Draws the Line. This class supports partial drawing, so only the area described by the rectangle will be drawn. As
the corners of the shape are cached, the line can quickly be redrawn when required.
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
Returns
Implements CanvasWidget.
7.106.4.2 getEnd()
Template Parameters
Parameters
out x The x coordinate.
out y The y coordinate.
See also
setEnd
setLine
7.106.4.3 getLineEndingStyle()
Returns
See also
LINE_ENDING_STYLE
setLineEndingStyle
Template Parameters
Parameters
out width The line width.
See also
setLineWidth
Template Parameters
Returns
See also
setLineWidth
7.106.4.6 getMinimalRect()
Gets minimal rectangle containing the shape drawn by this widget. Default implementation returns the size of the
entire widget, but this function should be overwritten in subclasses and return the minimal rectangle containing the
shape. See classes such as Circle for example implementations.
Returns
7.106.4.7 getStart()
Template Parameters
Parameters
out x The x coordinate.
out y The y coordinate.
See also
setStart
setLine
7.106.4.8 setCapPrecision()
void setCapPrecision (
int precision )
Sets a precision of the ends of the Line arc. The precision is given in degrees where 18 is the default which results
in a nice half circle with 10 line segments. 90 will draw "an arrow head".
Note
Parameters
precision The new cap precision.
Note
Template Parameters
Parameters
See also
updateEnd
getEnd
void setEnd (
CWRUtil::Q5 xQ5,
CWRUtil::Q5 yQ5 )
Parameters
Note
See also
updateEnd
getEnd
7.106.4.11 setLine()
Note
Template Parameters
Parameters
See also
setStart
setEnd
7.106.4.12 setLineEndingStyle()
void setLineEndingStyle (
LINE_ENDING_STYLE lineEnding )
Note
Parameters
lineEnding The line ending style.
See also
LINE_ENDING_STYLE
getLineEndingStyle
Note
Template Parameters
Parameters
See also
updateLineWidth
void setLineWidth (
CWRUtil::Q5 widthQ5 ) [inline]
Parameters
Note
See also
updateLineWidth
Note
Template Parameters
Parameters
See also
updateStart
getStart
setLine
setEnd
void setStart (
CWRUtil::Q5 xQ5,
CWRUtil::Q5 yQ5 )
Parameters
Note
See also
updateStart
getStart
setLine
setEnd
Update the end point for this Line. The rectangle that surrounds the line before and after will be invalidated.
Note
The area containing the Line is invalidated before and after the change.
Template Parameters
Parameters
void updateEnd (
CWRUtil::Q5 xQ5,
CWRUtil::Q5 yQ5 )
Update the end point for this Line. The rectangle that surrounds the line before and after will be invalidated.
Parameters
Note
The area containing the Line is invalidated before and after the change.
Update the width for this Line and invalidates the minimal rectangle surrounding the line on screen.
Note
The area containing the Line is invalidated before and after the change.
Template Parameters
Parameters
See also
setLineWidth
void updateLineWidth (
CWRUtil::Q5 widthQ5 ) [inline]
Update the width for this Line and invalidates the minimal rectangle surrounding the line on screen.
Parameters
Note
The area containing the Line is invalidated before and after the change.
See also
setLineWidth
Update the start point for this Line. The rectangle that surrounds the line before and after will be invalidated.
Note
The area containing the Line is invalidated before and after the change.
Template Parameters
Parameters
See also
setStart
updateEnd
void updateStart (
CWRUtil::Q5 xQ5,
CWRUtil::Q5 yQ5 )
Update the start point for this Line. The rectangle that surrounds the line before and after will be invalidated.
Parameters
Note
The area containing the Line is invalidated before and after the change.
See also
setStart
updateEnd
A line progress.
#include <touchgfx/containers/progress_indicators/LineProgress.hpp>
• LineProgress ()
Default constructor.
• virtual ∼LineProgress ()
Destructor.
• virtual void setProgressIndicatorPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the position and dimension of the line progress indicator.
• virtual void setPainter (AbstractPainter &painter)
Sets a painter.
• virtual void setStart (int x, int y)
Sets a starting point for the line.
• virtual void getStart (int &x, int &y) const
Gets the coordinates of the starting point of the line.
• virtual void setEnd (int x, int y)
Sets an end point for the line.
• virtual void getEnd (int &x, int &y) const
Gets the coordinates of the end point of the line.
• virtual void setLineWidth (int width)
Sets line width.
• virtual int getLineWidth () const
Gets line width.
• virtual void setLineEndingStyle (Line::LINE_ENDING_STYLE lineEndingStyle)
Sets line ending style.
Protected Attributes
• Line line
The line.
• CWRUtil::Q5 startX
The start x coordinate.
• CWRUtil::Q5 startY
The start y coordinate.
• CWRUtil::Q5 endX
The end x coordinate.
• CWRUtil::Q5 endY
The end y coordinate.
Using Line from canvas widgets, progress will be rendered as a line. The line does not need to horizontal or vertical,
but can start at any coordinate and finish at any coordinate.
Note
7.107.2.1 LineProgress()
LineProgress ( )
Default constructor.
7.107.2.2 ∼LineProgress()
∼LineProgress ( ) [virtual]
Destructor.
7.107.3.1 getAlpha()
Returns
The alpha.
See also
Line::getAlpha
7.107.3.2 getEnd()
void getEnd (
int & x,
int & y ) const [virtual]
Gets the coordinates of the end point of the line. Beware that this is not the coordinates of the current progress of
the line, but the coordinates when the line is at 100%.
Parameters
out x The x coordinate.
out y The y coordinate.
7.107.3.3 getLineEndingStyle()
Returns
7.107.3.4 getLineWidth()
Returns
7.107.3.5 getStart()
void getStart (
int & x,
int & y ) const [virtual]
Parameters
out x The x coordinate.
out y The y coordinate.
7.107.3.6 setAlpha()
void setAlpha (
uint8_t alpha ) [virtual]
Parameters
alpha The alpha.
See also
Line::setAlpha
7.107.3.7 setEnd()
void setEnd (
int x,
int y ) [virtual]
Sets an end point for the line. When progress is at 100%, the line will go from the coordinates set by setStart() to
these coordinates set by setEnd()
Parameters
See also
setStart
7.107.3.8 setLineEndingStyle()
void setLineEndingStyle (
Parameters
See also
Line::setLineEndingStyle
7.107.3.9 setLineWidth()
void setLineWidth (
int width ) [virtual]
Parameters
width The width.
See also
Line::setLineWidth
7.107.3.10 setPainter()
void setPainter (
AbstractPainter & painter ) [virtual]
Sets a painter to be used for drawing the line. This can be any Painter, a simple single color painter, a bitmap painter
or a custom painter.
Parameters
in painter The painter.
7.107.3.11 setProgressIndicatorPosition()
void setProgressIndicatorPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [virtual]
Sets the position and dimension of the line progress indicator relative to the background image.
Parameters
x The x coordinate.
y The y coordinate.
width The width of the line progress indicator.
height The height of the line progress indicator.
7.107.3.12 setStart()
void setStart (
int x,
int y ) [virtual]
Parameters
See also
setEnd
7.107.3.13 setValue()
Sets the current value in the range (min..max) set by setRange(). Values lower than min are mapped to min, values
higher than max are mapped to max.
Parameters
value The value.
This class provides a layout mechanism for arranging Drawable instances adjacently in the specified Direction.
#include <touchgfx/containers/ListLayout.hpp>
Constructor.
• virtual ∼ListLayout ()
Destructor.
• virtual void setDirection (const Direction d)
Sets the direction of the ListLayout.
• virtual Direction getDirection () const
Gets the direction of the ListLayout.
• virtual void add (Drawable &d)
Adds a Drawable instance to the end of the list.
• virtual void remove (Drawable &d)
Removes a Drawable.
• virtual void insert (Drawable ∗previousElement, Drawable &d)
Inserts a Drawable.
• virtual void removeAll ()
Removes all children.
• virtual uint16_t getType () const
For GUI testing only.
This class provides a layout mechanism for arranging Drawable instances adjacently in the specified Direction. The
first element in the ListLayout is positioned in the ListLayout origin (0,0). The dimension of this class is automatically
expanded to cover the area of the added Drawable instances.
See also
Container
7.108.2.1 ListLayout()
ListLayout (
const Direction d = SOUTH ) [inline]
Constructor. Constructs a ListLayout instance that arranges the added elements in the specified Direction.
Parameters
d The direction to grow in when adding children.
7.108.2.2 ∼ListLayout()
Destructor.
7.108.3.1 add()
void add (
Drawable & d ) [virtual]
Adds a Drawable instance to the end of the list. The Drawable dimensions shall be set prior to addition.
Parameters
in d The Drawable to add.
7.108.3.2 getDirection()
Returns
The current direction to grow in when added children (either SOUTH or EAST).
See also
setDirection()
7.108.3.3 getType()
Returns
TYPE_LISTLAYOUT.
7.108.3.4 insert()
void insert (
Drawable ∗ previousElement,
Drawable & d ) [virtual]
Inserts a Drawable.
Parameters
7.108.3.5 remove()
void remove (
Drawable & d ) [virtual]
Removes a Drawable. Safe to call even if drawable has not been added.
Parameters
in d The drawable to remove.
7.108.3.6 removeAll()
Removes all children by resetting their parent and sibling pointers. In addition, the geometry is reset and any parent
is signaled of the change.
Reimplemented from Container.
7.108.3.7 setDirection()
void setDirection (
const Direction d ) [virtual]
Sets the direction of the ListLayout. If elements have already been added to the ListLayout, these elements will be
repositioned to adhere to the new direction.
Parameters
d The new Direction to grow in when added children (either SOUTH or EAST).
See also
getDirection()
This implements a simple lock-free FIFO queue (single producer, single consumer).
#include <touchgfx/hal/DMA.hpp>
Protected Attributes
• BlitOp ∗ q
Pointer to the queue memory.
• atomic_t capacity
The number of elements the queue can contain.
• atomic_t head
Index to the head element.
• atomic_t tail
Index to the tail element.
This implements a simple lock-free FIFO queue (single producer, single consumer)
See also
DMA_Queue
7.109.2.1 LockFreeDMA_Queue()
LockFreeDMA_Queue (
BlitOp ∗ mem,
atomic_t n )
Parameters
out mem Pointer to the memory used by the queue to store elements.
n Number of elements the memory provided can contain.
7.109.3.1 first()
Returns
Implements DMA_Queue.
7.109.3.2 isEmpty()
Returns
Implements DMA_Queue.
7.109.3.3 isFull()
Returns
Implements DMA_Queue.
7.109.3.4 pop()
7.109.3.5 pushCopyOf()
void pushCopyOf (
const BlitOp & op ) [virtual]
Parameters
op The operation.
Implements DMA_Queue.
• Matrix4x4 ()
Default constructor.
• float getElement (int row, int column) const
Gets an element.
• void setViewDistance (float distance)
Sets view distance.
• Matrix4x4 setElement (int row, int column, float value)
Sets an element.
• Matrix4x4 & concatenateXRotation (float radians)
Concatenate x coordinate rotation.
• Matrix4x4 & concatenateYRotation (float radians)
Concatenate y coordinate rotation.
• Matrix4x4 & concatenateZRotation (float radians)
Concatenate z coordinate rotation.
• Matrix4x4 & concatenateXTranslation (float distance)
Concatenate x coordinate translation.
• Matrix4x4 & concatenateYTranslation (float distance)
Concatenate y coordinate translation.
• Matrix4x4 & concatenateZTranslation (float distance)
Concatenate z coordinate translation.
• Matrix4x4 & concatenateXScale (float distance)
Concatenate x coordinate scale.
• Matrix4x4 & concatenateYScale (float distance)
Concatenate y coordinate scale.
• Matrix4x4 & concatenateZScale (float distance)
Concatenate z coordinate scale.
Protected Attributes
7.110.2.1 Matrix4x4()
Matrix4x4 ( )
Default constructor.
7.110.3.1 concatenateXRotation()
Parameters
radians The radians.
Returns
A matrix_4x4&
7.110.3.2 concatenateXScale()
Parameters
distance The distance.
Returns
A matrix_4x4&
7.110.3.3 concatenateXTranslation()
Parameters
distance The distance.
Returns
A matrix_4x4&
7.110.3.4 concatenateYRotation()
Parameters
radians The radians.
Returns
A matrix_4x4&
7.110.3.5 concatenateYScale()
Parameters
distance The distance.
Returns
A matrix_4x4&
7.110.3.6 concatenateYTranslation()
Parameters
distance The distance.
Returns
A matrix_4x4&
7.110.3.7 concatenateZRotation()
Parameters
radians The radians.
Returns
A matrix_4x4&
7.110.3.8 concatenateZScale()
Parameters
distance The distance.
Returns
A matrix_4x4&
7.110.3.9 concatenateZTranslation()
Parameters
distance The distance.
Returns
A matrix_4x4&
7.110.3.10 getElement()
float getElement (
int row,
int column ) const [inline]
Gets an element.
Parameters
row The row.
column The column.
Returns
The element.
7.110.3.11 identity()
Gets the identity. Instead of using "Matrix4x4::identity()" consider using "Matrix4x4()" instead.
Returns
A matrix_4x4.
7.110.3.12 setElement()
Matrix4x4 setElement (
int row,
int column,
float value ) [inline]
Sets an element.
Parameters
row The row.
column The column.
value The value.
Returns
A matrix_4x4&
7.110.3.13 setViewDistance()
void setViewDistance (
float distance )
Parameters
distance The distance.
Interface for instrumenting processors to measure MCU load via measured CPU cycles.
#include <platform/core/MCUInstrumentation.hpp>
• MCUInstrumentation ()
Constructor.
• virtual void init ()=0
Initialize.
• virtual ∼MCUInstrumentation ()
Virtual destructor.
• virtual unsigned int getElapsedUS (unsigned int start, unsigned int now, unsigned int clockfrequency)=0
Gets elapsed microseconds based on clock frequency.
• virtual unsigned int getCPUCycles (void)=0
Gets CPU cycles from register.
• virtual void setMCUActive (bool active)
Sets MCU activity high.
• virtual uint32_t getCCConsumed ()
Gets number of consumed clock cycles.
• virtual void setCCConsumed (uint32_t val)
Sets number of consumed clock cycles.
Protected Attributes
Interface for instrumenting processors to measure MCU load via measured CPU cycles.
7.111.2.1 MCUInstrumentation()
MCUInstrumentation ( ) [inline]
7.111.2.2 ∼MCUInstrumentation()
Virtual destructor.
7.111.3.1 getCCConsumed()
Returns
clock cycles.
7.111.3.2 getCPUCycles()
Returns
CPU cycles.
7.111.3.3 getElapsedUS()
Parameters
Returns
7.111.3.4 init()
Initialize.
7.111.3.5 setCCConsumed()
void setCCConsumed (
uint32_t val ) [inline], [virtual]
Parameters
7.111.3.6 setMCUActive()
void setMCUActive (
bool active ) [inline], [virtual]
Parameters
Container for displaying a modal window and hijacking touch event to underlaying view and widgets.
#include <include/gui/common/ModalWindow.hpp>
• ModalWindow ()
Default constructor.
• virtual ∼ModalWindow ()
Destructor.
• virtual void setBackground (const BitmapId &bmpId)
Sets the background of the actual window.
• virtual void setBackground (const BitmapId &bmpId, int16_t backgroundX, int16_t backgroundY)
Sets the background of the actual window.
• virtual uint16_t getBackgroundWidth () const
Protected Attributes
• Box backgroundShade
The background shade.
• Container windowContainer
The window container that defines the active container area where both the windowBackground and added drawables
are placed.
• Image windowBackground
The window background.
Container for displaying a modal window and hijacking touch event to underlaying view and widgets. The container
has a background image and a surround box that acts as a shade on top of the rest of the screen. The background
image must be set (using the setBackground method) and the shade can be adjusted (using the setShadeAlpha
and setShadeColor methods).
The ModalWindow can either be used directly by adding widgets/containers to the ModalWindow from your view or
by sub-classing it if you need a specific ModalWindow with predefined behavior across your application.
The ModalWindow should be instantiated in the view class and added as the last element (to always be on top).
The ModalWindow will fill up the entire screen so it should always be placed at x=0, y=0.
To control the visibility of the ModalWindow use the show and hide methods.
7.112.2.1 ModalWindow()
ModalWindow ( )
Default constructor.
7.112.2.2 ∼ModalWindow()
∼ModalWindow ( ) [virtual]
Destructor.
7.112.3.1 add()
void add (
Drawable & d ) [virtual]
Adds a drawable to the ModalWindow. The drawable will be placed relative to the background image.
Parameters
in d The drawable to add.
7.112.3.2 getBackgroundHeight()
Gets the height of the actual window (the background images). Whereas the getHeight() method will return the
height including the shade.
Returns
7.112.3.3 getBackgroundWidth()
Gets the width of the actual window (the background images). Whereas the getWidth() method will return the width
including the shade.
Returns
7.112.3.4 getShadeAlpha()
Returns
7.112.3.5 getShadeColor()
Returns
7.112.3.6 hide()
7.112.3.7 isShowing()
Returns
7.112.3.8 remove()
void remove (
Drawable & d ) [virtual]
Parameters
in d The drawable to remove.
void setBackground (
const BitmapId & bmpId ) [virtual]
Sets the background of the actual window. The remaining area of the screen will be covered by the shade. The
background image is centered on the screen.
Parameters
void setBackground (
const BitmapId & bmpId,
int16_t backgroundX,
int16_t backgroundY ) [virtual]
Sets the background of the actual window. The remaining area of the screen will be covered by the shade. The
background image will be placed at the backgroundX and backgroundY coordinate.
Parameters
7.112.3.11 setShadeAlpha()
void setShadeAlpha (
uint8_t alpha ) [virtual]
Parameters
alpha The new alpha.
7.112.3.12 setShadeColor()
void setShadeColor (
colortype color ) [virtual]
Parameters
color The new color.
7.112.3.13 show()
• MoveAnimator ()
Default constructor.
• virtual ∼MoveAnimator ()
Destructor.
• void setMoveAnimationEndedAction (GenericCallback< const MoveAnimator< T > & > &callback)
Associates an action to be performed when the animation ends.
• void clearMoveAnimationEndedAction ()
Clears the move animation ended action previously set by setMoveAnimationEndedAction.
• virtual void setMoveAnimationDelay (uint16_t delay)
Sets a delay on animations done by the MoveAnimator.
• virtual uint16_t getMoveAnimationDelay () const
Gets the current animation delay.
• virtual bool isRunning () const
Gets whether or not the move animation is running.
• virtual bool isMoveAnimationRunning () const
Gets whether or not the move animation is running.
• void startMoveAnimation (int16_t endX, int16_t endY, uint16_t duration, EasingEquation xProgression←-
Equation=&EasingEquations::linearEaseNone, EasingEquation yProgressionEquation=&EasingEquations←-
::linearEaseNone)
Starts the move animation.
• void cancelMoveAnimation ()
Cancel move animation.
Protected Attributes
• bool moveAnimationRunning
Boolean that is true if the animation is running.
• uint16_t moveAnimationCounter
Counter that is equal to the current step in the animation.
• uint16_t moveAnimationDelay
A delay that is applied before animation start. Expressed in ticks.
• uint16_t moveAnimationDuration
The complete duration of the animation. Expressed in ticks.
• int16_t moveAnimationStartX
The X value at the beginning of the animation.
• int16_t moveAnimationStartY
The Y value at the beginning of the animation.
• int16_t moveAnimationEndX
The X value at the end of the animation.
• int16_t moveAnimationEndY
The Y value at the end of the animation.
• EasingEquation moveAnimationXEquation
EasingEquation expressing the development of the X value during the animation.
• EasingEquation moveAnimationYEquation
EasingEquation expressing the development of the Y value during the animation.
• GenericCallback< const MoveAnimator< T > &> ∗ moveAnimationEndedCallback
Animation ended Callback.
template<class T>
class touchgfx::MoveAnimator< T >
A MoveAnimator makes the template class T able to animate a movement from its current position to a specified
end position. The movement in both the X and Y direction can be described by supplying EasingEquations. The
MoveAnimator performs a callback when the animation has finished.
This mixin can be used on any Drawable.
Template Parameters
7.113.2.1 MoveAnimator()
MoveAnimator ( ) [inline]
7.113.2.2 ∼MoveAnimator()
7.113.3.1 cancelMoveAnimation()
7.113.3.2 clearMoveAnimationEndedAction()
See also
setMoveAnimationEndedAction
7.113.3.3 getMoveAnimationDelay()
Returns
7.113.3.4 handleTickEvent()
7.113.3.5 isMoveAnimationRunning()
Returns
7.113.3.6 isRunning()
Returns
7.113.3.7 nextMoveAnimationStep()
Execute next step in move animation and stop the timer if necessary.
7.113.3.8 setMoveAnimationDelay()
void setMoveAnimationDelay (
uint16_t delay ) [inline], [virtual]
Parameters
delay The delay in ticks.
7.113.3.9 setMoveAnimationEndedAction()
void setMoveAnimationEndedAction (
GenericCallback< const MoveAnimator< T > & > & callback ) [inline]
Parameters
callback The callback to be executed. The callback will be given a reference to the MoveAnimator.
See also
GenericCallback
7.113.3.10 startMoveAnimation()
void startMoveAnimation (
int16_t endX,
int16_t endY,
uint16_t duration,
EasingEquation xProgressionEquation = &EasingEquations::linearEaseNone,
EasingEquation yProgressionEquation = &EasingEquations::linearEaseNone ) [inline]
Starts the move animation from the current position to the specified end position. The development of the position
(X, Y) during the animation is described by the supplied EasingEquations.
Parameters
endX The X position of T at animation end. Relative to the container or view that holds T.
endY The Y position of T at animation end. Relative to the container or view that holds T.
duration The duration of the animation measured in ticks.
xProgressionEquation The equation that describes the development of the X position during the animation.
Default = EasingEquations::linearEaseNone.
yProgressionEquation The equation that describes the development of the Y position during the animation.
Default = EasingEquations::linearEaseNone.
• MVPApplication ()
Default constructor.
• virtual ∼MVPApplication ()
Destructor.
• virtual void handlePendingScreenTransition ()
Handles the pending screen transition.
• void evaluatePendingScreenTransition ()
Evaluates the pending Callback instances.
Protected Attributes
• Presenter ∗ currentPresenter
Pointer to the currently active presenter.
• GenericCallback ∗ pendingScreenTransitionCallback
Callback for screen transitions. Will be set to something valid when a transition request is made.
A specialization of the TouchGFX Application class that provides the necessary glue for transitioning between
presenter/view pairs.
It maintains a callback for transitioning and evaluates this at each tick.
See also
Application
7.114.2.1 MVPApplication()
MVPApplication ( ) [inline]
Default constructor.
7.114.2.2 ∼MVPApplication()
Destructor.
7.114.3.1 evaluatePendingScreenTransition()
Evaluates the pending Callback instances. If a callback is valid, it is executed and a Screen transition is executed.
7.114.3.2 handlePendingScreenTransition()
Public Attributes
Generic heap class for MVP applications. Serves as a way of obtaining the memory storage areas for presenters,
screens, transitions and the concrete application.
Subclassed by an application-specific heap which provides the actual storage areas. This generic interface is used
only in makeTransition.
7.115.2.1 MVPHeap()
MVPHeap (
AbstractPartition & pres,
AbstractPartition & scr,
AbstractPartition & tra,
MVPApplication & app ) [inline]
Constructs an MVPHeap.
Parameters
in pres A memory partition containing enough memory to hold the largest presenter.
in scr A memory partition containing enough memory to hold the largest view.
in tra A memory partition containing enough memory to hold the largest transition.
in app A reference to the MVPApplication instance.
7.115.2.2 ∼MVPHeap()
Destructor.
This is an "empty" DMA subclass that does nothing except assert if accidentally used.
#include <touchgfx/hal/NoDMA.hpp>
• NoDMA ()
Default constructor.
• virtual BlitOperations getBlitCaps ()
No blit operations supported by this DMA implementation.
• virtual void setupDataCopy (const BlitOp &blitOp)
Asserts if used.
• virtual void setupDataFill (const BlitOp &blitOp)
Asserts if used.
• virtual void signalDMAInterrupt ()
Does nothing.
• virtual void flush ()
Does nothing.
This is an "empty" DMA subclass that does nothing except assert if accidentally used. An instance of this object
can be used if DMA support is not desired.
See also
DMA_Interface
7.116.2.1 NoDMA()
NoDMA ( ) [inline]
7.116.3.1 flush()
Block until all DMA transfers are complete. Since this particular DMA does not do anything, return immediately.
Reimplemented from DMA_Interface.
7.116.3.2 getBlitCaps()
Returns
Implements DMA_Interface.
7.116.3.3 setupDataCopy()
void setupDataCopy (
const BlitOp & blitOp ) [inline], [virtual]
Asserts if used.
Parameters
Implements DMA_Interface.
7.116.3.4 setupDataFill()
void setupDataFill (
const BlitOp & blitOp ) [inline], [virtual]
Asserts if used.
Parameters
Implements DMA_Interface.
7.116.3.5 signalDMAInterrupt()
Does nothing.
Implements DMA_Interface.
#include <NoTouchController.hpp>
Empty TouchController implementation which does nothing. Use this if your display does not have touch input
capabilities.
7.117.2.1 ∼NoTouchController()
Destructor.
7.117.3.1 init()
Empty initialization.
Implements TouchController.
7.117.3.2 sampleTouch()
bool sampleTouch (
int32_t & x,
int32_t & y ) [inline], [virtual]
Parameters
out x unused.
out y unused.
Returns
false.
Implements TouchController.
• NoTransition ()
Default constructor.
• virtual ∼NoTransition ()
Destructor.
• virtual void handleTickEvent ()
Indicates that the transition is done after the first tick.
See also
Transition
7.118.2.1 NoTransition()
NoTransition ( ) [inline]
Default constructor.
7.118.2.2 ∼NoTransition()
Destructor.
7.118.3.1 handleTickEvent()
This class specifies OS wrappers for dealing with the frame buffer semaphore and the VSYNC signal.
#include <touchgfx/hal/OSWrappers.hpp>
This class specifies OS wrappers for dealing with the frame buffer semaphore and the VSYNC signal.
7.119.2.1 giveFrameBufferSemaphore()
7.119.2.2 giveFrameBufferSemaphoreFromISR()
Release the frame buffer semaphore in a way that is safe in interrupt context. Called from ISR.
7.119.2.3 initialize()
7.119.2.4 signalVSync()
Signal that a VSYNC has occurred. Should make the vsync queue/mutex available.
Note
This function is called from an ISR, and should (depending on OS) trigger a scheduling.
7.119.2.5 takeFrameBufferSemaphore()
7.119.2.6 taskDelay()
A function that causes executing task to sleep for a number of milliseconds. This function is OPTIONAL. It is only
used by the TouchGFX in the case of a specific frame refresh strategy (REFRESH_STRATEGY_OPTIM_SING←-
LE_BUFFER_TFT_CTRL). Due to backwards compatibility, in order for this function to be useable by the HAL the
function must be explicitly registered: hal.registerTaskDelayFunction(&OSWrappers::taskDelay)
Parameters
See also
HAL::setFrameRefreshStrategy(FrameRefreshStrategy s)
HAL::registerTaskDelayFunction(void (∗delayF)(uint16_t))
7.119.2.7 tryTakeFrameBufferSemaphore()
Attempt to obtain the frame buffer semaphore. If semaphore is not available, do nothing.
Note
must return immediately! This function does not care who has the taken the semaphore, it only serves to
make sure that the semaphore is taken by someone.
7.119.2.8 waitForVSync()
Note
This function must first clear the mutex/queue and then wait for the next one to occur.
Public Types
• Outline ()
Default constructor.
• virtual ∼Outline ()
Destructor.
• void reset ()
Resets this object.
• void moveTo (int x, int y)
Move a virtual pen to the specified coordinate.
• void lineTo (int x, int y)
Create a line from the current virtual pen coordinate to the given coordinate creating an Outline.
• unsigned getNumCells () const
Gets number cells registered in the current drawn path for the Outline.
• const Cell ∗ getCells ()
Gets a pointer to the the Cell objects in the Outline.
• void setMaxRenderY (int y)
Sets maximum render y coordinate.
• bool wasOutlineTooComplex ()
Determines if there was enough memory to register the entire outline.
An internal class that implements the main rasterization algorithm. Used in the Rasterizer. Should not be used
direcly.
7.120.2.1 OutlineFlags_t
7.120.3.1 Outline()
Outline ( )
Default constructor.
7.120.3.2 ∼Outline()
∼Outline ( ) [virtual]
Destructor.
7.120.4.1 getCells()
Gets a pointer to the the Cell objects in the Outline. If the Outline is not closed, it is closed. If the Outline is unsorted,
it will be quick sorted first.
Returns
7.120.4.2 getNumCells()
Gets number cells registered in the current drawn path for the Outline.
Returns
7.120.4.3 lineTo()
void lineTo (
int x,
int y )
Create a line from the current virtual pen coordinate to the given coordinate creating an Outline.
Parameters
x The x coordinate.
y The y coordinate.
7.120.4.4 moveTo()
void moveTo (
int x,
int y )
Parameters
x The x coordinate.
y The y coordinate.
7.120.4.5 reset()
void reset ( )
Resets this object. This implies removing the current Cell objects and preparing for a new Outline.
7.120.4.6 setMaxRenderY()
void setMaxRenderY (
int y ) [inline]
Sets maximum render y coordinate. This is used to avoid registering any Cell that has a y coordinate less than zero
of higher than the given y.
Parameters
7.120.4.7 wasOutlineTooComplex()
Determines if there was enough memory to register the entire outline, of if the outline was too complex.
Returns
false if the buffer for Outline Cell objects was too small.
Protected Attributes
• uint8_t painterColor
The color to use when painting.
PainterBW is used for drawing one 1bpp displays. The color is either on or off No transparency is supported.
See also
AbstractPainter
7.121.2.1 bw()
static unsigned bw (
unsigned red,
unsigned green,
unsigned blue ) [static]
Converts the selected color to either white (1) or black (0) depending on the converted gray value.
Parameters
red The red color.
green The green color.
blue The blue color.
Returns
1 (white) if the brightness of the RGB color is above 50% and 0 (black) otherwise.
7.121.2.2 getColor()
Returns
The color.
7.121.2.3 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.121.2.4 renderNext()
Parameters
Returns
Implements AbstractPainterBW.
7.121.2.5 setColor()
void setColor (
colortype color )
Parameters
color The color, 0=black, otherwise white.
Protected Attributes
PainterBWBitmap will take the color for a given point in the shape from a bitmap. Please be aware, the the bitmap
is used by the CWR (not Shape), so any rotation you might specify for a Canvas Widget (e.g. Shape) is not applied
to the bitmap as CWR is not aware of this rotation.
See also
AbstractPainter
7.122.2.1 PainterBWBitmap()
PainterBWBitmap (
const Bitmap & bmp = Bitmap(BITMAP_INVALID) )
Constructor.
Parameters
bmp The bitmap.
7.122.3.1 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.122.3.2 renderInit()
Returns
7.122.3.3 renderNext()
Parameters
Returns
Implements AbstractPainterBW.
7.122.3.4 setBitmap()
void setBitmap (
const Bitmap & bmp )
Parameters
bmp The bitmap.
Protected Attributes
• uint8_t painterGray
The grey color.
• uint8_t painterAlpha
The alpha value.
The PainterGRAY2 class allows a shape to be filled with a given color and alpha value. This allows transparent,
anti-aliased elements to be drawn.
See also
AbstractPainter
7.123.2.1 PainterGRAY2()
PainterGRAY2 (
colortype color = 0,
uint8_t alpha = 255 )
Constructor.
Parameters
color the color.
alpha the alpha.
7.123.3.1 getAlpha()
Returns
See also
setAlpha
7.123.3.2 getColor()
Returns
The color.
7.123.3.3 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.123.3.4 renderNext()
Parameters
Returns
Implements AbstractPainterGRAY2.
7.123.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Parameters
alpha The alpha value to use.
7.123.3.6 setColor()
void setColor (
colortype color,
uint8_t alpha = 255 )
Parameters
color The color.
alpha The alpha.
Protected Attributes
PainterGRAY2Bitmap will take the color for a given point in the shape from a bitmap. Please be aware, the the
bitmap is used by the CWR (not Shape), so any rotation you might specify for a Canvas Widget (e.g. Shape) is not
applied to the bitmap as CWR is not aware of this rotation.
See also
AbstractPainter
7.124.2.1 PainterGRAY2Bitmap()
PainterGRAY2Bitmap (
const Bitmap & bmp = Bitmap(BITMAP_INVALID),
uint8_t alpha = 255 )
Constructor.
Parameters
bmp The bitmap.
alpha the alpha.
7.124.3.1 getAlpha()
Returns
See also
setAlpha
7.124.3.2 render()
unsigned count,
const uint8_t ∗ covers ) [virtual]
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.124.3.3 renderInit()
Returns
7.124.3.4 renderNext()
Parameters
Returns
Implements AbstractPainterGRAY2.
7.124.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Sets an alpha value for the bitmap. If the image contains an alpha channel, this alpha value is combined with the
alpha in the bitmap to produce the final alpha value.
Parameters
alpha The alpha value to use if there is no alpha channel in the bitmap.
7.124.3.6 setBitmap()
void setBitmap (
const Bitmap & bmp )
Parameters
bmp The bitmap.
Protected Attributes
• uint8_t painterGray
The grey color.
• uint8_t painterAlpha
The alpha value.
The PainterGRAY4 class allows a shape to be filled with a given color and alpha value. This allows transparent,
anti-aliased elements to be drawn.
See also
AbstractPainter
7.125.2.1 PainterGRAY4()
PainterGRAY4 (
colortype color = 0,
uint8_t alpha = 255 )
Constructor.
Parameters
color the color.
alpha the alpha.
7.125.3.1 getAlpha()
Returns
See also
setAlpha
7.125.3.2 getColor()
Returns
The color.
7.125.3.3 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.125.3.4 renderNext()
Parameters
Returns
Implements AbstractPainterGRAY4.
7.125.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Parameters
alpha The alpha value to use.
7.125.3.6 setColor()
void setColor (
colortype color,
uint8_t alpha = 255 )
Parameters
color The color.
alpha The alpha.
Protected Attributes
PainterGRAY4Bitmap will take the color for a given point in the shape from a bitmap. Please be aware, the the
bitmap is used by the CWR (not Shape), so any rotation you might specify for a Canvas Widget (e.g. Shape) is not
applied to the bitmap as CWR is not aware of this rotation.
See also
AbstractPainter
7.126.2.1 PainterGRAY4Bitmap()
PainterGRAY4Bitmap (
const Bitmap & bmp = Bitmap(BITMAP_INVALID),
uint8_t alpha = 255 )
Constructor.
Parameters
bmp The bitmap.
alpha the alpha.
7.126.3.1 getAlpha()
Returns
See also
setAlpha
7.126.3.2 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.126.3.3 renderInit()
Returns
7.126.3.4 renderNext()
Parameters
Returns
Implements AbstractPainterGRAY4.
7.126.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Sets an alpha value for the bitmap. If the image contains an alpha channel, this alpha value is combined with the
alpha in the bitmap to produce the final alpha value.
Parameters
alpha The alpha value to use if there is no alpha channel in the bitmap.
7.126.3.6 setBitmap()
void setBitmap (
const Bitmap & bmp )
Parameters
bmp The bitmap.
• virtual bool renderNext (uint8_t &red, uint8_t &green, uint8_t &blue, uint8_t &alpha)
Get the color of the next pixel in the scan line.
Protected Attributes
• uint16_t painterColor
The color.
• uint16_t painterRed
The red part of the color.
• uint16_t painterGreen
The green part of the color.
• uint16_t painterBlue
The blue part of the color.
• uint8_t painterAlpha
The alpha value.
The PainterRGB565 class allows a shape to be filled with a given color and alpha value. This allows transparent,
anti-aliased elements to be drawn.
See also
AbstractPainter
7.127.2.1 PainterRGB565()
PainterRGB565 (
colortype color = 0,
uint8_t alpha = 255 )
Constructor.
Parameters
color the color.
alpha the alpha.
7.127.3.1 getAlpha()
Returns
See also
setAlpha
7.127.3.2 getColor()
Returns
The color.
7.127.3.3 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
Parameters
y The y coordinate.
count Number of pixels to fill.
covers The coverage in of each pixel.
7.127.3.4 renderNext()
Parameters
out red The red.
out green The green.
out blue The blue.
out alpha The alpha.
Returns
Implements AbstractPainterRGB565.
7.127.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Parameters
alpha The alpha value to use.
7.127.3.6 setColor()
void setColor (
colortype color,
uint8_t alpha = 255 )
Parameters
color The color.
alpha The alpha.
Protected Attributes
PainterRGB565Bitmap will take the color for a given point in the shape from a bitmap. Please be aware, the the
bitmap is used by the CWR (not Shape), so any rotation you might specify for a Canvas Widget (e.g. Shape) is not
applied to the bitmap as CWR is not aware of this rotation.
See also
AbstractPainter
7.128.2.1 PainterRGB565Bitmap()
PainterRGB565Bitmap (
const Bitmap & bmp = Bitmap(BITMAP_INVALID),
uint8_t alpha = 255 )
Constructor.
Parameters
bmp The bitmap.
alpha the alpha.
7.128.3.1 getAlpha()
Returns
See also
setAlpha
7.128.3.2 render()
int xAdjust,
int y,
unsigned count,
const uint8_t ∗ covers ) [virtual]
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.128.3.3 renderInit()
Returns
7.128.3.4 renderNext()
Parameters
out red The red.
out green The green.
out blue The blue.
out alpha The alpha.
Returns
Implements AbstractPainterRGB565.
7.128.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Sets an alpha value for the bitmap. If the image contains an alpha channel, this alpha value is combined with the
alpha in the bitmap to produce the final alpha value.
Parameters
alpha The alpha value to use if there is no alpha channel in the bitmap.
7.128.3.6 setBitmap()
void setBitmap (
const Bitmap & bmp )
Parameters
bmp The bitmap.
• virtual bool renderNext (uint8_t &red, uint8_t &green, uint8_t &blue, uint8_t &alpha)
Get the color of the next pixel in the scan line.
Protected Attributes
• uint8_t painterRed
The red part of the color.
• uint8_t painterGreen
The green part of the color.
• uint8_t painterBlue
The blue part of the color.
• uint8_t painterAlpha
The alpha value.
The PainterRGB888 class allows a shape to be filled with a given color and alpha value. This allows transparent,
anti-aliased elements to be drawn.
See also
AbstractPainter
7.129.2.1 PainterRGB888()
PainterRGB888 (
colortype color = 0,
uint8_t alpha = 255 )
Constructor.
Parameters
color the color.
alpha the alpha.
7.129.3.1 getAlpha()
Returns
See also
setAlpha
7.129.3.2 getColor()
Returns
The color.
7.129.3.3 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.129.3.4 renderNext()
Parameters
out red The red.
out green The green.
out blue The blue.
out alpha The alpha.
Returns
Implements AbstractPainterRGB888.
7.129.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Parameters
alpha The alpha value to use.
7.129.3.6 setColor()
void setColor (
colortype color,
uint8_t alpha = 255 )
Parameters
color The color.
alpha The alpha.
Constructor.
• void setBitmap (const Bitmap &bmp)
Sets a bitmap to be used when drawing the CanvasWidget.
• void setAlpha (uint8_t alpha)
Sets an alpha value for the bitmap.
• uint8_t getAlpha () const
Gets the current alpha value.
• virtual void render (uint8_t ∗ptr, int x, int xAdjust, int y, unsigned count, const uint8_t ∗covers)
Paint a designated part of the RenderingBuffer.
Protected Attributes
PainterRGB888Bitmap will take the color for a given point in the shape from a bitmap. Please be aware, the the
bitmap is used by the CWR (not Shape), so any rotation you might specify for a Canvas Widget (e.g. Shape) is not
applied to the bitmap as CWR is not aware of this rotation.
See also
AbstractPainter
7.130.2.1 PainterRGB888Bitmap()
PainterRGB888Bitmap (
const Bitmap & bmp = Bitmap(BITMAP_INVALID),
uint8_t alpha = 255 )
Constructor.
Parameters
bmp The bitmap.
alpha the alpha.
7.130.3.1 getAlpha()
Returns
See also
setAlpha
7.130.3.2 render()
Paint a designated part of the RenderingBuffer with respect to the amount of coverage of each pixel given by the
parameter covers.
Parameters
7.130.3.3 renderInit()
Returns
7.130.3.4 renderNext()
Parameters
out red The red.
out green The green.
out blue The blue.
out alpha The alpha.
Returns
Implements AbstractPainterRGB888.
7.130.3.5 setAlpha()
void setAlpha (
uint8_t alpha )
Sets an alpha value for the bitmap. If the image contains an alpha channel, this alpha value is combined with the
alpha in the bitmap to produce the final alpha value.
Parameters
alpha The alpha value to use if there is no alpha channel in the bitmap.
7.130.3.6 setBitmap()
void setBitmap (
const Bitmap & bmp )
Parameters
bmp The bitmap.
• Pair ()
Default constructor.
• Pair (const T1 &x, const T2 &y)
Constructor initializing the elements it holds using their copy constructor.
• template<class U , class V >
Pair (const Pair< U, V > &p)
Copy constructor.
Public Attributes
• T1 first
The first element.
• T2 second
The second element.
Template Parameters
Pair ( ) [inline]
Pair (
const T1 & x,
const T2 & y ) [inline]
Parameters
Pair (
const Pair< U, V > & p ) [inline]
Copy constructor.
Template Parameters
Parameters
This type provides a concrete Partition of memory-slots capable of holding any of the specified list of types.
#include <common/Partition.hpp>
Public Types
• Partition ()
Default constructor.
• virtual ∼Partition ()
Destructor.
• virtual uint16_t capacity () const
Specialization of AbstractPartition::capacity().
• virtual uint32_t element_size ()
Specialization of AbstractPartition::element_size().
The Partition is not aware of the types stored in the Partition memory, hence it provides no mechanism for deleting
C++ objects when the Partition is clear()'ed.
This class implements AbstractPartition.
Template Parameters
See also
AbstractPartition
7.132.2.1 SupportedTypesList
ListOfTypes SupportedTypesList
anonymous enum
Compile-time generated constants specifying the "element" or "slot" size used by this partition
7.132.4.1 Partition()
Partition ( ) [inline]
7.132.5.1 capacity()
Specialization of AbstractPartition::capacity().
Returns
An uint16_t.
See also
touchgfx::AbstractPartition::capacity()
Implements AbstractPartition.
void ∗ element (
uint16_t index ) [inline], [protected], [virtual]
Parameters
Returns
See also
touchgfx::AbstractPartition::element()
Implements AbstractPartition.
Parameters
Returns
See also
touchgfx::AbstractPartition::element()
Implements AbstractPartition.
7.132.5.4 element_size()
Specialization of AbstractPartition::element_size().
Returns
An uint32_t.
See also
touchgfx::AbstractPartition::element_size()
Implements AbstractPartition.
• PixelDataWidget ()
Default constructor.
• virtual void draw (const touchgfx::Rect &invalidatedArea) const
Draw the part of the RAM buffer that is inside the invalidated area.
• virtual touchgfx::Rect getSolidRect () const
Report this widget as being completely solid.
• void setPixelData (uint8_t ∗const data)
Set the pixel data to display.
• void setBitmapFormat (Bitmap::BitmapFormat format)
Set the format of the pixel data.
• void setAlpha (uint8_t a)
Sets the alpha channel for the image.
• uint8_t getAlpha () const
Gets the current alpha value.
Protected Attributes
• uint8_t ∗ buffer
The buffer where the pixels are copied from.
• Bitmap::BitmapFormat format
The pixel format for the data.
• uint8_t alpha
The Alpha for this widget.
The buffer must be of size as widget. If the LCD is 16 bit the buffer must hold 2 bytes for each pixel. If the LCD is
24 bit the buffer must hold 3 bytes for each pixel.
See also
touchgfx::Widget
7.133.2.1 PixelDataWidget()
PixelDataWidget ( )
Default constructor.
7.133.3.1 draw()
void draw (
const touchgfx::Rect & invalidatedArea ) const [virtual]
Draw the part of the RAM buffer that is inside the invalidated area.
Parameters
See also
touchgfx::Drawable
Implements Drawable.
7.133.3.2 getAlpha()
Returns
See also
setAlpha
7.133.3.3 getSolidRect()
Returns
Implements Drawable.
7.133.3.4 setAlpha()
void setAlpha (
uint8_t a )
Parameters
a The alpha value. 255 = completely solid.
7.133.3.5 setBitmapFormat()
void setBitmapFormat (
Bitmap::BitmapFormat format )
Parameters
7.133.3.6 setPixelData()
void setPixelData (
uint8_t ∗const data )
Parameters
Public Attributes
• int32_t x
The x coordinate.
• int32_t y
The y coordinate.
7.134.1.1 dist_sqr()
unsigned dist_sqr (
struct Point & o ) [inline]
Parameters
in o The point to get the squared distance to.
Returns
A 3D point.
#include <touchgfx/hal/Types.hpp>
Public Attributes
• fixed28_4 X
The X coordinate.
• fixed28_4 Y
The Y coordinate.
• float Z
The Z coordinate.
• float U
The U coordinate.
• float V
The V coordinate.
• Point4 ()
Default constructor.
• Point4 (float x, float y, float z)
Constructor.
See also
quadruple
Point4 ( ) [inline]
Default constructor.
Point4 (
float x,
float y,
float z ) [inline]
Constructor.
Parameters
x The x value.
y The y value.
z The z value.
• PreRenderable ()
Default constructor.
• void draw (const Rect &invalidatedArea) const
Overrides the draw function.
• virtual void setupDrawChain (const Rect &invalidatedArea, Drawable ∗∗nextPreviousElement)
Add to draw chain.
• bool isPreRendered () const
Whether or not the snapshot of the widget been taken.
• void preRender ()
Takes a snapshot of the current visual appearance of this widget.
template<class T>
class touchgfx::PreRenderable< T >
This mixin can be used on any Drawable. It provides a preRender function, which will cache the current visual
appearance of the Drawable to be cache in a memory region. Subsequent calls to draw() on this Drawable will
result in a simple memcpy of the cached memory instead of the normal draw operation. This mixin can therefore be
used on Drawables whose visual appearance is static and the normal draw operation takes a long time to compute.
Note
The actual uses of this mixin are rare, and the class is mainly provided for example purposes.
Template Parameters
7.137.2.1 PreRenderable()
PreRenderable ( ) [inline]
7.137.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [inline]
Overrides the draw function. If preRender has been called, perform a memcpy of the cached version. If not, just call
the base class version of draw.
Parameters
7.137.3.2 isPreRendered()
Returns
7.137.3.3 preRender()
Takes a snapshot of the current visual appearance of this widget. All subsequent calls to draw on this mixin will
result in the snapshot being draw.
7.137.3.4 setupDrawChain()
void setupDrawChain (
const Rect & invalidatedArea,
Drawable ∗∗ nextPreviousElement ) [inline], [virtual]
Note
Parameters
invalidatedArea Include drawables that intersect with this area only.
in,out nextPreviousElement Modifiable element in linked list.
The Presenter base class that all application-specific presenters should derive from.
#include <mvp/Presenter.hpp>
• Presenter ()
Default constructor.
The Presenter base class that all application-specific presenters should derive from. Only contains activate and
deactivate virtual functions which are called automatically during screen transition.
7.138.2.1 ∼Presenter()
Destructor.
7.138.2.2 Presenter()
Default constructor.
7.138.3.1 activate()
The activate function is called automatically when a screen transition causes this Presenter to become active. Place
initialization code for the Presenter here.
7.138.3.2 deactivate()
The deactivate function is called automatically when a screen transition causes this Presenter to become inactive.
Place cleanup code for the Presenter here.
• Q10 ()
Default constructor.
• Q10 (int i)
Constructor from integer.
• operator int () const
Gets the Q10 as an integer without conversion.
• Q10 operator- () const
Negation operator.
• Q10 operator+ (const Q10 &q10) const
Addition operator.
• Q15 operator∗ (const Q5 &q5) const
Multiplication operator.
• Q5 operator/ (const Q5 &q5) const
Division operator.
Defines a number with 10 bits reserved for the fractional part of the decimal number. Q10 implements some simple
arithmetic operations, most yielding a Q10 number and some yielding a Q5 number or a Q15 number as a result.
Q5∗Q5=Q10, Q10/Q5=Q5, ...
See also
Q5
Q15
http://en.wikipedia.org/wiki/Q_%28number_format%29
http://en.wikipedia.org/wiki/Fixed-point_arithmetic
Q10 ( ) [inline]
Default constructor.
Q10 (
int i ) [inline], [explicit]
Constructor from integer. No conversion is done - the integer is assumed to already be in Q10 format.
Parameters
Returns
7.139.3.2 operator∗()
Q15 operator∗ (
const Q5 & q5 ) const [inline]
Multiplication operator. The result is a Q15, not a Q10, for increased precision.
Parameters
Returns
7.139.3.3 operator+()
Q10 operator+ (
const Q10 & q10 ) const [inline]
Addition operator.
Parameters
Returns
7.139.3.4 operator-()
Negation operator.
Returns
7.139.3.5 operator/()
Q5 operator/ (
const Q5 & q5 ) const [inline]
Division operator.
Parameters
Returns
• Q15 (int i)
Constructor from integer. No conversion is done - the integer is assumed to already be in Q15 format.
• operator int () const
Gets the Q15 as an integer without conversion.
• Q15 operator- () const
Negation operator.
Defines a number with 15 bits reserved for the fractional part of the decimal number. Q15 is only used for sine/cosine
and for intermediate calculations when multiplying.
Q5∗Q5=Q10, Q10/Q5=Q5, ...
See also
Q5
Q10
http://en.wikipedia.org/wiki/Q_%28number_format%29
http://en.wikipedia.org/wiki/Fixed-point_arithmetic
7.140.2.1 Q15()
Q15 (
int i ) [inline], [explicit]
Constructor from integer. No conversion is done - the integer is assumed to already be in Q15 format.
Parameters
Returns
7.140.3.2 operator+()
Q15 operator+ (
const Q15 & q15 ) const [inline]
Addition operator.
Parameters
Returns
7.140.3.3 operator-()
Negation operator.
Returns
7.140.3.4 operator/()
Q10 operator/ (
const Q5 & q5 ) const [inline]
Parameters
Returns
• Q5 ()
Default constructor.
• Q5 (int i)
Constructor from integer.
• Q5 (const Q10 q10)
Constructor from Q10.
Defines a number with 5 bits reserved for the fractional part of the decimal number. Q5 implements some simple
arithmetic operations, most yielding a Q5 number and some yielding a Q10 number as a result. Other operations
also work with Q15 numbers.
See also
Q10
Q15
http://en.wikipedia.org/wiki/Q_%28number_format%29
http://en.wikipedia.org/wiki/Fixed-point_arithmetic
Q5 (
int i ) [inline], [explicit]
Constructor from integer. No conversion is done - the integer is assumed to already be in Q5 format.
Parameters
Q5 (
const Q10 q10 ) [inline]
Parameters
See also
Q10
Returns
Q10 operator∗ (
const Q5 & q5 ) const [inline]
Multiplication operator. The result is a Q10, not a Q5, for increased precision.
Parameters
Returns
See also
Q10
Q5 operator∗ (
const Q15 & q15 ) const [inline]
Multiplication operator. Often used in relation with sine and cosine calculation which are pre-calculated as Q15. As
the result is needed as a Q5, this operator multiplies with the given Q15 and converts the result to a Q5.
Parameters
Returns
See also
Q15
Q5 operator∗ (
const int i ) const [inline]
Multiplication operator.
Parameters
i The integer to multiply this with.
Returns
7.141.3.5 operator+()
Q5 operator+ (
const Q5 & q5 ) const [inline]
Addition operator.
Parameters
Returns
Negation operator.
Returns
Q5 operator- (
const Q5 & q5 ) const [inline]
Subtraction operator.
Parameters
Returns
Q5 operator/ (
const int i ) const [inline]
Division operator.
Parameters
i The integer to divide this by.
Returns
Q5 operator/ (
const Q5 q5 ) const [inline]
Division operator. Internally this Q5 is converted to Q10 before the division to increased precision.
Parameters
Returns
See also
Q10
7.141.3.10 to()
Convert the Q5 value to an integer by removing the 5 bits used for the fraction, or to a floating point value by dividing
by 32, depending on the type specified as T.
Template Parameters
Returns
Q5 value as a type T.
• Quadruple ()
Default constructor.
• Quadruple (float x, float y, float z, float w)
Constructor.
Protected Attributes
Quadruple (
float x,
float y,
float z,
float w ) [inline], [protected]
Constructor.
Parameters
x The x value.
y The y value.
z The z value.
w The w value.
7.142.3.1 getElement()
float getElement (
int row ) const [inline]
Gets an element.
Parameters
row The row.
Returns
The element.
7.142.3.2 getW()
Gets the w.
Returns
The w.
7.142.3.3 getX()
Get x coordinate.
Returns
The x coordinate.
7.142.3.4 getY()
Get y coordinate.
Returns
The y coordinate.
7.142.3.5 getZ()
Get z coordinate.
Returns
The z coordinate.
7.142.3.6 setElement()
void setElement (
int row,
float value ) [inline]
Sets an element.
Parameters
row The row.
value The value.
7.142.3.7 setW()
void setW (
float value ) [inline]
Sets a w.
Parameters
value The value.
7.142.3.8 setX()
void setX (
float value ) [inline]
Sets an x coordinate.
Parameters
value The value.
7.142.3.9 setY()
void setY (
float value ) [inline]
Sets a y coordinate.
Parameters
value The value.
7.142.3.10 setZ()
void setZ (
float value ) [inline]
Sets a z coordinate.
Parameters
value The value.
• RadioButton ()
Default constructor.
• virtual ∼RadioButton ()
Destructor.
• virtual void draw (const Rect &invalidatedArea) const
Draws the given invalidated area.
• virtual void handleClickEvent (const ClickEvent &event)
Updates the current state of the radio button.
• virtual void setBitmaps (const Bitmap &bmpUnselected, const Bitmap &bmpUnselectedPressed, const
Bitmap &bmpSelected, const Bitmap &bmpSelectedPressed)
Sets the bitmaps used by this button.
• void setDeselectedAction (GenericCallback< const AbstractButton & > &callback)
Associates an action to be performed when the AbstractButton is deselected.
• virtual Rect getSolidRect () const
Gets solid rectangle.
• void setAlpha (uint8_t alpha)
Sets the alpha channel for the image.
• uint8_t getAlpha () const
Gets the current alpha value.
• void setDeselectionEnabled (bool state)
States whether or not it is possible to de-select the RadioButton by clicking it.
• bool getDeselectionEnabled () const
Gets the current deselectionEnabled state.
• void setSelected (bool newSelected)
Sets the radio buttons selected state.
• bool getSelected () const
Gets the current selected state.
• Bitmap getCurrentlyDisplayedBitmap () const
Gets currently displayed bitmap.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
• Bitmap bitmapUnselected
The image to display when radio button unselected.
• Bitmap bitmapUnselectedPressed
The image to display when radio button unselected and pressed.
• Bitmap bitmapSelected
The image to display when radio button selected.
• Bitmap bitmapSelectedPressed
The image to display when radio button selected and pressed.
• uint8_t alpha
The current alpha value. 255 denotes solid, 0 denotes completely transparent.
• bool selected
The current selected state.
• bool deselectionEnabled
Is de-selecting a selected radio button by clicking it enabled.
• GenericCallback< const AbstractButton &> ∗ deselectedAction
The callback to be executed when this AbstractButton is unselected.
A radio button consists of four images, one for its not selected and one for selected. Each of these have an image
for a pressed state. RadioButtons can be added to a RadioButtonGroup which handles the de-selection of radio
buttons when a new selection is made.
See also
AbstractButton
7.143.2.1 RadioButton()
RadioButton ( ) [inline]
Default constructor.
7.143.2.2 ∼RadioButton()
Destructor.
7.143.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
See also
Drawable::draw()
Implements Drawable.
7.143.3.2 getAlpha()
Returns
7.143.3.3 getCurrentlyDisplayedBitmap()
Function to obtain the currently displayed bitmap, which depends on the radio button's pressed and selected state.
Returns
7.143.3.4 getDeselectionEnabled()
Returns
7.143.3.5 getSelected()
Returns
7.143.3.6 getSolidRect()
Returns
largest possible solid rect. Delegated to the largest solid rect of the radio button bitmap(s).
Implements Drawable.
7.143.3.7 getType()
Returns
TYPE_RADIOBUTTON.
7.143.3.8 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [virtual]
Updates the current state of the radio button - pressed or released, selected or not selected - and invalidates it.
If a transition from the not selected to selected was made, the associated action is executed and then the Widget is
invalidated.
Parameters
See also
Drawable::handleClickEvent()
7.143.3.9 setAlpha()
void setAlpha (
uint8_t alpha ) [inline]
Parameters
alpha The alpha value. 255 = completely solid.
7.143.3.10 setBitmaps()
void setBitmaps (
const Bitmap & bmpUnselected,
const Bitmap & bmpUnselectedPressed,
const Bitmap & bmpSelected,
const Bitmap & bmpSelectedPressed ) [virtual]
Sets the bitmaps used by this button. If no special pressed states are needed just specify the same bitmap for both
pressed and non-pressed bitmaps.
Parameters
bmpUnselected Bitmap to use when button is unselected.
bmpUnselectedPressed Bitmap to use when button is unselected and pressed.
bmpSelected Bitmap to use when button is selected.
bmpSelectedPressed Bitmap to use when button is selected and pressed.
7.143.3.11 setDeselectedAction()
void setDeselectedAction (
GenericCallback< const AbstractButton & > & callback ) [inline]
Parameters
callback The callback to be executed. The callback will be given a reference to the AbstractButton.
See also
GenericCallback
7.143.3.12 setDeselectionEnabled()
void setDeselectionEnabled (
bool state ) [inline]
Parameters
7.143.3.13 setSelected()
void setSelected (
bool newSelected )
Parameters
• RadioButtonGroup ()
Default constructor.
• virtual ∼RadioButtonGroup ()
Destructor.
• virtual void add (RadioButton &radioButton)
Add the RadioButton to the RadioButtonGroup.
• virtual RadioButton ∗ getRadioButton (uint16_t index) const
Gets the RadioButton at the specified index.
• virtual int32_t getSelectedRadioButtonIndex () const
Gets the index of the selected RadioButton.
• virtual RadioButton ∗ getSelectedRadioButton () const
Gets the selected RadioButton.
• virtual void setSelected (RadioButton &radioButton)
Sets the specified RadioButton to be selected.
• virtual void setDeselectionEnabled (bool deselectionEnabled)
Sets whether or not it is possible to deselect RadioButtons by clicking them when they are selected.
• virtual bool getDeselectionEnabled () const
Gets the current deselectionEnabled state.
• void setRadioButtonSelectedHandler (GenericCallback< const AbstractButton & > &callback)
Associate an action with a radio button.
• void setRadioButtonDeselectedHandler (GenericCallback< const AbstractButton & > &callback)
Associate an action with a radio button.
Protected Attributes
template<uint16_t CAPACITY>
class touchgfx::RadioButtonGroup< CAPACITY >
Class for handling a collection of RadioButtons. The RadioButtonGroup handles the de-selection of radio buttons
when a new selection occurs. A callback is executed when a new selection occurs reporting the newly selected
RadioButton.
Template class: specify a CAPACITY, that is the number of RadioButtons to store.
Template Parameters
See also
RadioButton
7.144.2.1 RadioButtonGroup()
RadioButtonGroup ( ) [inline]
Default constructor.
7.144.2.2 ∼RadioButtonGroup()
Destructor.
7.144.3.1 add()
void add (
RadioButton & radioButton ) [inline], [virtual]
Add the RadioButton to the RadioButtonGroup. Only add as many RadioButtons as the stated CAPACITY. Checked
by an assert.
Parameters
in radioButton the RadioButton that is to be added.
7.144.3.2 getDeselectionEnabled()
Returns
7.144.3.3 getRadioButton()
RadioButton ∗ getRadioButton (
uint16_t index ) const [inline], [virtual]
Parameters
Returns
7.144.3.4 getSelectedRadioButton()
Returns
7.144.3.5 getSelectedRadioButtonIndex()
Returns
7.144.3.6 radioButtonClickedHandler()
void radioButtonClickedHandler (
const AbstractButton & radioButton ) [inline], [protected], [virtual]
Handles the event that a RadioButton has been selected. deselects all other RadioButtons.
Parameters
radioButton the RadioButton that has been selected.
7.144.3.7 radioButtonDeselectedHandler()
void radioButtonDeselectedHandler (
const AbstractButton & radioButton ) [inline], [protected], [virtual]
Parameters
radioButton the RadioButton that has been deselected.
7.144.3.8 setDeselectionEnabled()
void setDeselectionEnabled (
bool deselectionEnabled ) [inline], [virtual]
Sets whether or not it is possible to deselect RadioButtons by clicking them when they are selected.
Parameters
7.144.3.9 setRadioButtonDeselectedHandler()
void setRadioButtonDeselectedHandler (
GenericCallback< const AbstractButton & > & callback ) [inline]
Associates an action to be performed when a radio button belonging to this group transition from selected to unse-
lected.
Parameters
callback The callback to be executed. The callback will be given a reference to the RadioButton that was
selected.
See also
GenericCallback
7.144.3.10 setRadioButtonSelectedHandler()
void setRadioButtonSelectedHandler (
GenericCallback< const AbstractButton & > & callback ) [inline]
Associates an action to be performed when a radio button belonging to this group is selected.
Parameters
callback The callback to be executed. The callback will be given a reference to the RadioButton that was
selected.
See also
GenericCallback
7.144.3.11 setSelected()
void setSelected (
RadioButton & radioButton ) [inline], [virtual]
Sets the specified RadioButton to be selected and deselects all other. Do not call before all RadioButtons have
been added to the RadioButtonGroup. Will call the radioButtonSelected callback.
Parameters
in radioButton the RadioButton to be selected.
Polygon Rasterizer that is used to render filled polygons with high-quality Anti- Aliasing.
#include <touchgfx/canvas_widget_renderer/Rasterizer.hpp>
Public Types
• Rasterizer ()
Default constructor.
• void reset ()
Resets this object.
• void setFillingRule (FillingRule fillingRule)
Sets the filling rule to be used when rendering the outline.
• void moveTo (int x, int y)
Move to.
• void lineTo (int x, int y)
Line to.
• unsigned calculateAlpha (int area) const
Calculates the alpha.
• template<class Renderer >
bool render (Renderer &r)
Renders this object.
• void setMaxRenderY (int y)
Sets maximum render y coordinate.
• bool wasOutlineTooComplex ()
Determines if we the outline was too complex to draw completely.
Polygon Rasterizer that is used to render filled polygons with high-quality Anti- Aliasing. Internally, by default, the
class uses integer coordinates in format 24.8, i.e. 24 bits for integer part and 8 bits for fractional - see POLY_BA←-
SE_SHIFT. This class can be used in the following way:
2. reset()
3. moveTo(x, y) / lineTo(x, y) - make the polygon. One can create more than one contour, but each contour must
consist of at least 3 vertices, i.e. moveTo(x1, y1); lineTo(x2, y2); lineTo(x3, y3); is the absolute minimum of
vertices that define a triangle. The algorithm does not check either the number of vertices nor coincidence
of their coordinates, but in the worst case it just won't draw anything. The order of the vertices (clockwise
or counterclockwise) is important when using the non-zero filling rule (fill_non_zero). In this case the vertex
order of all the contours must be the same if you want your intersecting polygons to be without "holes". You
actually can use different vertices order. If the contours do not intersect each other the order is not important
anyway. If they do, contours with the same vertex order will be rendered without "holes" while the intersecting
contours with different orders will have "holes".
anonymous enum
Enumerator
anonymous enum
Enumerator
AA_SHIFT Number of bits reserved for fraction part when calculating the area.
AA_NUM The value to divide or multiply with to convert to / from this format.
AA_MASK The value used to mask the fraction.
AA_2NUM Number of fraction bits when multiplying two area numbers.
AA_2MASK Mask for fraction bits when multiplying two area numbers.
7.145.2.3 FillingRule
enum FillingRule
Enumerator
FILL_NON_ZERO Filling rule to fill anything inside the outmost border of the outline.
FILL_EVEN_ODD Filling rule to fill using xor rule inside the outline.
7.145.3.1 Rasterizer()
Rasterizer ( ) [inline]
Default constructor.
7.145.4.1 calculateAlpha()
unsigned calculateAlpha (
int area ) const [inline]
Parameters
area The area.
Returns
7.145.4.2 lineTo()
void lineTo (
int x,
int y ) [inline]
Line to.
Parameters
x The x coordinate.
y The y coordinate.
7.145.4.3 moveTo()
void moveTo (
int x,
int y ) [inline]
Move to.
Parameters
x The x coordinate.
y The y coordinate.
7.145.4.4 render()
Template Parameters
Parameters
in r The Renderer to process.
Returns
true there was enough memory available to draw the outline and render the graphics, false if there was
insufficient memory and nothing was drawn.
7.145.4.5 reset()
Resets this object. Basically this is done by resetting the the Outline.
7.145.4.6 setFillingRule()
void setFillingRule (
FillingRule fillingRule ) [inline]
Parameters
7.145.4.7 setMaxRenderY()
void setMaxRenderY (
int y ) [inline]
Sets maximum render y coordinate. This is passed to the Outline to avoid registering any Cell that has a y coordinate
less than zero of higher than the given y.
Parameters
7.145.4.8 wasOutlineTooComplex()
Returns
• Rect ()
Default constructor.
• Rect (int16_t x, int16_t y, int16_t width, int16_t height)
Constructor.
• int16_t right () const
Gets the x coordinate of the right edge of the Rect.
• int16_t bottom () const
Gets the y coordinate of the bottom edge of the Rect.
• bool intersect (int16_t otherX, int16_t otherY) const
Determines whether specified point lies inside this rectangle.
• bool intersect (const Rect &other) const
Determines whether specified rectangle intersects with this rectangle.
• bool includes (const Rect &other) const
Determines whether the specified rectangle is completely included in this rectangle.
• Rect operator& (const Rect &other) const
Gets a rectangle describing the intersecting area between this rectangle and the supplied rectangle.
• void operator&= (const Rect &other)
Assigns this Rect to the intersection of the current Rect and the assigned Rect.
• void expandToFit (const Rect &other)
Increases the area covered by this rectangle to encompass the area covered by supplied rectangle.
• bool operator== (const Rect &other) const
Compares equality of two Rect by the dimensions and position of these.
• bool operator!= (const Rect &other) const
Opposite of the == operator.
• bool isEmpty () const
Public Attributes
• int16_t x
The x coordinate.
• int16_t y
The y coordinate.
• int16_t width
The width.
• int16_t height
The height.
Rect ( ) [inline]
Rect (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [inline]
Constructor.
Parameters
x The x coordinate.
y The y coordinate.
width The width.
height The height.
7.146.3.1 area()
Returns
7.146.3.2 bottom()
Returns
7.146.3.3 expandToFit()
void expandToFit (
const Rect & other ) [inline]
Increases the area covered by this rectangle to encompass the area covered by supplied rectangle.
Parameters
other The other rectangle.
7.146.3.4 includes()
bool includes (
const Rect & other ) const [inline]
Parameters
other The other rectangle.
Returns
bool intersect (
int16_t otherX,
int16_t otherY ) const [inline]
Parameters
Returns
bool intersect (
const Rect & other ) const [inline]
Parameters
other The other rectangle.
Returns
7.146.3.7 isEmpty()
Returns
7.146.3.8 operator"!=()
bool operator!= (
const Rect & other ) const [inline]
Parameters
other The Rect to compare with.
Returns
7.146.3.9 operator&()
Gets a rectangle describing the intersecting area between this rectangle and the supplied rectangle.
Parameters
other The other rectangle.
Returns
7.146.3.10 operator&=()
Assigns this Rect to the intersection of the current Rect and the assigned Rect. The assignment will result in a
Rect(0, 0, 0, 0) if they do not intersect.
Parameters
other The rect to intersect with.
7.146.3.11 operator==()
bool operator== (
const Rect & other ) const [inline]
Parameters
other The Rect to compare with.
Returns
true if the compared Rect have the same dimensions and coordinates.
7.146.3.12 right()
Returns
• Renderer ()
Default constructor.
• Renderer (RenderingBuffer &renderingBuffer, AbstractPainter &painter)
Constructor.
• void setRenderingBuffer (RenderingBuffer &renderingBuffer)
Sets rendering buffer.
• void render (const Scanline &scanline)
Render the given Scanline in the given color.
• RenderingBuffer & getRenderingBuffer ()
Gets the getRenderingBuffer.
This class template is used basically for rendering scanlines. The 'Span' argument is one of the span renderers,
such as SpanRGB565 and others.
Renderer ( ) [inline]
Default constructor. Function setRenderingBuffer() should be called to specify where the polygon should be ren-
dered.
Renderer (
RenderingBuffer & renderingBuffer,
AbstractPainter & painter ) [inline]
Constructor.
Parameters
7.147.3.1 getRenderingBuffer()
Returns
A RenderingBuffer&
7.147.3.2 render()
void render (
const Scanline & scanline ) [inline]
Parameters
7.147.3.3 setRenderingBuffer()
void setRenderingBuffer (
RenderingBuffer & renderingBuffer ) [inline]
Parameters
• RenderingBuffer ()
Default constructor.
• ∼RenderingBuffer ()
Destructor.
• RenderingBuffer (unsigned char ∗buf_, unsigned char xAdjust_, unsigned width_, unsigned height_, int
stride_)
Constructor.
• void attach (unsigned char ∗buf_, unsigned char xAdjust_, unsigned width_, unsigned height_, int stride_)
Attaches a buffer.
• unsigned char getXAdjust () const
Gets x coordinate adjust.
• unsigned getWidth () const
Gets the width.
• unsigned getHeight () const
Gets the height.
• bool inbox (int x, int y) const
Tests if a given coordinate is inside the RenderingBuffer.
• unsigned char ∗ row (unsigned y)
Gets a pointer to the given row in the RenderingBuffer.
• const unsigned char ∗ row (unsigned y) const
Gets a pointer to the given row in the RenderingBuffer.
Rendering buffer wrapper. This class does not know anything about memory organizations, all it does it keeps an
array of pointers to each pixel row. The general rules of rendering are as follows.
1. Allocate or create somehow a rendering buffer itself. Since the library does not depend on any particular plat-
form or architecture it was decided that it's your responsibility to create and destroy rendering buffers properly.
You can use any available mechanism to create it - you can use a system API function, simple memory allo-
cation, or even statically defined array. You also should know the memory organization (or possible variants)
in your system. For example, there's an R,G,B or B,G,R organizations with one byte per component (three
bytes per pixel) is used very often. So, if you intend to use class render_bgr24, for example, you should
allocate at least width∗height∗3 bytes of memory.
2. Create a RenderingBuffer object and then call method attach(). It requires a pointer to the buffer itself, width
and height of the buffer in pixels, and the length of the row in bytes. All these values must properly correspond
to the memory organization. The argument stride is used because in reality the row length in bytes does not
obligatory correspond with the width of the image in pixels, i.e. it cannot be simply calculated as width_in_←-
pixels ∗ bytes_per_pixel. For example, it must be aligned to 4 bytes in Windows bitmaps. Method attach() can
be called more than once. The execution time of it is very little, still it allocates memory of heigh ∗ sizeof(char∗)
bytes and has a loop while (height–) {...}, so it's unreasonable to call it every time before drawing any single
pixel :-)
3. Create an object (or a number of objects) of a rendering class, such as renderer_bgr24_solid, renderer←-
_bgr24_image and so on. These classes require a pointer to the RenderingBuffer object, but they do not
perform any considerable operations except storing this pointer. So, rendering objects can be created on
demand almost any time. These objects know about concrete memory organization (this knowledge is hard
coded), so actually, the memory you allocated or created in clause 1 should actually be in correspondence to
the needs of the rendering class.
5. Display the result, or store it, or whatever. It's also your responsibility and depends on the platform.
RenderingBuffer ( )
Default constructor.
7.148.2.2 ∼RenderingBuffer()
∼RenderingBuffer ( )
Destructor.
RenderingBuffer (
unsigned char ∗ buf_,
unsigned char xAdjust_,
unsigned width_,
unsigned height_,
int stride_ )
Constructor.
Parameters
7.148.3.1 attach()
void attach (
unsigned char ∗ buf_,
unsigned char xAdjust_,
unsigned width_,
unsigned height_,
int stride_ )
Attaches a buffer. Can be used if the buffer is not ready when the Rendering buffer is created initially.
Parameters
7.148.3.2 getHeight()
Returns
The height.
7.148.3.3 getWidth()
Returns
The width.
7.148.3.4 getXAdjust()
Returns
7.148.3.5 inbox()
bool inbox (
int x,
int y ) const [inline]
Parameters
x The x coordinate.
y The y coordinate.
Returns
Parameters
y The line number, ie the row.
Returns
Parameters
y The line number, ie the row.
Returns
• RepeatButton ()
Default constructor.
A button consists of two images, one for its normal state and one when it is pressed down. The button activates its
pressed action immediately, the after a given delay and then repeatedly after an interval.
See also
Button
7.149.2.1 RepeatButton()
RepeatButton ( )
See also
setDelay
setInterval
7.149.3.1 getDelay()
Returns
The delay.
See also
setDelay
7.149.3.2 getInterval()
Returns
The interval.
7.149.3.3 handleClickEvent()
void handleClickEvent (
const touchgfx::ClickEvent & event ) [virtual]
Handles the click event by immediately activating the button and then setting up a timer to repeatedly activate the
button.
Parameters
event The event.
7.149.3.4 handleTickEvent()
Handles the tick event that takes care of counting down until the next time the buttons should be activated.
Reimplemented from Drawable.
7.149.3.5 setDelay()
void setDelay (
int delay ) [virtual]
Sets the number of ticks from the first button activation until the next time it gets activated.
Parameters
delay The delay.
See also
setInterval
getDelay
7.149.3.6 setInterval()
void setInterval (
int interval ) [virtual]
Sets the interval in number of ticks between each each activation of the pressed button.
Parameters
interval The interval.
See also
setDelay
getInterval
• RepeatButtonTrigger ()
Default constructor.
• virtual ∼RepeatButtonTrigger ()
Destructor.
• void setDelay (int delay)
Sets a delay.
• int getDelay ()
Gets the delay.
• void setInterval (int interval)
Sets an interval.
• int getInterval ()
Gets the interval.
• void handleClickEvent (const touchgfx::ClickEvent &event)
Handles the click event described by event.
• void handleTickEvent ()
Handles the tick event.
A repeat button trigger. This trigger will create a button that reacts to a consistent touch. This means it will call the
action repeatedly as long as it is touched.
The RepeatButtonTrigger can be combined with one or more of the ButtonStyle classes to create a functional button.
7.150.2.1 getDelay()
Returns
The delay.
7.150.2.2 getInterval()
Returns
The interval.
7.150.2.3 handleClickEvent()
void handleClickEvent (
const touchgfx::ClickEvent & event ) [inline], [virtual]
Parameters
event The event.
7.150.2.4 setDelay()
void setDelay (
int delay ) [inline]
Parameters
delay The delay.
7.150.2.5 setInterval()
void setInterval (
int interval ) [inline]
Parameters
interval The interval.
Public Types
• ScalableImage ()
Default constructor.
• virtual ∼ScalableImage ()
Destructor.
• virtual void setBitmap (const Bitmap &bmp)
Sets the bitmap for the image.
• Bitmap getBitmap () const
Gets the bitmap for the image.
• virtual void setAlpha (uint8_t alpha)
Sets the alpha channel for the image.
• virtual uint8_t getAlpha () const
Gets the current alpha value.
• virtual void setScalingAlgorithm (ScalingAlgorithm algorithm)
Sets the algorithm to be used.
• virtual ScalingAlgorithm getScalingAlgorithm ()
Gets the algorithm used when rendering.
• virtual void draw (const Rect &invalidatedArea) const
Draws the given invalidated area.
• virtual Rect getSolidRect () const
Gets solid rectangle.
• virtual uint16_t getType () const
For GUI testing only.
• void drawTriangle (const Rect &invalidatedArea, uint16_t ∗fb, const float ∗triangleXs, const float ∗triangleYs,
const float ∗triangleZs, const float ∗triangleUs, const float ∗triangleVs) const
Draw a triangle part of the bitmap.
• RenderingVariant lookupRenderVariant () const
Looks up the appropriate render variant based on the bitmap format and scaling algorithm.
Protected Attributes
• ScalingAlgorithm currentScalingAlgorithm
The current scaling algorithm.
• Bitmap bitmap
The bitmap to render.
• uint8_t alpha
An alpha value that is applied to the entire image.
Widget for representing a scaled version of a bitmap. Simply change the width/height of the widget to resize the
image. The quality of the scaled image depends of the rendering algorithm used. The rendering algorithm can
be changed dynamically. Please note that scaling images is done at runtime and requires a lot of calculations.
Therefore use it with some care.
Note that this widget does not support 1 bit per pixel color depth.
See also
Widget
7.151.2.1 ScalingAlgorithm
enum ScalingAlgorithm
7.151.3.1 ScalableImage()
ScalableImage ( )
Default constructor.
7.151.3.2 ∼ScalableImage()
∼ScalableImage ( ) [virtual]
Destructor.
7.151.4.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
See also
Drawable::draw()
Implements Drawable.
7.151.4.2 drawTriangle()
void drawTriangle (
const Rect & invalidatedArea,
uint16_t ∗ fb,
const float ∗ triangleXs,
const float ∗ triangleYs,
const float ∗ triangleZs,
const float ∗ triangleUs,
const float ∗ triangleVs ) const [protected]
Parameters
invalidatedArea The invalidated area.
in,out fb If non-null, the fb.
triangleXs The triangle xs.
triangleYs The triangle ys.
triangleZs The triangle zs.
triangleUs The triangle us.
triangleVs The triangle vs.
7.151.4.3 getAlpha()
Returns
7.151.4.4 getBitmap()
Returns
7.151.4.5 getScalingAlgorithm()
Returns
7.151.4.6 getSolidRect()
Returns
See also
Drawable::getSolidRect()
Implements Drawable.
7.151.4.7 getType()
Returns
TYPE_SCALABLEIMAGE.
7.151.4.8 lookupRenderVariant()
Looks up the appropriate render variant based on the bitmap format and scaling algorithm.
Returns
A RenderingVariant.
7.151.4.9 setAlpha()
void setAlpha (
uint8_t alpha ) [inline], [virtual]
Parameters
alpha The alpha value. 255 = completely solid.
7.151.4.10 setBitmap()
void setBitmap (
const Bitmap & bmp ) [virtual]
Parameters
bmp The bitmap to be used by the widget.
7.151.4.11 setScalingAlgorithm()
void setScalingAlgorithm (
ScalingAlgorithm algorithm ) [virtual]
Parameters
algorithm The algorithm to use when rendering.
This class is used to transfer data from class Outline (or a similar one) to the rendering buffer.
#include <touchgfx/canvas_widget_renderer/Scanline.hpp>
Classes
• class iterator
An iterator to help go through all the elements that make up a Scanline.
• Scanline ()
Default constructor.
• virtual ∼Scanline ()
Destructor.
• void reset ()
Resets the Scanline object in preparation for the handling the next Scanline.
• void resetSpans ()
Resets the spans in preparation for the next Scanline.
• void addCell (int x, int y, unsigned cover)
Adds a single cell to the current Scanline.
• void addSpan (int x, int y, unsigned len, unsigned cover)
Adds a span of cells to the current Scanline.
• int isReady (int y) const
Checks if a Scanline is ready for rendering.
• int getY () const
Gets y coordinate, i.e. the vertical offset of the Scanline.
• unsigned getNumSpans () const
Gets number spans in the Scanline.
This class is used to transfer data from class Outline (or a similar one) to the rendering buffer. It's organized very
simple. The class stores information of horizontal spans to render it into a pixel-map buffer. Each span has initial X,
length, and an array of bytes that determine the alpha values for each pixel. So, the restriction of using this class
is 256 levels of Anti-Aliasing, which is quite enough for any practical purpose. Before using this class you should
know the minimal and maximal pixel coordinates of your scanline. The protocol of using is: 1. reset()
1. addCell() / addSpan() - accumulate scanline. You pass y coordinate into these functions in order to make
scanline know the last Y. Before calling addCell() / addSpan() you should check with method isReady(y) if
the last Y has changed. It also checks if the scanline is not empty. When forming one scanline the next x
coordinate must be always greater than the last stored one, i.e. it works only with ordered coordinates.
2. If the current scanline isReady() you should render it and then call resetSpans() before adding new
cells/spans.
3. Rendering:
Scanline provides an iterator class that allows you to extract the spans and the cover values for each pixel. Be
aware that clipping has not been done yet, so you
int baseX = scanline.getBaseX(); // base X. Should be added to the span's X // "scanline" is a const reference to the
// scanline passed in.
int y = scanline.y(); // y coordinate of the scanline
7.152.2.1 Scanline()
Scanline ( )
Default constructor. Initiate a Scanline by setting up pointers to store covers, and counts.
7.152.2.2 ∼Scanline()
Destructor.
7.152.3.1 addCell()
Adds a single cell to the current Scanline. Works just like invoking addSpan() with a len=1.
Parameters
x The x coordinate.
y The y coordinate.
cover The cover.
7.152.3.2 addSpan()
void addSpan (
int x,
int y,
unsigned len,
unsigned cover )
Adds a span of cells to the current Scanline. Works like calling addCell() len times.
Parameters
x The x coordinate.
y The y coordinate.
len The length.
cover The cover.
7.152.3.3 getNumSpans()
Returns
7.152.3.4 getY()
Gets y coordinate, i.e. the vertical offset of the Scanline. This allows easy positioning of the Outline. The y
coordinate is setup through function reset().
Returns
The y coordinate.
7.152.3.5 isReady()
Checks if a Scanline is ready for rendering. A Scanline is ready for rendering when the y coordinate has changed.
Since all the cells are sorted, a change in the y coordinate means that we have moved to the next Scanline and
thus the collected data for the Scanline must be rendered before we register cells for the next Scanline.
Parameters
y The y coordinate.
Returns
True if the given y coordinate differs from the y coordinate for the cells in the current Scanline.
7.152.3.6 reset()
void reset ( )
Resets the Scanline object in preparation for the handling the next Scanline.
7.152.3.7 resetSpans()
Resets the spans in preparation for the next Scanline. Identical to calling reset() without changing the dx_ and dy_
parameters from the previous call to reset().
A Screen represents a full-screen drawable area. Applications create specific screens by subclassing this class.
#include <touchgfx/Screen.hpp>
• Screen ()
Default constructor.
• virtual ∼Screen ()
Destructor.
• void draw ()
Tells the screen to draw its entire area.
• void startSMOC (Rect &invalidatedArea)
Starts a JSMOC run, analyzing what parts of what widgets should be redrawn.
• void JSMOC (const Rect &invalidatedArea, Drawable ∗widgetToDraw)
Recursive JSMOC function. This is the actual occlusion culling implementation.
• virtual void draw (Rect &rect)
Tell the screen to draw the specified area.
• virtual void setupScreen ()
Called by Application::switchScreen() when this screen is going to be displayed.
• virtual void afterTransition ()
Called by Application::handleTick() when the transition to the screen is done.
• virtual void tearDownScreen ()
Called by Application::switchScreen() when this screen will no longer be displayed.
• virtual void handleClickEvent (const ClickEvent &evt)
Traverse the drawables in reverse z-order and notify them of a click event.
• virtual void handleDragEvent (const DragEvent &evt)
Traverse the drawables in reverse z-order and notify them of a drag event.
• virtual void handleGestureEvent (const GestureEvent &evt)
Handle gestures. Traverses drawables in reverse-z and notifies them of the gesture.
• virtual void handleTickEvent ()
Called by the Application on the current screen with a frequency of Application::TICK_INTERVAL_MS.
• virtual void handleKeyEvent (uint8_t key)
Called by the Application on the reception of a "key", the meaning of which is platform/application specific.
• bool usingSMOC () const
Determines if using JSMOC.
• void bindTransition (Transition &trans)
Enables the transition to access the containers.
• Container & getRootContainer ()
Obtain a reference to the root container of this screen.
Protected Attributes
• Container container
The container contains the contents of the screen.
• Drawable ∗ focus
The drawable currently in focus (set when DOWN_PRESSED is received).
A Screen represents a full-screen drawable area. Applications create specific screens by subclassing this class.
Each screen has a root container to which drawables can be added.
This class makes sure to delegate draw requests and various events to the appropriate drawables in correct order.
7.153.2.1 Screen()
Screen ( )
Default constructor.
7.153.2.2 ∼Screen()
Destructor.
7.153.3.1 add()
void add (
Drawable & d ) [inline], [protected]
Note
Must not be called with a Drawable that was already added to the screen. If in doubt, call remove() first.
Parameters
in d The Drawable to add.
7.153.3.2 afterTransition()
Called by Application::handleTick() when the transition to the screen is done. Base version does nothing, but
override to do screen specific initialization code that has to be done after the transition to the screen.
See also
touchgfx::Application::handleTick()
7.153.3.3 bindTransition()
void bindTransition (
Transition & trans )
Parameters
in trans The transition to bind.
void draw ( )
Note
void draw (
Rect & rect ) [virtual]
Tell the screen to draw the specified area. Will traverse the drawables tree in z- order and delegate draw to them.
Note
Parameters
in rect The area in absolute coordinates.
7.153.3.6 getRootContainer()
Returns
7.153.3.7 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [virtual]
Traverse the drawables in reverse z-order and notify them of a click event.
Parameters
evt The event to handle.
7.153.3.8 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [virtual]
Traverse the drawables in reverse z-order and notify them of a drag event.
Parameters
evt The event to handle.
7.153.3.9 handleGestureEvent()
void handleGestureEvent (
const GestureEvent & evt ) [virtual]
Handle gestures. Traverses drawables in reverse-z and notifies them of the gesture.
Parameters
evt The event to handle.
7.153.3.10 handleKeyEvent()
void handleKeyEvent (
uint8_t key ) [inline], [virtual]
Called by the Application on the reception of a "key", the meaning of which is platform/application specific. Default
implementation does nothing.
Parameters
key The key to handle.
7.153.3.11 handleTickEvent()
7.153.3.12 JSMOC()
void JSMOC (
const Rect & invalidatedArea,
Drawable ∗ widgetToDraw )
Parameters
in invalidatedArea The area to redraw, expressed in absolute coordinates.
in widgetToDraw Widget currently being drawn.
7.153.3.13 remove()
void remove (
Drawable & d ) [inline], [protected]
Removes a drawable from the content container. Safe to call even if the drawable was never added (in which case
nothing happens).
Parameters
in d The Drawable to remove.
7.153.3.14 setupScreen()
Called by Application::switchScreen() when this screen is going to be displayed. Base version does nothing, but
place any screen specific initialization code in an overridden version.
See also
touchgfx::Application::switchScreen()
7.153.3.15 startSMOC()
void startSMOC (
Rect & invalidatedArea )
Starts a JSMOC run, analyzing what parts of what widgets should be redrawn.
Parameters
in invalidatedArea The area to redraw, expressed in absolute coordinates.
7.153.3.16 tearDownScreen()
Called by Application::switchScreen() when this screen will no longer be displayed. Base version does nothing, but
place any screen specific cleanup code in an overridden version.
See also
touchgfx::Application::switchScreen()
7.153.3.17 useSMOCDrawing()
void useSMOCDrawing (
bool enabled ) [protected]
Parameters
enabled true if JSMOC should be enabled, false if disabled (meaning painter's algorithm is employed instead).
7.153.3.18 usingSMOC()
Returns
• ScrollableContainer ()
Default constructor.
• virtual ∼ScrollableContainer ()
Destructor.
• void enableHorizontalScroll (bool enable)
Enables horizontal scrolling.
• void enableVerticalScroll (bool enable)
Enables the vertical scroll.
• virtual void isScrollableXY (bool &scrollX, bool &scrollY)
Is the ClickableContainer scrollable in either direction?
• void setScrollbarsVisible (bool newVisible)
Sets the visibility of the scrollbars, when the scrollable area is pressed.
• void setScrollbarsPermanentlyVisible ()
sets the visibility for the scrollbars to be permanent.
• virtual void add (Drawable &d)
Adds a Drawable instance as child to this ScrollableContainer.
• virtual void getLastChild (int16_t x, int16_t y, Drawable ∗∗last)
Gets the last child in the container.
• virtual void handleClickEvent (const ClickEvent &evt)
Handle the click event.
• virtual void handleDragEvent (const DragEvent &evt)
Handle the drag event.
• virtual void handleGestureEvent (const GestureEvent &evt)
Gestures generate a scroll animation so these are intercepted in the same manner as drag events.
• virtual void handleTickEvent ()
Handle tick events.
• virtual Rect getContainedArea () const
Protected Attributes
• uint8_t scrollbarPadding
The amount of padding. The scrollbar will have a bit of space to the borders of the container.
• uint8_t scrollbarWidth
The width of the scrollbar.
• uint8_t scrollbarAlpha
The scrollbar is semitransparent.
• colortype scrollbarColor
A ScrollableContainer is a container that allows its contents to be scrolled. It will intercept drag operations and move
child nodes accordingly.
The size of the ScrollableContainer should be the visible view port area. If the container contains drawables that
are larger than the ScrollableContainer itself, scrolling is enabled.
Note
The ScrollableContainer will consume all DragEvents in the area covered by the container, and use.
See also
Container
7.154.2.1 ScrollableContainer()
ScrollableContainer ( )
Default constructor.
7.154.2.2 ∼ScrollableContainer()
Destructor.
7.154.3.1 add()
void add (
Drawable & d ) [virtual]
Parameters
in d The drawable.
7.154.3.2 childGeometryChanged()
This function can be called on parent nodes to signal that the size of one or more of its children have changed.
Currently only used in ScrollableContainer to redraw scrollbars when the size of the scrolling contents changes.
See also
Drawable::childGeometryChanged
7.154.3.3 doScroll()
bool doScroll (
int16_t deltaX,
int16_t deltaY ) [protected], [virtual]
Method to actually scroll the container. Passing negative values will scroll the items in the ScrollableContainer up /
left, whereas positive values will scroll items down / right.
If the distance is larger than allowed, the deltas are adjusted down to make sure the contained items stay inside
view.
Parameters
deltaX The horizontal amount to scroll.
deltaY The vertical amount to scroll.
Returns
did the container actually scroll. The call doScroll(0,0) will always return false.
7.154.3.4 enableHorizontalScroll()
void enableHorizontalScroll (
bool enable ) [inline]
By default, scrolling in either direction is enabled, provided that the content is larger than the size of the scrollable
container. This function can be used to explicitly (dis)allow scrolling in the horizontal direction, even if the content is
larger than the container.
Parameters
7.154.3.5 enableVerticalScroll()
void enableVerticalScroll (
bool enable ) [inline]
Enables the vertical scroll. By default, scrolling in either direction is enabled, provided that the content is larger than
the size of the scrollable container. This function can be used to explicitly (dis)allow scrolling in the vertical direction,
even if the content is larger than the container.
Parameters
7.154.3.6 getContainedArea()
Returns
7.154.3.7 getLastChild()
void getLastChild (
int16_t x,
int16_t y,
Drawable ∗∗ last ) [inline], [virtual]
Gets the last child in the container. The ScrollableContainer needs to intercept click events, since the scrollbars
are displayed upon reception of a PRESSED ClickEvent. The ScrollableContainer will automatically re-delegate the
event to the appropriate child.
Parameters
7.154.3.8 getScrolledX()
Returns
7.154.3.9 getScrolledY()
Returns
7.154.3.10 getType()
Returns
TYPE_SCROLLABLECONTAINER.
7.154.3.11 getXBorder()
Rect getXBorder (
const Rect & xBar,
const Rect & yBar ) const [protected]
Parameters
Returns
The area.
7.154.3.12 getXScrollbar()
Returns
7.154.3.13 getYBorder()
Rect getYBorder (
const Rect & xBar,
const Rect & yBar ) const [protected]
Parameters
Returns
The area.
7.154.3.14 getYScrollbar()
Returns
7.154.3.15 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [virtual]
Handle the click event. Get ready for scrolling, display scrollbars, etc. Send the click to appropriate child widget.
Parameters
7.154.3.16 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [virtual]
Handle the drag event. Initiate a scrolling of the container. Update scrollbars.
Parameters
evt The DragEvent.
7.154.3.17 handleGestureEvent()
void handleGestureEvent (
const GestureEvent & evt ) [virtual]
Gestures generate a scroll animation so these are intercepted in the same manner as drag events.
Parameters
7.154.3.18 handleTickEvent()
7.154.3.19 invalidateScrollbars()
7.154.3.20 isScrollableXY()
void isScrollableXY (
bool & scrollX,
bool & scrollY ) [inline], [virtual]
Is the ClickableContainer scrollable in either direction? Takes the width of the contained elements into account.
Parameters
in,out scrollX Is the container able to scroll horizontally.
in,out scrollY Is the container able to scroll vertically.
7.154.3.21 moveChildrenRelative()
void moveChildrenRelative (
int16_t deltaX,
int16_t deltaY ) [virtual]
Parameters
deltaX Horizontal displacement.
deltaY Vertical displacement.
7.154.3.22 reset()
void reset ( )
Resets the x/y coordinates of childrento the position they were in before the first drag event was received or to the
position they were in the last time reset() was invoked.
7.154.3.23 setMaxVelocity()
void setMaxVelocity (
uint16_t max ) [inline]
Parameters
7.154.3.24 setScrollbarPadding()
void setScrollbarPadding (
uint8_t padding )
Parameters
padding The padding.
7.154.3.25 setScrollbarsAlpha()
void setScrollbarsAlpha (
uint8_t alpha )
Parameters
alpha The alpha value. 255 = completely solid.
7.154.3.26 setScrollbarsColor()
void setScrollbarsColor (
colortype color )
Parameters
7.154.3.27 setScrollbarsPermanentlyVisible()
void setScrollbarsPermanentlyVisible ( )
7.154.3.28 setScrollbarsVisible()
void setScrollbarsVisible (
bool newVisible )
Sets the visibility of the scrollbars, when the scrollable area is pressed.
Parameters
newVisible If true (default), the scrollbars are visible when scrollable area is pressed. If false, scrollbars are
always hidden.
7.154.3.29 setScrollbarWidth()
void setScrollbarWidth (
uint8_t width )
Parameters
7.154.3.30 setScrollThreshold()
void setScrollThreshold (
int16_t t ) [inline]
Change the threshold which the first drag event received must exceed before initiating a scroll.
Note
All subsequent scrolls will be processed regardless of threshold value until a ClickEvent::RELEASED is re-
ceived.
Parameters
t The new threshold value.
• ScrollBase ()
Default constructor.
• virtual ∼ScrollBase ()
Destructor.
• virtual void setWidth (int16_t width)
Sets width of the ScrollBase.
• virtual void setHeight (int16_t height)
Sets height of the ScrollBase.
• virtual void setHorizontal (bool horizontal)
Sets a horizontal layout.
• virtual bool getHorizontal () const
Gets the orientation of the drawables.
• virtual void setCircular (bool circular)
Sets whether the list is circular or not.
• virtual bool getCircular () const
Gets the circular setting.
• void setDrawableSize (int16_t drawableSize, int16_t drawableMargin)
Sets drawables size.
• virtual int16_t getDrawableSize () const
Gets drawable size.
• virtual int16_t getDrawableMargin () const
Gets drawable margin.
• virtual void setNumberOfItems (int16_t numberOfItems)
Sets number of items in the DrawableList.
• virtual int16_t getNumberOfItems () const
Gets number of items in the DrawableList.
• void setEasingEquation (EasingEquation equation)
Protected Types
Protected Attributes
• DrawableList list
The list.
• int16_t numberOfDrawables
Number of drawables.
• int16_t distanceBeforeAlignedItem
The distance before aligned item.
• int16_t itemSize
Size of the item.
• uint16_t swipeAcceleration
The swipe acceleration.
• uint16_t dragAcceleration
The drag acceleration.
• uint16_t maxSwipeItems
The maximum swipe items.
• EasingEquation easingEquation
The easing equation.
• uint16_t defaultAnimationSteps
The animation steps.
• GenericCallback< int16_t > ∗ itemSelectedCallback
The item selected callback.
• GenericCallback ∗ itemLockedInCallback
The item locked in callback.
• GenericCallback ∗ animationEndedCallback
The animation ended callback.
• GenericCallback< int16_t > ∗ itemPressedCallback
The item pressed callback.
• AnimationState currentAnimationState
The current animation state.
• int gestureStep
The gesture step.
• int gestureStepsTotal
The gesture steps total.
• int gestureStart
The gesture start.
• int gestureEnd
The gesture end.
• int16_t xClick
The click.
• int16_t yClick
The click.
• int32_t initialSwipeOffset
The initial swipe offset.
• bool draggableX
Is the container draggable in the horizontal direction.
• bool draggableY
Is the container draggable in the vertical direction.
See also
ScrollWheelBase
ScrollList
DrawableList
7.155.2.1 AnimationState
Enumerator
NO_ANIMATION No animation.
ANIMATING_GESTURE Animating a gesture.
ANIMATING_DRAG Animating a click+drag.
7.155.3.1 ScrollBase()
ScrollBase ( )
Default constructor.
7.155.3.2 ∼ScrollBase()
Destructor.
7.155.4.1 allowHorizontalDrag()
void allowHorizontalDrag (
bool enable )
Enables horizontal scrolling to be passed to the children. By default, scrolling in either direction is enabled. This
function can be used to explicitly (dis)allow scrolling in the horizontal direction.
Parameters
7.155.4.2 allowVerticalDrag()
void allowVerticalDrag (
bool enable )
Enables the vertical scroll to be passed to the children. By default, scrolling in either direction is enabled. This
function can be used to explicitly (dis)allow scrolling in the vertical direction.
Parameters
7.155.4.3 animateToItem()
void animateToItem (
int16_t itemIndex,
int16_t animationSteps = -1 ) [virtual]
Go to item, possibly with animation. The given item index is scrolled into view. If animationSteps is omitted, the
default number of animation steps is used. If animationSteps is 0 no animation will be used, otherwise the number
of animation steps specified is used.
Parameters
See also
setAnimationSteps
7.155.4.4 animateToPosition()
void animateToPosition (
int32_t position,
int16_t steps = -1 ) [protected], [virtual]
Parameters
position The new position.
steps The steps.
Reimplemented in ScrollWheelBase.
7.155.4.5 getAnimationSteps()
Returns
See also
setAnimationSteps
setEasingEquation
7.155.4.6 getCircular()
Returns
True if the list is circular (infinite), false if the list is not circular (finite).
See also
DrawableList::getCircular
setCircular
7.155.4.7 getDragAcceleration()
Returns
Note
The reason for multiplying the acceleration by 10 is to avoid introducing floating point arithmetics.
See also
setDragAcceleration
7.155.4.8 getDrawableMargin()
Returns
7.155.4.9 getDrawableSize()
Returns
See also
setDrawables
7.155.4.10 getHorizontal()
Returns
See also
DrawableList::getHorizontal
setHorizontal
7.155.4.11 getMaxSwipeItems()
Returns
See also
setMaxSwipeItems
7.155.4.12 getNearestAlignedOffset()
int32_t getNearestAlignedOffset (
int32_t offset ) const [protected], [virtual]
Parameters
Returns
Reimplemented in ScrollList.
7.155.4.13 getNormalizedOffset()
int getNormalizedOffset (
int offset ) const [protected]
Parameters
Returns
7.155.4.14 getNumberOfItems()
Returns
See also
setNumberOfItems
DrawableList::getNumberOfItems
7.155.4.15 getOffset()
Returns
The offset.
7.155.4.16 getPositionForItem()
int32_t getPositionForItem (
int16_t itemIndex ) [protected], [pure virtual]
Get the position for an item. The position should ensure that the item is in view as defined by the semantics of the
actual scroll class.
Parameters
Returns
7.155.4.17 getSwipeAcceleration()
Returns
Note
The reason for multiplying the acceleration by 10 is to avoid introducing floating point arithmetics.
See also
setSwipeAcceleration
7.155.4.18 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [virtual]
Parameters
evt The event.
7.155.4.19 handleGestureEvent()
void handleGestureEvent (
const GestureEvent & evt ) [virtual]
Parameters
evt The event.
7.155.4.20 handleTickEvent()
7.155.4.21 initialize()
7.155.4.22 isAnimating()
Query if this object is animating. This can be good to know if getSelectedItem() is called, as the result might not be
as expected if isAnimating() returns true.
Returns
7.155.4.23 itemChanged()
void itemChanged (
int itemIndex ) [virtual]
Inform that an item has change and force all drawables with the given item index to be updated via the callback
provided.
Parameters
Reimplemented in ScrollWheelWithSelectionStyle.
7.155.4.24 keepOffsetInsideLimits()
int32_t keepOffsetInsideLimits (
int32_t newOffset,
int16_t overShoot ) const [protected], [pure virtual]
Parameters
Returns
An int32_t.
7.155.4.25 setAnimationEndedCallback()
void setAnimationEndedCallback (
GenericCallback<> & callback )
Parameters
in,out callback The ended callback.
7.155.4.26 setAnimationSteps()
void setAnimationSteps (
int16_t steps )
Sets animation steps when moving to a new selected item. The default value is 30.
Parameters
steps The animation steps.
See also
setEasingEquation
getAnimationSteps
7.155.4.27 setCircular()
void setCircular (
bool circular ) [virtual]
Sets whether the list is circular (infinite) or not. A circular list is a list where the first drawable re-appears after the
last item in the list - and the last item in the list appears before the first item in the list.
Parameters
circular True if the list should be circular, false if the list should not be circular.
See also
DrawableList::setCircular
getCircular
Reimplemented in ScrollWheelWithSelectionStyle.
7.155.4.28 setDragAcceleration()
void setDragAcceleration (
uint16_t acceleration )
Sets drag acceleration times 10, so "10" means "1", "15" means "1.5".
Parameters
acceleration The drag acceleration. 10 makes the containers follow the finger, higher values makes the
containers move faster.
Note
The reason for multiplying the acceleration by 10 is to avoid introducing floating point arithmetics.
See also
getDragAcceleration
7.155.4.29 setDrawableSize()
void setDrawableSize (
int16_t drawableSize,
int16_t drawableMargin )
Sets drawables size. The drawable is is the size of each drawable in the list (this is enforced by the DrawableList
class). The spacing is the amount of blank to add between each drawable. Half of the space is placed before and
half of the space is placed after the drawable. The entire size of an item is thus size + spacing.
Parameters
7.155.4.30 setEasingEquation()
void setEasingEquation (
EasingEquation equation )
Sets easing equation when changing the selected item, for example via swipe or AnimateTo.
Parameters
equation The equation.
See also
setAnimationSteps
getAnimationSteps
7.155.4.31 setHeight()
void setHeight (
int16_t height ) [virtual]
Parameters
7.155.4.32 setHorizontal()
void setHorizontal (
bool horizontal ) [virtual]
Sets a horizontal layout. If horizontal is set true, all drawables are arranged side by side. If horizontal is set false,
the drawables are arranged above and below each other (vertically).
Parameters
Note
See also
DrawableList::setHorizontal
getHorizontal
Reimplemented in ScrollWheelWithSelectionStyle.
7.155.4.33 setItemPressedCallback()
void setItemPressedCallback (
GenericCallback< int16_t > & callback )
Parameters
in callback The callback.
7.155.4.34 setItemSelectedCallback()
void setItemSelectedCallback (
GenericCallback< int16_t > & callback )
Sets Callback which will be called when the selected item is clicked.
Parameters
in callback The callback.
7.155.4.35 setMaxSwipeItems()
void setMaxSwipeItems (
uint16_t maxItems )
Sets maximum swipe items. Often useful when there are five visible items on the screen and a swipe action should
at most swipe the next/previous five items into view to achieve sort of a paging effect.
Parameters
maxItems The maximum items, 0 means "no limit".
See also
getMaxSwipeItems
7.155.4.36 setNumberOfItems()
void setNumberOfItems (
int16_t items ) [virtual]
Sets number of items in the DrawableList. This forces all drawables to be updated to ensure that the content is
correct. For example a minute selector might could have 60 items (only some of which are visible at any given time).
Parameters
Note
Reimplemented in ScrollWheelWithSelectionStyle.
7.155.4.37 setOffset()
void setOffset (
int32_t offset ) [protected], [virtual]
Parameters
Reimplemented in ScrollWheelWithSelectionStyle.
7.155.4.38 setSwipeAcceleration()
void setSwipeAcceleration (
uint16_t acceleration )
Parameters
acceleration The acceleration times 10, so "60" means "6" and "75" means "7.5".
Note
The reason for multiplying the acceleration by 10 is to avoid introducing floating point arithmetics.
See also
getSwipeAcceleration
7.155.4.39 setWidth()
void setWidth (
int16_t width ) [virtual]
Parameters
width The width.
7.155.4.40 stopAnimation()
void stopAnimation ( )
• ScrollList ()
Default constructor.
• virtual ∼ScrollList ()
Destructor.
• virtual void setDrawables (DrawableListItemsInterface &drawableListItems, GenericCallback< Drawable←-
ListItemsInterface ∗, int16_t, int16_t > &updateDrawableCallback)
Protected Attributes
• int16_t paddingAfterLastItem
The distance after last item.
• bool snapping
True to snapping.
• int windowSize
Size of the window.
A scrolling menu of drawables. To preserve resources, a lot of items can be displayed using only a few drawables.
To achieve this, please see DrawableList.
7.156.2.1 ScrollList()
ScrollList ( )
Default constructor.
7.156.2.2 ∼ScrollList()
Destructor.
7.156.3.1 getItem()
int16_t getItem (
int16_t drawableIndex ) [inline]
Gets an item.
Parameters
Returns
The item.
7.156.3.2 getNearestAlignedOffset()
int32_t getNearestAlignedOffset (
int32_t offset ) const [protected], [virtual]
Parameters
Returns
7.156.3.3 getPaddingAfter()
Returns
See also
setPadding
getPaddingBefore
7.156.3.4 getPaddingBefore()
Returns
See also
setPadding
getPaddingAfter
7.156.3.5 getPositionForItem()
int32_t getPositionForItem (
int16_t itemIndex ) [protected], [virtual]
Get the position for an item. The position should ensure that the item is in view as defined by the semantics of the
actual scroll class. If the item is already in view, the current offset is returned and not the offset of the given item.
Parameters
Returns
Implements ScrollBase.
7.156.3.6 getSnapping()
Returns
7.156.3.7 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [virtual]
Parameters
evt The event.
7.156.3.8 keepOffsetInsideLimits()
int32_t keepOffsetInsideLimits (
int32_t newOffset,
int16_t overShoot ) const [protected], [virtual]
Parameters
Returns
An int32_t.
Implements ScrollBase.
7.156.3.9 setDrawables()
void setDrawables (
DrawableListItemsInterface & drawableListItems,
GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > & update←-
DrawableCallback ) [virtual]
Parameters
See also
DrawableList::setDrawables
7.156.3.10 setPadding()
void setPadding (
int16_t distanceBefore,
int16_t distanceAfter )
Sets distance offset before and after the "visible" drawables in the ScrollList. This allows the actual area where
widgets are placed to have a little extra area where parts of drawables can be seen. For example if the ScrollList
is 200, each drawable is 50 and distance before and distance after are 25, then there is room for three visible
drawables inside the ScrollList. When scrolling, part of the scrolled out drawables can be seen before and after
the three drawables. Actually 25/50 = 50% of a drawable can be seen before and after the three drawables in the
ScrollList.
Parameters
See also
getPaddingBefore
getPaddingAfter
7.156.3.11 setSnapping()
void setSnapping (
bool snap )
Set snapping. If snapping is false, the items can flow freely. If snapping is true, the items will snap into place so an
item is always in the "selected" spot.
Parameters
snap true to snap.
7.156.3.12 setWindowSize()
void setWindowSize (
int16_t items )
Sets window size. This is the number of items that should always be visible. The default value is 1.
Parameters
items The items.
Note
A scroll wheel.
#include <touchgfx/containers/scrollers/ScrollWheel.hpp>
• ScrollWheel ()
Default constructor.
• virtual ∼ScrollWheel ()
Destructor.
• virtual void setDrawables (DrawableListItemsInterface &drawableListItems, GenericCallback< Drawable←-
ListItemsInterface ∗, int16_t, int16_t > &updateDrawableCallback)
Sets the drawables.
A scroll wheel is a list of identically styled drawables which can be scrolled through. One of the items in the list is the
"selected" one, and scrolling through the list can be done in various ways. The ScrollWheel uses the DrawableList
to make it possible to handle a huge number of items using only a limited number of drawables by reusing drawables
that are no longer in view.
See also
DrawableList
ScrollWheelWithSelectionStyle
7.157.2.1 ScrollWheel()
ScrollWheel ( )
Default constructor.
7.157.2.2 ∼ScrollWheel()
∼ScrollWheel ( ) [virtual]
Destructor.
7.157.3.1 setDrawables()
void setDrawables (
DrawableListItemsInterface & drawableListItems,
GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > & update←-
DrawableCallback ) [virtual]
Sets the drawables used by the scroll wheel. The drawables are accessed through a callback that will return the
needed drawable and another callback that will put the right data in the drawable.
Parameters
• ScrollWheelBase ()
Default constructor.
• virtual ∼ScrollWheelBase ()
Destructor.
• virtual void setSelectedItemOffset (int16_t offset)
Sets selected item offset.
• virtual int16_t getSelectedItemOffset () const
Gets selected item offset.
• int getSelectedItem () const
Gets selected item.
• virtual int32_t keepOffsetInsideLimits (int32_t newOffset, int16_t overShoot) const
Keep offset inside limits.
• virtual void handleClickEvent (const ClickEvent &evt)
Handles the click event described by evt.
• virtual void handleDragEvent (const DragEvent &evt)
Handles the drag event described by evt.
• virtual void handleGestureEvent (const GestureEvent &evt)
Handles the gesture event described by evt.
• void setAnimateToCallback (GenericCallback< int16_t > &callback)
Sets Callback which will be called when the ScrollWheel animates to a new item.
Protected Attributes
See also
ScrollWheel
ScrollWheelWithHighlight
7.158.2.1 ScrollWheelBase()
ScrollWheelBase ( )
Default constructor.
7.158.2.2 ∼ScrollWheelBase()
Destructor.
7.158.3.1 animateToPosition()
void animateToPosition (
int32_t position,
int16_t steps = -1 ) [protected], [virtual]
Parameters
position The new position.
steps (Optional) The number of steps. If steps is <0, the default number of steps is used (this is the
default). If steps ==0, there will be no animation, simply a direct skip to the given position.
7.158.3.2 getPositionForItem()
int32_t getPositionForItem (
int16_t itemIndex ) [protected], [virtual]
Get the position for an item. The position should ensure that the item is in view as defined by the semantics of the
actual scroll class.
Parameters
Returns
Implements ScrollBase.
7.158.3.3 getSelectedItem()
Gets selected item. If an animation is in progress, the item that is being scrolled to is returned, not the item that
happens to be flying by at the time.
Returns
7.158.3.4 getSelectedItemOffset()
Gets offset of selected item measured in pixels relative to the start of the widget.
Returns
See also
setSelectedItemOffset
7.158.3.5 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [virtual]
Parameters
evt The event.
7.158.3.6 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [virtual]
Parameters
evt The event.
7.158.3.7 handleGestureEvent()
void handleGestureEvent (
const GestureEvent & evt ) [virtual]
Parameters
evt The event.
7.158.3.8 keepOffsetInsideLimits()
int32_t keepOffsetInsideLimits (
int32_t newOffset,
int16_t overShoot ) const [virtual]
Parameters
Returns
An int32_t.
Implements ScrollBase.
7.158.3.9 setAnimateToCallback()
void setAnimateToCallback (
GenericCallback< int16_t > & callback )
Sets Callback which will be called when the ScrollWheel animates to a new item.
Parameters
in callback The callback.
7.158.3.10 setSelectedItemOffset()
void setSelectedItemOffset (
int16_t offset ) [virtual]
Sets selected item offset. This is the number of pixels from the start of the widget where the selected item is
placed on screen. The offset is the relative x coordinate if the ScrollWheel is horizontal, otherwise it is the relative y
coordinate. If this value is zero, the selected item is placed at the very start of the widget.
Parameters
• ScrollWheelWithSelectionStyle ()
Default constructor.
• virtual ∼ScrollWheelWithSelectionStyle ()
Destructor.
• virtual void setWidth (int16_t width)
Sets the width.
• virtual void setHeight (int16_t height)
Sets the height.
• virtual void setHorizontal (bool horizontal)
Sets whether the scroll wheel is horizontal or vertical.
• virtual void setCircular (bool circular)
Sets whether the scroll wheel is circular.
• virtual void setNumberOfItems (int16_t numberOfItems)
Sets number of items in the scroll wheel.
• virtual void setSelecteItemOffset (int16_t offset)
Sets selected item offset.
• virtual void setSelectedItemExtraSize (int16_t extraSizeBefore, int16_t extraSizeAfter)
Sets selected item extra size.
• virtual int16_t getSelectedItemExtraSizeBefore () const
Gets selected item extra size before.
• virtual int16_t getSelectedItemExtraSizeAfter () const
Gets selected item extra size after.
Protected Attributes
• int16_t drawablesInFirstList
List of drawables in firsts.
• DrawableList list1
The center list.
• DrawableList list2
The last list.
• int16_t extraSizeBeforeSelectedItem
The distance before selected item.
• int16_t extraSizeAfterSelectedItem
The distance after selected item.
• int16_t marginBeforeSelectedItem
The distance before selected item.
• int16_t marginAfterSelectedItem
The distance after selected item.
• DrawableListItemsInterface ∗ drawables
The drawables at the beginning and end of the scroll wheel.
• DrawableListItemsInterface ∗ centerDrawables
The drawables at the center of the scroll wheel.
• GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > ∗ originalUpdateDrawableCallback
The original update drawable callback.
• GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > ∗ originalUpdateCenterDrawable←-
Callback
The original update center drawable callback.
A scroll wheel with selection style. Similar to an ordinary ScrollWheel, but with a different style for the selected item
which can thus be bold, have a different color or similar effect to highlight it.
See also
DrawableList
ScrollWheel
7.159.2.1 ScrollWheelWithSelectionStyle()
ScrollWheelWithSelectionStyle ( )
Default constructor.
7.159.2.2 ∼ScrollWheelWithSelectionStyle()
Destructor.
7.159.3.1 getSelectedItemExtraSizeAfter()
Returns
See also
setSelectedItemExtraSize
7.159.3.2 getSelectedItemExtraSizeBefore()
Returns
See also
setSelectedItemExtraSize
7.159.3.3 getSelectedItemMarginAfter()
Returns
See also
setSelectedItemMargin
7.159.3.4 getSelectedItemMarginBefore()
Returns
See also
setSelectedItemMargin
7.159.3.5 initialize()
7.159.3.6 itemChanged()
void itemChanged (
int itemIndex ) [virtual]
Inform that an item has change and force all drawables with the given item index to be updated via the callback
provided.
Parameters
7.159.3.7 refreshDrawableListsLayout()
Refresh drawable lists layout. Ensure that the three DrawableLists are places correctly and setup properly. This is
typically done after the ScrollWheelWithSelectionStyle has been resized or the size of the selected item is changed.
7.159.3.8 setCircular()
void setCircular (
bool circular ) [virtual]
Sets whether the scroll wheel is circular. IF the scroll wheel is circular, it can be scrolled infinitely so that the last
item appears before the first item, just like the first item appears after the last item in the list.
Parameters
circular True to make the scroll wheel circular.
See also
getCircular
7.159.3.9 setDrawables()
void setDrawables (
DrawableListItemsInterface & drawableListItems,
GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > & update←-
DrawableCallback,
DrawableListItemsInterface & centerDrawableListItems,
GenericCallback< DrawableListItemsInterface ∗, int16_t, int16_t > & update←-
CenterDrawableCallback ) [virtual]
Setups the widget. Numerous parameters control the position of the widget, the two scroll lists inside and the values
in them.
Parameters
7.159.3.10 setDrawableSize()
void setDrawableSize (
int16_t drawableSize,
int16_t drawableMargin ) [virtual]
Sets drawable size. Each item in the scroll wheel will have a size of the sum of the two numbers, where the
drawableSize is the size of the drawable in the list and the drawableMargin is the margin between each drawable
(half of which is placed before the drawable, the rest is placed after the drawable).
Parameters
See also
getDrawableSize
getDrawableMargin
getItemSize
7.159.3.11 setHeight()
void setHeight (
int16_t height ) [virtual]
Sets the height. If the scroll wheel is horizontal, the height is propagated to all the drawables.
Parameters
height The height.
7.159.3.12 setHorizontal()
void setHorizontal (
bool horizontal ) [virtual]
Sets whether the scroll wheel is horizontal or vertical. If the scroll wheel is hortizontal, the items are arranged side
by side, otherwise they are arranged above and below each other.
Parameters
See also
getHorizontal
7.159.3.13 setNumberOfItems()
void setNumberOfItems (
int16_t numberOfItems ) [virtual]
Sets number of items in the scroll wheel. The scroll wheel is refreshed to ensure that everything is displayed properly
on the screen.
Parameters
See also
getNumberOfItems
7.159.3.14 setOffset()
void setOffset (
int32_t offset ) [protected], [virtual]
Parameters
See also
getOffset
7.159.3.15 setSelectedItemExtraSize()
void setSelectedItemExtraSize (
int16_t extraSizeBefore,
int16_t extraSizeAfter ) [virtual]
Sets selected item extra size to make the size of the area for the center drawables larger.
Parameters
See also
setSelecteItemOffset
7.159.3.16 setSelectedItemMargin()
void setSelectedItemMargin (
int16_t marginBefore,
int16_t marginAfter ) [virtual]
Sets margin around selected item. This like an invisible area added before and after the selected item (including
extra size).
Parameters
See also
setSelecteItemOffset
setSelectedItemExtraSize
7.159.3.17 setSelectedItemPosition()
void setSelectedItemPosition (
int16_t offset,
int16_t extraSizeBefore,
int16_t extraSizeAfter,
int16_t marginBefore,
int16_t marginAfter ) [virtual]
Sets the selected item offset. This is the distance from the beginning of the ScrollWheel measured in pixels. The
distance before and after that should also be drawn using the center drawables - for example to extend area of
emphasized elements - can also be specified. Further, if a gap is needed between the "normal" drawables and
the center drawables - for example to give the illusion that that items disappear under a graphical element, only to
appear in the center.
This is a combination of setSelectedItemOffset, setSelectedItemExtraSize and setSelectedItemMargin.
Parameters
See also
setSelectedItemOffset
setSelectedItemExtraSize
setSelectedItemMargin
7.159.3.18 setSelecteItemOffset()
void setSelecteItemOffset (
int16_t offset ) [virtual]
Sets selected item offset. This is the number of pixels from the start of the widget where the selected item is
placed on screen. The offset is the relative x coordinate if the ScrollWheel is horizontal, otherwise it is the relative y
coordinate. If this value is zero, the selected item is placed at the very start of the widget.
Parameters
7.159.3.19 setWidth()
void setWidth (
int16_t width ) [virtual]
Sets the width. If the scroll wheel is vertical, the width is propagated to all the drawables.
Parameters
width The width.
See also
TouchController
7.160.2.1 init()
7.160.2.2 sampleTouch()
bool sampleTouch (
int32_t & x,
int32_t & y ) [virtual]
Checks whether the touch screen is being touched, and if so, what coordinates.
Parameters
Returns
Implements TouchController.
See also
TouchController
7.161.2.1 init()
7.161.2.2 sampleTouch()
bool sampleTouch (
int32_t & x,
int32_t & y ) [virtual]
Checks whether the touch screen is being touched, and if so, what coordinates.
Parameters
Returns
Implements TouchController.
• virtual ∼Shape ()
Virtual Destructor.
• virtual int getNumPoints () const
Gets number points used to make up the shape.
• virtual void setCorner (int i, CWRUtil::Q5 x, CWRUtil::Q5 y)
Sets a corner of the shape in Q5 format.
• virtual CWRUtil::Q5 getCornerX (int i) const
Gets the x coordinate of a corner.
• virtual CWRUtil::Q5 getCornerY (int i) const
Gets the y coordinate of a corner.
template<uint16_t POINTS>
class touchgfx::Shape< POINTS >
Simple widget capable of drawing a shape. The shape can be scaled and rotated around 0,0. Note that the y axis
goes down, so a shape that goes up must be given negative coordinates.
The Shape class allows the user to draw any shape and allows the defined shape to be scaled, rotated and moved
freely. Example uses could be the hands of a clock (see the touchgfx_demo2014 for an actual implementation).
Template Parameters
See also
CanvasWidget
7.162.2.1 ∼Shape()
Virtual Destructor.
7.162.3.1 getCacheX()
CWRUtil::Q5 getCacheX (
int i ) const [inline], [protected], [virtual]
Parameters
Returns
Implements AbstractShape.
7.162.3.2 getCacheY()
CWRUtil::Q5 getCacheY (
int i ) const [inline], [protected], [virtual]
Parameters
Returns
Implements AbstractShape.
7.162.3.3 getCornerX()
CWRUtil::Q5 getCornerX (
int i ) const [inline], [virtual]
Parameters
Returns
Implements AbstractShape.
7.162.3.4 getCornerY()
CWRUtil::Q5 getCornerY (
int i ) const [inline], [virtual]
Parameters
Returns
Implements AbstractShape.
7.162.3.5 getNumPoints()
Returns
Implements AbstractShape.
7.162.3.6 setCache()
void setCache (
int i,
CWRUtil::Q5 x,
CWRUtil::Q5 y ) [inline], [protected], [virtual]
Sets the cached coordinates of a given corner. The coordinates in the cache are the coordinates from the corners
after rotating and scaling the coordinate.
Parameters
Implements AbstractShape.
7.162.3.7 setCorner()
void setCorner (
int i,
CWRUtil::Q5 x,
CWRUtil::Q5 y ) [inline], [virtual]
Parameters
Implements AbstractShape.
Defines an alias representing the array of points making up the abstract shape.
#include <touchgfx/widgets/canvas/AbstractShape.hpp>
Public Attributes
• Tx
The x coordinate of the points.
• Ty
The y coordinate of the points.
template<typename T>
struct touchgfx::AbstractShape::ShapePoint< T >
Defines an alias representing the array of points making up the abstract shape. This will help setting up the
abstractShape very easily using setAbstractShape().
Template Parameters
See also
setAbstractShape()
SlideMenu is a container that has the functionality of being either collapsed or expanded.
#include <touchgfx/containers/SlideMenu.hpp>
Public Types
• SlideMenu ()
Default constructor.
• virtual ∼SlideMenu ()
Destructor.
• virtual void setup (SlideMenu::ExpandDirection newExpandDirection, const Bitmap &backgroundBMP, const
Bitmap &stateChangeButtonBMP, const Bitmap &stateChangeButtonPressedBMP)
Setup the SlideMenu by positioning the stateChangeButton next to background image relative to the expand direction
and center it in the other dimension.
• virtual void setup (SlideMenu::ExpandDirection newExpandDirection, const Bitmap &backgroundBMP, const
Bitmap &stateChangeButtonBMP, const Bitmap &stateChangeButtonPressedBMP, int16_t backgroundX,
int16_t backgroundY, int16_t stateChangeButtonX, int16_t stateChangeButtonY)
Setup method for the SlideMenu. Positioning of the background image and the stateChangeButton is done by stating
the X and Y coordinates for the elements (relative to the SlideMenu).
• virtual void setExpandDirection (SlideMenu::ExpandDirection newExpandDirection)
Sets the expand direction.
• virtual SlideMenu::ExpandDirection getExpandDirection () const
Gets the expand direction.
• virtual void setVisiblePixelsWhenCollapsed (int16_t visiblePixels)
Sets the amount of visible pixels when collapsed.
• virtual int16_t getVisiblePixelsWhenCollapsed () const
Gets the visible pixels when collapsed.
• virtual void setHiddenPixelsWhenExpanded (int16_t hiddenPixels)
Sets the amount of hidden pixels when expanded.
• virtual int16_t getHiddenPixelsWhenExpanded () const
Gets the hidden pixels when expanded.
• virtual void setExpandedStateTimeout (uint16_t timeout)
Sets the expanded state timeout in ticks.
• virtual uint16_t getExpandedStateTimeout () const
Gets expanded state timeout.
• virtual void setAnimationDuration (uint16_t duration)
Sets the animation duration.
• virtual uint16_t getAnimationDuration () const
Gets the animation duration.
• virtual void setAnimationEasingEquation (EasingEquation animationEasingEquation)
Sets the animation easing equation.
• virtual EasingEquation getAnimationEasingEquation () const
Gets the animation easing equation.
• virtual void setState (SlideMenu::State newState)
Sets the state of the SlideMenu. No animation is performed.
• virtual void animateToState (SlideMenu::State newState)
Animate to the given state.
• virtual SlideMenu::State getState ()
Gets the current state.
• virtual void resetExpandedStateTimer ()
Resets the expanded state timer.
• virtual uint16_t getExpandedStateTimer () const
Gets the expanded state timer.
• virtual int16_t getBackgroundX () const
Gets the background x coordinate.
• virtual int16_t getBackgroundY () const
Gets the background y coordinate.
• virtual int16_t getStateChangeButtonX () const
Gets the state change button x coordinate.
• virtual int16_t getStateChangeButtonY () const
Gets the state change button y coordinate.
• virtual void setStateChangedCallback (GenericCallback< const SlideMenu & > &callback)
Set the state changed callback. This callback is called when the state change button is clicked.
Protected Attributes
• uint16_t expandedStateTimeout
The expanded state timeout.
• uint16_t expandedStateTimer
The timer that counts towards the expandedStateTimeout. If reached the SlideMenu will animate to COLLAPSED.
• uint16_t animationDuration
The animation duration of the state change animation.
SlideMenu is a container that has the functionality of being either collapsed or expanded. The SlideMenu consists
of a background and a activate button that toggles the SlideMenus collapsed/expanded state.
The relative positions of the background and state change button is configurable as is the direction in which the
SlideMenu expands and collapses. How much of the SlideMenu that is visible when collapsed can be set with the
setVisiblePixelsWhenCollapsed(..) method. It is, of course, important that the state change button is accessible
when collapsed. The SlideMenu will animate back to the collapsed state after a expandedStateTimeout is reached.
The timer can be reset, for example when the user interacts with elements in the list. Use the resetExpanded←-
StateTimer(..) method for this.
Actual menu elements are added normally using the add(..) method and are positioned relative to the SlideMenu.
7.164.2.1 add()
void add (
Drawable & d ) [virtual]
Parameters
d The drawable to add.
7.164.2.2 animateToState()
void animateToState (
SlideMenu::State newState ) [virtual]
Parameters
7.164.2.3 animationEndedHandler()
void animationEndedHandler (
const MoveAnimator< Container > & container ) [protected]
Parameters
7.164.2.4 getAnimationDuration()
Returns
7.164.2.5 getAnimationEasingEquation()
Returns
7.164.2.6 getBackgroundX()
Returns
7.164.2.7 getBackgroundY()
Returns
7.164.2.8 getCollapsedXCoordinate()
Returns
7.164.2.9 getCollapsedYCoordinate()
Returns
7.164.2.10 getExpandDirection()
Returns
7.164.2.11 getExpandedStateTimeout()
Returns
7.164.2.12 getExpandedStateTimer()
Returns
7.164.2.13 getExpandedXCoordinate()
Returns
7.164.2.14 getExpandedYCoordinate()
Returns
7.164.2.15 getHiddenPixelsWhenExpanded()
Returns
7.164.2.16 getState()
Returns
7.164.2.17 getStateChangeButtonX()
Returns
7.164.2.18 getStateChangeButtonY()
Returns
7.164.2.19 getVisiblePixelsWhenCollapsed()
Returns
7.164.2.20 remove()
void remove (
Drawable & d ) [virtual]
Parameters
d The drawable to remove.
7.164.2.21 resetExpandedStateTimer()
Resets the expanded state timer. The SlideMenu will animate to the COLLAPSED state after a number of ticks (set
with setExpandedStateTimeout(..)). This method resets this timer.
7.164.2.22 setAnimationDuration()
void setAnimationDuration (
uint16_t duration ) [virtual]
Parameters
duration The animation duration.
7.164.2.23 setAnimationEasingEquation()
void setAnimationEasingEquation (
EasingEquation animationEasingEquation ) [virtual]
Parameters
animationEasingEquation The animation easing equation.
7.164.2.24 setExpandDirection()
void setExpandDirection (
SlideMenu::ExpandDirection newExpandDirection ) [virtual]
Parameters
newExpandDirection The new expand direction.
7.164.2.25 setExpandedStateTimeout()
void setExpandedStateTimeout (
uint16_t timeout ) [virtual]
Sets the expanded state timeout in ticks. The SlideMenu will animate to the COLLAPSED state when this number
of ticks has been executed while the SlideMenu is in the EXPANDED state. The timer can be reset with the reset←-
ExpandedStateTimer method.
Parameters
timeout The timeout in ticks.
7.164.2.26 setHiddenPixelsWhenExpanded()
void setHiddenPixelsWhenExpanded (
int16_t hiddenPixels ) [virtual]
Parameters
hiddenPixels The hidden pixels.
7.164.2.27 setState()
void setState (
SlideMenu::State newState ) [virtual]
Parameters
7.164.2.28 setStateChangedAnimationEndedCallback()
void setStateChangedAnimationEndedCallback (
GenericCallback< const SlideMenu & > & callback ) [virtual]
Parameters
callback The callback.
7.164.2.29 setStateChangedCallback()
void setStateChangedCallback (
GenericCallback< const SlideMenu & > & callback ) [virtual]
Parameters
callback The callback.
void setup (
SlideMenu::ExpandDirection newExpandDirection,
const Bitmap & backgroundBMP,
const Bitmap & stateChangeButtonBMP,
const Bitmap & stateChangeButtonPressedBMP ) [virtual]
Setup the SlideMenu by positioning the stateChangeButton next to background image relative to the expand direc-
tion and center it in the other dimension. The width and height of the SlideMenu will be automatically set to span
both elements. Default values are: expandedStateTimeout = 200, visiblePixelsWhenCollapsed = 0, hiddenPixels←-
WhenExpanded = 0, animationDuration = 10, animationEquation = cubicEaseInOut.
Parameters
newExpandDirection The new expand direction.
backgroundBMP The background bitmap.
stateChangeButtonBMP The state change button bitmap.
stateChangeButtonPressedBMP The state change button pressed bitmap.
void setup (
SlideMenu::ExpandDirection newExpandDirection,
const Bitmap & backgroundBMP,
const Bitmap & stateChangeButtonBMP,
const Bitmap & stateChangeButtonPressedBMP,
int16_t backgroundX,
int16_t backgroundY,
int16_t stateChangeButtonX,
int16_t stateChangeButtonY ) [virtual]
Setup method for the SlideMenu. Positioning of the background image and the stateChangeButton is done by stating
the X and Y coordinates for the elements (relative to the SlideMenu). The width and height of the SlideMenu will
be automatically set to span both elements. Default values are: expandedStateTimeout = 200, visiblePixelsWhen←-
Collapsed = 0, hiddenPixelsWhenExpanded = 0, animationDuration = 10, animationEquation = cubicEaseInOut.
Parameters
newExpandDirection The new expand direction.
backgroundBMP The background bitmap.
stateChangeButtonBMP The state change button bitmap.
stateChangeButtonPressedBMP The state change button pressed bitmap.
backgroundX The background x coordinate.
backgroundY The background y coordinate.
stateChangeButtonX The state change button x coordinate.
stateChangeButtonY The state change button y coordinate.
7.164.2.32 setVisiblePixelsWhenCollapsed()
void setVisiblePixelsWhenCollapsed (
int16_t visiblePixels ) [virtual]
Parameters
visiblePixels The visible pixels.
7.164.2.33 stateChangeButtonClickedHandler()
void stateChangeButtonClickedHandler (
const AbstractButton & button ) [protected]
Parameters
button The state change button.
A slider is a graphical element with which the user may set a value by moving an indicator or by clicking the slider.
#include <touchgfx/containers/Slider.hpp>
• Slider ()
Default constructor.
• virtual ∼Slider ()
Destructor.
• void setBitmaps (const Bitmap &sliderBackground, const Bitmap &sliderBackgroundSelected, const Bitmap
&indicator)
Sets all the bitmaps for the Slider.
• void setBitmaps (const BitmapId sliderBackground, const BitmapId sliderBackgroundSelected, const
BitmapId indicator)
Sets all the bitmaps for the Slider.
• void setStartValueCallback (GenericCallback< const Slider &, int > &callback)
Associates an action to be performed when an interaction (drag or click) with the slider is initiated.
• void setStopValueCallback (GenericCallback< const Slider &, int > &callback)
Associates an action to be performed when an interaction with the slider ends (i.e. drag/click).
• void setNewValueCallback (GenericCallback< const Slider &, int > &callback)
Associates an action to be performed when the slider changes its value.
• virtual void setupHorizontalSlider (uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorY, uint16_t
indicatorMinX, uint16_t indicatorMaxX)
Sets up the slider in horizontal mode.
• virtual void setupVerticalSlider (uint16_t backgroundX, uint16_t backgroundY, uint16_t indicatorX, uint16_t
indicatorMinY, uint16_t indicatorMaxY)
Sets up the slider in vertical mode.
• virtual uint16_t getIndicatorMin () const
Gets indicator minimum.
• virtual uint16_t getIndicatorMax () const
Gets indicator maximum.
• virtual void setValueRange (int minValue, int maxValue, int newValue)
Sets the value range of the slider.
• virtual uint16_t getMinValue () const
Gets the minimum value.
• virtual uint16_t getMaxValue () const
Gets the maximum value.
• virtual void setValueRange (int minValue, int maxValue)
Sets the value range of the slider.
• virtual void setValue (int value)
Places the indicator at the specified value.
• int getValue ()
Gets the current value represented by the indicator.
• virtual uint16_t getType () const
For GUI testing only.
Protected Types
Protected Attributes
• SliderOrientation sliderOrientation
The slider orientation.
• int currentValue
The current value represented of the slider.
• int valueRangeMin
The value range min.
• int valueRangeMax
The value range max.
• Image background
The background image.
• Image backgroundSelected
The backgroundSelected image.
• Image indicator
The indicator image.
• Container backgroundSelectedViewPort
The backgroundSelected view port. Controls the visible part of the backgroundSelected image.
• int16_t indicatorMinPosition
The minimum position of the indicator (either x coordinate in horizontal mode or y coordinate in vertical mode)
• int16_t indicatorMaxPosition
The maximum position of the indicator (either x coordinate in horizontal mode or y coordinate in vertical mode)
• GenericCallback< const Slider &, int > ∗ startValueCallback
The start value callback (called when an interaction with the indicator is initiated)
• GenericCallback< const Slider &, int > ∗ stopValueCallback
The stop value callback (called when an interaction with the indicator ends)
• GenericCallback< const Slider &, int > ∗ newValueCallback
The new value callback (called when the indicator is moved)
A slider is a graphical element with which the user may set a value by moving an indicator or by clicking the slider.
The slider can operate in horizontal or vertical mode.
The slider has two bitmaps. One bitmap is used on one side of the indicator. The other is used on the other side.
They can be used in indicating the part of the slider value range that is currently selected.
The slider operates on an integer value range that can be set by the user.
7.165.2.1 Slider()
Slider ( )
7.165.3.1 getIndicatorMax()
Returns
See also
setupHorizontalSlider
setupVerticalSlider
getIndicatorMin
7.165.3.2 getIndicatorMin()
Returns
See also
setupHorizontalSlider
setupVerticalSlider
getIndicatorMax
7.165.3.3 getIndicatorPositionRangeSize()
Returns
7.165.3.4 getIndicatorRadius()
Returns
7.165.3.5 getMaxValue()
Returns
See also
setValueRange
getMinValue
7.165.3.6 getMinValue()
Returns
See also
setValueRange
getMaxValue
7.165.3.7 getType()
Returns
TYPE_BUTTON.
7.165.3.8 getValue()
Returns
7.165.3.9 getValueRangeSize()
Returns
7.165.3.10 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [protected], [virtual]
Parameters
evt The event.
7.165.3.11 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [protected], [virtual]
Parameters
evt The event.
7.165.3.12 positionToValue()
int positionToValue (
int16_t position ) const [protected], [virtual]
Translate a position (x coordinate in horizontal mode and y in vertical mode) in the indicator position range to the
corresponding value in the value range.
Parameters
position The position.
Returns
void setBitmaps (
const Bitmap & sliderBackground,
const Bitmap & sliderBackgroundSelected,
const Bitmap & indicator )
Sets all the bitmaps for the Slider. The slider show the sliderBackgroundSelected bitmap in the region of the slider
that is selected, that is the area to the left of the indicator for a horizontal slider and below the indicator for a vertical
slider. To ignore this effect just add the same bitmap for both the sliderBackground and the sliderBackground←-
Selected.
Parameters
sliderBackground The slider background with the slider range unselected.
sliderBackgroundSelected The slider background with the slider range selected.
indicator The indicator.
void setBitmaps (
const BitmapId sliderBackground,
const BitmapId sliderBackgroundSelected,
const BitmapId indicator )
Sets all the bitmaps for the Slider. The slider show the sliderBackgroundSelected bitmap in the region of the slider
that is selected, that is the area to the left of the indicator for a horizontal slider and below the indicator for a vertical
slider. To ignore this effect just add the same bitmap for both the sliderBackground and the sliderBackground←-
Selected.
Parameters
sliderBackground The slider background.
sliderBackgroundSelected The slider background selected.
indicator The indicator.
7.165.3.15 setNewValueCallback()
void setNewValueCallback (
GenericCallback< const Slider &, int > & callback ) [inline]
Parameters
callback The callback to be executed. The callback will be given a reference to the Slider and the current
value of the slider.
See also
GenericCallback
7.165.3.16 setStartValueCallback()
void setStartValueCallback (
GenericCallback< const Slider &, int > & callback ) [inline]
Associates an action to be performed when an interaction (drag or click) with the slider is initiated.
Parameters
callback The callback to be executed. The callback will be given a reference to the Slider and the current
value of the slider at interaction start.
See also
GenericCallback
7.165.3.17 setStopValueCallback()
void setStopValueCallback (
GenericCallback< const Slider &, int > & callback ) [inline]
Associates an action to be performed when an interaction with the slider ends (i.e. drag/click).
Parameters
callback The callback to be executed. The callback will be given a reference to the Slider and the current
value of the slider at interaction end.
See also
GenericCallback
7.165.3.18 setupHorizontalSlider()
void setupHorizontalSlider (
uint16_t backgroundX,
uint16_t backgroundY,
uint16_t indicatorY,
uint16_t indicatorMinX,
uint16_t indicatorMaxX ) [virtual]
Sets up the slider in horizontal mode with the range going from the left to right.
Places the backgrounds and the indicator inside the Slider container. It is possible to place the end points of the
indicator outside the background image if it needs to go beyond the boundaries of the background. The width and
height of the Slider will be adjusted appropriately so that both the background and the indicator will be fully visible
in both the minimum and maximum indicator positions.
Note that the x and y position of the Slider will either be the left/top of the background or the left/top of the indicator
in its minimum x coordinate.
Calls setValue with the current value (default 0) and triggers the newSliderValue callback.
Parameters
backgroundX The background x coordinate inside the slider.
backgroundY The background y coordinate inside the slider.
indicatorY The indicator y coordinate inside the slider.
indicatorMinX The indicator minimum x coordinate inside the slider. This is the position used when the slider
is at its minimum value. Must be less than indicatorMaxX.
indicatorMaxX The indicator maximum x coordinate inside the slider. This is the position used when the
slider is at its maximum value. Must be greater than indicatorMinX.
7.165.3.19 setupVerticalSlider()
void setupVerticalSlider (
uint16_t backgroundX,
uint16_t backgroundY,
uint16_t indicatorX,
uint16_t indicatorMinY,
uint16_t indicatorMaxY ) [virtual]
Sets up the slider in vertical mode with the range going from the bottom to top.
Places the backgrounds and the indicator inside the Slider container. It is possible to place the end points of the
indicator outside the background image if it needs to go beyond the boundaries of the background. The width and
height of the Slider will be adjusted appropriately so that both the background and the indicator will be fully visible
in both the minimum and maximum indicator positions.
Note that the x and y position of the Slider will either be the left/top of the background or the left/top of the indicator
in its minimum y coordinate.
Calls setValue with the current value (default 0) and triggers the newSliderValue callback.
Parameters
backgroundX The background x coordinate inside the slider.
backgroundY The background y coordinate inside the slider.
indicatorX The indicator x coordinate inside the slider.
indicatorMinY The indicator minimum y coordinate inside the slider. This is the position used when the slider
is at its maximum value. Must be less than indicatorMaxX.
indicatorMaxY The indicator maximum y coordinate inside the slider. This is the position used when the
slider is at its minimum value. Must be greater than indicatorMinX.
7.165.3.20 setValue()
void setValue (
int value ) [virtual]
Places the indicator at the specified value relative to the specified value range. Values beyond the value range will
be rounded to the min/max value in the value range.
Note that the value update triggers a newSliderValue callback just as a drag or click does.
Note that if the value range is larger than the number of pixels specified for the indicator min and max some values
will not be represented by the slider and thus is not possible to set with this method. In this case the value will be
rounded to the nearest value that is represented in the current setting.
Parameters
value The value.
void setValueRange (
int minValue,
int maxValue,
int newValue ) [virtual]
Sets the value range of the slider. Values accepted and returned by the slider will be in this range.
The slider will set its value to the specified new value.
Note that if the range is larger than the number of pixels specified for the indicator min and max some values will
not be represented by the slider.
Parameters
minValue The minimum value. Must be less than maxValue.
maxValue The maximum value. Must be greater than minValue.
newValue The new value.
void setValueRange (
int minValue,
int maxValue ) [virtual]
Sets the value range of the slider. Values accepted and returned by the slider will be in this range.
The slider will set its value to the current value or round to minValue or maxValue if the current value is outside the
new range.
Note that if the range is larger than the number of pixels specified for the indicator min and max some values will
not be represented by the slider.
Parameters
minValue The minimum value. Must be less than maxValue.
maxValue The maximum value. Must be greater than minValue.
7.165.3.23 updateIndicatorPosition()
void updateIndicatorPosition (
int16_t position ) [protected], [virtual]
Updates the indicator position described by position. Calls the newSliderValueCallback with the new value.
Parameters
position The position (x coordinate in horizontal mode and y coordinate in vertical mode).
7.165.3.24 valueToPosition()
int16_t valueToPosition (
int value ) const [protected], [virtual]
Translate a value in the value range to a position in the indicator position range (x coordinate in horizontal mode and
y in vertical mode).
Parameters
value The value.
Returns
Protected Attributes
• SnapshotWidget snapshot
The SnapshotWidget that is moved when transitioning.
• SnapshotWidget ∗ snapshotPtr
Pointer pointing to the snapshot used in this transition.The snapshot pointer.
template<Direction templateDirection>
class touchgfx::SlideTransition< templateDirection >
A Transition that slides from one screen to the next. It does so by moving a SnapShotWidget with a snapshot of the
Screen transitioning away from, and by moving the contents of Screen transitioning to.
Template Parameters
See also
Transition
7.166.2.1 SlideTransition()
SlideTransition (
const uint8_t transitionSteps = 20 ) [inline]
Constructor.
Parameters
7.166.2.2 ∼SlideTransition()
Destructor.
7.166.3.1 handleTickEvent()
Handles the tick event when transitioning. It moves the contents of the Screen's container and a SnapshotWidget
with a snapshot of the previous Screen. The direction of the transition determines the direction the contents of the
container and the SnapshotWidget moves.
Reimplemented from Transition.
7.166.3.2 init()
See also
Transition::init()
7.166.3.3 initMoveDrawable()
void initMoveDrawable (
Drawable & d ) [inline], [protected], [virtual]
Parameters
in d The Drawable to move.
7.166.3.4 tearDown()
Tear down.
See also
Transition::teadDown()
7.166.3.5 tickMoveDrawable()
void tickMoveDrawable (
Drawable & d ) [inline], [protected], [virtual]
Parameters
in d The Drawable to move.
A mix-in that will make class T draggable and able to snap to a position.
#include <touchgfx/mixins/Snapper.hpp>
• Snapper ()
Default constructor.
• virtual ∼Snapper ()
Destructor.
• virtual void handleDragEvent (const DragEvent &evt)
Called when dragging the Snapper.
• virtual void handleClickEvent (const ClickEvent &evt)
Handles the click events when the Snapper is clicked.
• void setSnapPosition (int16_t x, int16_t y)
Sets the position the Snapper should snap to.
• void setDragAction (GenericCallback< const DragEvent & > &callback)
Associates an action to be performed when the Snapper is dragged.
• void setSnappedAction (GenericCallback<> &callback)
Associates an action to be performed when the Snapper is snapped.
template<class T>
class touchgfx::Snapper< T >
A mix-in that will make class T draggable and able to snap to a position when a drag operation has ended. The
mix-in is able to perform callbacks when the snapper gets dragged and when the Snapper snaps to its snap position.
Template Parameters
See also
Draggable<T>
7.167.2.1 Snapper()
Snapper ( ) [inline]
Default constructor.
7.167.2.2 ∼Snapper()
Destructor.
7.167.3.1 handleClickEvent()
void handleClickEvent (
const ClickEvent & evt ) [inline], [virtual]
Handles the click events when the Snapper is clicked. It saves its current position as the snap position if the Snapper
is pressed. This happens when the drag operation starts.
The snapper will then move to the snap position when the click is released. This happens when the drag operation
ends.
Parameters
evt The click event.
7.167.3.2 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [inline], [virtual]
Called when dragging the Snapper. It will delegate the event if a GenericCallback is set with setDragAction.
Parameters
evt The drag event.
7.167.3.3 setDragAction()
void setDragAction (
GenericCallback< const DragEvent & > & callback ) [inline]
Parameters
callback The callback will be executed with the DragEvent.
See also
GenericCallback
7.167.3.4 setSnappedAction()
void setSnappedAction (
GenericCallback<> & callback ) [inline]
Parameters
in callback The callback to be executed on snap.
See also
GenericCallback
7.167.3.5 setSnapPosition()
void setSnapPosition (
int16_t x,
int16_t y ) [inline]
Sets the position the Snapper should snap to. This position will be overridden with the Snappers current position
when the Snapper is pressed.
Parameters
x The x coordinate.
y The y coordinate.
A widget that is able to make a snapshot of the area the SnapshotWidget covers.
#include <touchgfx/widgets/SnapshotWidget.hpp>
• SnapshotWidget ()
Default constructor.
• virtual ∼SnapshotWidget ()
Destructor.
• virtual void draw (const Rect &invalidatedArea) const
Draws the SnapshotWidget.
• virtual Rect getSolidRect () const
Gets solid rectangle.
Protected Attributes
• uint16_t ∗ fbCopy
Pointer to the animation storage in which the pixel data for this snapshot is stored. Zero if no snapshot has been
made.
• uint8_t alpha
The alpha with which to draw this snapshot.
A widget that is able to make a snapshot of the area the SnapshotWidget covers. The SnapshotWidget will show the
snapshot captured when it is drawn. Note: The snapshot must be taken from a byte aligned position. On BPP=4,
this means on even positions, x=0, 2, 4, 8,... On BPP=2, this means on positions, x= 0, 4, 8, 12,... On BPP=1, this
means on positions, x= 0, 8, 16,...
See also
Widget
7.168.2.1 SnapshotWidget()
SnapshotWidget ( )
Default constructor.
7.168.2.2 ∼SnapshotWidget()
∼SnapshotWidget ( ) [virtual]
Destructor.
7.168.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Draws the SnapshotWidget. It supports partial drawing, so it only redraws the area described by invalidatedArea.
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
Implements Drawable.
7.168.3.2 getAlpha()
Returns
7.168.3.3 getSolidRect()
Returns
Implements Drawable.
7.168.3.4 getType()
Returns
TYPE_SNAPSHOTWIDGET.
Makes a snapshot of the area the SnapshotWidget currently covers. This area is defined by setting the dimensions
and the position of the SnapshotWidget. The snapshot is stored in Animation Storage.
void makeSnapshot (
const BitmapId bmp ) [virtual]
Makes a snapshot of the area the SnapshotWidget currently covers. This area is defined by setting the dimensions
and the position of the SnapshotWidget. The snapshot is stored in the provided dynamic bitmap.
Parameters
bmp The target dynamic bitmap.
7.168.3.7 setAlpha()
void setAlpha (
const uint8_t a ) [inline]
Parameters
a The alpha value.
• StringVisuals ()
Construct an empty StringVisuals object.
• StringVisuals (const Font ∗font, colortype color, uint8_t alpha, Alignment alignment, uint16_t linespace, Text←-
Rotation rotation, TextDirection textDirection, uint8_t indentation, WideTextAction wideTextAction=WIDE_T←-
EXT_NONE)
Construct a StringVisual object for rendering text.
Public Attributes
• uint16_t linespace
Line space in pixels for multiline strings. Default is 0.
• uint8_t alpha
8-bit alpha value. Default is 255 (solid).
• uint8_t indentation
Indentation of text inside rectangle. Text will start this far from the left/right edge.
• WideTextAction wideTextAction
What to do with wide text lines.
StringVisuals ( ) [inline]
StringVisuals (
const Font ∗ font,
colortype color,
uint8_t alpha,
Alignment alignment,
uint16_t linespace,
TextRotation rotation,
TextDirection textDirection,
uint8_t indentation,
WideTextAction wideTextAction = WIDE_TEXT_NONE ) [inline]
Parameters
A swipe container.
#include <touchgfx/containers/SwipeContainer.hpp>
See also
touchgfx::Container.
7.170.2.1 add()
void add (
touchgfx::Drawable & page ) [virtual]
Parameters
in,out page The page to add.
Note
7.170.2.2 getNumberOfPages()
Returns
7.170.2.3 handleClickEvent()
Defines the event handler interface for ClickEvents. The default implementation ignores the event. The event is only
received if the drawable is touchable.
Parameters
7.170.2.4 handleDragEvent()
Defines the event handler interface for DragEvents. The event is only received if the drawable is touchable.
Parameters
7.170.2.5 handleGestureEvent()
Defines the event handler interface for GestureEvents. The default implementation ignores the event. The event is
only received if the drawable is touchable.
Parameters
7.170.2.6 handleTickEvent()
Called periodically by the framework if the Drawable instance has subscribed to timer ticks.
See also
Application::registerTimerWidget
7.170.2.7 remove()
void remove (
Drawable & page ) [virtual]
Parameters
in,out page The page to remove.
Note
This is safe to call even if page is not a page (in which case nothing happens).
7.170.2.8 setEndSwipeElasticWidth()
void setEndSwipeElasticWidth (
uint16_t width )
Parameters
width The width in pixels.
7.170.2.9 setPageIndicatorBitmaps()
void setPageIndicatorBitmaps (
const touchgfx::Bitmap & normalPage,
const touchgfx::Bitmap & highlightedPage )
Parameters
normalPage The normal page.
highlightedPage The highlighted page.
7.170.2.10 setPageIndicatorXY()
void setPageIndicatorXY (
int16_t x,
int16_t y )
Parameters
x The x coordinate.
y The y coordinate.
7.170.2.11 setPageIndicatorXYWithCenteredX()
void setPageIndicatorXYWithCenteredX (
int16_t x,
int16_t y )
Sets the x and y position of the page indicator. The value specified as x will be the center coordinate of the page
indicators.
Parameters
x The center x coordinate.
y The y coordinate.
Note
This method should not be used until all pages have been added, the setPageIndicatorBitmaps has been
called and the page indicator therefore has the correct width.
7.170.2.12 setSelectedPage()
void setSelectedPage (
uint8_t pageIndex )
Parameters
7.170.2.13 setSwipeCutoff()
void setSwipeCutoff (
uint16_t cutoff ) [virtual]
Set the swipe cutoff which indicates how far you should drag a page before it results in a page change.
Parameters
• TextArea ()
Default constructor.
• virtual Rect getSolidRect () const
Gets solid rectangle.
• void setColor (colortype color)
Sets the color of the text.
• colortype getColor () const
Gets the color of the text.
• void setAlpha (uint8_t alpha)
Sets the alpha value of the text.
• uint8_t getAlpha () const
Gets the alpha value of the text.
• virtual void setBaselineY (int16_t baselineY)
Adjusts the TextArea y coordinate to place the text at the specified baseline.
• virtual void setXBaselineY (int16_t x, int16_t baselineY)
Adjusts the TextArea y coordinate to place the text at the specified baseline.
• void setLinespacing (uint16_t space)
Sets the line spacing of the TextArea.
• uint16_t getLinespacing () const
Protected Attributes
• TypedText typedText
The TypedText to display.
• colortype color
The color to use.
• uint16_t linespace
The line spacing to use, in pixels, in case the text contains newlines.
• uint8_t alpha
The alpha to use.
• uint8_t indentation
The indentation of the text inside the text area.
• TextRotation rotation
The text rotation to use.
• WideTextAction wideTextAction
What to do if the text is wider than the text area.
This widget is capable of showing a text area on the screen. A TextArea can display a TypedText. Optional configu-
ration include text color.
Example text_example shows how to use a TextArea.
Note
A TextArea just holds a pointer to the text displayed. The developer must ensure that the pointer remains valid
when drawing.
See also
7.171.2.1 TextArea()
TextArea ( ) [inline]
7.171.3.1 draw()
void draw (
const Rect & area ) const [virtual]
Parameters
area The invalidated area.
Implements Drawable.
Reimplemented in TextAreaWithTwoWildcards, and TextAreaWithOneWildcard.
7.171.3.2 getAlpha()
Returns
7.171.3.3 getColor()
Returns
7.171.3.4 getIndentation()
Returns
The indentation.
See also
setIndetation
7.171.3.5 getLinespacing()
Returns
7.171.3.6 getRotation()
Returns
7.171.3.7 getSolidRect()
Returns
the largest solid rectangle for this widget. For a TextArea, this is an empty area.
Implements Drawable.
7.171.3.8 getTextHeight()
Gets the total height needed by the text, taking number of lines and line spacing into consideration.
Returns
7.171.3.9 getTextWidth()
Gets the width in pixels of the current associated text in the current selected language. In case of multi-lined text
the width of the widest line is returned.
Returns
7.171.3.10 getType()
Returns
TYPE_TEXTAREA.
7.171.3.11 getTypedText()
Returns
7.171.3.12 getWideTextAction()
Returns
See also
setWideTextAction
7.171.3.13 resizeHeightToCurrentText()
void resizeHeightToCurrentText ( )
Sets the height of the TextArea to match the height of the current associated text for the current selected language.
This is espicially useful for texts with WordWrap enabled.
Please note that if the current text rotation is either 90 or 270 degrees, the width of the text area will be set and not
the height, as the text is rotated.
See also
resizeToCurrentText
setWordWrap
setRotation
7.171.3.14 resizeToCurrentText()
void resizeToCurrentText ( )
Sets the dimensions of the TextArea to match the width and height of the current associated text for the current
selected language.
Please note that if the current text rotation is either 90 or 270 degrees, the width of the text area will be set to the
height of the text and vice versa, as the text is rotated.
See also
setRotation
resizeHeightToCurrentText
7.171.3.15 setAlpha()
void setAlpha (
uint8_t alpha ) [inline]
Parameters
alpha The alpha value. 255 = completely solid. 0 = invisible.
7.171.3.16 setBaselineY()
void setBaselineY (
int16_t baselineY ) [inline], [virtual]
Adjusts the text areas y coordinate so the text will have its baseline at the specified value. The placements is relative
to the specified TypedText so if this changes you have to set the baseline again. Note that setTypedText must be
called prior to setting the baseline.
Parameters
7.171.3.17 setColor()
void setColor (
colortype color ) [inline]
Parameters
color The color to use.
7.171.3.18 setIndentation()
void setIndentation (
uint8_t indent ) [inline]
Sets the indentation for the text. This is very useful when a font is an italic font where letters such as "j" and "g"
extend a lot to the left under the previous characters. if a line starts with a "j" or "g" this letter would either have to
be pushed to the right to be able to see all of it, e.g. using spaces which would ruin a multi line text which is left
aligned. This could be solved by changing a textarea.setPosition(50,50,100,100) to textarea.setPosition(45,50,110,
100) followed by a textarea.setIndentation(5). Characters that do not extend to the left under the previous characters
will be drawn in the same position in either case, but "j" and "g" will be aligned with other lines.
The function getMaxPixelsLeft() will give you the maximum number of pixels any glyph in the font extends to the left.
Parameters
indent The indentation from left (when left aligned text) and right (when right aligned text).
See also
getMaxPixelsLeft
7.171.3.19 setLinespacing()
void setLinespacing (
uint16_t space ) [inline]
Parameters
7.171.3.20 setRotation()
void setRotation (
const TextRotation rotation = TEXT_ROTATE_0 ) [inline]
Sets rotation of the text in the TextArea. The value TEXT_ROTATE_0 is the default for normal text. The value
TEXT_ROTATE_90 will rotate the text clockwise, thus writing from the top of the display and down. Similarly TE←-
XT_ROTATE_180 and TEXT_ROTATE_270 is further rotate 90 degrees clockwise.
Parameters
7.171.3.21 setTypedText()
void setTypedText (
TypedText t )
Sets the TypedText of the text area. If no prior size has been set the TextArea will be resized to fit the new TypedText.
Parameters
7.171.3.22 setWideTextAction()
void setWideTextAction (
WideTextAction action ) [inline]
Sets wide text action. Defines what to do if a line of text is wider than the text area. Default action is WIDE_TEXT←-
_NONE which means that text lines are only broken if there is a newline in the text.
If wrapping is enabled and the text would occupy more lines than the size of the TextArea, the last line will get an
ellipsis to signal that some text is missing. The character used for ellipsis is taken from the text spreadsheet.
Parameters
See also
WideTextAction
getWideTextAction
resizeHeightToCurrentText
7.171.3.23 setXBaselineY()
void setXBaselineY (
int16_t x,
int16_t baselineY ) [inline], [virtual]
Adjusts the text areas y coordinate so the text will have its baseline at the specified value. The placements is relative
to the specified TypedText so if this changes you have to set the baseline again. Note that setTypedText must be
called prior to setting the baseline. The specified x coordinate will be used as the x coordinate of the TextArea.
Parameters
• TextAreaWithOneWildcard ()
Default constructor.
• virtual int16_t getTextHeight ()
Gets text height.
• virtual void draw (const Rect &area) const
Draws TextArea and its text.
• void setWildcard (const Unicode::UnicodeChar ∗value)
Protected Attributes
TextArea with one wildcard. The format string (i.e. the text pointer set in TextArea::setText) is expected to contain a
wildcard s.
See also
TextAreaWithWildcardBase
7.172.2.1 TextAreaWithOneWildcard()
TextAreaWithOneWildcard ( ) [inline]
Note
7.172.3.1 draw()
void draw (
const Rect & area ) const [inline], [virtual]
Draws TextArea and its text if a Font is set and the TypedText associated with the TextArea is valid.
Parameters
area The invalidated area.
7.172.3.2 getTextHeight()
Returns
7.172.3.3 getTextWidth()
Gets the width in pixels of the current associated text in the current selected language. In case of multi-lined text
the width of the widest line is returned.
Returns
7.172.3.4 getType()
Returns
TYPE_TEXTAREAWITHONEWILDCARD.
7.172.3.5 getWildcard()
Returns
7.172.3.6 setWildcard()
void setWildcard (
const Unicode::UnicodeChar ∗ value ) [inline]
Parameters
• TextAreaWithTwoWildcards ()
Default constructor.
• virtual int16_t getTextHeight ()
Gets text height.
• virtual void draw (const Rect &area) const
Draws TextArea and its text.
• void setWildcard1 (const Unicode::UnicodeChar ∗value)
Sets the first wildcard in the text.
• const Unicode::UnicodeChar ∗ getWildcard1 () const
Gets the first wildcard in the text.
• void setWildcard2 (const Unicode::UnicodeChar ∗value)
Sets the second wildcard in the text.
• const Unicode::UnicodeChar ∗ getWildcard2 () const
Gets the second wildcard in the text.
• virtual uint16_t getTextWidth () const
Gets the width in pixels of the current associated text.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
TextArea with two wildcards. The format string (i.e. the text pointer set in TextArea::setText) is expected to contain
two wildcards s.
See also
TextAreaWithWildcardBase
7.173.2.1 TextAreaWithTwoWildcards()
TextAreaWithTwoWildcards ( ) [inline]
Note
7.173.3.1 draw()
void draw (
const Rect & area ) const [inline], [virtual]
Draws TextArea and its text if a Font is set and the TypedText associated with the TextArea is valid.
Parameters
area The invalidated area.
7.173.3.2 getTextHeight()
Returns
7.173.3.3 getTextWidth()
Gets the width in pixels of the current associated text in the current selected language. In case of multi-lined text
the width of the widest line is returned.
Returns
7.173.3.4 getType()
Returns
TYPE_TEXTAREAWITHTWOWILDCARDS.
7.173.3.5 getWildcard1()
Returns
7.173.3.6 getWildcard2()
Returns
7.173.3.7 setWildcard1()
void setWildcard1 (
const Unicode::UnicodeChar ∗ value ) [inline]
Sets the first wildcard in the text. Must be a zero-terminated UnicodeChar array.
Parameters
7.173.3.8 setWildcard2()
void setWildcard2 (
const Unicode::UnicodeChar ∗ value ) [inline]
Sets the second wildcard in the text. Must be a zero-terminated UnicodeChar array.
Parameters
Base class for TextAreas displaying texts with one or more wildcards.
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
• TextAreaWithWildcardBase ()
Create an empty text area.
• int16_t calculateTextHeight (const Unicode::UnicodeChar ∗format,...) const
Gets the total height needed by the text.
Base class for TextAreas displaying texts with one or more wildcards.
See also
TextAreaWithOneWildcard
TextAreaWithTwoWildcards
7.174.2.1 TextAreaWithWildcardBase()
TextAreaWithWildcardBase ( ) [inline]
Note
7.174.3.1 calculateTextHeight()
int16_t calculateTextHeight (
const Unicode::UnicodeChar ∗ format,
... ) const
Gets the total height needed by the text. Determined by number of lines and linespace. The number of wildcards in
the text should match the number of values for the wildcards.
Parameters
Returns
• TextButtonStyle ()
Default constructor.
• virtual ∼TextButtonStyle ()
Destructor.
• void setText (TypedText t)
Sets a text.
• void setTextX (int16_t x)
Sets text x coordinate.
• void setTextY (int16_t y)
Sets text y coordinate.
• void setTextXY (int16_t x, int16_t y)
Sets text xy.
• void setTextPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets text position.
• void setTextRotation (TextRotation rotation)
Sets text rotation.
• void setTextColors (colortype newColorReleased, colortype newColorPressed)
Sets text colors.
Protected Attributes
• TextArea text
The text.
• colortype colorReleased
The color released.
• colortype colorPressed
The color pressed.
template<class T>
class touchgfx::TextButtonStyle< T >
An text button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional
button. This class will show a text in one of two colors depending on the state of the button (pressed or released).
The TextButtonStyle does not set the size of the enclosing container (normally AbstractButtonContainer). The size
must be set manually.
To get a background behind the text, use TextButtonStyle together with e.g. ImageButtonStyle: TextButton←-
Style<ImageButtonStyle<ClickButtonTrigger> > myButton;
The position of the text can be adjusted with setTextXY (default is centered).
Template Parameters
See also
AbstractButtonContainer
7.175.2.1 setText()
void setText (
TypedText t ) [inline]
Parameters
t A TypedText to process.
7.175.2.2 setTextColors()
void setTextColors (
colortype newColorReleased,
colortype newColorPressed ) [inline]
Parameters
7.175.2.3 setTextPosition()
void setTextPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [inline]
Parameters
x The x coordinate.
y The y coordinate.
width The width of the text.
height The height of the text.
7.175.2.4 setTextRotation()
void setTextRotation (
TextRotation rotation ) [inline]
Parameters
rotation The rotation.
7.175.2.5 setTextX()
void setTextX (
int16_t x ) [inline]
Parameters
x The x coordinate.
7.175.2.6 setTextXY()
void setTextXY (
int16_t x,
int16_t y ) [inline]
Parameters
x The x coordinate.
y The y coordinate.
7.175.2.7 setTextY()
void setTextY (
int16_t y ) [inline]
Parameters
y The y coordinate.
A text progress.
#include <touchgfx/containers/progress_indicators/TextProgress.hpp>
• TextProgress ()
Default constructor.
• virtual ∼TextProgress ()
Destructor.
• virtual void setProgressIndicatorPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the position and dimension of the text progress indicator.
• virtual void setTypedText (const TypedText &t)
Sets the typed text.
• virtual TypedText getTypedText () const
Gets the typed text.
• virtual void setColor (colortype color)
Sets the color.
• virtual colortype getColor () const
Gets the color.
• virtual void setAlpha (uint8_t alpha)
Sets the alpha.
• virtual uint8_t getAlpha () const
Gets the alpha.
• virtual void setValue (int value)
Sets a value.
• virtual void setNumberOfDecimals (uint16_t numberOfDecimals)
Sets number of decimals.
• virtual uint16_t getNumberOfDecimals () const
Gets number of decimals.
Protected Attributes
• TextAreaWithOneWildcard textArea
The text area.
• Unicode::UnicodeChar textBuffer [9]
Room for 100.0000.
• uint16_t decimals
The number of decimals.
A text progress will display progress as a number with a given number of decimals.
Note
The implementation does not use floating point variables to calculate the progress.
7.176.2.1 TextProgress()
TextProgress ( )
Default constructor.
7.176.2.2 ∼TextProgress()
∼TextProgress ( ) [virtual]
Destructor.
7.176.3.1 getAlpha()
Returns
The alpha.
See also
setAlpha
TextArea::getAlpha
7.176.3.2 getColor()
Returns
The color.
7.176.3.3 getNumberOfDecimals()
Returns
See also
setNumberOfDecimals
7.176.3.4 getTypedText()
Returns
See also
setTypedText
7.176.3.5 setAlpha()
void setAlpha (
uint8_t alpha ) [virtual]
Parameters
alpha The alpha.
See also
getAlpha
TextArea::setAlpha
7.176.3.6 setColor()
void setColor (
colortype color ) [virtual]
Parameters
color The color.
See also
getColor
TextArea::setColor
7.176.3.7 setNumberOfDecimals()
void setNumberOfDecimals (
uint16_t numberOfDecimals ) [virtual]
Parameters
See also
getNumberOfDecimals
7.176.3.8 setProgressIndicatorPosition()
void setProgressIndicatorPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [virtual]
Sets the position and dimension of the text progress indicator relative to the background image.
Parameters
x The x coordinate.
y The y coordinate.
Parameters
7.176.3.9 setTypedText()
void setTypedText (
const TypedText & t ) [virtual]
Sets the typed text. The text should have one wildcard and could for example "< progress>%".
Parameters
t The TypedText to process.
See also
getTypedText
7.176.3.10 setValue()
Sets the current value in the range (min..max) set by setRange(). Values lower than min are mapped to min, values
higher than max are mapped to max.
Parameters
value The value.
• TextProvider ()
Default constructor.
• void initialize (const Unicode::UnicodeChar ∗format, va_list pArg)
Initializes the TextProvider.
• Unicode::UnicodeChar getNextChar ()
The TextProvider is used in drawing basic and wildcard strings. The TextProvider enables wildcard expansion of the
string at the time it is written to the LCD.
It provides printf formatted text strings one character at the time, without the need for a user provided buffer to store
the text string.
7.177.2.1 TextProvider()
TextProvider ( )
Empty constructor. The user must call initialize() before characters can be provided.
7.177.3.1 getNextChar()
Unicode::UnicodeChar getNextChar ( )
Returns
See also
TextProvider::getNextLigature()
7.177.3.2 getNextLigature()
Unicode::UnicodeChar getNextLigature (
TextDirection direction )
Gets the next ligature. For most languages this is the same as getNextChar() but eg. Arabic has different ligatures
for each character.
Note
Functions getNextLigature() and getNextChar() will advance through the same buffer and mixing the use of
those functions is not recommended and may cause undesired results. Instead create two TextProviders and
user getNextChar() on one and getNextLigature() on the other.
Parameters
direction The direction.
Returns
See also
TextProvider::getNextChar()
7.177.3.3 initialize()
void initialize (
const Unicode::UnicodeChar ∗ format,
va_list pArg )
Initializes the TextProvider. Each '\2' character in the format is replaced by one UnicodeChar∗ argument from pArg.
Parameters
Class for setting language and getting texts. The language set will determine which texts will be used.
7.178.2.1 getLanguage()
Returns
7.178.2.2 getText()
Parameters
Returns
The text.
7.178.2.3 setLanguage()
Parameters
Public Types
• TextureMapper ()
Default constructor.
• virtual ∼TextureMapper ()
Destructor.
• virtual void setBitmap (const Bitmap &bmp)
Sets the bitmap for the image.
• Bitmap getBitmap () const
Gets the bitmap for the image.
• virtual void draw (const Rect &invalidatedArea) const
Draws the given invalidated area.
• virtual Rect getSolidRect () const
Gets solid rectangle.
• virtual void setRenderingAlgorithm (RenderingAlgorithm algorithm)
Sets the algorithm to be used.
• virtual RenderingAlgorithm getRenderingAlgorithm () const
Gets the algorithm used when rendering.
• void setAlpha (uint8_t a)
Sets the global alpha blending value.
• uint8_t getAlpha () const
Gets the current alpha value.
• virtual void updateAngles (float xAngle, float yAngle, float zAngle)
Updates the angles of the image.
• virtual void updateXAngle (float xAngle)
Updates the x coordinate angle described by xAngle.
• virtual void updateYAngle (float yAngle)
Updates the y coordinate angle described by yAngle.
• virtual void updateZAngle (float zAngle)
Updates the z coordinate angle described by zAngle.
• virtual float getXAngle () const
Get x angle.
• virtual float getYAngle () const
Get y angle.
• virtual float getZAngle () const
Get z angle.
• virtual void setScale (float scale)
Sets the scale of the image.
• virtual float getScale () const
Gets the scale.
• virtual void setOrigo (float x, float y, float z)
Sets the transformation origo.
• virtual void setOrigo (float x, float y)
Sets the transformation origo.
• virtual float getOrigoX () const
Gets transformation origo x coordinate.
• void applyTransformation ()
Applies the transformation.
• Rect getBoundingRect () const
Gets bounding rectangle.
• void drawTriangle (const Rect &invalidatedArea, uint16_t ∗fb, const float ∗triangleXs, const float ∗triangleYs,
const float ∗triangleZs, const float ∗triangleUs, const float ∗triangleVs) const
Draw triangle.
• RenderingVariant lookupRenderVariant () const
Returns the rendering variant based on the bitmap format, alpha value and rendering algorithm.
Protected Attributes
• RenderingAlgorithm currentRenderingAlgorithm
The current rendering algorithm.
• Bitmap bitmap
The bitmap to render.
• uint8_t alpha
An alpha value that is applied to the entire image.
• float xBitmapPosition
The bitmap position x.
• float yBitmapPosition
The bitmap position y.
• float xAngle
The angle x.
• float yAngle
The angle y.
• float zAngle
The angle z.
• float scale
The scale.
• float xOrigo
The origo x coordinate.
• float yOrigo
The origo y coordinate.
• float zOrigo
The origo z coordinate.
• float xCamera
The camera x coordinate.
• float yCamera
The camera y coordinate.
• float cameraDistance
The camera distance.
• float imageX0
The coordinate for the image points.
• float imageY0
The coordinate for the image points.
• float imageZ0
The coordinate for the image points.
• float imageX1
The TextureMapper displays a transformed image. The TextureMapper can be used in effects where an image
should be rotated in two or three dimensions.
The image can be freely scaled and rotated in three dimensions. The scaling and rotation is done around the
adjustable origin. A virtual camera is applied to the rendered image yielding a perspective impression. The amount
of perspective impression can be adjusted. The transformed image is clipped according to the dimensions of the
TextureMapper. In order to make the image fully visible the TextureMapper should be large enough to accommodate
the transformed image.
Note that the drawing of this widget is not trivial and typically has a significant effect on the mcu load. The number
of pixels drawn, the presence of global alpha or per pixel alpha inflicts the computation and should be considered.
Note that this widget does not support 1 bit per pixel color depth.
See also
Widget
7.179.2.1 RenderingAlgorithm
enum RenderingAlgorithm
7.179.3.1 ∼TextureMapper()
∼TextureMapper ( ) [virtual]
Destructor.
7.179.4.1 applyTransformation()
Transform the bitmap using the supplied origo, scale, rotation and camera. This method is called by all the methods
that manipulate origo, scale, rotation and camera.
7.179.4.2 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Draws the given invalidated area. The part of the transformed image inside the invalidatedArea will be drawn.
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
See also
Drawable::draw()
Implements Drawable.
7.179.4.3 drawTriangle()
void drawTriangle (
const Rect & invalidatedArea,
uint16_t ∗ fb,
const float ∗ triangleXs,
The TextureMapper will draw the transformed bitmap by drawing two triangles. One triangle is created from the
points 0,1,2 and the other triangle from the points 1,2,3. The triangle is drawn using the x,y,z values from each point
along with the u,v coordinates in the bitmap associated with each point.
Parameters
invalidatedArea The invalidated area.
in,out fb If non-null, the fb.
triangleXs The triangle xs.
triangleYs The triangle ys.
triangleZs The triangle zs.
triangleUs The triangle us.
triangleVs The triangle vs.
7.179.4.4 getAlpha()
Returns
See also
setAlpha
7.179.4.5 getBitmap()
Returns
the bitmap.
7.179.4.6 getBitmapPositionX()
Returns
7.179.4.7 getBitmapPositionY()
Returns
7.179.4.8 getBoundingRect()
Returns
7.179.4.9 getCameraDistance()
Returns
7.179.4.10 getCameraX()
Returns
7.179.4.11 getCameraY()
Returns
7.179.4.12 getOrigoX()
Returns
7.179.4.13 getOrigoY()
Returns
7.179.4.14 getOrigoZ()
Returns
7.179.4.15 getRenderingAlgorithm()
Returns
7.179.4.16 getScale()
Returns
The scale.
7.179.4.17 getSolidRect()
Returns
See also
Drawable::getSolidRect()
Implements Drawable.
7.179.4.18 getType()
Returns
TYPE_TEXTUREMAPPER.
7.179.4.19 getX0()
Get the x coordinate of the top left corner of the transformed bitmap.
Returns
The X0 coordinate.
7.179.4.20 getX1()
Get the x coordinate of the top right corner of the transformed bitmap.
Returns
The X1 coordinate.
7.179.4.21 getX2()
Returns
The X2 coordinate.
7.179.4.22 getX3()
Get the x coordinate of the bottom left corner of the transformed bitmap.
Returns
The X3 coordinate.
7.179.4.23 getXAngle()
Get x angle.
Returns
The x angle.
7.179.4.24 getY0()
Get the y coordinate of the top left corner of the transformed bitmap.
Returns
The Y0 coordinate.
7.179.4.25 getY1()
Get the y coordinate of the top right corner of the transformed bitmap.
Returns
The Y1 coordinate.
7.179.4.26 getY2()
Get the y coordinate of the bottom right corner of the transformed bitmap.
Returns
The Y2 coordinate.
7.179.4.27 getY3()
Get the y coordinate of the bottom left corner of the transformed bitmap.
Returns
The Y3 coordinate.
7.179.4.28 getYAngle()
Get y angle.
Returns
The y angle.
7.179.4.29 getZ0()
Get the z coordinate of the top left corner of the transformed bitmap.
Returns
The Z0 coordinate.
7.179.4.30 getZ1()
Get the z coordinate of the top right corner of the transformed bitmap.
Returns
The Z1 coordinate.
7.179.4.31 getZ2()
Get the z coordinate of the bottom right corner of the transformed bitmap.
Returns
The Z2 coordinate.
7.179.4.32 getZ3()
Get the z coordinate of the bottom left corner of the transformed bitmap.
Returns
The Z3 coordinate.
7.179.4.33 getZAngle()
Get z angle.
Returns
The z angle.
7.179.4.34 lookupRenderVariant()
Returns the rendering variant based on the bitmap format, alpha value and rendering algorithm.
Returns
The RenderingVariant.
7.179.4.35 setAlpha()
void setAlpha (
uint8_t a ) [inline]
Parameters
a new alpha.
7.179.4.36 setBitmap()
void setBitmap (
const Bitmap & bmp ) [virtual]
Sets the bitmap for the image. Note that the width and height of the TextureMapper is set to the size of the image.
Parameters
bmp The bitmap to be used by the widget.
void setBitmapPosition (
float x,
float y ) [inline], [virtual]
Sets the position of the bitmap within the TextureMapper. The bitmap is clipped against the dimensions of the
TextureMapper.
Parameters
x The x coordinate.
y The y coordinate.
void setBitmapPosition (
int x,
int y ) [inline], [virtual]
Sets the position of the bitmap within the TextureMapper. The bitmap is clipped against the dimensions of the
TextureMapper.
Parameters
x The x coordinate.
y The y coordinate.
7.179.4.39 setCamera()
void setCamera (
float x,
float y ) [inline], [virtual]
Parameters
7.179.4.40 setCameraDistance()
void setCameraDistance (
float d ) [inline], [virtual]
Sets camera distance. Minimal allowed distance is MINIMAL_CAMERA_DISTANCE. Values below will be set to
MINIMAL_CAMERA_DISTANCE.
Parameters
d The new camera distance.
void setOrigo (
float x,
float y,
float z ) [inline], [virtual]
Parameters
x The x coordinate.
y The y coordinate.
z The z coordinate.
void setOrigo (
float x,
float y ) [inline], [virtual]
Parameters
x The x coordinate.
y The y coordinate.
7.179.4.43 setRenderingAlgorithm()
void setRenderingAlgorithm (
RenderingAlgorithm algorithm ) [inline], [virtual]
Parameters
algorithm The algorithm to use when rendering.
7.179.4.44 setScale()
void setScale (
float scale ) [virtual]
Parameters
scale The new scale value.
7.179.4.45 updateAngles()
void updateAngles (
float xAngle,
float yAngle,
float zAngle ) [virtual]
Parameters
xAngle The new x Angle.
yAngle The new y Angle.
zAngle The new x Angle.
7.179.4.46 updateXAngle()
void updateXAngle (
float xAngle ) [inline], [virtual]
Parameters
xAngle The new x angle.
7.179.4.47 updateYAngle()
void updateYAngle (
float yAngle ) [inline], [virtual]
Parameters
yAngle The new y angle.
7.179.4.48 updateZAngle()
void updateZAngle (
float zAngle ) [inline], [virtual]
Parameters
zAngle The new z angle.
A texture source. Contains a pointer to the data and the width and height of the texture. The alpha channel is used
in 565 rendering with alpha. The stride is the width used when moving to the next line of the texture.
#include <touchgfx/hal/Types.hpp>
Public Attributes
Protected Attributes
• int16_t xOffset
The X offset into the bitmap to start drawing.
• int16_t yOffset
The Y offset into the bitmap to start drawing.
Simple widget capable of showing a tiled bitmap. This means that when TiledImage is larger than the provided
Bitmap, the Bitmap is repeated over and over horizontally and vertically. The bitmap can be alpha-blended with the
background and have areas of transparency.
See also
Image
7.181.2.1 TiledImage()
TiledImage (
const Bitmap & bmp = Bitmap() ) [inline]
Constructs a new Image with a default alpha value of 255 (solid) and a default Bitmap if none is specified.
Parameters
bmp The bitmap to display.
7.181.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [virtual]
Draws the image. This class supports partial drawing, so only the area described by the rectangle will be drawn.
Parameters
invalidatedArea The rectangle to draw, with coordinates relative to this drawable.
7.181.3.2 getOffset()
void getOffset (
int16_t & x,
int16_t & y ) [virtual]
Gets the offset into the bitmap where the tile drawing should start. Please note that the offsets set using setOffset
have been normalized.
Parameters
See also
getXOffset
getYOffset
7.181.3.3 getSolidRect()
Gets the largest solid (non-transparent) rectangle. This value is pre-calculated by the image converter tool.
Returns
7.181.3.4 getType()
Returns
TYPE_IMAGE.
7.181.3.5 getXOffset()
Returns
See also
getYOffset
getOffset
7.181.3.6 getYOffset()
Returns
See also
getXOffset
getOffset
7.181.3.7 setBitmap()
void setBitmap (
const Bitmap & bmp ) [virtual]
Sets the bitmap ID for this TiledImage. Updates the width and height of this widget to match that of the bitmap.
Parameters
bmp The bitmap instance.
See also
Bitmap
7.181.3.8 setOffset()
void setOffset (
int16_t x,
int16_t y ) [virtual]
Sets an offset into the bitmap where the tile drawing should start.
Parameters
See also
setXOffset
setYOffset
7.181.3.9 setXOffset()
void setXOffset (
int16_t x ) [virtual]
Sets x offset into the bitmap where the tile drawing should start.
Parameters
See also
setYOffset
setOffset
7.181.3.10 setYOffset()
void setYOffset (
int16_t y ) [virtual]
Sets y offset into the bitmap where the tile drawing should start.
Parameters
See also
setXOffset
setOffset
• TiledImageButtonStyle ()
Default constructor.
• virtual ∼TiledImageButtonStyle ()
Destructor.
• virtual void setWidth (int16_t width)
Sets a width.
• virtual void setHeight (int16_t height)
Sets a height.
• virtual void setTileBitmaps (const Bitmap &bmpReleased, const Bitmap &bmpPressed)
Sets tile bitmaps.
• virtual void setTileOffset (int16_t x, int16_t y)
Sets an offset into the bitmap where the tile drawing should start.
Protected Attributes
• TiledImage tiledImage
The tiled image.
• Bitmap upTile
The image to display when button is released.
• Bitmap downTile
The image to display when button is pressed.
template<class T>
class touchgfx::TiledImageButtonStyle< T >
An tiled image button style. This class is supposed to be used with one of the ButtonTrigger classes to create a
functional button. This class will show one of two tiled images depending on the state of the button (pressed or
released).
The TiledImageButtonStyle does not set the size of the enclosing container (normally AbstractButtonContainer) to
the size of the pressed Bitmap. This can be overridden by calling setWidth/setHeight after setting the bitmaps.
Template Parameters
See also
AbstractButtonContainer
7.182.2.1 setHeight()
void setHeight (
int16_t height ) [inline], [virtual]
Parameters
height The height.
7.182.2.2 setTileBitmaps()
void setTileBitmaps (
const Bitmap & bmpReleased,
const Bitmap & bmpPressed ) [inline], [virtual]
Parameters
bmpReleased The bitmap released.
bmpPressed The bitmap pressed.
7.182.2.3 setTileOffset()
void setTileOffset (
int16_t x,
int16_t y ) [inline], [virtual]
Sets an offset into the bitmap where the tile drawing should start.
Parameters
7.182.2.4 setWidth()
void setWidth (
int16_t width ) [inline], [virtual]
Parameters
width The width.
A ToggleButton is a Button specialization that swaps the two bitmaps when clicked.
#include <touchgfx/widgets/ToggleButton.hpp>
• ToggleButton ()
Default constructor.
• virtual void setBitmaps (const Bitmap &bmpReleased, const Bitmap &bmpPressed)
Sets the bitmaps.
• void forceState (bool activeState)
Force the button into a specific state.
• bool getState () const
Gets the state.
• virtual void handleClickEvent (const ClickEvent &event)
Overrides handleClickEvent.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
• Bitmap originalPressed
Contains the bitmap that was originally being displayed when button is pressed.
A ToggleButton is a Button specialization that swaps the two bitmaps when clicked, such that the previous "pressed"
bitmap, now becomes the one displayed when button is not pressed.
See also
Button
7.183.2.1 ToggleButton()
ToggleButton ( )
Default constructor.
7.183.3.1 forceState()
void forceState (
bool activeState )
Use this function to force the button in one of the two possible states. If button is forced to the active state, then the
pressed bitmap from the last call to setBitmaps becomes the one displayed when button is not pressed.
Parameters
activeState If true, display the bmpPressed bitmap when not pressed. If false display the bmpReleased bitmap.
7.183.3.2 getState()
Returns
7.183.3.3 getType()
Returns
TYPE_TOGGLEBUTTON.
7.183.3.4 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [virtual]
Parameters
event The event to handle.
7.183.3.5 setBitmaps()
void setBitmaps (
const Bitmap & bmpReleased,
const Bitmap & bmpPressed ) [inline], [virtual]
Note
This specific implementation remembers what bitmap was used as pressed, in order to support the ability to
force the state.
Parameters
bmpReleased The bitmap to show in the "normal" state, ie when button is not pressed.
bmpPressed The bitmap to show when the button is pressed.
See also
Button::setBitmaps
• ToggleButtonTrigger ()
Default constructor.
• virtual ∼ToggleButtonTrigger ()
Destructor.
• void forceState (bool activeState)
Force the button into a specific state.
• void setToggleCanceled (bool isToggleCanceled)
Protected Attributes
• bool toggleCanceled
True if toggle canceled.
A toggle button trigger. This trigger will create a button that reacts on clicks. This means it will call the action when
it gets a touch released event.
The ToggleButtonTrigger will stay in pressed state until it is clicked again.
The ToggleButtonTrigger can be combined with one or more of the ButtonStyle classes to create a functional button.
7.184.2.1 forceState()
void forceState (
bool activeState ) [inline]
Use this function to force the button in one of the two possible states. If button is forced to the active state, then
AbstractButtonContainer will be in a pressed state.
Parameters
7.184.2.2 getToggleCanceled()
Returns
7.184.2.3 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [inline], [virtual]
Parameters
event The event.
7.184.2.4 setToggleCanceled()
void setToggleCanceled (
bool isToggleCanceled ) [inline]
Parameters
• TouchArea ()
Default constructor.
• virtual void draw (const Rect &invalidatedArea) const
A TouchArea will not draw anything.
• virtual void handleDragEvent (const DragEvent &evt)
A TouchArea will not move when dragged.
• virtual void handleClickEvent (const ClickEvent &event)
A TouchArea will refine the handling of click events.
• virtual Rect getSolidRect () const
A TouchArea has no solid rectangle.
• void setPressedAction (GenericCallback< const AbstractButton & > &callback)
Associates an action to be performed when the TouchArea is pressed.
• virtual uint16_t getType () const
For GUI testing only.
Protected Attributes
Invisible widget used to capture touch events. The TouchArea consumes drag events without the widget it self
moving.
See also
AbstractButton
7.185.2.1 TouchArea()
TouchArea ( ) [inline]
Default constructor.
7.185.3.1 draw()
void draw (
const Rect & invalidatedArea ) const [inline], [virtual]
Parameters
Implements Drawable.
7.185.3.2 getSolidRect()
Returns
an empty rect.
Implements Drawable.
7.185.3.3 getType()
Returns
TYPE_TOUCHAREA.
7.185.3.4 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [virtual]
A TouchArea will refine the handling of click events in order to enable the callback to the pressedAction.
Parameters
event The event to handle.
7.185.3.5 handleDragEvent()
void handleDragEvent (
const DragEvent & evt ) [inline], [virtual]
Parameters
evt The event to handle. Ignored.
7.185.3.6 setPressedAction()
void setPressedAction (
GenericCallback< const AbstractButton & > & callback ) [inline]
Parameters
• TouchButtonTrigger ()
Default constructor.
• virtual ∼TouchButtonTrigger ()
Destructor.
• virtual void handleClickEvent (const ClickEvent &event)
Handles the click event described by event.
A touch button trigger. This trigger will create a button that reacts on touches. This means it will call the action when
it gets a touch pressed event.
The TouchButtonTrigger can be combined with one or more of the ButtonStyle classes to create a functional button.
7.186.2.1 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [inline], [virtual]
Parameters
event The event.
Class TouchCalibraiton is responsible for translating coordinates (Point) based on matrix of calibration values.
7.187.2.1 setCalibrationMatrix()
Parameters
7.187.2.2 translatePoint()
Translates the specified point using the matrix. If matrix has not been initialized, p is not modified.
Parameters
in,out p The point to translate.
• virtual ∼TouchController ()
Destructor.
• virtual void init ()=0
Initializes touch controller.
• virtual bool sampleTouch (int32_t &x, int32_t &y)=0
Checks whether the touch screen is being touched, and if so, what coordinates.
7.188.2.1 ∼TouchController()
Destructor.
7.188.3.1 init()
7.188.3.2 sampleTouch()
bool sampleTouch (
int32_t & x,
int32_t & y ) [pure virtual]
Checks whether the touch screen is being touched, and if so, what coordinates.
Parameters
Returns
• Transition ()
Default constructor.
• virtual ∼Transition ()
Destructor.
• virtual void handleTickEvent ()
Called for every tick when transitioning.
• bool isDone () const
Protected Attributes
• Container ∗ screenContainer
The screen Container of the Screen transitioning to.
• bool done
Flag that indicates when the transition is done. This should be set by implementing classes.
The Transition class is the base class for Transitions. Implementations of Transition defines what happens when
transitioning between Screens, which typically involves visual effects. An example of a transition implementation
can be seen in example custom_transition_example. The most basic transition is the NoTransition class that does
a transition without any visual effects.
See also
NoTransition
SlideTransition
7.189.2.1 Transition()
Transition ( ) [inline]
7.189.2.2 ∼Transition()
Destructor.
7.189.3.1 handleTickEvent()
7.189.3.2 init()
Initializes the transition. Called after the c.tor. when the application changes the transition. Base version does
nothing.
Reimplemented in CoverTransition< templateDirection >, and SlideTransition< templateDirection >.
7.189.3.3 isDone()
Query if the transition is done transitioning. It is the responsibility of the inheriting class to set the underlying done
flag.
Returns
7.189.3.4 setScreenContainer()
void setScreenContainer (
Container & cont ) [inline], [virtual]
Sets the screen container. Is used by Screen to enable the transition to access the container.
Parameters
in cont The container the transition should have access to.
7.189.3.5 tearDown()
Tears down the Animation. Called before the d.tor. when the application changes the transition. Base version does
nothing.
Reimplemented in CoverTransition< templateDirection >, and SlideTransition< templateDirection >.
• TwoWildcardTextButtonStyle ()
Default constructor.
• virtual ∼TwoWildcardTextButtonStyle ()
Destructor.
• void setTwoWildcardText (TypedText t)
Sets wildcard text.
• void setTwoWildcardTextX (int16_t x)
Sets wildcard text x coordinate.
• void setTwoWildcardTextY (int16_t y)
Sets wildcard text y coordinate.
• void setTwoWildcardTextXY (int16_t x, int16_t y)
Sets wildcard text xy.
• void setTwoWildcardTextPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets text position.
• void setTwoWildcardTextRotation (TextRotation rotation)
Sets wildcard text rotation.
• void setWildcardTextBuffer1 (const Unicode::UnicodeChar ∗value)
Sets the first wildcard in the text.
• void setWildcardTextBuffer2 (const Unicode::UnicodeChar ∗value)
Sets the second wildcard in the text.
• void setTwoWildcardTextColors (colortype newColorReleased, colortype newColorPressed)
Sets wild card text colors.
Protected Attributes
• TextAreaWithTwoWildcards twoWildcardText
The wildcard text.
• colortype colorReleased
The color released.
• colortype colorPressed
The color pressed.
template<class T>
class touchgfx::TwoWildcardTextButtonStyle< T >
An wildcard text button style. This class is supposed to be used with one of the ButtonTrigger classes to create
a functional button. This class will show a text with a wildcard in one of two colors depending on the state of the
button (pressed or released).
The TwoWildcardTextButtonStyle does not set the size of the enclosing container (normally AbstractButton←-
Container). The size must be set manually.
To get a background behind the text, use TwoWildcardTextButtonStyle together with e.g. ImageButtonStyle: Two←-
WildcardTextButtonStyle<ImageButtonStyle<ClickButtonTrigger> > myButton;
The position of the text can be adjusted with setTwoWildcardTextXY (default is centered).
Template Parameters
See also
AbstractButtonContainer
Template Parameters
7.190.2.1 setTwoWildcardText()
void setTwoWildcardText (
TypedText t ) [inline]
Parameters
t A TypedText to process.
7.190.2.2 setTwoWildcardTextColors()
void setTwoWildcardTextColors (
colortype newColorReleased,
colortype newColorPressed ) [inline]
Parameters
7.190.2.3 setTwoWildcardTextPosition()
void setTwoWildcardTextPosition (
int16_t x,
int16_t y,
int16_t width,
Parameters
x The x coordinate.
y The y coordinate.
width The width of the text.
height The height of the text.
7.190.2.4 setTwoWildcardTextRotation()
void setTwoWildcardTextRotation (
TextRotation rotation ) [inline]
Parameters
rotation The rotation.
7.190.2.5 setTwoWildcardTextX()
void setTwoWildcardTextX (
int16_t x ) [inline]
Parameters
x The x coordinate.
7.190.2.6 setTwoWildcardTextXY()
void setTwoWildcardTextXY (
int16_t x,
int16_t y ) [inline]
Parameters
x The x coordinate.
y The y coordinate.
7.190.2.7 setTwoWildcardTextY()
void setTwoWildcardTextY (
int16_t y ) [inline]
Parameters
y The y coordinate.
7.190.2.8 setWildcardTextBuffer1()
void setWildcardTextBuffer1 (
const Unicode::UnicodeChar ∗ value ) [inline]
Sets the first wildcard in the text. Must be a zero-terminated UnicodeChar array.
Parameters
7.190.2.9 setWildcardTextBuffer2()
void setWildcardTextBuffer2 (
const Unicode::UnicodeChar ∗ value ) [inline]
Sets the second wildcard in the text. Must be a zero-terminated UnicodeChar array.
Parameters
TypedText represents text (as in characters) and typography (as in font and alignment).
#include <touchgfx/TypedText.hpp>
Classes
• struct TypedTextData
The data structure for typed texts.
• static void registerTypedTextDatabase (const TypedTextData ∗data, const Font ∗const ∗f, const uint16_t n)
Registers an array of typed texts.
• static void registerTexts (const Texts ∗t)
Registers an array of texts.
TypedText represents text (as in characters) and typography (as in font and alignment). TypedText provides methods
for interacting with the text, font and alignment.
Example text_example shows how to use TypedText.
See also
TextArea
7.191.2.1 TypedText()
TypedText (
const TypedTextId id = TYPED_TEXT_INVALID ) [inline], [explicit]
Parameters
7.191.3.1 getAlignment()
Returns
The alignment.
7.191.3.2 getFont()
Returns
The font.
7.191.3.3 getId()
Returns
The id.
7.191.3.4 getText()
Returns
The text.
7.191.3.5 getTextDirection()
Returns
The alignment.
7.191.3.6 hasValidId()
Returns
Is the id valid.
7.191.3.7 registerTexts()
Parameters
7.191.3.8 registerTypedTextDatabase()
Registers an array of typed texts. All typed text instances are bound to this database.
Parameters
Public Attributes
This class declares a handler interface for user interface events, i.e. events generated by the users interaction with
the device. With the exception of the system timer tick, all other system events, which are not related to the user
interface device peripherals (display, keys etc.) are not part of this interface.
7.193.2.1 ∼UIEventListener()
Destructor.
7.193.3.1 handleClickEvent()
void handleClickEvent (
const ClickEvent & event ) [inline], [virtual]
This handler is invoked when a mouse click or display touch event has been detected by the system.
Parameters
event The event data.
Reimplemented in Application.
7.193.3.2 handleDragEvent()
void handleDragEvent (
const DragEvent & event ) [inline], [virtual]
This handler is invoked when a drag event has been detected by the system.
Parameters
event The event data.
Reimplemented in Application.
7.193.3.3 handleGestureEvent()
void handleGestureEvent (
const GestureEvent & event ) [inline], [virtual]
This handler is invoked when a gesture event has been detected by the system.
Parameters
event The event data.
Reimplemented in Application.
7.193.3.4 handleKeyEvent()
void handleKeyEvent (
uint8_t c ) [inline], [virtual]
This handler is invoked when a key (or button) event has been detected by the system.
Parameters
c The key or button pressed.
Reimplemented in Application.
7.193.3.5 handlePendingScreenTransition()
7.193.3.6 handleTickEvent()
This handler is invoked when a system tick event has been generated. The system tick period is configured in the
HAL.
Reimplemented in Application.
This class provides simple helper functions for working with 16-bit strings.
#include <touchgfx/Unicode.hpp>
Public Types
• static UnicodeChar ∗ snprintfFloats (UnicodeChar ∗dst, uint16_t dstSize, const char ∗format, const float
∗values)
Variant of snprintf for floats only.
• static UnicodeChar ∗ snprintfFloat (UnicodeChar ∗dst, uint16_t dstSize, const char ∗format, const float value)
Variant of snprintf.
• static int strncmp (const UnicodeChar ∗RESTRICT str1, const UnicodeChar ∗RESTRICT str2, uint16_←-
t maxchars)
Compares up to maxchars characters of the string str1 to those of the string str2.
• static int strncmp_ignore_white_spaces (const UnicodeChar ∗RESTRICT str1, const UnicodeChar ∗REST←-
RICT str2, uint16_t maxchars)
Like strncmp except that ignore any spaces in the two strings.
• static uint16_t fromUTF8 (const uint8_t ∗utf8, UnicodeChar ∗dst, uint16_t maxchars)
Convert a string from utf8 to unicode.
• static uint16_t toUTF8 (const UnicodeChar ∗unicode, uint8_t ∗utf8, uint16_t maxbytes)
Converts a string from unicode to utf8.
7.194.1.1 UnicodeChar
uint16_t UnicodeChar
7.194.2.1 atoi()
String to integer conversion. Starts conversion at the start of the string. Running digits from here are converted.
Parameters
Returns
The converted integer value of the string, 0 if the string does not start with a digit.
7.194.2.2 fromUTF8()
Convert a string from utf8 to unicode. The conversion stops if there is no more room in the destination or if the
terminating zero character has been converted.
Parameters
Returns
The number of characters successfully converted from utf8 to unicode including the terminating zero.
7.194.2.3 itoa()
Parameters
value to convert.
out buffer to place result in.
bufferSize Size of buffer (number of 16-bit values).
radix to use (8 for octal, 10 for decimal, 16 for hex)
Formats a string and adds null termination. The string is formatted like when printf is used.
Support formats: %c (element type: char), %s (element type: zero-terminated UnicodeChar list), %u, %i, %d, %o,
%x (all these are integers formatted in radix 10, 10, 10, 8, 16 respectively).
The number formats (%u, %i, %d, %o and %x) all support %[0][length]X to specify the size of the generated field
(length) and whether the number should be prefixed with zeros (or blanks).
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
See also
snprintfFloat, snprintfFloats
Variant of snprintf.
Support formats: %c (element type: char), %s (element type: zero-terminated UnicodeChar list), %u, %i, %d, %o,
%x (all these are integers formatted in radix 10, 10, 10, 8, 16 respectively).
The number formats (%u, %i, %d, %o and %x) all support
%[flags][width][.precision]X
Where width is the desired width of the output. If the value is larger, more characters may be generated, but not
more than the parameter dstSize. If width is '∗' the actual width is read from the parameters passed to this function.
Where precision is the number of number of digits after the decimal point, default is 3. Use "%.f" to not generate
any numbers after the decimal point. If precision is '∗' the actual precision is read from the parameters passed to
this function.
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
Note
%f is not supported by this function because floats are converted to doubles when given as parameters in a
variable argument list (va_list). Use snprintfFloat or snprintfFloats instead.
Warning
The format string is internally copied from at char∗ to a UnicodeChar∗. This buffer has a limit of 63 charac-
ters, so if the format is longer than 63 characters, the caller must do this copying to prevent an assert from
triggering:
touchgfx::Unicode::UnicodeChar tmpfmt[200];
touchgfx::Unicode::strncpy(tmpfmt, "Very, very, very, very, very, very, very,
very, very long format %i", 200);
touchgfx::Unicode::snprintf(dst, dstSize, tmpfmt, ...);
See also
snprintfFloat, snprintfFloats
%[flags][width][.precision]f
Where width is the desired width of the output. If the value is larger, more characters may be generated, but not
more than the parameter dstSize.
Where precision is the number of number of digits after the decimal point, default is 3. Use "%.f" to not generate
any numbers after the decimal point.
Unicode::UnicodeChar buffer[20];
Unicode::snprintfFloat(buffer, 20, "%6.4f", 3.14159f);
// buffer="3.1416" Unicode::snprintfFloat(buffer, 20, "%#6.f", 3.14159f);
// buffer=" 3." Unicode::snprintfFloat(buffer, 20, "%6f", 3.14159f);
// buffer=" 3.142" Unicode::snprintfFloat(buffer, 20, "%+06.f", 3.14159f);
// buffer="+00003"
If more control over the output is needed, see snprintfFloats which can have more than a single "%f" in the string
and also supports "∗" in place of a number.
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
See also
snprintf, snprintfFloats
%[flags][width][.precision]f
Where width is the desired width of the output. If the value is larger, more characters may be generated, but not
more than the parameter dstSize.
Where precision is the number of number of digits after the decimal point, default is 3. Use "%.f" to not generate
any numbers after the decimal point.
Unicode::UnicodeChar buffer[20];
Unicode::snprintfFloat(buffer, 20, "%6.4f", 3.14159f);
// buffer="3.1416"
Unicode::snprintfFloat(buffer, 20, "%#6.f", 3.14159f);
// buffer=" 3."
Unicode::snprintfFloat(buffer, 20, "%6f", 3.14159f);
// buffer=" 3.142"
Unicode::snprintfFloat(buffer, 20, "%+06.f", 3.14159f);
// buffer="+00003"
If more control over the output is needed, see snprintfFloats which can have more than a single "%f" in the string
and also supports "∗" in place of a number.
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
Warning
The format string is internally copied from at char∗ to a UnicodeChar∗. This buffer has a limit of 63 charac-
ters, so if the format is longer than 63 characters, the caller must do this copying to prevent an assert from
triggering:
touchgfx::Unicode::UnicodeChar tmpfmt[200];
touchgfx::Unicode::strncpy(tmpfmt, "Very, very, very, very, very, very, very,
very, very long format %f", 200);
touchgfx::Unicode::snprintfFloats(dst, dstSize, tmpfmt, values);
See also
snprintf, snprintfFloats
%[flags][width][.precision]f
Where width is the desired width of the output. If the value is larger, more characters may be generated, but not
more than the parameter dstSize. If width is '∗' the actual width is read from the list of values passed to this function.
Where precision is the number of number of digits after the decimal point, default is
1. Use "%.f" to not generate any numbers after the decimal point. If precision is '∗' the actual precision is read
from the list of values passed to this function.
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
See also
snprintf, snprintfFloat
%[flags][width][.precision]f
Where width is the desired width of the output. If the value is larger, more characters may be generated, but not
more than the parameter dstSize. If width is '∗' the actual width is read from the list of values passed to this function.
Where precision is the number of number of digits after the decimal point, default is
1. Use "%.f" to not generate any numbers after the decimal point. If precision is '∗' the actual precision is read
from the list of values passed to this function.
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
@warning The format string is internally copied from at char* to a UnicodeChar*. This
buffer
has a limit of 63 characters, so if the format is longer than 63 characters, the
caller must do this copying to prevent an assert from triggering:
touchgfx::Unicode::UnicodeChar tmpfmt[200];
touchgfx::Unicode::strncpy(tmpfmt, "Very, very, very, very, very, very, very,
very, very long format %f", 200);
touchgfx::Unicode::snprintfFloats(dst, dstSize, tmpfmt, values);
See also
snprintf, snprintfFloat
Parameters
str The string in question.
Returns
Length of string.
Parameters
str The string.
Returns
Length of string.
7.194.2.12 strncmp()
Compares up to maxchars characters of the string str1 to those of the string str2. This function starts comparing the
first character of each string. If they are equal to each other, it continues with the following pairs until the characters
differ, until a terminating null-character is reached, or until maxchars characters match in both strings, whichever
happens first.
Parameters
Returns
Returns an integral value indicating the relationship between the strings: A zero value indicates that the
characters compared in both strings are all equal. A value greater than zero indicates that the first character
that does not match has a greater value in str1 than in str2; And a value less than zero indicates the opposite.
7.194.2.13 strncmp_ignore_white_spaces()
Like strncmp except that ignore any spaces in the two strings.
Parameters
Returns
Returns an integral value indicating the relationship between the strings: A zero value indicates that the
characters compared in both strings are all equal. A value greater than zero indicates that the first character
that does not match has a greater value in str1 than in str2; And a value less than zero indicates the opposite.
Copy a string to a destination buffer, UnicodeChar to UnicodeChar version. Stops if it encounters a zero-termination,
in which case the zero-termination is included in the destination string. Otherwise copies maxchars.
Parameters
out dst The destination buffer. Must have a size of at least maxchars.
in src The source string (UnicodeChars)
maxchars Maximum number of characters to copy.
Returns
Warning
If there is no null-termination among the first n UnicodeChars of src, the string placed in destination will NOT
be zero-terminated!
Copy a string to a destination buffer, char to UnicodeChar version. Stops if it encounters a zero-termination, in
which case the zero-termination is included in the destination string. Otherwise copies maxchars.
Parameters
out dst The destination buffer. Must have a size of at least maxchars.
in src The source string as an array of chars.
maxchars Maximum number of characters to copy.
Returns
Warning
If there is no null-termination among the first n bytes of src, the string placed in destination will NOT be
zero-terminated!
7.194.2.16 toUTF8()
Converts a string from unicode to utf8. The conversion stops if there is no more room in the destination or if the
terminating zero character has been converted. U+10000 through U+10FFFF are skipped.
Parameters
unicode The unicode string.
out utf8 The destination buffer for the converted string.
maxbytes The maximum number of bytes that the utf8 array can hold.
Returns
The number of characters successfully converted from unicode to utf8 including the terminating zero.
7.194.2.17 utoa()
Parameters
value to convert.
out buffer to place result in.
bufferSize Size of buffer (number of 16-bit values).
radix to use (8 for octal, 10 for decimal, 16 for hex)
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
See also
snprintf
Parameters
Returns
pointer to the first element in the buffer where the formatted string is placed.
See also
snprintf
• Vector ()
Default constructor.
• T & operator[ ] (uint16_t idx)
Index operator.
• const T & operator[ ] (uint16_t idx) const
Const version of the index operator.
• void add (T e)
Adds an element to the Vector if the Vector is not full.
• void remove (T e)
Removes an element from the Vector if found in the Vector.
• T removeAt (uint16_t index)
Removes an element at the specified index of the Vector.
• T quickRemoveAt (uint16_t index)
Removes an element at the specified index of the Vector.
• void reverse ()
Reverses the ordering of the elements in the Vector.
• bool contains (T elem)
Checks if the Vector contains an element.
• uint16_t size () const
Gets the current size of the Vector which is the number of elements contained in the Vector.
• bool isEmpty () const
Query if this object is empty.
• uint16_t maxCapacity () const
Query the maximum capacity of the vector.
• void clear ()
Clears the contents of the container.
Template Parameters
7.195.2.1 Vector()
Vector ( ) [inline]
7.195.3.1 add()
void add (
T e ) [inline]
Adds an element to the Vector if the Vector is not full. Does nothing if the Vector is full.
Parameters
e The element to add to the Vector.
7.195.3.2 clear()
Clears the contents of the container. It does not destruct any of the elements in the Vector.
7.195.3.3 contains()
bool contains (
T elem ) [inline]
Checks if the Vector contains an element. The == operator of the element is used when comparing it with the
elements in the Vector.
Parameters
elem The element.
Returns
7.195.3.4 isEmpty()
Returns
7.195.3.5 maxCapacity()
Returns
T & operator[ ] (
uint16_t idx ) [inline]
Index operator.
Parameters
Returns
Parameters
Returns
7.195.3.8 quickRemoveAt()
T quickRemoveAt (
uint16_t index ) [inline]
Removes an element at the specified index of the Vector. The last element in the list is moved to the position where
the element is removed.
Parameters
index The index to remove.
Returns
7.195.3.9 remove()
void remove (
T e ) [inline]
Removes an element from the Vector if found in the Vector. Does nothing if the element is not found in the Vector.
The == operator of the element is used when comparing it with the elements in the Vector.
Parameters
7.195.3.10 removeAt()
T removeAt (
uint16_t index ) [inline]
Removes an element at the specified index of the Vector. Will "bubble-down" any remaining elements after the
specified index.
Parameters
index The index to remove.
Returns
7.195.3.11 reverse()
7.195.3.12 size()
Gets the current size of the Vector which is the number of elements contained in the Vector.
Returns
• Vector4 ()
Default constructor.
• Vector4 (float x, float y, float z)
Constructor.
• Vector4 crossProduct (const Vector4 &operand)
Cross product.
See also
quadruple
Vector4 ( ) [inline]
Default constructor.
Vector4 (
float x,
float y,
float z ) [inline]
Constructor.
Parameters
x The x value.
y The y value.
z The z value.
7.196.3.1 crossProduct()
Vector4 crossProduct (
const Vector4 & operand ) [inline]
Cross product.
Parameters
operand The second operand.
Returns
• View ()
Default constructor.
• void bind (T &presenter)
Binds an instance of a specific Presenter type (subclass) to the View instance.
Protected Attributes
• T ∗ presenter
Pointer to the Presenter associated with this view.
template<class T>
class touchgfx::View< T >
This is a generic touchgfx::Screen specialization for normal applications. It provides a link to the Presenter class.
Note
Template Parameters
See also
Screen
7.197.2.1 View()
View ( ) [inline]
Default constructor.
7.197.3.1 bind()
void bind (
T & presenter ) [inline]
Binds an instance of a specific Presenter type (subclass) to the View instance. This function is called automatically
when a new presenter/view pair is activated.
Parameters
• Widget ()
Default constructor.
• virtual ∼Widget ()
Destructor.
• virtual void getLastChild (int16_t x, int16_t y, Drawable ∗∗last)
Function for obtaining the the last child of this widget that intersects with the specified point.
• virtual uint16_t getType () const
For GUI testing only.
A Widget is a Drawable leaf (i.e. not a container). It does not currently contain any implementation code, since the
Drawable base class handles everything related to leaf nodes. Extend this when implementing custom widgets.
See also
Drawable
7.198.2.1 Widget()
Widget ( ) [inline]
Default constructor.
7.198.2.2 ∼Widget()
Destructor.
7.198.3.1 getLastChild()
void getLastChild (
int16_t x,
int16_t y,
Drawable ∗∗ last ) [inline], [virtual]
Function for obtaining the the last child of this widget that intersects with the specified point. Used in input event
handling for obtaining the appropriate drawable that should receive the event. Note that input events must be
delegated to the last drawable of the tree (meaning highest z-order / front-most drawable).
Only containers can have children, so this implementation simply yields itself as result. The container implementa-
tion will filter children that do not intersect with the point or are not visible/enabled, so performing those checks are
unnecessary.
Parameters
Implements Drawable.
7.198.3.2 getType()
Returns
TYPE_WIDGET.
• WildcardTextButtonStyle ()
Default constructor.
• virtual ∼WildcardTextButtonStyle ()
Destructor.
• void setWildcardText (TypedText t)
Sets wildcard text.
• void setWildcardTextX (int16_t x)
Sets wildcard text x coordinate.
• void setWildcardTextY (int16_t y)
Sets wildcard text y coordinate.
• void setWildcardTextXY (int16_t x, int16_t y)
Sets wildcard text xy.
• void setWildcardTextPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets text position.
• void setWildcardTextRotation (TextRotation rotation)
Sets wildcard text rotation.
• void setWildcardTextBuffer (const Unicode::UnicodeChar ∗buffer)
Sets wildcard text buffer.
• void setWildcardTextColors (colortype newColorReleased, colortype newColorPressed)
Sets wild card text colors.
Protected Attributes
• TextAreaWithOneWildcard wildcardText
The wildcard text.
• colortype colorReleased
The color released.
• colortype colorPressed
The color pressed.
template<class T>
class touchgfx::WildcardTextButtonStyle< T >
An wildcard text button style. This class is supposed to be used with one of the ButtonTrigger classes to create
a functional button. This class will show a text with a wildcard in one of two colors depending on the state of the
button (pressed or released).
The WildcardTextButtonStyle does not set the size of the enclosing container (normally AbstractButtonContainer).
The size must be set manually.
To get a background behind the text, use WildcardTextButtonStyle together with e.g. ImageButtonStyle: Wildcard←-
TextButtonStyle<ImageButtonStyle<ClickButtonTrigger> > myButton;
The position of the text can be adjusted with setTextXY (default is centered).
Template Parameters
See also
AbstractButtonContainer
Template Parameters
7.199.2.1 setWildcardText()
void setWildcardText (
TypedText t ) [inline]
Parameters
t A TypedText to process.
7.199.2.2 setWildcardTextBuffer()
void setWildcardTextBuffer (
const Unicode::UnicodeChar ∗ buffer ) [inline]
Parameters
7.199.2.3 setWildcardTextColors()
void setWildcardTextColors (
colortype newColorReleased,
colortype newColorPressed ) [inline]
Parameters
7.199.2.4 setWildcardTextPosition()
void setWildcardTextPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [inline]
Parameters
x The x coordinate.
y The y coordinate.
width The width of the text.
height The height of the text.
7.199.2.5 setWildcardTextRotation()
void setWildcardTextRotation (
TextRotation rotation ) [inline]
Parameters
rotation The rotation.
7.199.2.6 setWildcardTextX()
void setWildcardTextX (
int16_t x ) [inline]
Parameters
x The x coordinate.
7.199.2.7 setWildcardTextXY()
void setWildcardTextXY (
int16_t x,
int16_t y ) [inline]
Parameters
x The x coordinate.
y The y coordinate.
7.199.2.8 setWildcardTextY()
void setWildcardTextY (
int16_t y ) [inline]
Parameters
y The y coordinate.
Class for optimizing and wrapping move and zoom operations on ScalableImages.
#include <touchgfx/containers/ZoomAnimationImage.hpp>
Public Types
• enum ZoomMode {
FIXED_CENTER = 0, FIXED_LEFT, FIXED_RIGHT, FIXED_TOP, FIXED_BOTTOM, FIXED_LEFT_AND←-
_TOP, FIXED_RIGHT_AND_TOP,
FIXED_LEFT_AND_BOTTOM, FIXED_RIGHT_AND_BOTTOM }
A ZoomMode describes in which direction the image will grow/shrink when do a zoom animation. A FIXED direction
means that the image will not grow/shrink in that direction.
• ZoomAnimationImage ()
Default constructor.
• virtual ∼ZoomAnimationImage ()
Destructor.
• void startZoomAnimation (int16_t endWidth, int16_t endHeight, uint16_t duration, ZoomMode zoom←-
Mode=FIXED_LEFT_AND_TOP, touchgfx::EasingEquation widthProgressionEquation=&touchgfx::Easing←-
Equations::linearEaseNone, EasingEquation heightProgressionEquation=&touchgfx::EasingEquations←-
::linearEaseNone)
Setup and starts the zoom animation.
• void startZoomAndMoveAnimation (int16_t endX, int16_t endY, int16_t endWidth, int16_t end←-
Height, uint16_t duration, ZoomMode zoomMode=FIXED_LEFT_AND_TOP, EasingEquation x←-
ProgressionEquation=&touchgfx::EasingEquations::linearEaseNone, EasingEquation yProgression←-
Equation=&touchgfx::EasingEquations::linearEaseNone, EasingEquation widthProgressionEquation=&touchgfx←-
::EasingEquations::linearEaseNone, EasingEquation heightProgressionEquation=&touchgfx::Easing←-
Equations::linearEaseNone)
Setup and starts the zoom and move animation.
• void cancelZoomAnimation ()
Cancel zoom animation.
• virtual void handleTickEvent ()
The tick handler.
• void setBitmaps (const Bitmap &smallBitmap, const Bitmap &largeBitmap)
Initializes the bitmap of the image to be used.
• Bitmap getSmallBitmap () const
Gets the small bitmap.
• Bitmap getLargeBitmap () const
Gets the large bitmap.
• virtual void setPosition (int16_t x, int16_t y, int16_t width, int16_t height)
Sets the size and position of the image, relative to its parent.
• virtual void setWidth (int16_t width)
Sets the width of the image.
Protected Types
Protected Attributes
• States currentState
The current animation state.
• uint32_t animationCounter
The progress counter for the animation.
• uint16_t zoomAnimationDelay
A delay that is applied before animation start. Expressed in ticks.
• touchgfx::Bitmap smallBmp
The bitmap representing the small image.
• touchgfx::Bitmap largeBmp
The bitmap representing the large image.
• touchgfx::Image image
The image for displaying the bitmap when the width/height is equal one of the bitmaps.
• ScalableImage scalableImage
The scalable image for displaying the bitmap when the width/height is not equal one of the bitmaps.
• ZoomMode currentZoomMode
The ZoomMode to use by the animation.
• int16_t zoomAnimationStartWidth
Width of the zoom animation start.
• int16_t zoomAnimationStartHeight
Height of the zoom animation start.
• int16_t zoomAnimationEndWidth
Width of the zoom animation end.
• int16_t zoomAnimationEndHeight
Height of the zoom animation end.
• int16_t zoomAnimationStartX
The zoom animation start x coordinate.
• int16_t zoomAnimationStartY
The zoom animation start y coordinate.
• int16_t zoomAnimationDeltaX
The zoom animation delta x.
• int16_t zoomAnimationDeltaY
The zoom animation delta y.
• int16_t moveAnimationEndX
The move animation end x coordinate.
• int16_t moveAnimationEndY
The move animation end y coordinate.
• uint16_t animationDuration
Duration of the animation.
• EasingEquation zoomAnimationWidthEquation
The zoom animation width equation.
• EasingEquation zoomAnimationHeightEquation
The zoom animation height equation.
• EasingEquation moveAnimationXEquation
The move animation x coordinate equation.
• EasingEquation moveAnimationYEquation
The move animation y coordinate equation.
• touchgfx::GenericCallback< const ZoomAnimationImage & > ∗ animationEndedAction
The animation ended action.
Class for optimizing and wrapping move and zoom operations on ScalableImages. The ZoomAnimationImage takes
two bitmaps representing the same image but at a small and a large resolution. These bitmaps should be the sizes
that are used when not animating the image. The ZoomAnimationImage will use an Image for displaying the bitmap
when its width and height matches one of them. When it does not it will use a ScalableImage instead. The main
idea is that the supplied bitmaps should be the end points of the zoom animation so that it ends up using an Image
when not animating. This is, however, not a required. You can animate from and to sizes that are not equal the sizes
of the bitmaps. The result is a container that has the high performance of an ordinary image when the size matches
the prerendered bitmaps. Moreover it supplies easy to use animation functions that lets you zoom and move the
image.
Note
Note that since this container uses the ScalableImage it has the same restrictions. That means no 1 bit per
pixel mode.
See also
ScalableImage
7.200.2.1 States
Enumerator
7.200.3.1 ZoomAnimationImage()
ZoomAnimationImage ( )
7.200.3.2 ∼ZoomAnimationImage()
∼ZoomAnimationImage ( ) [virtual]
7.200.4.1 getAlpha()
Returns
7.200.4.2 getAnimationDelay()
Returns
7.200.4.3 getLargeBitmap()
Returns
7.200.4.4 getScalingMode()
Returns
7.200.4.5 getSmallBitmap()
Returns
7.200.4.6 getType()
Returns
TYPE_ZOOMANIMATIONIMAGE.
7.200.4.7 handleTickEvent()
7.200.4.8 isRunning()
Returns
7.200.4.9 isZoomAnimationRunning()
Returns
7.200.4.10 setAlpha()
void setAlpha (
uint8_t alpha ) [virtual]
Parameters
alpha The alpha value. 255 = completely solid.
7.200.4.11 setAnimationDelay()
void setAnimationDelay (
uint16_t delay ) [virtual]
Parameters
delay The delay in ticks.
7.200.4.12 setAnimationEndedCallback()
void setAnimationEndedCallback (
touchgfx::GenericCallback< const ZoomAnimationImage & > & callback ) [inline]
Parameters
callback The callback to be executed. The callback will be given a reference to the ZoomAnimationImage.
See also
GenericCallback
7.200.4.13 setBitmaps()
void setBitmaps (
const Bitmap & smallBitmap,
const Bitmap & largeBitmap )
Initializes the bitmap of the image to be used. The bitmaps should represent the same image in the two needed
static resolutions. Note that it is possible to scale the image beyond the sizes of these bitmaps.
Parameters
smallBitmap The image in the smallest resolution.
largeBitmap The image in the largest resolution.
7.200.4.14 setCurrentState()
void setCurrentState (
States state ) [protected], [virtual]
Parameters
state The new state.
7.200.4.15 setDimension()
void setDimension (
int16_t width,
int16_t height ) [virtual]
Sets the width and height of the image. Chooses the optimal rendering method afterwards The image is automati-
cally invalidated.
Parameters
width The new width.
height The new height.
7.200.4.16 setHeight()
void setHeight (
int16_t height ) [virtual]
Sets the height of the image. Chooses the optimal rendering method afterwards. The image is automatically
invalidated.
Parameters
height The new height.
7.200.4.17 setPosition()
void setPosition (
int16_t x,
int16_t y,
int16_t width,
int16_t height ) [virtual]
Sets the size and position of the image, relative to its parent. Chooses the optimal rendering method afterwards
The image is automatically invalidated.
Parameters
7.200.4.18 setScalingMode()
void setScalingMode (
ScalableImage::ScalingAlgorithm mode ) [virtual]
Parameters
mode The new mode.
7.200.4.19 setWidth()
void setWidth (
int16_t width ) [virtual]
Sets the width of the image. Chooses the optimal rendering method afterwards The image is automatically invali-
dated.
Parameters
width The new width.
7.200.4.20 startTimerAndSetParameters()
void startTimerAndSetParameters (
int16_t endWidth,
int16_t endHeight,
uint16_t duration,
ZoomMode zoomMode,
EasingEquation widthProgressionEquation,
EasingEquation heightProgressionEquation ) [protected]
Starts timer and set parameters. Contains code shared between startZoomAnimation() and startZoomAndMove←-
Animation(). If both delay and duration is zero, the end position and size is applied and the animation is ended.
Parameters
endWidth The end width.
Parameters
endHeight The end height.
duration The duration.
zoomMode The zoom mode.
widthProgressionEquation The width progression equation.
heightProgressionEquation The height progression equation.
7.200.4.21 startZoomAndMoveAnimation()
void startZoomAndMoveAnimation (
int16_t endX,
int16_t endY,
int16_t endWidth,
int16_t endHeight,
uint16_t duration,
ZoomMode zoomMode = FIXED_LEFT_AND_TOP,
EasingEquation xProgressionEquation = &touchgfx::EasingEquations::linearEaseNone,
EasingEquation yProgressionEquation = &touchgfx::EasingEquations::linearEaseNone,
EasingEquation widthProgressionEquation = &touchgfx::EasingEquations::linearEase←-
None,
EasingEquation heightProgressionEquation = &touchgfx::EasingEquations::linear←-
EaseNone )
Setup and starts the zoom and move animation. At end of the animation the image will have been resized to the
endWidth and endHeight and have moved from its original position to the endX and endY. Please note that the
ZoomMode might influence the actual end position since the zoom transformation might change the X and Y of the
image. The ZoomMode FIXED_LEFT_AND_TOP ensures that the endX and endY will be the actual end position.
The development of the width, height, X and Y during the animation is described by the supplied EasingEquations.
The container is registered as a TimerWidget. Unregistering is handled automatically when the animation has
finished.
Parameters
endX The X position of the image at animation end. Relative to the container or view
that holds the ZoomAnimationImage.
endY The Y position of the image at animation end. Relative to the container or view
that holds the ZoomAnimationImage.
endWidth The width of the image at animation end.
endHeight The height of the image at animation end.
duration The duration of the animation measured in ticks.
zoomMode The zoom mode that will be used during the animation. Default =
FIXED_LEFT_AND_TOP.
xProgressionEquation The equation that describes the development of the X position during the
animation. Default = EasingEquations::linearEaseNone.
yProgressionEquation The equation that describes the development of the Y position during the
animation. Default = EasingEquations::linearEaseNone.
widthProgressionEquation The equation that describes the development of the width during the animation.
Default = EasingEquations::linearEaseNone.
heightProgressionEquation The equation that describes the development of the height during the animation.
Default = EasingEquations::linearEaseNone.
7.200.4.22 startZoomAnimation()
void startZoomAnimation (
int16_t endWidth,
int16_t endHeight,
uint16_t duration,
ZoomMode zoomMode = FIXED_LEFT_AND_TOP,
touchgfx::EasingEquation widthProgressionEquation = &touchgfx::EasingEquations←-
::linearEaseNone,
EasingEquation heightProgressionEquation = &touchgfx::EasingEquations::linear←-
EaseNone )
Setup and starts the zoom animation. At end of the animation the image will have been resized to the end←-
Width and endHeight. The development of the width and height during the animation is described by the supplied
EasingEquations. The container is registered as a TimerWidget. Unregistering is handled automatically when the
animation has finished.
Note that the animation follows the specified ZoomMode so the X and Y of the image might change during animation.
Parameters
7.200.4.23 updateRenderingMethod()
Chooses the optimal rendering of the image given the current width and height.
7.200.4.24 updateZoomAnimationDeltaXY()
Calculates the change in X and Y caused by the zoom animation given the current ZoomMode.
find get
touchgfx::AbstractPartition, 92 touchgfx::GPIO, 334
touchgfx::ConstFont, 223 touchgfx::LED, 444
first getAbsoluteRect
touchgfx::DMA_Queue, 253 touchgfx::Drawable, 263
touchgfx::LockFreeDMA_Queue, 467 getAlignment
fixed28_4Mul touchgfx::TypedText, 747
touchgfx, 52 getAllocationCount
fixed28_4ToFloat touchgfx::AbstractPartition, 92
touchgfx, 52 getAllowed
floatToFixed16_16 touchgfx::DMA_Interface, 250
touchgfx, 52 getAlpha
floatToFixed28_4 touchgfx::AbstractButtonContainer, 66
touchgfx, 52 touchgfx::Box, 147
floorDivMod touchgfx::BoxProgress, 150
touchgfx, 53 touchgfx::BoxWithBorder, 154
flush touchgfx::Button, 160
touchgfx::DMA_Interface, 250 touchgfx::CanvasWidget, 184
touchgfx::NoDMA, 487 touchgfx::CircleProgress, 206
flushDMA touchgfx::DigitalClock, 241
touchgfx::HAL, 347 touchgfx::Image, 376
flushFrameBuffer touchgfx::ImageProgress, 380
touchgfx::HALSDL2, 363 touchgfx::LineProgress, 458
touchgfx::HAL, 347 touchgfx::PainterGRAY2, 502
Font, 310 touchgfx::PainterGRAY2Bitmap, 505
touchgfx::Font, 311 touchgfx::PainterGRAY4, 508
FontManager, 318 touchgfx::PainterGRAY4Bitmap, 511
FontProvider, 319 touchgfx::PainterRGB565, 515
forEachChild touchgfx::PainterRGB565Bitmap, 518
touchgfx::Container, 227 touchgfx::PainterRGB888, 521
forceReportAsSolid
touchgfx::PainterRGB888Bitmap, 525
touchgfx::Box, 147
touchgfx::PixelDataWidget, 532
forceState
touchgfx::RadioButton, 554
touchgfx::ToggleButton, 732
touchgfx::ScalableImage, 584
touchgfx::ToggleButtonTrigger, 734
touchgfx::SnapshotWidget, 674
FrameBuffer
touchgfx::TextArea, 683
touchgfx, 49
touchgfx::TextProgress, 700
FrameRefreshStrategy
touchgfx::TextureMapper, 712
touchgfx::HAL, 341
touchgfx::ZoomAnimationImage, 781
fromUTF8
getAlphaData
touchgfx::Unicode, 753
touchgfx::Bitmap, 140
frontPorchEntered
getAnchorAtZero
touchgfx::HAL, 348
touchgfx::ImageProgress, 380
GPIO_ID getAngle
touchgfx::GPIO, 333 touchgfx::AbstractShape, 101
GPIO, 333 getAnimationDelay
gcd touchgfx::ZoomAnimationImage, 781
touchgfx, 53 getAnimationDuration
GenericCallback< T1, T2, T3 >, 320 touchgfx::AnalogClock, 110
GenericCallback< T1, T2, void >, 322 touchgfx::SlideMenu, 651
GenericCallback< T1, void, void >, 324 getAnimationEasingEquation
GenericCallback< void >, 325 touchgfx::SlideMenu, 651
GestureEvent, 327 getAnimationStep
touchgfx::GestureEvent, 328 touchgfx::AnimationTextureMapper, 124
GestureType getAnimationSteps
touchgfx::GestureEvent, 327 touchgfx::ScrollBase, 612
Gestures, 329 getAnimationStorage
touchgfx::Gestures, 330 touchgfx::HAL, 348
setAllowed setBitmap
touchgfx::DMA_Interface, 251 touchgfx::AnimatedImage, 119
setAlpha touchgfx::Image, 377
touchgfx::AbstractButtonContainer, 67 touchgfx::ImageProgress, 382
touchgfx::Box, 148 touchgfx::PainterBWBitmap, 500
touchgfx::BoxProgress, 151 touchgfx::PainterGRAY2Bitmap, 507
touchgfx::BoxWithBorder, 155 touchgfx::PainterGRAY4Bitmap, 513
touchgfx::Button, 161 touchgfx::PainterRGB565Bitmap, 520
touchgfx::CanvasWidget, 185 touchgfx::PainterRGB888Bitmap, 526
touchgfx::CircleProgress, 208 touchgfx::ScalableImage, 586
touchgfx::DigitalClock, 242 touchgfx::TextureMapper, 719
touchgfx::Image, 377 touchgfx::TiledImage, 726
touchgfx::ImageProgress, 381 setBitmapFormat
touchgfx::LineProgress, 460 touchgfx::PixelDataWidget, 533
touchgfx::PainterGRAY2, 503 setBitmapPosition
touchgfx::PainterGRAY2Bitmap, 506 touchgfx::TextureMapper, 719
touchgfx::PainterGRAY4, 510 setBitmapXY
touchgfx::PainterGRAY4Bitmap, 513 touchgfx::AnimatedImageButtonStyle, 121
touchgfx::PainterRGB565, 516 touchgfx::ImageButtonStyle, 379
touchgfx::PainterRGB565Bitmap, 520 setBitmaps
touchgfx::PainterRGB888, 523 touchgfx::AnimatedImage, 119
touchgfx::PainterRGB888Bitmap, 526 touchgfx::AnimatedImageButtonStyle, 121
touchgfx::PixelDataWidget, 533 touchgfx::Button, 161
touchgfx::RadioButton, 555 touchgfx::ButtonWithIcon, 165
touchgfx::ScalableImage, 586 touchgfx::ImageButtonStyle, 378
touchgfx::SnapshotWidget, 675 touchgfx::RadioButton, 556
touchgfx::TextArea, 686 touchgfx::Slider, 662, 663
touchgfx::TextProgress, 701 touchgfx::ToggleButton, 733
touchgfx::TextureMapper, 718 touchgfx::ZoomAnimationImage, 783
touchgfx::ZoomAnimationImage, 782 setBorderColor
setAnchorAtZero touchgfx::BoxWithBorder, 155
touchgfx::ImageProgress, 381 setBorderSize
setAngle touchgfx::BoxWithBorder, 155
touchgfx::AbstractShape, 104 touchgfx::BoxWithBorderButtonStyle, 157
setAnimateToCallback setBoxWithBorderColors
touchgfx::ScrollWheelBase, 632 touchgfx::BoxWithBorderButtonStyle, 157
setAnimation setBoxWithBorderHeight
touchgfx::AnalogClock, 112 touchgfx::BoxWithBorderButtonStyle, 158
setAnimationDelay setBoxWithBorderPosition
touchgfx::ZoomAnimationImage, 783 touchgfx::BoxWithBorderButtonStyle, 158
setAnimationDuration setBoxWithBorderWidth
touchgfx::SlideMenu, 654 touchgfx::BoxWithBorderButtonStyle, 158
setAnimationEasingEquation setBuffer
touchgfx::SlideMenu, 654 touchgfx::Keyboard, 395
setAnimationEndedCallback setBufferPosition
touchgfx::ScrollBase, 617 touchgfx::Keyboard, 395
touchgfx::ZoomAnimationImage, 783 setButtonController
setAnimationSteps touchgfx::HAL, 354
touchgfx::ScrollBase, 618 setCCConsumed
setArc touchgfx::MCUInstrumentation, 475
touchgfx::Circle, 199, 200 setCache
setBackground touchgfx::AbstractShape, 104
touchgfx::AbstractProgressIndicator, 97 touchgfx::Bitmap, 143
touchgfx::AnalogClock, 112 touchgfx::Shape, 646
touchgfx::ModalWindow, 478, 479 setCalibrationMatrix
setBaselineY touchgfx::TouchCalibration, 739
touchgfx::DigitalClock, 242 setCamera
touchgfx::TextArea, 687 touchgfx::TextureMapper, 719
setTileOffset touchgfx::AbstractPainter, 74
touchgfx::TiledImageButtonStyle, 730 setWidth
setTime12Hour touchgfx::DigitalClock, 244
touchgfx::AbstractClock, 69 touchgfx::Drawable, 272
setTime24Hour touchgfx::DrawableList, 282
touchgfx::AbstractClock, 69 touchgfx::ScrollBase, 622
setToggleCanceled touchgfx::ScrollWheelWithSelectionStyle, 641
touchgfx::ToggleButtonTrigger, 735 touchgfx::TiledImageButtonStyle, 731
setTouchSampleRate touchgfx::ZoomAnimationImage, 785
touchgfx::HAL, 357 setWildcard
setTouchable touchgfx::TextAreaWithOneWildcard, 691
touchgfx::Drawable, 271 setWildcard1
setTwoWildcardText touchgfx::TextAreaWithTwoWildcards, 694
touchgfx::TwoWildcardTextButtonStyle, 744 setWildcard2
setTwoWildcardTextColors touchgfx::TextAreaWithTwoWildcards, 694
touchgfx::TwoWildcardTextButtonStyle, 744 setWildcardText
setTwoWildcardTextPosition touchgfx::WildcardTextButtonStyle, 775
touchgfx::TwoWildcardTextButtonStyle, 744 setWildcardTextBuffer
setTwoWildcardTextRotation touchgfx::WildcardTextButtonStyle, 775
touchgfx::TwoWildcardTextButtonStyle, 745 setWildcardTextBuffer1
setTwoWildcardTextXY touchgfx::TwoWildcardTextButtonStyle, 746
touchgfx::TwoWildcardTextButtonStyle, 745 setWildcardTextBuffer2
setTwoWildcardTextX touchgfx::TwoWildcardTextButtonStyle, 746
touchgfx::TwoWildcardTextButtonStyle, 745 setWildcardTextColors
setTwoWildcardTextY touchgfx::WildcardTextButtonStyle, 775
touchgfx::TwoWildcardTextButtonStyle, 745 setWildcardTextPosition
setType touchgfx::WildcardTextButtonStyle, 775
touchgfx::ClickEvent, 215 setWildcardTextRotation
setTypedText touchgfx::WildcardTextButtonStyle, 776
touchgfx::DigitalClock, 243 setWildcardTextXY
touchgfx::TextArea, 688 touchgfx::WildcardTextButtonStyle, 776
touchgfx::TextProgress, 703 setWildcardTextX
setUpdateTicksInterval touchgfx::WildcardTextButtonStyle, 776
touchgfx::AnimatedImage, 119 setWildcardTextY
touchgfx::AnimatedImageButtonStyle, 122 touchgfx::WildcardTextButtonStyle, 776
setValue setWindowSize
touchgfx::AbstractProgressIndicator, 98 touchgfx::ScrollList, 627
touchgfx::BoxProgress, 152 setWindowTitle
touchgfx::CircleProgress, 210 touchgfx::HALSDL2, 367
touchgfx::ImageProgress, 382 setWriteMemoryUsageReport
touchgfx::LineProgress, 462 touchgfx::CanvasWidgetRenderer, 190
touchgfx::Slider, 665 setXBaselineY
touchgfx::TextProgress, 703 touchgfx::TextArea, 689
setValueRange setXOffset
touchgfx::Slider, 666 touchgfx::TiledImage, 727
setViewDistance setXY
touchgfx::Matrix4x4, 472 touchgfx::Drawable, 273
setVisible setYOffset
touchgfx::Drawable, 272 touchgfx::TiledImage, 727
setVisiblePixelsWhenCollapsed setup
touchgfx::SlideMenu, 657 touchgfx::SlideMenu, 656
setVsyncInterval setupAnimation
touchgfx::HALSDL2, 367 touchgfx::AnimationTextureMapper, 126
setWideTextAction setupBuffer
touchgfx::TextArea, 688 touchgfx::CanvasWidgetRenderer, 189
setWidget setupDataCopy
touchgfx::JSMOCHelper, 388 touchgfx::DMA_Interface, 251
setWidgetAlpha touchgfx::NoDMA, 488
updateIndicatorPosition
touchgfx::Slider, 666
updateLineWidth
touchgfx::Line, 455, 456
updateRenderingMethod
touchgfx::ZoomAnimationImage, 787
updateStart
touchgfx::Line, 456
updateTextPosition
touchgfx::ButtonWithLabel, 170
updateXAngle
touchgfx::TextureMapper, 721
updateYAngle
touchgfx::TextureMapper, 722
updateZAngle
touchgfx::TextureMapper, 722
updateZoomAnimationDeltaXY
touchgfx::ZoomAnimationImage, 787
useSMOCDrawing
touchgfx::Screen, 595
usingSMOC
touchgfx::Screen, 596
utoa
touchgfx::Unicode, 764
vSync
touchgfx::HAL, 359
valueToPosition
touchgfx::Slider, 667
Vector
touchgfx::Vector, 766
Vector< T, capacity >, 765
Vector4, 769
touchgfx::Vector4, 770
View
touchgfx::View, 771
View< T >, 770
vsnprintf
touchgfx::Unicode, 764, 765
waitForFrameBufferSemaphore
touchgfx::DMA_Interface, 252
waitForVSync
touchgfx::OSWrappers, 492
wasOutlineTooComplex
touchgfx::Outline, 495
touchgfx::Rasterizer, 567
WideTextAction
touchgfx, 50
Widget, 772
touchgfx::Widget, 772
width
touchgfx::GlyphNode, 333
WildcardTextButtonStyle< T >, 773
writeRegister
touchgfx::I2C, 369
ZoomAnimationImage, 777
touchgfx::ZoomAnimationImage, 780