Repository navigation
Added setPixel method - #3
electron-rare wants to merge 7 commits into
Conversation
|
Hello, and thank you for your interest in making ObjectFLED bertter. However I don't see a reason to expose a method to bypass draw buffer and write directly to frame buffer. What is your use case for this? Also, I'm afraid such a method would not work anyway, since whatever it writes to frame buffer is overwritten by show(). When I ported OctoWS2811 code to ObjectFLED, I removed setPixel()/getPixel() methods, and encapsulated the framebuffer in the object, so users don't have to worry about it like in Octo code. You might find OctoWS2811 a better library for your needs, since framebuffer is created in user sketch. I looked at your last 7 commits, and the one which changes ObjectFLED.cpp is a mess, from changing the whitespace of every line in your code editor. I cannot tell what you changed. If your code editor does this to a diff, then make separate commits: one for the whitespace changes when you load and save; and one for actual changes you make in code after that. Better yet, set your code editor not to re-format all the whitespace. |
|
Hello,
I put back the setpixel and getpixel functions, to have backward compatibility with octo based code receiving artnet frames.
I also made all the ribbon options (GRBW etc...) because they were not implemented in the switch case, which caused the code to crash...
I'm not a very good programmer, more of an electronics specialist ;)
clément saillant / l'életron rare
664 Route de la Rivière
69870 Grandris
06 25 33 44 20
***@***.***
… Le 12 févr. 2025 à 16:44, KurtMF ***@***.***> a écrit :
Hello, and thank you for your interest in making ObjectFLED bertter. However I don't see a reason to expose a method to bypass draw buffer and write directly to frame buffer. What is your use case for this?
Also, I'm afraid such a method would not work anyway, since whatever it writes to frame buffer is overwritten by show().
When I ported OctoWS2811 code to ObjectFLED, I removed setPixel()/getPixel() methods, and encapsulated the framebuffer in the object, so users don't have to worry about it like in Octo code.
I looked at your last 7 commits, and the one which changes ObjectFLED.cpp is a mess, from changing the whitespace of every line in your code editor. I cannot tell what you changed. If your code editor does this to a diff, then make separate commits: one for the whitespace changes when you load and save; and one for actual changes you make in code after that.
—
Reply to this email directly, view it on GitHub <#3 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AZ5GPA5ISXKWF3LFAXELDIT2PNT6BAVCNFSM6AAAAABW3B2M3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJUGEYDMNRRHE>.
You are receiving this because you authored the thread.
|
|
Arcnet frames? That is a LAN protocol. Neither Octo or ObjectFLED processes network frames. It still doesn't make sense to me to have this setPixel method when it's output to framebuffer is destroyed every time you show it. It sounds to me like you are doing something proprietary with this code, and while you are welcome to use it for that, the changes you make don't belong in the library for general use. Setting pixel colors is performed with writes to the user-defined drawing buffer. A non-functional setPixel method is not something I'm going to merge into this library. Also, I never intended to add all the possible combinations of RGB and RGBW to the code, since I cannot find evidence that anyone is actually making LED chips with color orders not already supported in ObjectFLED. I searched Google, Amazon, Digikey, and Adafruit websites for this. I don't want to add overhead to the show() method for checking color orders that don't actually exist in the real world. That said, do you have actual LED chips which require one of these extra color formats you want to add? Can you provide link to it's datasheet? The only time ObjectFLED uses the color format routines you are trying to update, is when it is running the genFrameBuffer() routine, which is what replaces anything you put there with your new setPixel method. None of this makes sense to me, sorry. |
|
I did some reading about Artnet protocol, and I also double-checked the OctoWS2811 code for setPixel(). I confirmed that Octo does not write pixel data to it's framebuffer, it writes to user-supplied draw buffer. Then just as in Object, Octo replaces the entire framebuffer with new data every time show() is called. I cannot see how your code changes in this PR could possibly work or be functional. From OctoWS2811: If you had something working with OctoWS2811, and you want to port it to ObjectFLED, then these steps should convert your code successfully:
setPixel(index, color); replaced with: myDrawBuffer[index] = color; |
|
There is 1 key difference between OctoWS2811 and ObjectFLED. While both libraries expect input in RGB byte-order format, Octo will apply different color formats (ie- GBR, RGBW, etc) only when setPixel() is used. If you write to your Octo draw buffer directly (without setPixel), you need to order the colors yourself. ObjectFLED will apply different color formats when show() is called, translating RGB format of the entire draw buffer to the required format (GBR, RGBW, etc) in frame buffer. There is no need for setPixel(), except to simplify writing an already simple memory assignment to draw buffer. In addition to color order translation, ObjectFLED show() also applies brightness and color balance translations to the draw buffer when generating frame buffer. These translations are not available in Octo. |
|
Closing this, will re-visit when you return to LEDCurtain duty. Does your OctoWWS2811 LEDCurtain code work? If so, I think there's easier way to port it to ObjectFLED. |
add setPixel method, to update pixel with source (SD, artnet, video...)
in progress added BGRW, GRBW, WRGB...