alloc_cell.c File Reference

#include <math.h>
#include <grass/gis.h>

Include dependency graph for alloc_cell.c:

Go to the source code of this file.

Defines

#define F2I(map_type)   (map_type == CELL_TYPE ? 0 : (map_type == FCELL_TYPE ? 1 : 2))

Functions

int G_raster_size (RASTER_MAP_TYPE data_type)
 return size of raster
CELL * G_allocate_cell_buf ()
 allocate a raster buffer
void * G_allocate_raster_buf (RASTER_MAP_TYPE data_type)
 Allocate raster array.
CELL * G_allocate_c_raster_buf ()
 Allocate an array of CELL.
FCELL * G_allocate_f_raster_buf ()
 Allocate an array of FCELL.
DCELL * G_allocate_d_raster_buf ()
 Allocate an array of DCELL.
char * G_allocate_null_buf ()
 Allocate an array of char.
unsigned char * G__allocate_null_bits (int cols)
int G__null_bitstream_size (int cols)


Define Documentation

#define F2I ( map_type   )     (map_type == CELL_TYPE ? 0 : (map_type == FCELL_TYPE ? 1 : 2))

Definition at line 5 of file alloc_cell.c.

Referenced by G_raster_size().


Function Documentation

unsigned char* G__allocate_null_bits ( int  cols  ) 

Definition at line 130 of file alloc_cell.c.

References G__null_bitstream_size(), and G_calloc().

Referenced by G__open_cell_old().

int G__null_bitstream_size ( int  cols  ) 

CELL* G_allocate_c_raster_buf (  ) 

Allocate an array of CELL.

Allocate an array of CELL based on the number of columns in the current region.

Returns:
CELL *

Definition at line 79 of file alloc_cell.c.

References G_calloc(), and G_window_cols().

CELL* G_allocate_cell_buf (  ) 

allocate a raster buffer

This routine allocates a buffer of type CELL just large enough to hold one row of raster data (based on the number of columns in the active region).

CELL *cell;
 cell = G_allocate_cell_buf(void);
If larger buffers are required, the routine G_malloc can be used. If sufficient memory is not available, an error message is printed and exit() is called. Returns pointer to a buffer. The routine is generally used with each open cell file.

Parameters:
void 
Returns:
CELL *

Definition at line 48 of file alloc_cell.c.

References G_calloc(), and G_window_cols().

DCELL* G_allocate_d_raster_buf (  ) 

Allocate an array of DCELL.

Allocate an array of DCELL based on the number of columns in the current region.

Returns:
DCELL *

Definition at line 109 of file alloc_cell.c.

References G_calloc(), and G_window_cols().

FCELL* G_allocate_f_raster_buf (  ) 

Allocate an array of FCELL.

Allocate an array of FCELL based on the number of columns in the current region.

Returns:
FCELL *

Definition at line 94 of file alloc_cell.c.

References G_calloc(), and G_window_cols().

char* G_allocate_null_buf (  ) 

Allocate an array of char.

Allocate an array of char based on the number of columns in the current region.

Returns:
char *

Definition at line 124 of file alloc_cell.c.

References G_calloc(), and G_window_cols().

void* G_allocate_raster_buf ( RASTER_MAP_TYPE  data_type  ) 

Allocate raster array.

Allocate an array of CELL, FCELL, or DCELL (depending on data_type) based on the number of columns in the current region.

Parameters:
data_type 
Returns:
void *

Definition at line 63 of file alloc_cell.c.

References G_calloc(), G_raster_size(), and G_window_cols().

int G_raster_size ( RASTER_MAP_TYPE  data_type  ) 

return size of raster

If data_type is CELL_TYPE, returns sizeof(CELL) If data_type is FCELL_TYPE, returns sizeof(FCELL) If data_type is DCELL_TYPE, returns sizeof(DCELL)

Parameters:
data_type 
Returns:
int

Definition at line 22 of file alloc_cell.c.

References F2I.

Referenced by G__lookup_colors(), G__set_null_value(), G_allocate_raster_buf(), G_get_raster_row_colors(), G_mark_raster_cats(), G_raster_cpy(), G_row_update_fp_range(), and G_zero_raster_buf().


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