forked from Makuna/NeoPixelBus
Add BGR color configuration
This commit is contained in:
@@ -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
|
class NeoRgbw64Feature : public Neo8ByteElementsNoSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user