diff --git a/T_GAMMA.md b/T_GAMMA.md index eb41fb5..6e8fdb6 100644 --- a/T_GAMMA.md +++ b/T_GAMMA.md @@ -2,21 +2,27 @@ The T_GAMMA is a template class specialization feature that defines the specific You as the sketch author do not need to write one of these as a library of them is available for you to choose from. If you need something custom then you can write your own, just copy one of the following and modify as you see fit. ### NeoGammaEquationMethod -If not specified this is the default used. It uses an equation to calculate the gamma correction. It is slower but more accurate. +It uses an equation to calculate the gamma correction. It is slower but more accurate. ``` NeoPixelBusLg strip(PixelCount, PixelPin); +or +NeoGamma colorGamma; ``` ### NeoGammaCieLabEquationMethod Like the NeoGammaEquationMethod but uses as a specific model by the CIE Lab. It is slower but more accurate. ``` NeoPixelBusLg strip(PixelCount, PixelPin); +or +NeoGamma colorGamma; ``` ### NeoGammaTableMethod This will use a pre-calculated static lookup table to improve performance. This consumes memory to contain the lookup table. While just as accurate when using 8-bit color elements, the accuracy is not as good when using 16-bit color elements. ``` NeoPixelBusLg strip(PixelCount, PixelPin); +or +NeoGamma colorGamma; ``` ### NeoGammaDynamicTableMethod @@ -24,7 +30,9 @@ This will use sketch defined equation to dynamically create at runtime the pre-c Using this specialization object will require that you provide a callback function that will calculate the gamma and that in setup() of your sketch that you call NeoGammaDynamicTableMethod::Initialize(yourGammaCalcFunction). ``` -NeoPixelBusLg strip(PixelCount, PixelPin); +NeoPixelBusLg strip(PixelCount, PixelPin); +or +NeoGamma colorGamma; float GammaCalc(float unitValue) { // we will use CieLab gamma equation for our custom table @@ -44,9 +52,11 @@ This will cause no gamma correction to be applied. Use this as way to disable g NeoPixelBusLg strip(PixelCount, PixelPin); ``` -### NeoGammaInvert +### NeoGammaInvertMethod In the rare case that your NeoPixels have values that are inverted where it thinks 0 is full bright and 255 is black; you can use this wrapping specialization class to invert the colors at the last stage of pixel adjustments. -Below demonstrates the construction of a NeoPixelBusLg object using an inverted NeoGammaTableMethod for gamma specialization. +Below demonstrates the use for an inverted NeoGammaTableMethod for gamma specialization. ``` -NeoPixelBusLg> strip(PixelCount, PixelPin); +NeoPixelBusLg> strip(PixelCount, PixelPin); +or +NeoGamma> colorGamma; ```