esp8266Compiled

const & in template causes near 100 bytes extra code, so removed
This commit is contained in:
Makuna
2016-03-20 11:20:50 -07:00
parent 3dbfae7fc4
commit 0b6862852c
5 changed files with 23 additions and 4 deletions

View File

@@ -19,8 +19,8 @@ NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);
// uncomment only one of these to compare memory use or speed // uncomment only one of these to compare memory use or speed
// //
// NeoGamma<NeoGammaEquationMethod> gamma; // NeoGamma<NeoGammaEquationMethod> colorGamma;
NeoGamma<NeoGammaTableMethod> gamma; NeoGamma<NeoGammaTableMethod> colorGamma;
void DrawPixels(bool corrected, HslColor startColor, HslColor stopColor) void DrawPixels(bool corrected, HslColor startColor, HslColor stopColor)
{ {
@@ -30,7 +30,7 @@ void DrawPixels(bool corrected, HslColor startColor, HslColor stopColor)
RgbColor color = HslColor::LinearBlend(startColor, stopColor, progress); RgbColor color = HslColor::LinearBlend(startColor, stopColor, progress);
if (corrected) if (corrected)
{ {
color = gamma.Correct(color); color = colorGamma.Correct(color);
} }
strip.SetPixelColor(index, color); strip.SetPixelColor(index, color);
} }

View File

@@ -133,7 +133,7 @@ public:
return _countPixels; return _countPixels;
}; };
void SetPixelColor(uint16_t indexPixel, const typename T_COLOR_FEATURE::ColorObject& color) void SetPixelColor(uint16_t indexPixel, typename T_COLOR_FEATURE::ColorObject color)
{ {
if (indexPixel < _countPixels) if (indexPixel < _countPixels)
{ {

View File

@@ -62,6 +62,19 @@ struct HtmlColor
{ {
}; };
// ------------------------------------------------------------------------
// Comparison operators
// ------------------------------------------------------------------------
bool operator==(const HtmlColor& other) const
{
return (Color == other.Color);
};
bool operator!=(const HtmlColor& other) const
{
return !(*this == other);
};
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// BilinearBlend between four colors by the amount defined by 2d variable // BilinearBlend between four colors by the amount defined by 2d variable
// c00 - upper left quadrant color // c00 - upper left quadrant color

View File

@@ -79,6 +79,9 @@ struct RgbColor
{ {
}; };
// ------------------------------------------------------------------------
// Comparison operators
// ------------------------------------------------------------------------
bool operator==(const RgbColor& other) const bool operator==(const RgbColor& other) const
{ {
return (R == other.R && G == other.G && B == other.B); return (R == other.R && G == other.G && B == other.B);

View File

@@ -86,6 +86,9 @@ struct RgbwColor
{ {
}; };
// ------------------------------------------------------------------------
// Comparison operators
// ------------------------------------------------------------------------
bool operator==(const RgbwColor& other) const bool operator==(const RgbwColor& other) const
{ {
return (R == other.R && G == other.G && B == other.B && W == other.W); return (R == other.R && G == other.G && B == other.B && W == other.W);