Bit confused about void TFT_eSPI::drawGlyph(uint16_t code) #1927
Frank-Bemelman
started this conversation in
General
Replies: 1 comment 1 reply
-
The flickering is likely due to the display being updated too frequently with changing values, or maybe the screen is being cleared between updates? Post a simple complete example demonstrating the problem. The extra code queues up pixels of the same colour for more efficient (faster) rendering. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to understand why my ili9341 240x320 display shows quite a bit of flickering when updating it very frequently (10 times a second) with text in smooth font, so I dug into this function just for the heck of it.
First part is to fill the background above the glyph. Ok.
Then the drawing of the glyph, walking through each y and x. Makes sense.
And finally fill the background below the glyph. Ok.
I see two nested for loops to draw the actual glyph:
for (int32_t y = 0; y < gHeight[gNum]; y++)
and
for (int32_t x = 0; x < gWidth[gNum]; x++)
There is a lot going on here, that I don't understand. Pixel checks, bl and fl, drawFastHLine calls.
If I remove all code, and only keep these two lines:
if (getColor) bg = getColor(x + cx, y + cy);
drawPixel(x + cx, y + cy, alphaBlend(pixel, fg, bg));
...it works just as good (in my case anyway). Even when I leave out the getColor line, I see no diffence - but I could imagine that comes into place when printing text over an image background.
So I am a bit puzzled about all this code and it's purpose.
In the meantime, I am starting to believe the flickering I notice is an artefact of the display itself. It is also much more noticabe when I look at an angle, and much less when I look at it sitting perfectly in front.
That's all folks ;-)
Beta Was this translation helpful? Give feedback.
All reactions