GRASS 8 Programmer's Manual 8.6.0dev(2026)-5f4f7ad06c
Loading...
Searching...
No Matches
c_count.c
Go to the documentation of this file.
1#include <grass/gis.h>
2#include <grass/raster.h>
3
4void c_count(DCELL *result, DCELL *values, int n, const void *closure UNUSED)
5{
6 int count;
7 int i;
8
9 count = 0;
10
11 for (i = 0; i < n; i++)
12 if (!Rast_is_d_null_value(&values[i]))
13 count++;
14
15 *result = count;
16}
17
18void w_count(DCELL *result, DCELL (*values)[2], int n,
19 const void *closure UNUSED)
20{
22 int i;
23
24 count = 0.0;
25
26 for (i = 0; i < n; i++)
27 if (!Rast_is_d_null_value(&values[i][0]))
28 count += values[i][1];
29
30 *result = count;
31}
#define Rast_is_d_null_value(dcellVal)
stat_func c_count
stat_func_w w_count
double DCELL
Definition gis.h:635
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
Definition gis.h:46
int count