12 int ny,
int nz,
void *block,
int type)
15 int tileX0, tileY0, tileZ0, tileOffsX0, tileOffsY0, tileOffsZ0;
16 int tileX1, tileY1, tileZ1, tileOffsX1, tileOffsY1, tileOffsZ1;
17 int tx, ty, tz, dx, dy, dz,
x, y, z, rows, cols, depths;
24 "Rast3d_get_block_nocache: error in Rast3d_alloc_tiles");
27 &tileOffsX0, &tileOffsY0, &tileOffsZ0);
29 &tileY1, &tileZ1, &tileOffsX1, &tileOffsY1,
32 for (tz = tileZ0; tz <= tileZ1; tz++) {
33 dz = (tz - tileZ0) * map->
tileZ - tileOffsZ0;
34 for (ty = tileY0; ty <= tileY1; ty++) {
35 dy = (ty - tileY0) * map->
tileY - tileOffsY0;
36 for (tx = tileX0; tx <= tileX1; tx++) {
37 dx = (tx - tileX0) * map->
tileX - tileOffsX0;
46 "error in Rast3d_get_tile_ptr");
52 "error in Rast3d_read_tile");
58 cols = (tx == tileX1 ? tileOffsX1 : map->
tileX - 1);
59 rows = (ty == tileY1 ? tileOffsY1 : map->
tileY - 1);
60 depths = (tz == tileZ1 ? tileOffsZ1 : map->
tileZ - 1);
62 x = (tx == tileX0 ? tileOffsX0 : 0);
64 for (z = (tz == tileZ0 ? tileOffsZ0 : 0); z <= depths; z++)
65 for (y = (ty == tileY0 ? tileOffsY0 : 0); y <= rows; y++) {
69 (z + dz) * nx * ny + (y + dy) * nx + (
x + dx), type,
103 int nz,
void *block,
int type)
105 int x, y, z, nNull, x1, y1, z1, length;
118 for (z = z0; z < z1; z++) {
119 for (y = y0; y < y1; y++) {
120 for (
x = x0;
x < x1;
x++) {
128 nNull = (y0 + ny - y) * nx;
132 nNull = (z0 + nz - z) * ny * nx;
#define G_incr_void_ptr(ptr, size)
void Rast3d_copy_values(const void *, int, int, void *, int, int, int)
int Rast3d_tile_index_in_range(RASTER3D_Map *, int)
Returns 1 if tileIndex is a valid index for map. Returns 0 otherwise.
void Rast3d_set_null_value(void *, int, int)
Fills the vector pointed to by c with nofElts NULL-values of type.
void Rast3d_free_tiles(void *)
Is equivalent to Rast3d_free (tiles);
void Rast3d_set_null_tile(RASTER3D_Map *, void *)
Is equivalent to Rast3d_set_null_tile_type (map, tile, Rast3d_file_type_map (map)).
void * Rast3d_get_tile_ptr(RASTER3D_Map *, int)
This function returns a pointer to a tile which contains the data for the tile with index tileIndex....
int Rast3d_tile2tile_index(RASTER3D_Map *, int, int, int)
Returns tile-index corresponding to tile-coordinates (xTile, yTile, zTile).
void Rast3d_get_value_region(RASTER3D_Map *, int, int, int, void *, int)
Returns in *value the cell-value of the cell with region-coordinate (x, y, z). The value returned is ...
void Rast3d_coord2tile_coord(RASTER3D_Map *, int, int, int, int *, int *, int *, int *, int *, int *)
Converts cell-coordinates (x, y, z) into tile-coordinates (xTile, yTile, zTile) and the coordinate of...
int Rast3d_read_tile(RASTER3D_Map *, int, void *, int)
Reads tile with index tileIndex into the tile buffer. The cells are stored with type type which must ...
void * Rast3d_alloc_tiles_type(RASTER3D_Map *, int, int)
Allocates a vector of nofTiles tiles with the same dimensions as the tiles of map and large enough to...
void Rast3d_fatal_error(const char *,...) __attribute__((format(printf
void Rast3d_get_block(RASTER3D_Map *map, int x0, int y0, int z0, int nx, int ny, int nz, void *block, int type)
Copies the cells contained in the block (cube) with vertices (x0, y0, z0) and (x0 + nx - 1,...
void Rast3d_get_block_nocache(RASTER3D_Map *map, int x0, int y0, int z0, int nx, int ny, int nz, void *block, int type)
#define RASTER3D_MIN(a, b)