Created NeoPixelBusLg object (markdown)

Michael Miller
2023-04-01 10:41:11 -07:00
parent a6c7402543
commit 664b97ac2c

22
NeoPixelBusLg-object.md Normal file

@@ -0,0 +1,22 @@
See [NeoPixeBus object](https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object) for more details on the general use of this object.
See [NeoPixelBusLg object API Reference](https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBusLg-object-API) for more details on the methods exposed.
This object is provided to wrap up concepts of luminance control with gamma correction in a supportable object for most users. For more advanced users, look at the NeoPixelBufferShader example for an approach that provides more control and flexibility.
This object differs from the normal NeoPixelBus by supporting a strip wide luminance feature with gamma correction.
This object allows one place to set and query a general luminance of the entire strip. When the luminance is changed, all pixels that are set after the change will be modified.
The human eye perceives light levels differently than what the NeoPixels or DotStars show. The LEDs brightness levels are very linear so the gamma correction will convert them to a nonlinear curve so that what you see is what you expected. Providing a better overall brightness level across the colors.
**Note:** When the luminance is changed, it does not change current pixels values as the original values before being modified by luminance and corrected for gamma are not stored and thus cannot be reconstituted and run back through the modifications.
Just like the normal NeoPixelObject, it must be constructed with a ["Feature"](https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object#neo-features) and a ["Method"](https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object#neo-methods) object that define which pixels you are using and how they are updated.
```
NeoPixelBusLg<NeoGrbFeature, NeoWs2812xMethod> strip(pixelCount, pixelPin);
```
A new optional template specialization "T_GAMMA" has been added to control how gamma correction is done. The default if not specified is a slower but more accurate equation method. This can easily be changed by providing one of the many alternatives, in this example below the faster table lookup method.
```
NeoPixelBusLg<NeoRgbFeature, NeoWs2812xMethod, NeoGammaTableMethod> strip(PixelCount, PixelPin);
```