diff --git a/keywords.txt b/keywords.txt index 473d7b0..d293bbd 100644 --- a/keywords.txt +++ b/keywords.txt @@ -33,8 +33,10 @@ NeoRbgFeature KEYWORD1 NeoBgrFeature KEYWORD1 NeoRgbw64Feature KEYWORD1 NeoRgb48Feature KEYWORD1 +NeoGrb48Feature KEYWORD1 NeoRgbUcs8903Feature KEYWORD1 NeoRgbwUcs8904Feature KEYWORD1 +NeoGrb48Ws2816Feature KEYWORD1 NeoWrgbTm1814Feature KEYWORD1 NeoRgbTm1914Feature KEYWORD1 NeoGrbTm1914Feature KEYWORD1 diff --git a/src/internal/NeoColorFeatures.h b/src/internal/NeoColorFeatures.h index 5c6a0f5..5c01170 100644 --- a/src/internal/NeoColorFeatures.h +++ b/src/internal/NeoColorFeatures.h @@ -710,4 +710,45 @@ public: }; typedef NeoRgb48Feature NeoRgbUcs8903Feature; -typedef NeoRgbw64Feature NeoRgbwUcs8904Feature; \ No newline at end of file +typedef NeoRgbw64Feature NeoRgbwUcs8904Feature; + + + +class NeoGrb48Feature : public Neo6ByteElementsNoSettings +{ +public: + static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color) + { + uint16_t* p = reinterpret_cast(getPixelAddress(pPixels, indexPixel)); + + *p++ = color.G; + *p++ = color.R; + *p = color.B; + } + + static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint16_t* p = reinterpret_cast(getPixelAddress(pPixels, indexPixel)); + + color.G = *p++; + color.R = *p++; + color.B = *p; + + return color; + } + + static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint16_t* p = reinterpret_cast(getPixelAddress(reinterpret_cast(pPixels), indexPixel)); + + color.G = pgm_read_word(p++); + color.R = pgm_read_word(p++); + color.B = pgm_read_word(p); + + return color; + } +}; + +typedef NeoGrb48Feature NeoGrbWs2816Feature;