forked from Makuna/NeoPixelBus
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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user