Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

GFX Library speed performance
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

GFX Library speed performance

by TomCee on Tue Aug 18, 2020 4:34 pm

Are there any specifications for the GFX library for various graphics tasks? Draw lines, fill screen, etc...

For instance, I need to draw, then blank a line. How long does this take?

Thank you,
TomC

TomCee
 
Posts: 3
Joined: Tue Aug 18, 2020 1:34 pm

Re: GFX Library speed performance

by mikeysklar on Tue Aug 18, 2020 5:35 pm

Hello TomC,

There are "primitives" built into the GFX library. Performance will dramatically vary based on the type of processor you are using.

Code: Select all | TOGGLE FULL SIZE
 void drawPixel(uint16_t x, uint16_t y, uint16_t color);

Code: Select all | TOGGLE FULL SIZE
 void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);

Code: Select all | TOGGLE FULL SIZE
 void drawFastVLine(uint16_t x0, uint16_t y0, uint16_t length, uint16_t color);
void drawFastHLine(uint8_t x0, uint8_t y0, uint8_t length, uint16_t color);

Code: Select all | TOGGLE FULL SIZE
 void drawRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t color);
void fillRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t color);

Code: Select all | TOGGLE FULL SIZE
 void drawCircle(uint16_t x0, uint16_t y0, uint16_t r, uint16_t color);
void fillCircle(uint16_t x0, uint16_t y0, uint16_t r, uint16_t color);

Code: Select all | TOGGLE FULL SIZE
 void drawRoundRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t radius, uint16_t color);
void fillRoundRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t radius, uint16_t color);

Code: Select all | TOGGLE FULL SIZE
 void drawTriangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
void fillTriangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);

Code: Select all | TOGGLE FULL SIZE
 void fillScreen(uint16_t color);


There is also support for text characters and bitmaps.

posting.php?mode=reply&f=47&t=168551

mikeysklar
 
Posts: 2007
Joined: Mon Aug 01, 2016 8:10 pm

Re: GFX Library speed performance

by TomCee on Wed Aug 19, 2020 8:58 am

Hello Mike

Thank you for the prompt reply.

I understand that total execution time will vary with processor used, but am curious what is the response time of the display itself. Can I draw a white line[or pixel], then retrace it in black within xx mSec? [Of course we can then get into the region of eye persistence. ]

Tnx
TomC

TomCee
 
Posts: 3
Joined: Tue Aug 18, 2020 1:34 pm

Re: GFX Library speed performance

by mikeysklar on Wed Aug 19, 2020 6:44 pm

Hi TomCee,

I don't have specific timings on screen performance. However, we do have a great thread that discusses the Hackaday Optimized GFX libraries and a few tips about increasing display performance by avoiding too many calls to pgm_read_byte() and passing both foreground and background color with setTextColor().

viewtopic.php?f=25&t=80992
https://hackaday.io/project/6038-pdqgfx ... d-graphics
https://github.com/XarkLabs/PDQ_GFX_Lib ... er/PDQ_GFX

mikeysklar
 
Posts: 2007
Joined: Mon Aug 01, 2016 8:10 pm

Re: GFX Library speed performance

by TomCee on Wed Aug 19, 2020 7:51 pm

Excellent...thanks...

TomC

TomCee
 
Posts: 3
Joined: Tue Aug 18, 2020 1:34 pm

Please be positive and constructive with your questions and comments.