GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-602118adcc
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <grass/raster.h>
#include "raster3d_intern.h"
Go to the source code of this file.
Functions | |
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 be one of FCELL_TYPE and DCELL_TYPE. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index tile is filled with NULL-values. More... | |
int | Rast3d_read_tile_float (RASTER3D_Map *map, int tileIndex, void *tile) |
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, FCELL_TYPE). More... | |
int | Rast3d_read_tile_double (RASTER3D_Map *map, int tileIndex, void *tile) |
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, DCELL_TYPE). More... | |
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 are unlocked, the lock request is ignored. More... | |
int | Rast3d_unlock_tile (RASTER3D_Map *map, int tileIndex) |
Unlocks tile with tileIndex. More... | |
int | Rast3d_unlock_all (RASTER3D_Map *map) |
Unlocks every tile in cache of map. More... | |
void | Rast3d_autolock_on (RASTER3D_Map *map) |
Turns autolock mode on. More... | |
void | Rast3d_autolock_off (RASTER3D_Map *map) |
Turns autolock mode Off. More... | |
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 with Rast3d_unlock_all () in order to avoid situations where the new minimum is larger than the actual number of unlocked tiles. minUnlocked must be one of RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode() (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which explicitly specifies the number of tiles. More... | |
int | Rast3d_begin_cycle (RASTER3D_Map *map) |
Starts a new cycle. More... | |
int | Rast3d_end_cycle (RASTER3D_Map *map) |
Ends a cycle. More... | |
void Rast3d_autolock_off | ( | RASTER3D_Map * | map | ) |
Turns autolock mode Off.
map |
Definition at line 360 of file tileread.c.
References RASTER3D_Map::cache, Rast3d_cache_autolock_off(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.
Referenced by Rast3d_end_cycle().
void Rast3d_autolock_on | ( | RASTER3D_Map * | map | ) |
Turns autolock mode on.
map |
Definition at line 340 of file tileread.c.
References RASTER3D_Map::cache, Rast3d_cache_autolock_on(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.
Referenced by Rast3d_begin_cycle().
int Rast3d_begin_cycle | ( | RASTER3D_Map * | map | ) |
Starts a new cycle.
map |
Definition at line 411 of file tileread.c.
References Rast3d_autolock_on(), Rast3d_fatal_error(), and Rast3d_unlock_all().
int Rast3d_end_cycle | ( | RASTER3D_Map * | map | ) |
Ends a cycle.
map |
Definition at line 434 of file tileread.c.
References Rast3d_autolock_off().
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 are unlocked, the lock request is ignored.
map | |
tileIndex |
Definition at line 262 of file tileread.c.
References RASTER3D_Map::cache, Rast3d_cache_lock(), Rast3d_error(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.
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 with Rast3d_unlock_all ()
in order to avoid situations where the new minimum is larger than the actual number of unlocked tiles. minUnlocked must be one of RASTER3D_USE_CACHE_X, RASTER3D_USE_CACHE_Y, RASTER3D_USE_CACHE_Z, RASTER3D_USE_CACHE_XY, RASTER3D_USE_CACHE_XZ, RASTER3D_USE_CACHE_YZ, RASTER3D_USE_CACHE_XYZ, the result of Rast3d_cache_size_encode() (cf.{g3d:G3d.cacheSizeEncode}), or any positive integer which explicitly specifies the number of tiles.
map | |
minUnlocked |
Definition at line 389 of file tileread.c.
References RASTER3D_Map::cache, Rast3d__compute_cache_size(), Rast3d_cache_set_min_unlock(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.
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 be one of FCELL_TYPE and DCELL_TYPE. If the tile with tileIndex is not stored on the file corresponding to map, and tileIndex is a valid index tile is filled with NULL-values.
map | |
tileIndex | |
tile | |
type |
Definition at line 151 of file tileread.c.
Referenced by Rast3d_get_tile_ptr(), Rast3d_read_tile_double(), and Rast3d_read_tile_float().
int Rast3d_read_tile_double | ( | RASTER3D_Map * | map, |
int | tileIndex, | ||
void * | tile | ||
) |
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, DCELL_TYPE).
map | |
tileIndex | |
tile |
Definition at line 233 of file tileread.c.
References DCELL_TYPE, Rast3d_error(), and Rast3d_read_tile().
int Rast3d_read_tile_float | ( | RASTER3D_Map * | map, |
int | tileIndex, | ||
void * | tile | ||
) |
Is equivalent to Rast3d_read_tile (map, tileIndex, tile, FCELL_TYPE).
map | |
tileIndex | |
tile |
Definition at line 210 of file tileread.c.
References FCELL_TYPE, Rast3d_error(), and Rast3d_read_tile().
int Rast3d_unlock_all | ( | RASTER3D_Map * | map | ) |
Unlocks every tile in cache of map.
map |
Definition at line 315 of file tileread.c.
References RASTER3D_Map::cache, Rast3d_cache_unlock_all(), Rast3d_error(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.
Referenced by Rast3d_begin_cycle().
int Rast3d_unlock_tile | ( | RASTER3D_Map * | map, |
int | tileIndex | ||
) |
Unlocks tile with tileIndex.
map | |
tileIndex |
Definition at line 289 of file tileread.c.
References RASTER3D_Map::cache, Rast3d_cache_unlock(), Rast3d_error(), Rast3d_fatal_error(), and RASTER3D_Map::useCache.