-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a faster tft pixel draw? #6
Comments
At the moment only XDrawLine fromt the XWindows driver is used here: Of course using only the point and line functions is not the fastest way to write to the screen, but the simpliest. A possibility to speed it up would be to add the XFillRectangle function: and afterwards to access it from the Adafruit-Driver or your Fastled-Driver. |
Thanks for the pointer. It will work, but it will be so slow (and apparently somewhat locks for X server for each dot printed), that isn't very useable. I completely suck a XWindow programming, so sorry that my knowledge is 0 there. You are right that I can get around it by XFillRectangle, and I may do that, but if the drawPixel primitive can't be faste, some adafruit::gfx code won't work well. thanks for your answer. |
You are right, drawing a bitmap is quite slow. It is done with this example. I think it should be possible to speed it up by using XCreateImage: |
As a quick update, for now I ended up using the already working (and fast) SDL support: http://marc.merlins.org/perso/arduino/post_2020-01-24_Running-Arduino-code-with-2D-FastLED_-Adafruit_GFX_-and-LEDMatrix-displays-on-Linux.html X11 output support is left just in case, but given that it's not scaled up (the SDL output is), the SDL support has been preferable anyway. |
Hi again,
I'm working on bringing a big library of APIs on top of your work (to allow developing on PCs for faster speed and debugging).
I've already done the work with a fork of your lib that uses SDL, but it's an old fork of your work that is lacking serial support plus a lot of code you added, and I'd rather have is depend on X11 instead of SDL.
The SDL version does work well and fast, though, it writes to an emulated neopixel 1D array that gets rendered into a 2D SDL matrix: https://github.com/MarcFork/FastLEDonPc
My concern at this point is that all my code relies on a framebuffer that is stored in memory and synced to the hardware backend when matrix->show() is called.
The only way I knew how to implement this is by calling XWindow::drawPoint_RGB for every dot, in the matrix, but it is very slow (0.2sec for only 160x120 resolution). See:
https://github.com/marcmerlin/FastLED_TFTWrapper_GFX/blob/2a2de242054f227f603156139b5bbeed6197193a/FastLED_TFTWrapper_GFX.cpp#L28
Is there a better way to give a precomputed square matrix in RGB888 to Xwindow without calling the slow draw pixel, pixel by pixel?
Thanks.
The text was updated successfully, but these errors were encountered: