@@ -617,7 +617,7 @@ typedef struct Segment {
617617 void setPixelColor (float i, CRGB c, bool aa = true ) { setPixelColor (i, RGBW32 (c.r ,c.g ,c.b ,0 ), aa); }
618618 uint32_t __attribute__ ((pure)) getPixelColor(int i); // WLEDMM attribute added
619619 // 1D support functions (some implement 2D as well)
620- void blur (uint8_t );
620+ void blur (uint8_t , bool smear = false );
621621 void fill (uint32_t c);
622622 void fade_out (uint8_t r);
623623 void fadeToBlackBy (uint8_t fadeBy);
@@ -658,12 +658,15 @@ typedef struct Segment {
658658 return (x%width) + (y%height) * width;
659659 }
660660 void setPixelColorXY (int x, int y, uint32_t c); // set relative pixel within segment with color
661- void setPixelColorXY (int x, int y, byte r, byte g, byte b, byte w = 0 ) { setPixelColorXY (x, y, RGBW32 (r,g,b,w)); } // automatically inline
662- void setPixelColorXY (int x, int y, CRGB c) { setPixelColorXY (x, y, RGBW32 (c.r ,c.g ,c.b ,0 )); } // automatically inline
663- void setPixelColorXY (float x, float y, uint32_t c, bool aa = true , bool fast = true );
664- void setPixelColorXY (float x, float y, byte r, byte g, byte b, byte w = 0 , bool aa = true ) { setPixelColorXY (x, y, RGBW32 (r,g,b,w), aa); }
665- void setPixelColorXY (float x, float y, CRGB c, bool aa = true ) { setPixelColorXY (x, y, RGBW32 (c.r ,c.g ,c.b ,0 ), aa); }
666- uint32_t __attribute__ ((pure)) getPixelColorXY(uint16_t x, uint16_t y); // WLEDMM attribute pure
661+ inline void setPixelColorXY (unsigned x, unsigned y, uint32_t c) { setPixelColorXY (int (x), int (y), c); }
662+ inline void setPixelColorXY (int x, int y, byte r, byte g, byte b, byte w = 0 ) { setPixelColorXY (x, y, RGBW32 (r,g,b,w)); }
663+ inline void setPixelColorXY (int x, int y, CRGB c) { setPixelColorXY (x, y, RGBW32 (c.r ,c.g ,c.b ,0 )); }
664+ // #ifdef WLED_USE_AA_PIXELS
665+ void setPixelColorXY (float x, float y, uint32_t c, bool aa = true , bool fast=true );
666+ inline void setPixelColorXY (float x, float y, byte r, byte g, byte b, byte w = 0 , bool aa = true ) { setPixelColorXY (x, y, RGBW32 (r,g,b,w), aa); }
667+ inline void setPixelColorXY (float x, float y, CRGB c, bool aa = true ) { setPixelColorXY (x, y, RGBW32 (c.r ,c.g ,c.b ,0 ), aa); }
668+ // #endif
669+ uint32_t __attribute__ ((pure)) getPixelColorXY(int x, int y);
667670 // 2D support functions
668671 void blendPixelColorXY (uint16_t x, uint16_t y, uint32_t color, uint8_t blend);
669672 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); }
@@ -672,8 +675,8 @@ typedef struct Segment {
672675 void addPixelColorXY (int x, int y, CRGB c, bool fast = false ) { addPixelColorXY (x, y, RGBW32 (c.r ,c.g ,c.b ,0 ), fast); }
673676 void fadePixelColorXY (uint16_t x, uint16_t y, uint8_t fade);
674677 void box_blur (uint16_t i, bool vertical, fract8 blur_amount); // 1D box blur (with weight)
675- void blurRow (uint16_t row, fract8 blur_amount);
676- void blurCol (uint16_t col, fract8 blur_amount);
678+ void blurRow (uint32_t row, fract8 blur_amount, bool smear = false );
679+ void blurCol (uint32_t col, fract8 blur_amount, bool smear = false );
677680 void moveX (int8_t delta, bool wrap = false );
678681 void moveY (int8_t delta, bool wrap = false );
679682 void move (uint8_t dir, uint8_t delta, bool wrap = false );
@@ -692,32 +695,36 @@ typedef struct Segment {
692695 void nscale8 (uint8_t scale);
693696 bool jsonToPixels (char *name, uint8_t fileNr); // WLEDMM for artifx
694697 #else
695- uint16_t XY (uint16_t x, uint16_t y) { return x; }
696- void setPixelColorXY (int x, int y, uint32_t c) { setPixelColor (x, c); }
697- void setPixelColorXY (int x, int y, byte r, byte g, byte b, byte w = 0 ) { setPixelColor (x, RGBW32 (r,g,b,w)); }
698- void setPixelColorXY (int x, int y, CRGB c) { setPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 )); }
699- void setPixelColorXY (float x, float y, uint32_t c, bool aa = true ) { setPixelColor (x, c, aa); }
700- void setPixelColorXY (float x, float y, byte r, byte g, byte b, byte w = 0 , bool aa = true ) { setPixelColor (x, RGBW32 (r,g,b,w), aa); }
701- void setPixelColorXY (float x, float y, CRGB c, bool aa = true ) { setPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 ), aa); }
702- uint32_t getPixelColorXY (uint16_t x, uint16_t y) { return getPixelColor (x); }
703- void blendPixelColorXY (uint16_t x, uint16_t y, uint32_t c, uint8_t blend) { blendPixelColor (x, c, blend); }
704- void blendPixelColorXY (uint16_t x, uint16_t y, CRGB c, uint8_t blend) { blendPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 ), blend); }
705- void addPixelColorXY (int x, int y, uint32_t color, bool fast = false ) { addPixelColor (x, color, fast); }
706- void addPixelColorXY (int x, int y, byte r, byte g, byte b, byte w = 0 , bool fast = false ) { addPixelColor (x, RGBW32 (r,g,b,w), fast); }
707- void addPixelColorXY (int x, int y, CRGB c, bool fast = false ) { addPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 ), fast); }
708- void fadePixelColorXY (uint16_t x, uint16_t y, uint8_t fade) { fadePixelColor (x, fade); }
709- void box_blur (uint16_t i, bool vertical, fract8 blur_amount) {}
710- void blurRow (uint16_t row, fract8 blur_amount) {}
711- void blurCol (uint16_t col, fract8 blur_amount) {}
712- void moveX (int8_t delta, bool wrap = false ) {}
713- void moveY (int8_t delta, bool wrap = false ) {}
714- void move (uint8_t dir, uint8_t delta, bool wrap = false ) {}
715- void fill_circle (uint16_t cx, uint16_t cy, uint8_t radius, CRGB c) {}
716- void drawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t c) {}
717- void drawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, CRGB c) {}
718- void drawCharacter (unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, uint32_t color) {}
719- void drawCharacter (unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, CRGB color) {}
720- void wu_pixel (uint32_t x, uint32_t y, CRGB c) {}
698+ inline uint16_t XY (uint16_t x, uint16_t y) { return x; }
699+ inline void setPixelColorXY (int x, int y, uint32_t c) { setPixelColor (x, c); }
700+ inline void setPixelColorXY (unsigned x, unsigned y, uint32_t c) { setPixelColor (int (x), c); }
701+ inline void setPixelColorXY (int x, int y, byte r, byte g, byte b, byte w = 0 ) { setPixelColor (x, RGBW32 (r,g,b,w)); }
702+ inline void setPixelColorXY (int x, int y, CRGB c) { setPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 )); }
703+ // #ifdef WLED_USE_AA_PIXELS
704+ inline void setPixelColorXY (float x, float y, uint32_t c, bool aa = true ) { setPixelColor (x, c, aa); }
705+ inline void setPixelColorXY (float x, float y, byte r, byte g, byte b, byte w = 0 , bool aa = true ) { setPixelColor (x, RGBW32 (r,g,b,w), aa); }
706+ inline void setPixelColorXY (float x, float y, CRGB c, bool aa = true ) { setPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 ), aa); }
707+ // #endif
708+ inline uint32_t getPixelColorXY (uint16_t x, uint16_t y) { return getPixelColor (x); }
709+ inline void blendPixelColorXY (uint16_t x, uint16_t y, uint32_t c, uint8_t blend) { blendPixelColor (x, c, blend); }
710+ inline void blendPixelColorXY (uint16_t x, uint16_t y, CRGB c, uint8_t blend) { blendPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 ), blend); }
711+ inline void addPixelColorXY (int x, int y, uint32_t color, bool fast = false ) { addPixelColor (x, color, fast); }
712+ inline void addPixelColorXY (int x, int y, byte r, byte g, byte b, byte w = 0 , bool fast = false ) { addPixelColor (x, RGBW32 (r,g,b,w), fast); }
713+ inline void addPixelColorXY (int x, int y, CRGB c, bool fast = false ) { addPixelColor (x, RGBW32 (c.r ,c.g ,c.b ,0 ), fast); }
714+ inline void fadePixelColorXY (uint16_t x, uint16_t y, uint8_t fade) { fadePixelColor (x, fade); }
715+ inline void box_blur (uint16_t i, bool vertical, fract8 blur_amount) {}
716+ inline void blurRow (uint32_t row, fract8 blur_amount, bool smear = false ) {}
717+ inline void blurCol (uint32_t col, fract8 blur_amount, bool smear = false ) {}
718+ inline void moveX (int8_t delta, bool wrap = false ) {}
719+ inline void moveY (int8_t delta, bool wrap = false ) {}
720+ inline void move (uint8_t dir, uint8_t delta, bool wrap = false ) {}
721+ inline void fill_circle (uint16_t cx, uint16_t cy, uint8_t radius, CRGB c) {}
722+ inline void drawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t c) {}
723+ inline void drawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, CRGB c) {}
724+ inline void drawCharacter (unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, uint32_t color, uint32_t = 0 , int8_t = 0 ) {}
725+ inline void drawCharacter (unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, CRGB color) {}
726+ inline void drawCharacter (unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, CRGB c, CRGB c2, int8_t rotate = 0 ) {}
727+ inline void wu_pixel (uint32_t x, uint32_t y, CRGB c) {}
721728 #endif
722729 uint8_t * getAudioPalette (int pal); // WLEDMM netmindz ar palette
723730} segment;
0 commit comments