From: Andy Spencer Date: Sun, 12 Jun 2011 04:50:56 +0000 (+0000) Subject: Change int to float for colormap mapping X-Git-Tag: v0.5~4 X-Git-Url: http://pileus.org/git/?p=aweather;a=commitdiff_plain;h=ca379618a19e37151b8f279013362aee18d0b662 Change int to float for colormap mapping This fixes a bug when using correlation coefficient --- diff --git a/src/plugins/radar-info.h b/src/plugins/radar-info.h index db0e127..100c7bd 100644 --- a/src/plugins/radar-info.h +++ b/src/plugins/radar-info.h @@ -33,7 +33,7 @@ typedef struct { extern AWeatherColormap colormaps[]; -static inline guint8 *colormap_get(AWeatherColormap *colormap, int value) +static inline guint8 *colormap_get(AWeatherColormap *colormap, float value) { int idx = value * colormap->scale + colormap->shift; return colormap->data[CLAMP(idx, 0, colormap->len)];