94 double north, east, top;
104 double row, col, depth;
119 north = ((double)y + 0.5) / (double)map->window.rows *
120 (map->window.north - map->window.south) + map->window.south;
123 east = ((double)x + 0.5) / (double)map->window.cols *
124 (map->window.east - map->window.west) + map->window.west;
125 top = ((double)z + 0.5) / (double)map->window.depths *
126 (map->window.top - map->window.bottom) + map->window.bottom;
141 (north - map->region.south) / (map->region.north -
142 map->region.south) * map->region.rows;
145 col = (east - map->region.west) / (map->region.east - map->region.west) *
148 (top - map->region.bottom) / (map->region.top -
149 map->region.bottom) *
153 if ((row < 0) || (row >= map->region.rows) ||
154 (col < 0) || (col >= map->region.cols) ||
155 (depth < 0) || (depth >= map->region.depths)) {
161 map->resampleFun(map, (
int)row, (
int)col, (
int)depth, value, type);
G3D_Region * G3d_windowPtr()
void G3d_setNullValue(void *c, int nofElts, int type)
Fills the vector pointed to by c with nofElts NULL-values of type.
double G3d_getDouble(G3D_Map *map, int x, int y, int z)
Is equivalent to G3d_getValue (map, x, y, z, &value, DCELL_TYPE); return value.
void G3d_getValue(G3D_Map *map, int x, int y, int z, void *value, int type)
Returns in *value the cell-value of the cell with window-coordinate (x, y, z). The value returned is ...
void G3d_getWindow(G3D_Region *window)
Stores the current default window in window.
void G3d_setWindow(G3D_Region *window)
Sets the default window used for every map opened later in the program. Can be used multiple times in...
void G3d_setWindowMap(G3D_Map *map, G3D_Region *window)
Sets the window for map to window. Can be used multiple times for the same map.
void G3d_adjustRegion(G3D_Region *region)
Computes an adjusts the resolutions in the region structure from the region boundaries and number of ...
void G3d_regionCopy(G3D_Region *regionDest, G3D_Region *regionSrc)
Copies the values of regionSrc into regionDst. (The unfortunate order of parameters was chosen in ord...
float G3d_getFloat(G3D_Map *map, int x, int y, int z)
Is equivalent to G3d_getValue (map, x, y, z, &value, FCELL_TYPE); return value.