Skip to content

Commit c07658a

Browse files
committed
post-merge
* fix drawLine prototype * a few more "inline" * typo
1 parent 2aad3f5 commit c07658a

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

wled00/FX.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -618,22 +618,22 @@ typedef struct Segment {
618618
// 1D strip
619619
uint16_t virtualLength(void) const;
620620
void setPixelColor(int n, uint32_t c); // set relative pixel within segment with color
621-
void setPixelColor(int n, byte r, byte g, byte b, byte w = 0) { setPixelColor(n, RGBW32(r,g,b,w)); } // automatically inline
622-
void setPixelColor(int n, CRGB c) { setPixelColor(n, RGBW32(c.r,c.g,c.b,0)); } // automatically inline
621+
inline void setPixelColor(int n, byte r, byte g, byte b, byte w = 0) { setPixelColor(n, RGBW32(r,g,b,w)); } // automatically inline
622+
inline void setPixelColor(int n, CRGB c) { setPixelColor(n, RGBW32(c.r,c.g,c.b,0)); } // automatically inline
623623
void setPixelColor(float i, uint32_t c, bool aa = true);
624-
void setPixelColor(float i, uint8_t r, uint8_t g, uint8_t b, uint8_t w = 0, bool aa = true) { setPixelColor(i, RGBW32(r,g,b,w), aa); }
625-
void setPixelColor(float i, CRGB c, bool aa = true) { setPixelColor(i, RGBW32(c.r,c.g,c.b,0), aa); }
624+
inline void setPixelColor(float i, uint8_t r, uint8_t g, uint8_t b, uint8_t w = 0, bool aa = true) { setPixelColor(i, RGBW32(r,g,b,w), aa); }
625+
inline void setPixelColor(float i, CRGB c, bool aa = true) { setPixelColor(i, RGBW32(c.r,c.g,c.b,0), aa); }
626626
uint32_t __attribute__((pure)) getPixelColor(int i); // WLEDMM attribute added
627627
// 1D support functions (some implement 2D as well)
628628
void blur(uint8_t, bool smear = false);
629629
void fill(uint32_t c);
630630
void fade_out(uint8_t r);
631631
void fadeToBlackBy(uint8_t fadeBy);
632632
void blendPixelColor(int n, uint32_t color, uint8_t blend);
633-
void blendPixelColor(int n, CRGB c, uint8_t blend) { blendPixelColor(n, RGBW32(c.r,c.g,c.b,0), blend); }
633+
inline void blendPixelColor(int n, CRGB c, uint8_t blend) { blendPixelColor(n, RGBW32(c.r,c.g,c.b,0), blend); }
634634
void addPixelColor(int n, uint32_t color, bool fast = false);
635-
void addPixelColor(int n, byte r, byte g, byte b, byte w = 0, bool fast = false) { addPixelColor(n, RGBW32(r,g,b,w), fast); } // automatically inline
636-
void addPixelColor(int n, CRGB c, bool fast = false) { addPixelColor(n, RGBW32(c.r,c.g,c.b,0), fast); } // automatically inline
635+
inline void addPixelColor(int n, byte r, byte g, byte b, byte w = 0, bool fast = false) { addPixelColor(n, RGBW32(r,g,b,w), fast); } // automatically inline
636+
inline void addPixelColor(int n, CRGB c, bool fast = false) { addPixelColor(n, RGBW32(c.r,c.g,c.b,0), fast); } // automatically inline
637637
void fadePixelColor(uint16_t n, uint8_t fade);
638638
uint8_t get_random_wheel_index(uint8_t pos);
639639
uint32_t __attribute__((pure)) color_from_palette(uint_fast16_t, bool mapping, bool wrap, uint8_t mcol, uint8_t pbri = 255);
@@ -678,10 +678,10 @@ typedef struct Segment {
678678
uint32_t __attribute__((pure)) getPixelColorXY(int x, int y);
679679
// 2D support functions
680680
void blendPixelColorXY(uint16_t x, uint16_t y, uint32_t color, uint8_t blend);
681-
void blendPixelColorXY(uint16_t x, uint16_t y, CRGB c, uint8_t blend) { blendPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0), blend); }
681+
inline void blendPixelColorXY(uint16_t x, uint16_t y, CRGB c, uint8_t blend) { blendPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0), blend); }
682682
void addPixelColorXY(int x, int y, uint32_t color, bool fast = false);
683-
void addPixelColorXY(int x, int y, byte r, byte g, byte b, byte w = 0, bool fast = false) { addPixelColorXY(x, y, RGBW32(r,g,b,w), fast); } // automatically inline
684-
void addPixelColorXY(int x, int y, CRGB c, bool fast = false) { addPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0), fast); }
683+
inline void addPixelColorXY(int x, int y, byte r, byte g, byte b, byte w = 0, bool fast = false) { addPixelColorXY(x, y, RGBW32(r,g,b,w), fast); } // automatically inline
684+
inline void addPixelColorXY(int x, int y, CRGB c, bool fast = false) { addPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0), fast); }
685685
void fadePixelColorXY(uint16_t x, uint16_t y, uint8_t fade);
686686
void box_blur(uint16_t i, bool vertical, fract8 blur_amount); // 1D box blur (with weight)
687687
void blurRow(uint32_t row, fract8 blur_amount, bool smear = false);
@@ -693,16 +693,16 @@ typedef struct Segment {
693693
inline void drawCircle(uint16_t cx, uint16_t cy, uint8_t radius, CRGB c, bool soft = false) { drawCircle(cx, cy, radius, RGBW32(c.r,c.g,c.b,0), soft); }
694694
void fillCircle(uint16_t cx, uint16_t cy, uint8_t radius, uint32_t c, bool soft = false);
695695
inline void fillCircle(uint16_t cx, uint16_t cy, uint8_t radius, CRGB c, bool soft = false) { fillCircle(cx, cy, radius, RGBW32(c.r,c.g,c.b,0), soft); }
696-
void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t c);
697-
void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, CRGB c) { drawLine(x0, y0, x1, y1, RGBW32(c.r,c.g,c.b,0)); } // automatic inline
696+
void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t c, bool soft = false);
697+
inline void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, CRGB c, bool soft = false) { drawLine(x0, y0, x1, y1, RGBW32(c.r,c.g,c.b,0), soft); } // automatic inline
698698
void drawArc(uint16_t x0, uint16_t y0, uint16_t radius, uint32_t color, uint32_t fillColor = 0);
699-
void drawArc(uint16_t x0, uint16_t y0, uint16_t radius, CRGB color, CRGB fillColor = BLACK) { drawArc(x0, y0, radius, RGBW32(color.r,color.g,color.b,0), RGBW32(fillColor.r,fillColor.g,fillColor.b,0)); } // automatic inline
699+
inline void drawArc(uint16_t x0, uint16_t y0, uint16_t radius, CRGB color, CRGB fillColor = BLACK) { drawArc(x0, y0, radius, RGBW32(color.r,color.g,color.b,0), RGBW32(fillColor.r,fillColor.g,fillColor.b,0)); } // automatic inline
700700
void drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, uint32_t color, uint32_t col2 = 0);
701-
void drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, CRGB c, CRGB c2) { drawCharacter(chr, x, y, w, h, RGBW32(c.r,c.g,c.b,0), RGBW32(c2.r,c2.g,c2.b,0)); } // automatic inline
701+
inline void drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, CRGB c, CRGB c2) { drawCharacter(chr, x, y, w, h, RGBW32(c.r,c.g,c.b,0), RGBW32(c2.r,c2.g,c2.b,0)); } // automatic inline
702702
void wu_pixel(uint32_t x, uint32_t y, CRGB c);
703703
//void blur1d(fract8 blur_amount); // blur all rows in 1 dimension
704704
void blur2d(fract8 blur_amount) { blur(blur_amount); }
705-
void fill_solid(CRGB c) { fill(RGBW32(c.r,c.g,c.b,0)); }
705+
inline void fill_solid(CRGB c) { fill(RGBW32(c.r,c.g,c.b,0)); }
706706
void nscale8(uint8_t scale);
707707
bool jsonToPixels(char *name, uint8_t fileNr); //WLEDMM for artifx
708708
#else

wled00/FX_2Dfcn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ void Segment::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint3
632632
unsigned keep = float(0xFFFF) * (intersectY-int(intersectY)); // how much color to keep
633633
unsigned seep = 0xFFFF - keep; // how much background to keep
634634
int y = int(intersectY);
635-
if (steep) std::swap(x,y); // temporaryly swap if steep
635+
if (steep) std::swap(x,y); // temporarily swap if steep
636636
// pixel coverage is determined by fractional part of y co-ordinate
637637
setPixelColorXY(x, y, color_blend(c, getPixelColorXY(x, y), keep, true));
638638
setPixelColorXY(x+int(steep), y+int(!steep), color_blend(c, getPixelColorXY(x+int(steep), y+int(!steep)), seep, true));

0 commit comments

Comments
 (0)