Skip to content

Commit

Permalink
double to float
Browse files Browse the repository at this point in the history
  • Loading branch information
tobozo authored Feb 18, 2024
1 parent 2ec0252 commit 24776df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lgfx/v1/LGFXBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ namespace lgfx
const colors_t createGradient( const rgb888_t(&colors)[N] ) { const colors_t ret = { colors, N }; return ret; }
const colors_t createGradient( const rgb888_t* colors, const uint32_t count ) { const colors_t ret = { colors, count }; return ret; }
template <typename T=rgb888_t>
T mapGradient( double val, double min, double max, const colors_t gr ) { rgb888_t c=map_gradient(val, min, max, gr); return T(c.r, c.g, c.b); }
T mapGradient( float val, float min, float max, const colors_t gr ) { rgb888_t c=map_gradient(val, min, max, gr); return T(c.r, c.g, c.b); }
template <typename T=rgb888_t>
T mapGradient( double val, double min, double max, const rgb888_t *colors, uint32_t count ) { rgb888_t c=map_gradient(val, min, max, colors, count); return T(c.r, c.g, c.b); }
T mapGradient( float val, float min, double max, const rgb888_t *colors, uint32_t count ) { rgb888_t c=map_gradient(val, min, max, colors, count); return T(c.r, c.g, c.b); }

LGFX_INLINE_T void drawSmoothLine ( int32_t x0, int32_t y0, int32_t x1, int32_t y1, const T& color ) { drawWideLine( x0, y0, x1, y1, 0.5f, color); }
void drawGradientLine ( int32_t x0, int32_t y0, int32_t x1, int32_t y1, const colors_t colors ) { draw_gradient_line(x0, y0, x1, y1, colors); }
Expand Down Expand Up @@ -1293,8 +1293,8 @@ namespace lgfx

bool clampArea(int32_t *xlo, int32_t *ylo, int32_t *xhi, int32_t *yhi);

rgb888_t map_gradient( double value, double start, double end, const rgb888_t *colors, uint32_t colors_count );
rgb888_t map_gradient( double value, double start, double end, const colors_t gradient );
rgb888_t map_gradient( float value, float start, float end, const rgb888_t *colors, uint32_t colors_count );
rgb888_t map_gradient( float value, float start, float end, const colors_t gradient );

void draw_gradient_line( int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t colorstart, uint32_t colorend );
void draw_gradient_line( int32_t x0, int32_t y0, int32_t x1, int32_t y1, const colors_t gradient );
Expand Down

0 comments on commit 24776df

Please sign in to comment.