opencell.c File Reference

#include <rpc/types.h>
#include <rpc/xdr.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <grass/config.h>
#include "G.h"
#include <grass/gis.h>
#include <grass/glocale.h>

Include dependency graph for opencell.c:

Go to the source code of this file.

Defines

#define FP_NBYTES   G__.fp_nbytes
#define FP_TYPE   G__.fp_type
#define FORMAT_FILE   "f_format"

Functions

int G_open_cell_old (char *name, char *mapset)
int G__open_cell_old (char *name, char *mapset)
int G_open_cell_new (char *name)
int G_open_cell_new_random (char *name)
int G_open_cell_new_uncompressed (char *name)
int G_want_histogram (int flag)
int G_set_cell_format (int n)
int G_cellvalue_format (CELL v)
int G_open_fp_cell_new (char *name)
int G_open_fp_cell_new_uncompressed (char *name)
int G__reallocate_work_buf (int bytes_per_cell)
int G__reallocate_null_buf (void)
int G__reallocate_mask_buf (void)
int G__reallocate_temp_buf (void)
int G_set_fp_type (RASTER_MAP_TYPE map_type)
 This controls the storage type for floating-point maps. It affects subsequent calls to G_open_fp_map_new(). The type must be one of FCELL_TYPE (float) or DCELL_TYPE (double). The use of this routine by applications is discouraged since its use would override user preferences.
int G_raster_map_is_fp (char *name, char *mapset)
 Returns true(1) if raster map name in mapset is a floating-point dataset; false(0) otherwise.
RASTER_MAP_TYPE G_raster_map_type (char *name, char *mapset)
RASTER_MAP_TYPE G__check_fp_type (char *name, char *mapset)
int G_open_raster_new (char *name, RASTER_MAP_TYPE wr_type)
int G_open_raster_new_uncompressed (char *name, RASTER_MAP_TYPE wr_type)
int G_set_quant_rules (int fd, struct Quant *q)
 Sets quant translation rules for raster map opened for reading. fd is a file descriptor returned by G_open_cell_old(). After calling this function, G_get_c_raster_row() and G_get_map_row() will use rules defined by q (instead of using rules defined in map's quant file) to convert floats to ints.


Define Documentation

#define FORMAT_FILE   "f_format"

Definition at line 909 of file opencell.c.

#define FP_NBYTES   G__.fp_nbytes

Definition at line 450 of file opencell.c.

Referenced by G_open_fp_cell_new(), G_open_fp_cell_new_uncompressed(), and G_set_fp_type().

#define FP_TYPE   G__.fp_type

Definition at line 452 of file opencell.c.

Referenced by G_open_fp_cell_new(), G_open_fp_cell_new_uncompressed(), and G_set_fp_type().


Function Documentation

RASTER_MAP_TYPE G__check_fp_type ( char *  name,
char *  mapset 
)

int G__open_cell_old ( char *  name,
char *  mapset 
)

int G__reallocate_mask_buf ( void   ) 

Definition at line 843 of file opencell.c.

References G_malloc(), and G_realloc().

Referenced by G__open_cell_old(), and G_set_window().

int G__reallocate_null_buf ( void   ) 

Definition at line 824 of file opencell.c.

References G_malloc(), and G_realloc().

Referenced by G__open_cell_old(), and G_set_window().

int G__reallocate_temp_buf ( void   ) 

Definition at line 862 of file opencell.c.

References G_malloc(), and G_realloc().

Referenced by G__open_cell_old(), and G_set_window().

int G__reallocate_work_buf ( int  bytes_per_cell  ) 

Definition at line 804 of file opencell.c.

References G_malloc(), and G_realloc().

Referenced by G__open_cell_old(), and G_set_window().

int G_cellvalue_format ( CELL  v  ) 

Definition at line 511 of file opencell.c.

int G_open_cell_new ( char *  name  ) 

Definition at line 461 of file opencell.c.

References OPEN_NEW_COMPRESSED.

Referenced by G_open_raster_new().

int G_open_cell_new_random ( char *  name  ) 

Definition at line 470 of file opencell.c.

References OPEN_NEW_RANDOM.

int G_open_cell_new_uncompressed ( char *  name  ) 

Definition at line 479 of file opencell.c.

References OPEN_NEW_UNCOMPRESSED.

Referenced by G_open_raster_new_uncompressed().

int G_open_cell_old ( char *  name,
char *  mapset 
)

Definition at line 178 of file opencell.c.

References G__check_for_auto_masking(), G__open_cell_old(), and G_warning().

int G_open_fp_cell_new ( char *  name  ) 

Definition at line 521 of file opencell.c.

References FP_NBYTES, FP_TYPE, getenv(), OPEN_NEW_COMPRESSED, XDR_DOUBLE_NBYTES, and XDR_FLOAT_NBYTES.

Referenced by G_open_raster_new().

int G_open_fp_cell_new_uncompressed ( char *  name  ) 

int G_open_raster_new ( char *  name,
RASTER_MAP_TYPE  wr_type 
)

int G_open_raster_new_uncompressed ( char *  name,
RASTER_MAP_TYPE  wr_type 
)

int G_raster_map_is_fp ( char *  name,
char *  mapset 
)

Returns true(1) if raster map name in mapset is a floating-point dataset; false(0) otherwise.

Parameters:
name 
mapset 
Returns:
int

Definition at line 924 of file opencell.c.

References G__file_name(), G_find_cell(), G_warning(), and NULL.

Referenced by G__read_cats(), G__write_cats(), and G_read_colors().

RASTER_MAP_TYPE G_raster_map_type ( char *  name,
char *  mapset 
)

int G_set_cell_format ( int  n  ) 

Definition at line 496 of file opencell.c.

int G_set_fp_type ( RASTER_MAP_TYPE  map_type  ) 

This controls the storage type for floating-point maps. It affects subsequent calls to G_open_fp_map_new(). The type must be one of FCELL_TYPE (float) or DCELL_TYPE (double). The use of this routine by applications is discouraged since its use would override user preferences.

Parameters:
type 
Returns:
int

Definition at line 891 of file opencell.c.

References FP_NBYTES, FP_TYPE, G_warning(), XDR_DOUBLE_NBYTES, and XDR_FLOAT_NBYTES.

Referenced by G_open_raster_new(), and G_open_raster_new_uncompressed().

int G_set_quant_rules ( int  fd,
struct Quant *  q 
)

Sets quant translation rules for raster map opened for reading. fd is a file descriptor returned by G_open_cell_old(). After calling this function, G_get_c_raster_row() and G_get_map_row() will use rules defined by q (instead of using rules defined in map's quant file) to convert floats to ints.

Parameters:
fd 
q 
Returns:
int

Definition at line 1069 of file opencell.c.

References G_quant_add_rule(), G_quant_get_neg_infinite_rule(), G_quant_get_pos_infinite_rule(), G_quant_init(), G_quant_set_neg_infinite_rule(), G_quant_set_pos_infinite_rule(), G_quant_truncate(), G_warning(), fileinfo::open_mode, OPEN_OLD, and fileinfo::quant.

int G_want_histogram ( int  flag  ) 

Definition at line 488 of file opencell.c.


Generated on Sun Apr 6 17:32:23 2008 for GRASS by  doxygen 1.5.5