42 #include <grass/gis.h>
60 struct Colors *src,
struct Cell_stats *statf)
64 long count, total, sum;
100 x = min + (max -
min) * (sum + count / 2.0) / total;
133 struct Colors *src,
struct FP_stats *statf)
158 for (i = 0; i <= statf->count; i++) {
159 int red2, grn2, blu2;
162 val2 = statf->min + (statf->max - statf->min) * i / statf->count;
163 if (statf->geometric)
166 val2 = exp(val2) - 1;
169 x = min + (max -
min) * sum / statf->total;
176 if (i == statf->count)
179 sum += statf->stats[i];
218 for (i = 0; i <= samples; i++) {
219 int red2, grn2, blu2;
223 y = min + (max -
min) * i / samples;
228 else if (i == samples)
231 lx = lmin + (lmax - lmin) * i / samples;
237 &x, red2, grn2, blu2,
272 lmin =
log(fabs(min) + 1.0);
273 lmax =
log(fabs(max) + 1.0);
275 amax = fabs(min) > fabs(max) ? fabs(min) : fabs(max);
276 lamax = lmin > lmax ? lmin : lmax;
284 for (i = 0; i <= samples; i++) {
285 int red2, grn2, blu2;
289 y = min + (max -
min) * i / samples;
294 else if (i == samples)
297 lx = 0 + lamax * i / samples;
302 DCELL x0 = prev, x1 = x;
304 &x1, red2, grn2, blu2,
309 &x1, red2, grn2, blu2,