#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>
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 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().
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 235 of file opencell.c.
References fileinfo::cellhd, fileinfo::cur_row, fileinfo::data, G__allocate_null_bits(), G__check_format(), G__create_window_mapping(), G__init_window(), G__name_is_fully_qualified(), G__projection_name(), G__reallocate_mask_buf(), G__reallocate_null_buf(), G__reallocate_temp_buf(), G__reallocate_work_buf(), G_calloc(), G_copy(), G_find_cell(), G_get_cellhd(), G_get_reclass(), G_open_old(), G_raster_map_type(), G_read_quant(), G_store(), G_warning(), fileinfo::io_error, fileinfo::map_type, fileinfo::mapset, fileinfo::min_null_row, fileinfo::name, fileinfo::nbytes, NULL, fileinfo::null_cur_row, fileinfo::null_file_exists, fileinfo::NULL_ROWS, NULL_ROWS_INMEM, fileinfo::null_work_buf, fileinfo::open_mode, OPEN_OLD, fileinfo::quant, fileinfo::reclass, fileinfo::reclass_flag, XDR_DOUBLE_NBYTES, XDR_FLOAT_NBYTES, and fileinfo::xdrstream.
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().
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 | ) |
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 | ) |
Definition at line 547 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.
name | ||
mapset |
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 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.
type |
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.
fd | ||
q |
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.