GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
null.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <sys/types.h>
4 #include <unistd.h>
5 
6 #include <grass/raster.h>
7 
8 #include "raster3d_intern.h"
9 
10 /*---------------------------------------------------------------------------*/
11 
12 int Rast3d_is_null_value_num(const void *n, int type)
13 {
14  if (type == FCELL_TYPE)
15  return Rast_is_f_null_value(n);
16  else
17  return Rast_is_d_null_value(n);
18 }
19 
20 /*---------------------------------------------------------------------------*/
21 
22 
23 /*!
24  * \brief
25  *
26  * Fills the vector pointed to by <em>c</em> with <em>nofElts</em> NULL-values
27  * of <em>type</em>.
28  *
29  * \param c
30  * \param nofElts
31  * \param type
32  * \return void
33  */
34 
35 void Rast3d_set_null_value(void *c, int nofElts, int type)
36 {
37  if (type == FCELL_TYPE) {
38  Rast_set_f_null_value((float *)c, nofElts);
39  return;
40  }
41 
42  Rast_set_d_null_value((double *)c, nofElts);
43 }
int Rast_is_f_null_value(const FCELL *fcellVal)
To check if a FCELL raster value is set to NULL.
Definition: null_val.c:242
int Rast3d_is_null_value_num(const void *n, int type)
Definition: null.c:12
void Rast_set_f_null_value(FCELL *fcellVals, int numVals)
To set a number of FCELL raster values to NULL.
Definition: null_val.c:138
void Rast3d_set_null_value(void *c, int nofElts, int type)
Fills the vector pointed to by c with nofElts NULL-values of type.
Definition: null.c:35
void Rast_set_d_null_value(DCELL *dcellVals, int numVals)
To set a number of DCELL raster values to NULL.
Definition: null_val.c:155
#define FCELL_TYPE
Definition: raster.h:12
int Rast_is_d_null_value(const DCELL *dcellVal)
To check if a DCELL raster value is set to NULL.
Definition: null_val.c:261