GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gsget.c
Go to the documentation of this file.
1 
19 #include <grass/gstypes.h>
20 
31 int get_mapatt(typbuff * buff, int offset, float *att)
32 {
33  if (buff->nm) {
34  if (BM_get
35  (buff->nm, (offset % buff->nm->cols),
36  (offset / buff->nm->cols))) {
37  return (0);
38  }
39  }
40 
41  *att = (buff->ib ? (float)buff->ib[offset] :
42  buff->sb ? (float)buff->sb[offset] :
43  buff->cb ? (float)buff->cb[offset] :
44  buff->fb ? (float)buff->fb[offset] : buff->k);
45 
46  if (buff->tfunc) {
47  *att = (buff->tfunc) (*att, offset);
48  }
49 
50  return (1);
51 }
int BM_get(struct BM *map, int x, int y)
Gets &#39;val&#39; from the bitmap.
Definition: bitmap.c:220
int get_mapatt(typbuff *buff, int offset, float *att)
Get map attributes.
Definition: gsget.c:31
char buff[1024]
Definition: g3dcats.c:89