Add BGR color feature (#553)

* Add BGR color configuration

* Version up (to load correctly?)

* Revert "Version up (to load correctly?)"

This reverts commit 5f676ad47a.
This commit is contained in:
Vasil-Pahomov
2022-01-09 22:23:46 +03:00
committed by GitHub
parent 269edf0317
commit 4085973edf

View File

@@ -593,6 +593,45 @@ public:
};
class NeoBgrFeature : public Neo3ByteElementsNoSettings
{
public:
static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color)
{
uint8_t* p = getPixelAddress(pPixels, indexPixel);
*p++ = color.B;
*p++ = color.G;
*p = color.R;
}
static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel)
{
ColorObject color;
const uint8_t* p = getPixelAddress(pPixels, indexPixel);
color.B = *p++;
color.G = *p++;
color.R = *p;
return color;
}
static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel)
{
ColorObject color;
const uint8_t* p = getPixelAddress(reinterpret_cast<const uint8_t*>(pPixels), indexPixel);
color.B = pgm_read_byte(p++);
color.G = pgm_read_byte(p++);
color.R = pgm_read_byte(p);
return color;
}
};
class NeoRgbw64Feature : public Neo8ByteElementsNoSettings
{
public: