From d343e630b4105dbcf53ab2998df337cd88afb0b4 Mon Sep 17 00:00:00 2001 From: reaper7 Date: Wed, 6 Apr 2016 17:03:59 +0200 Subject: [PATCH] new feature NeoRbgFeature --- src/internal/NeoColorFeatures.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/internal/NeoColorFeatures.h b/src/internal/NeoColorFeatures.h index e0afb39..3062645 100644 --- a/src/internal/NeoColorFeatures.h +++ b/src/internal/NeoColorFeatures.h @@ -181,3 +181,28 @@ public: return color; } }; + +class NeoRbgFeature : public Neo3Elements +{ +public: + static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color) + { + uint8_t* p = getPixelAddress(pPixels, indexPixel); + + *p++ = color.R; + *p++ = color.B; + *p = color.G; + } + + static ColorObject retrievePixelColor(uint8_t* pPixels, uint16_t indexPixel) + { + ColorObject color; + uint8_t* p = getPixelAddress(pPixels, indexPixel); + + color.R = *p++; + color.B = *p++; + color.G = *p; + + return color; + } +};