Closed tobozo closed 9 months ago
thanks ! There are places where double type is used for coordinate calculation, but wouldn't float be sufficient? I don't think such exact precision is required.
fixed, apparently this is also provides a small performance improvement with radial gradients
btw @lovyan03 do you want me to submit that to M5GFX too ?
Features in this PR:
LGFX Methods:
NOTE: COLOR can be any of uint8_t, uint16_t, uint32_t, RGBColor, rgb888_t, rgb565_t, rgb888_t, etc
Draw thick+smooth lines:
void drawWideLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick, COLOR color)
Draw thick+smooth lines (gradient fill):
void drawWideLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick, const colors_t gradient)
Draw wedge line:
void drawWedgeLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick0, float thick1, COLOR color)
Draw wedge line (gradient fill):
void drawWedgeLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, float thick0, float thick1, const colors_t gradient)
Fill smooth circle with single color (redundant with fillSmoothCircle(), kept for benchmark):
void drawSpot(int32_t x, int32_t y, float radius, COLOR fg_color)
Fill smooth circle, like fillSmoothCircle() but with gradient fill:
void drawGradientSpot(int32_t x, int32_t y, float radius, const colors_t gradient)
Draw antialiased line:
void drawSmoothLine( LovyanGFX* gfx, int32_t x0, int32_t y0, int32_t x1, int32_t y1, COLOR color )
Draw gradient line (not smoothed, used for filling):
void drawGradientLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, const colors_t gradient )
void drawGradientHLine(int32_t x, int32_t y, uint32_t w, const colors_t gradient )
void drawGradientVLine(int32_t x, int32_t y, uint32_t h, const colors_t gradient )
Fill rect with radial/linear gradient (fill_style_t can be any of RADIAL, HLINEAR or VLINEAR):
void fillGradientRect(int32_t x, int32_t y, uint32_t w, uint32_t h, COLOR start, COLOR end, fill_style_t style=RADIAL )
void fillGradientRect(int32_t x, int32_t y, uint32_t w, uint32_t h, const colors_t gradient, fill_style_t style=RADIAL )
Create a gradient item from a sized array of colors or from a pointer to an array of colors:
colors_t createGradient( rgb888_t[] colors )
colors_t createGradient( rgb888_t* colors, uint32_t count )
Example: