Skip to content

Commit

Permalink
esp8266Compiled
Browse files Browse the repository at this point in the history
const & in template causes near 100 bytes extra code, so removed
  • Loading branch information
Makuna committed Mar 20, 2016
1 parent 3dbfae7 commit 0b68628
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/NeoPixelGamma/NeoPixelGamma.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);

// uncomment only one of these to compare memory use or speed
//
// NeoGamma<NeoGammaEquationMethod> gamma;
NeoGamma<NeoGammaTableMethod> gamma;
// NeoGamma<NeoGammaEquationMethod> colorGamma;
NeoGamma<NeoGammaTableMethod> colorGamma;

void DrawPixels(bool corrected, HslColor startColor, HslColor stopColor)
{
Expand All @@ -30,7 +30,7 @@ void DrawPixels(bool corrected, HslColor startColor, HslColor stopColor)
RgbColor color = HslColor::LinearBlend(startColor, stopColor, progress);
if (corrected)
{
color = gamma.Correct(color);
color = colorGamma.Correct(color);
}
strip.SetPixelColor(index, color);
}
Expand Down
2 changes: 1 addition & 1 deletion src/NeoPixelBus.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ template<typename T_COLOR_FEATURE, typename T_METHOD> class NeoPixelBus
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)
{
Expand Down
13 changes: 13 additions & 0 deletions src/internal/HtmlColor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
// c00 - upper left quadrant color
Expand Down
3 changes: 3 additions & 0 deletions src/internal/RgbColor.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ struct RgbColor
{
};

// ------------------------------------------------------------------------
// Comparison operators
// ------------------------------------------------------------------------
bool operator==(const RgbColor& other) const
{
return (R == other.R && G == other.G && B == other.B);
Expand Down
3 changes: 3 additions & 0 deletions src/internal/RgbwColor.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ struct RgbwColor
{
};

// ------------------------------------------------------------------------
// Comparison operators
// ------------------------------------------------------------------------
bool operator==(const RgbwColor& other) const
{
return (R == other.R && G == other.G && B == other.B && W == other.W);
Expand Down

0 comments on commit 0b68628

Please sign in to comment.