Select one of the symbols to view example projects that use it.
 
Outline
#define LCD24BPP_HPP
#include <touchgfx/hal/Types.hpp>
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/lcd/LCD.hpp>
#include <touchgfx/Font.hpp>
#include <touchgfx/Bitmap.hpp>
#include <touchgfx/Unicode.hpp>
#include <touchgfx/TextProvider.hpp>
#include <touchgfx/TextureMapTypes.hpp>
#include <stdarg.h>
touchgfx
Files
loading...
CodeScopeSTM32 Libraries and SamplesTouchGFXtouchgfx/framework/include/platform/driver/lcd/LCD24bpp.hpp
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * This file is part of the TouchGFX 4.10.0 distribution. * * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license * SLA0044, the "License"; You may not use this file except in compliance with * the License. You may obtain a copy of the License at: * www.st.com/SLA0044 * ****************************************************************************** *//* ... */ #ifndef LCD24BPP_HPP #define LCD24BPP_HPP #include <touchgfx/hal/Types.hpp> #include <touchgfx/hal/HAL.hpp> #include <touchgfx/lcd/LCD.hpp> #include <touchgfx/Font.hpp> #include <touchgfx/Bitmap.hpp> #include <touchgfx/Unicode.hpp> #include <touchgfx/TextProvider.hpp> #include <touchgfx/TextureMapTypes.hpp> #include <stdarg.h> 9 includes namespace touchgfx { #undef LCD /** * @class LCD24bpp LCD24bpp.hpp platform/driver/lcd/LCD24bpp.hpp * * @brief This class contains the various low-level drawing routines for drawing bitmaps. * * This class contains the various low-level drawing routines for drawing bitmaps, texts * and rectangles on 16 bits per pixel displays. * * @note All coordinates are expected to be in absolute coordinates! * * @see LCD *//* ... */ class LCD24bpp : public LCD { public: virtual ~LCD24bpp() {} /** * @fn virtual void LCD24bpp::init(); * * @brief Performs initialization. * * Performs initialization. *//* ... */ virtual void init(); /** * @fn virtual void LCD24bpp::drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); * * @brief Draws a portion of a bitmap. * * Draws a portion of a bitmap. * * @param bitmap The bitmap to draw. * @param x The absolute x coordinate to place pixel (0, 0) on the screen. * @param y The absolute y coordinate to place pixel (0, 0) on the screen. * @param rect A rectangle describing what region of the bitmap is to be drawn. * @param alpha Optional alpha value. Default is 255 (solid). * @param useOptimized if false, do not attempt to substitute (parts of) this bitmap with * faster fillrects. *//* ... */ virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true); /** * @fn virtual void LCD24bpp::blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); * * @brief Blits a 2D source-array to the framebuffer. * * 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. * * @param sourceData The source-array pointer (points to the beginning of the * data). The sourceData must be stored as 16-bits RGB565 * values. * @param source The location and dimension of the source. * @param blitRect A rectangle describing what region is to be drawn. * @param alpha The alpha value to use for blending (255 = solid, no blending) * @param hasTransparentPixels If true, this data copy contains transparent pixels and * require hardware support for that to be enabled. *//* ... */ virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); /** * @fn virtual void LCD24bpp::blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); * * @brief Blits a 2D source-array to the framebuffer while converting the format. * * 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. * * @param 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. * @param sourceFormat The bitmap format used in the source data. * @param source The location and dimension of the source. * @param blitRect A rectangle describing what region is to be drawn. * @param alpha The alpha value to use for blending (255 = solid, no blending) * @param hasTransparentPixels If true, this data copy contains transparent pixels and * require hardware support for that to be enabled. *//* ... */ virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels); /** * @fn virtual uint16_t* LCD24bpp::copyFrameBufferRegionToMemory(const Rect& region, const BitmapId bitmap = BITMAP_ANIMATION_STORAGE) = 0; * * @brief Copies a part of the frame buffer. * * Copies a part of the frame buffer to a bitmap. * * @param region The part to copy. * @param bitmap The bitmap to store the data in. Default parameter is Animation Storage. * * @return A pointer to the copy. * *//* ... */ virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& region, const BitmapId bitmap = BITMAP_ANIMATION_STORAGE); /** * @fn virtual void LCD24bpp::fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); * * @brief Draws a filled rectangle in the specified color. * * Draws a filled rectangle in the specified color. * * @param rect The rectangle to draw in absolute coordinates. * @param color The rectangle color. * @param alpha The rectangle opacity (255=solid) *//* ... */ virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255); /** * @fn virtual uint8_t LCD24bpp::bitDepth() const * * @brief Number of bits per pixel used by the display. * * Number of bits per pixel used by the display. * * @return The number of bits per pixel. *//* ... */ virtual uint8_t bitDepth() const { return 24; ...} public: protected: static const uint16_t TRANSPARENT_COL = 0xABCD; ///< Transparency color. /** * @fn virtual void LCD24bpp::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); * * @brief 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. * * 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 subDivisionSize will * determine the size of the piecewise affine texture mapped lines. * * @param dest The description of where the texture is drawn - can be used to * issue a draw off screen. * @param gradients The gradients using in interpolation across the scan line. * @param leftEdge The left edge of the scan line. * @param rightEdge The right edge of the scan line. * @param texture The texture. * @param absoluteRect The containing rectangle in absolute coordinates. * @param dirtyAreaAbsolute The dirty area in absolute coordinates. * @param renderVariant The render variant - includes the algorithm and the pixel format. * @param alpha The alpha. * @param 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. *//* ... */ 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); /** * @fn static int LCD24bpp::nextPixel(bool portrait, TextRotation rotation); * * @brief Find out how much to advance in the display buffer to get to the next pixel. * * Find out how much to advance in the display buffer to get to the next pixel. * * @param portrait Is the display running in portrait mode? * @param rotation Rotation to perform. * * @return How much to advance to get to the next pixel. *//* ... */ static int nextPixel(bool portrait, TextRotation rotation); /** * @fn static int LCD24bpp::nextLine(bool portrait, TextRotation rotation); * * @brief Find out how much to advance in the display buffer to get to the next line. * * Find out how much to advance in the display buffer to get to the next line. * * @param portrait Is the display running in portrait mode? * @param rotation Rotation to perform. * * @return How much to advance to get to the next line. *//* ... */ static int nextLine(bool portrait, TextRotation rotation); /** * @fn virtual void LCD24bpp::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); * * @brief Private version of draw-glyph with explicit destination buffer pointer argument. * * Private version of draw-glyph with explicit destination buffer pointer argument. * For all parameters (except the buffer pointer) see the public version of * drawGlyph() * * @param [in] wbuf The destination (frame) buffer to draw to. * @param widgetArea The canvas to draw the glyph inside. * @param x Horizontal offset to start drawing the glyph. * @param y Vertical offset to start drawing the glyph. * @param offsetX Horizontal offset in the glyph to start drawing from. * @param offsetY Vertical offset in the glyph to start drawing from. * @param invalidatedArea The area to draw within. * @param glyph Specifications of the glyph to draw. * @param glyphData Data containing the actual glyph (dense format) * @param color The color of the glyph. * @param bitsPerPixel Bit depth of the glyph. * @param alpha The transparency of the glyph. * @param rotation Rotation to do before drawing the glyph. *//* ... */ 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); /** * @fn static void LCD24bpp::blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha); * * @brief Blits a 2D source-array to the framebuffer. * * 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. * * @param sourceData The source-array pointer (points to the beginning of the data). The * sourceData must be stored as 32- bits ARGB8888 values. * @param source The location and dimension of the source. * @param blitRect A rectangle describing what region is to be drawn. * @param alpha The alpha value to use for blending applied to the whole image (255 = * solid, no blending) *//* ... */ static void blitCopyARGB8888(const uint32_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);protected: ...}; ...} // namespace touchgfx/* ... */ #endif // LCD24BPP_HPP