These are chat archives for Makuna/NeoPixelBus

9th
Jun 2018
Michael Miller
@Makuna
Jun 09 2018 00:13 UTC
@ge0rg This work is preset as the NeoGamma object
Michael Miller
@Makuna
Jun 09 2018 00:19 UTC
I suggest correcting the color right before calling SetPixelColor
Georg Lukas
@ge0rg
Jun 09 2018 17:02 UTC
@Makuna what I'm doing is darkening the pixels in place, so I'd need a shadow copy of all pixels without gamma correction, and apply the correction on each loop for each pixel:
            NeoGrbFeature::ColorObject c = neopixel.GetPixelColor(i);
            c.Darken(3);
            neopixel.SetPixelColor(i, c);
@Makuna my hope was to be able to tell NeoPixel that it should automatically apply gamma correction when translating the shadow copy into the UART/DMA buffer
Michael Miller
@Makuna
Jun 09 2018 18:08 UTC
@ge0rg Did you read the Wiki FAQ on Darkening in Place. The same caution listed there applies to gamma correction. I do not suggest using In-Place modifications as design method as it will induce quantization and you will get some strange effects. Further, due to only a few "NeoMethods" actually use a secondary buffer, there is no translation exposed as it would causing orphan functionality for others and make porting between them imposible.
The design model I suggest is that pixel values are calculated and applied. Not knowing what your source or what you put into the strip I can't suggest an exact plan; but in general, look at the animation support for some samples on how to do this.
Michael Miller
@Makuna
Jun 09 2018 18:14 UTC
To support a general double buffer supported across all NeoMethods, there is a NeoDib object that can contain a "image", and then have it rendered into the strip using its method "Render" passing it a shader object that includes the code you want; in your case both the Darken and gamma correction.
Michael Miller
@Makuna
Jun 09 2018 18:39 UTC
There is an example that shows how to use the NeoDib, see NeoPixelDibTest example, which demonstrates dimming.