PxMatrix icon indicating copy to clipboard operation
PxMatrix copied to clipboard

Faster draw functions (up to 10 times)

Open giummy opened this issue 7 years ago • 2 comments

  • Precompute of indices of the buffer array to speed up drawings
  • Faster draw single pixel (fillMatrixBuffer)
  • Implementation of virtual AdaFruit GFX methods: --- drawFastHLine --- drawFastVLine --- fillRect The source has been indented and formatted using tabs, merge could not be handled by Git.

giummy avatar Jun 27 '18 18:06 giummy

Hi there,

wow that’s hard to read like that. Will try to plow through it when I have the time. I had a pbrief look … first thing I noticed is that 40MHz SPI clk is not going to work on most matrices. Also I don’t get how you can pre-compute without knowing x - you simply set it to 0. Have to spend some time on understanding whats going on.

Cheers

Dom

On 27. Jun 2018, at 20:02, giummy [email protected] wrote:

Precompute of indices of the buffer array to speed up drawings Faster draw single pixel (fillMatrixBuffer) Implementation of virtual AdaFruit GFX methods: --- drawFastHLine --- drawFastVLine --- fillRect The source has been indented and formatted using tabs, merge could not be handled by Git. You can view, comment on, or merge this pull request online at:

https://github.com/2dom/PxMatrix/pull/24 https://github.com/2dom/PxMatrix/pull/24 Commit Summary

Faster draw functions (up to 10 times) File Changes

M PxMatrix.h https://github.com/2dom/PxMatrix/pull/24/files#diff-0 (1364) Patch Links:

https://github.com/2dom/PxMatrix/pull/24.patch https://github.com/2dom/PxMatrix/pull/24.patch https://github.com/2dom/PxMatrix/pull/24.diff https://github.com/2dom/PxMatrix/pull/24.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/2dom/PxMatrix/pull/24, or mute the thread https://github.com/notifications/unsubscribe-auth/AD4vjG6nzmrDRl0tCn4Xd4Yn-uZnE5Qoks5uA8jNgaJpZM4U6JMD.

2dom avatar Jun 27 '18 18:06 2dom

Oops, my 8266 is working at 40MHz with a 64x32 led matrix. Can be set at 20MHz, the optimization is at buffer matrix level, not at SPI. The main idea is to compute the offset of the first byte of each line (actually the last one, since it is reversed to be streamed to SPI). This works correctly for 32x32 and 64x32 matrices, I didn't test for panel_width>1, but the original slower method is still there and can be used instead. At least since I would grab more than one panel... :)

giummy avatar Jun 27 '18 18:06 giummy