MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_string_renderer.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
23 
31 #ifndef LE_STRING_RENDERER_H
32 #define LE_STRING_RENDERER_H
33 
35 
36 // *****************************************************************************
37 /* Structure:
38  struct leStringRenderRequest
39 
40  Summary:
41  Defines the arguments necessary to perform an leString draw operation
42 
43  Description:
44  const leString* str - the string to draw
45  int32_t x - the x position in screen space
46  int32_t y - the y position in screen space
47  leHAlignment align - the alignment of the string
48  leColor color - the color to write
49  uint32_t alpha - global alpha value to apply
50 
51  Remarks:
52  None.
53 */
58 typedef struct leStringRenderRequest
59 {
60  const leString* str;
61  int32_t x;
62  int32_t y;
63  leHAlignment align;
64  leColor color;
65  uint32_t alpha;
66  const leBlendLookupTable* lookupTable;
68 
69 // *****************************************************************************
70 /* Structure:
71  struct leUStringRenderRequest
72 
73  Summary:
74  Defines the arguments necessary to perform an leChar string draw operation
75 
76  Description:
77  const leChar* str - the string buffer to draw
78  uint32_t length - the length of the string in leChar
79  const leFont* font - the font to reference for rendering
80  int32_t x - the x position in screen space
81  int32_t y - the y position in screen space
82  leHAlignment align - the alignment of the string
83  leColor color - the color to write
84  uint32_t alpha - global alpha value to apply
85 
86  Remarks:
87  None.
88 */
93 typedef struct leUStringRenderRequest
94 {
95  const leChar* str;
96  uint32_t length;
97  const leFont* font;
98  int32_t x;
99  int32_t y;
100  leHAlignment align;
101  leColor color;
102  uint32_t alpha;
103  const leBlendLookupTable* lookupTable;
105 
106 // *****************************************************************************
107 /* Structure:
108  struct leCStringRenderRequest
109 
110  Summary:
111  Defines the arguments necessary to perform a C-style string draw operation
112 
113  Description:
114  const char* str - the c string buffer to draw
115  const leFont* font - the font to reference for rendering
116  int32_t x - the x position in screen space
117  int32_t y - the y position in screen space
118  leHAlignment align - the alignment of the string
119  leColor color - the color to write
120  uint32_t alpha - global alpha value to apply
121 
122  Remarks:
123  None.
124 */
130 {
131  const char* str;
132  const leFont* font;
133  int32_t x;
134  int32_t y;
135  leHAlignment align;
136  leColor color;
137  uint32_t alpha;
138  const leBlendLookupTable* lookupTable;
140 
141 // *****************************************************************************
153 
154 // *****************************************************************************
166 
167 // *****************************************************************************
179 
180 #endif /* LE_STRING_RENDERER_H */
virtual uint32_t length(const leString *_this)
Get length of the string.
This struct represents a string render request.
Definition: legato_string_renderer.h:58
leResult leStringRenderer_DrawUString(leUStringRenderRequest *req)
Draw C-Style string.
Definition: legato_string_renderer.c:253
This struct represents a string.
Definition: legato_string.h:107
This struct represents a font object.
Definition: legato_font.h:156
This struct represents a c-style string render request.
Definition: legato_string_renderer.h:129
leResult
This enum represents function call results.
Definition: legato_common.h:123
struct leUStringRenderRequest leUStringRenderRequest
This struct represents a lechar string render request.
This struct represents a lechar string render request.
Definition: legato_string_renderer.h:93
leResult leStringRenderer_DrawString(leStringRenderRequest *req)
Draw an leString.
Definition: legato_string_renderer.c:159
leResult leStringRenderer_DrawCString(leCStringRenderRequest *req)
Draw leChar string.
Definition: legato_string_renderer.c:346
leHAlignment
This enum represents the horizontal alignment mode of objects.
Definition: legato_common.h:195
This struct represents a blend color lookup table.
Definition: legato_color.h:293
struct leStringRenderRequest leStringRenderRequest
This struct represents a string render request.
uint16_t leChar
This typedef represents Legato character.
Definition: legato_common.h:414
struct leCStringRenderRequest leCStringRenderRequest
This struct represents a c-style string render request.
Fixed string functions and definitions.