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 "G.h"
#include "gis.h"
#include "glocale.h"

Include dependency graph for opencell.c:

Go to the source code of this file.

Defines

#define FCB   G__.fileinfo[fd]
#define WINDOW   G__.window
#define DATA_NROWS   FCB.cellhd.rows
#define DATA_NCOLS   FCB.cellhd.cols
#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 DATA_NCOLS   FCB.cellhd.cols

Definition at line 113 of file opencell.c.

#define DATA_NROWS   FCB.cellhd.rows

Definition at line 112 of file opencell.c.

#define FCB   G__.fileinfo[fd]

Definition at line 110 of file opencell.c.

#define FORMAT_FILE   "f_format"

Definition at line 909 of file opencell.c.

#define FP_NBYTES   G__.fp_nbytes

Definition at line 432 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 434 of file opencell.c.

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

#define WINDOW   G__.window

Definition at line 111 of file opencell.c.

Referenced by G__create_window_mapping(), and G__open_cell_old().


Function Documentation

RASTER_MAP_TYPE G__check_fp_type ( char *  name,
char *  mapset 
)

Definition at line 962 of file opencell.c.

References FORMAT_FILE, G__file_name(), G_find_key_value(), G_free_key_value(), G_read_key_value_file(), G_strip(), G_warning(), and NULL.

Referenced by G_raster_map_type().

int G__open_cell_old ( char *  name,
char *  mapset 
)

Definition at line 214 of file opencell.c.

References FCB, G__allocate_null_bits(), G__init_window(), G__name_is_fully_qualified(), G__projection_name(), G_copy(), G_find_cell(), G_get_cellhd(), G_get_reclass(), G_open_old(), G_raster_map_type(), G_store(), G_warning(), if(), MAXFILES, NULL, NULL_ROWS_INMEM, WINDOW, XDR_DOUBLE_NBYTES, and XDR_FLOAT_NBYTES.

Referenced by G__check_for_auto_masking(), and G_open_cell_old().

int G__reallocate_mask_buf ( void   ) 

Definition at line 843 of file opencell.c.

References G_malloc(), and G_realloc().

int G__reallocate_null_buf ( void   ) 

Definition at line 824 of file opencell.c.

References G_malloc(), and G_realloc().

int G__reallocate_temp_buf ( void   ) 

Definition at line 862 of file opencell.c.

References G_malloc(), and G_realloc().

int G__reallocate_work_buf ( int  bytes_per_cell  ) 

Definition at line 804 of file opencell.c.

References G_malloc(), and G_realloc().

int G_cellvalue_format ( CELL  v  ) 

Definition at line 493 of file opencell.c.

int G_open_cell_new ( char *  name  ) 

Definition at line 443 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 452 of file opencell.c.

References OPEN_NEW_RANDOM.

int G_open_cell_new_uncompressed ( char *  name  ) 

Definition at line 461 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 157 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 503 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  ) 

Definition at line 529 of file opencell.c.

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

Referenced by G_open_raster_new_uncompressed().

int G_open_raster_new ( char *  name,
RASTER_MAP_TYPE  wr_type 
)

Definition at line 1019 of file opencell.c.

References G_fatal_error(), G_legal_filename(), G_open_cell_new(), G_open_fp_cell_new(), and G_set_fp_type().

int G_open_raster_new_uncompressed ( char *  name,
RASTER_MAP_TYPE  wr_type 
)

Definition at line 1037 of file opencell.c.

References G_fatal_error(), G_legal_filename(), G_open_cell_new_uncompressed(), G_open_fp_cell_new_uncompressed(), and G_set_fp_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 
)

Definition at line 940 of file opencell.c.

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

Referenced by G__open_cell_old(), G__quant_import(), G_read_fp_range(), G_read_range(), G_write_quant(), and G_write_range().

int G_set_cell_format ( int  n  ) 

Definition at line 478 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 cell, FCB, 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(), and OPEN_OLD.

int G_want_histogram ( int  flag  ) 

Definition at line 470 of file opencell.c.


Generated on Wed Aug 23 17:49:51 2006 for GRASS by  doxygen 1.4.7