forked from Makuna/NeoPixelBus
GRB48 Color Feature (#581)
This commit is contained in:
@@ -33,8 +33,10 @@ NeoRbgFeature KEYWORD1
|
|||||||
NeoBgrFeature KEYWORD1
|
NeoBgrFeature KEYWORD1
|
||||||
NeoRgbw64Feature KEYWORD1
|
NeoRgbw64Feature KEYWORD1
|
||||||
NeoRgb48Feature KEYWORD1
|
NeoRgb48Feature KEYWORD1
|
||||||
|
NeoGrb48Feature KEYWORD1
|
||||||
NeoRgbUcs8903Feature KEYWORD1
|
NeoRgbUcs8903Feature KEYWORD1
|
||||||
NeoRgbwUcs8904Feature KEYWORD1
|
NeoRgbwUcs8904Feature KEYWORD1
|
||||||
|
NeoGrb48Ws2816Feature KEYWORD1
|
||||||
NeoWrgbTm1814Feature KEYWORD1
|
NeoWrgbTm1814Feature KEYWORD1
|
||||||
NeoRgbTm1914Feature KEYWORD1
|
NeoRgbTm1914Feature KEYWORD1
|
||||||
NeoGrbTm1914Feature KEYWORD1
|
NeoGrbTm1914Feature KEYWORD1
|
||||||
|
@@ -711,3 +711,44 @@ public:
|
|||||||
|
|
||||||
typedef NeoRgb48Feature NeoRgbUcs8903Feature;
|
typedef NeoRgb48Feature NeoRgbUcs8903Feature;
|
||||||
typedef NeoRgbw64Feature NeoRgbwUcs8904Feature;
|
typedef NeoRgbw64Feature NeoRgbwUcs8904Feature;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class NeoGrb48Feature : public Neo6ByteElementsNoSettings
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color)
|
||||||
|
{
|
||||||
|
uint16_t* p = reinterpret_cast<uint16_t*>(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<const uint16_t*>(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<const uint16_t*>(getPixelAddress(reinterpret_cast<const uint8_t*>(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;
|
||||||
|
Reference in New Issue
Block a user