Updated NeoGamma object (markdown)

Michael Miller
2023-04-02 12:11:22 -07:00
parent 29127e6484
commit 12413b62df

@@ -1,25 +1,23 @@
The NeoGamma object provides an easy way to convert a color object to a gamma corrected value. The human eye perceives light levels differently than what the NeoPixels show. NeoPixels brightness levels are very linear so this object will convert them to the nonlinear so that what you see is what you expected.
To construct one, you need provide a method that defines how it does the calculation. There are two methods supported, either by the equation or by a look-up table.
```
NeoGamma<NeoGammaEquationMethod> colorGamma;
To construct one, you need provide a gamma model that defines how it does the calculation. There are several models already supplied to select from.
```
NeoGamma<NeoGammaTableMethod> colorGamma;
```
Once you have one, you can then just call the Correct() method on it to get a gamma corrected color.
```
color = colorGamma.Correct(color);
```
### [The List of Gamma objects](https://github.com/Makuna/NeoPixelBus/wiki/T_GAMMA)
## NeoGamma
### Methods
#### RgbColor Correct(RgbColor original)
This will return the color corrected into the human perceived linear visible spectrum.
#### RgbwColor Correct(RgbwColor original)
This will return the color corrected into the human perceived linear visible spectrum.
## NeoGammaEquationMethod
This method will use a floating point equation to calculate the conversion. It requires very little memory but will require more CPU overhead to run than the NeoGammaTableMethod. Its provided for those with restricted memory devices.
## NeoGammaTableMethod
This method will use a 256 byte table to lookup the conversion values. It will be very fast to do conversion and should be the method to use if you can spare the memory.
#### RgbColor Correct(const RgbColor& original)
This will return the 8-bit RGB color corrected into the human perceived linear visible spectrum.
#### RgbwColor Correct(const RgbwColor& original)
This will return the 8-bit RGBW color corrected into the human perceived linear visible spectrum.
#### Rgb48Color Correct(const Rgb48Color& original)
This will return the 16-bit RGB color corrected into the human perceived linear visible spectrum.
#### Rgbw64Color Correct(const Rgbw64Color& original)
This will return the 16-bit RGBW color corrected into the human perceived linear visible spectrum.