Add BGR color configuration

This commit is contained in:
Vasil
2022-01-07 14:37:48 +03:00
parent 1f109e9a24
commit f929ad6e7a

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: