grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

raster2.c File Reference
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/display.h>
Include dependency graph for raster2.c:

Go to the source code of this file.

Functions

int D_set_overlay_mode (int n)
 Configure raster overlay mode. More...
 
int D_color (CELL cat, struct Colors *colors)
 
int D_c_color (CELL cat, struct Colors *colors)
 
int D_d_color (DCELL val, struct Colors *colors)
 Same functionality as D_color() except that the value is type DCELL. This implies that the floating-point interfaces to the colors are used by this routine. More...
 
int D_f_color (FCELL val, struct Colors *colors)
 Same functionality as D_color() except that the value is type FCELL. This implies that the floating-point interfaces to the colors are used by this routine. More...
 
int D_color_of_type (const void *raster, struct Colors *colors, RASTER_MAP_TYPE data_type)
 If the data_type is CELL_TYPE, calls D_color((CELL *value, colors); If the data_type is FCELL_TYPE, calls D_f_color((FCELL *value, colors); If the data_type is DCELL_TYPE, calls D_d_color((DCELL *value, colors);. More...
 

Variables

int D__overlay_mode = 0
 

Function Documentation

◆ D_c_color()

int D_c_color ( CELL  cat,
struct Colors colors 
)

Definition at line 74 of file raster2.c.

References CELL_TYPE, colors, and D_color_of_type().

Referenced by D_color().

◆ D_color()

int D_color ( CELL  cat,
struct Colors colors 
)

Definition at line 68 of file raster2.c.

References colors, and D_c_color().

◆ D_color_of_type()

int D_color_of_type ( const void *  raster,
struct Colors colors,
RASTER_MAP_TYPE  data_type 
)

If the data_type is CELL_TYPE, calls D_color((CELL *value, colors); If the data_type is FCELL_TYPE, calls D_f_color((FCELL *value, colors); If the data_type is DCELL_TYPE, calls D_d_color((DCELL *value, colors);.

Parameters
value
colors
data_type
Returns
int

Definition at line 134 of file raster2.c.

References b, colors, D_RGB_color(), g, r, and Rast_get_color().

Referenced by D_c_color(), D_d_color(), and D_f_color().

◆ D_d_color()

int D_d_color ( DCELL  val,
struct Colors colors 
)

Same functionality as D_color() except that the value is type DCELL. This implies that the floating-point interfaces to the colors are used by this routine.

Parameters
value
colors
Returns
int

Definition at line 93 of file raster2.c.

References colors, D_color_of_type(), and DCELL_TYPE.

◆ D_f_color()

int D_f_color ( FCELL  val,
struct Colors colors 
)

Same functionality as D_color() except that the value is type FCELL. This implies that the floating-point interfaces to the colors are used by this routine.

Parameters
value
colors
Returns
int

Definition at line 112 of file raster2.c.

References colors, D_color_of_type(), and FCELL_TYPE.

◆ D_set_overlay_mode()

int D_set_overlay_mode ( int  n)

Configure raster overlay mode.

This routine determines if D_draw_raster() draws in overlay mode (locations with category 0 are left untouched) or not (colored with the color for category 0).

Parameters
n1 (TRUE) for overlay mode; 0 (FALSE) otherwise
Returns
0

Definition at line 50 of file raster2.c.

References D__overlay_mode.

Variable Documentation

◆ D__overlay_mode

int D__overlay_mode = 0

code in this file is designed to send raster data to the graphics driver. It handles raster->color lookup translation, as well as loading appropriate colormaps into the driver and the sending of raster data to the plotter. The loading of colors is designed to never send more colors than the hardware can support - even though the GRASS drivers will allocate virtual colormaps to pretend there are more This code effectively disables that driver feature/mistake.

To simply plot raster data:

to specify if overlay mode is to be used D_set_overlay_mode(flag) int flag; /1=yes,0=no/

to select a raster color for line drawing D_color (cat, colors) CELL cat struct Colors *colors; /color info/

D_color_of_type(raster, colors, data_type); void *raster; struct Colors *colors; /color info/ RASTER_MAP_TYPE data_type;

Note: the same Colors structure must be passed to all routines.

Definition at line 36 of file raster2.c.

Referenced by D_draw_raster_RGB(), D_raster_draw_begin(), D_set_overlay_mode(), and draw_cell().