From e04c30c8aeb5355a9f1760610f49abd22c6dc96c Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Sat, 20 Feb 2021 18:26:20 +0300 Subject: [PATCH] Build-time flag to disable CIE1931 color correction Signed-off-by: Emil Muratov --- ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 9 ++++++++- ESP32-HUB75-MatrixPanel-I2S-DMA.h | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index 6525ef4..6feee64 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -478,10 +478,11 @@ void IRAM_ATTR MatrixPanel_I2S_DMA::updateMatrixDMABuffer(int16_t x_coord, int16 * i.e. It's almost impossible for color_depth_idx of 0 to be sent out to the MATRIX unless the 'value' of a color is exactly '1' * https://ledshield.wordpress.com/2012/11/13/led-brightness-to-your-eye-gamma-correction-no/ */ - +#ifndef NO_CIE1931 red = lumConvTab[red]; green = lumConvTab[green]; blue = lumConvTab[blue]; +#endif /* When using the drawPixel, we are obviously only changing the value of one x,y position, * however, the two-scan panels paint TWO lines at the same time @@ -543,9 +544,11 @@ void MatrixPanel_I2S_DMA::updateMatrixDMABuffer(uint8_t red, uint8_t green, uint if ( !initialized ) return; /* https://ledshield.wordpress.com/2012/11/13/led-brightness-to-your-eye-gamma-correction-no/ */ +#ifndef NO_CIE1931 red = lumConvTab[red]; green = lumConvTab[green]; blue = lumConvTab[blue]; +#endif for(uint8_t color_depth_idx=0; color_depth_idx