10 Rast3d_xdrTile2tile(
RASTER3D_Map * map,
void *tile,
int rows,
int cols,
int depths,
11 int xRedundant,
int yRedundant,
int zRedundant,
int nofNum,
14 int y, z, xLength, yLength, length;
17 Rast3d_error(
"Rast3d_xdrTile2tile: error in Rast3d_init_copy_from_xdr");
23 Rast3d_error(
"Rast3d_xdrTile2tile: error in Rast3d_copy_from_xdr");
30 xLength = xRedundant * length;
31 yLength = map->
tileX * yRedundant * length;
34 for (z = 0; z < depths; z++) {
35 for (y = 0; y < rows; y++) {
37 Rast3d_error(
"Rast3d_xdrTile2tile: error in Rast3d_copy_from_xdr");
57 for (z = 0; z < depths; z++) {
59 Rast3d_error(
"Rast3d_xdrTile2tile: error in Rast3d_copy_from_xdr");
74 Rast3d_error(
"Rast3d_xdrTile2tile: error in Rast3d_copy_from_xdr");
89 static int Rast3d_readTileUncompressed(
RASTER3D_Map * map,
int tileIndex,
int nofNum)
96 if (read(map->
data_fd,
xdr, nofBytes) != nofBytes) {
97 Rast3d_error(
"Rast3d_readTileUncompressed: can't read file");
106 static int Rast3d_readTileCompressed(
RASTER3D_Map * map,
int tileIndex,
int nofNum)
113 (
"Rast3d_readTileCompressed: error in Rast3d_fpcompress_read_xdr_nums");
147 int nofNum, rows, cols, depths, xRedundant, yRedundant, zRedundant;
149 if ((tileIndex >= map->
nTiles) || (tileIndex < 0))
152 if (map->
index[tileIndex] == -1) {
158 &rows, &cols, &depths,
159 &xRedundant, &yRedundant,
162 if (lseek(map->
data_fd, map->
index[tileIndex], SEEK_SET) == -1) {
168 if (!Rast3d_readTileUncompressed(map, tileIndex, nofNum)) {
169 Rast3d_error(
"Rast3d_read_tile: error in Rast3d_readTileUncompressed");
173 else if (!Rast3d_readTileCompressed(map, tileIndex, nofNum)) {
174 Rast3d_error(
"Rast3d_read_tile: error in Rast3d_readTileCompressed");
178 if (!Rast3d_xdrTile2tile(map, tile, rows, cols, depths,
179 xRedundant, yRedundant, zRedundant, nofNum, type)) {
180 Rast3d_error(
"Rast3d_read_tile: error in Rast3d_xdrTile2tile");
208 Rast3d_error(
"Rast3d_read_tile_float: error in Rast3d_read_tile");
232 Rast3d_error(
"Rast3d_read_tile_double: error in Rast3d_read_tile");
265 Rast3d_error(
"Rast3d_lock_tile: error in Rast3d_cache_lock");
292 Rast3d_error(
"Rast3d_unlock_tile: error in Rast3d_cache_unlock");
318 Rast3d_error(
"Rast3d_unlock_all: error in Rast3d_cache_unlock_all");
int Rast3d_cache_lock(RASTER3D_cache *, int)
int Rast3d_copy_from_xdr(int, void *)
int Rast3d_read_tile(RASTER3D_Map *map, int tileIndex, void *tile, int type)
Reads tile with index tileIndex into the tile buffer. The cells are stored with type type which must ...
int Rast3d_lock_tile(RASTER3D_Map *map, int tileIndex)
Locks tile with tileIndex in cache. If after locking fewer than the minimum number of unlocked tiles ...
void Rast3d_set_null_tile_type(RASTER3D_Map *, void *, int)
Assumes that tile is a tile with the same dimensions as the tiles of map. Fills tile with NULL-values...
void Rast3d_set_null_value(void *, int, int)
Fills the vector pointed to by c with nofElts NULL-values of type.
#define G_incr_void_ptr(ptr, size)
void Rast3d_fatal_error(const char *,...) __attribute__((format(printf
int Rast3d_cache_unlock_all(RASTER3D_cache *)
void Rast3d_error(const char *,...) __attribute__((format(printf
void Rast3d_cache_autolock_off(RASTER3D_cache *)
int Rast3d__compute_cache_size(RASTER3D_Map *, int)
void Rast3d_mask_tile(RASTER3D_Map *, int, void *, int)
Replaces the values stored in tile (with tileIndex) for which Rast3d_is_masked returns 1 with NULL-va...
int Rast3d_read_tile_double(RASTER3D_Map *map, int tileIndex, void *tile)
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, DCELL_TYPE).
void Rast3d_cache_autolock_on(RASTER3D_cache *)
int Rast3d_init_copy_from_xdr(RASTER3D_Map *, int)
int Rast3d_unlock_tile(RASTER3D_Map *map, int tileIndex)
Unlocks tile with tileIndex.
#define RASTER3D_MIN(a, b)
#define RASTER3D_NO_COMPRESSION
int Rast3d_end_cycle(RASTER3D_Map *map)
Ends a cycle.
int Rast3d_compute_clipped_tile_dimensions(RASTER3D_Map *, int, int *, int *, int *, int *, int *, int *)
Computes the dimensions of the tile when clipped to fit the region of map. The clipped dimensions are...
int Rast3d_read_tile_float(RASTER3D_Map *map, int tileIndex, void *tile)
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, FCELL_TYPE).
int Rast3d_unlock_all(RASTER3D_Map *map)
Unlocks every tile in cache of map.
int Rast3d_fpcompress_read_xdr_nums(int, char *, int, int, int, char *, int)
void Rast3d_autolock_on(RASTER3D_Map *map)
Turns autolock mode on.
void Rast3d_min_unlocked(RASTER3D_Map *map, int minUnlocked)
Sets the minimum number of unlocked tiles to minUnlocked. This function should be used in combination...
void Rast3d_autolock_off(RASTER3D_Map *map)
Turns autolock mode Off.
void Rast3d_cache_set_min_unlock(RASTER3D_cache *, int)
int Rast3d_begin_cycle(RASTER3D_Map *map)
Starts a new cycle.
int Rast3d_cache_unlock(RASTER3D_cache *, int)
int Rast3d_mask_is_off(RASTER3D_Map *)
Returns 1 if the mask for map is turned off. Returns 0 otherwise.