color_look.c File Reference

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

Include dependency graph for color_look.c:

Go to the source code of this file.

Functions

int G_lookup_colors (CELL *cell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors)
 lookup an array of colors
int G_lookup_c_raster_colors (CELL *cell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors)
 The same as G_lookup_colors(cell, r, g, b, set, n, colors).
int G_lookup_raster_colors (void *raster, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors, RASTER_MAP_TYPE map_type)
 If the cell_type is CELL_TYPE, calls G_lookup_colors((CELL *)cell, r, g, b, set, n, colors); If the cell_type is FCELL_TYPE, calls G_lookup_f_raster_colors(FCELL *)cell, r, g, b, set, n, colors); If the cell_type is DCELL_TYPE, calls G_lookup_d_raster_colors(DCELL *)cell, r, g, b, set, n, colors);.
int G_lookup_f_raster_colors (FCELL *fcell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors)
 Converts the n floating-point values in the fcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.
int G_lookup_d_raster_colors (DCELL *dcell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors)
 Converts the n floating-point values in the dcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.
int G__lookup_colors (void *raster, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors, int mod, int rules_only, RASTER_MAP_TYPE data_type)
int G__interpolate_color_rule (DCELL val, unsigned char *red, unsigned char *grn, unsigned char *blu, struct _Color_Rule_ *rule)


Function Documentation

int G__interpolate_color_rule ( DCELL  val,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
struct _Color_Rule_ *  rule 
)

Definition at line 457 of file color_look.c.

Referenced by G__lookup_colors().

int G__lookup_colors ( void *  raster,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
unsigned char *  set,
int  n,
struct Colors *  colors,
int  mod,
int  rules_only,
RASTER_MAP_TYPE  data_type 
)

int G_lookup_c_raster_colors ( CELL *  cell,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
unsigned char *  set,
int  n,
struct Colors *  colors 
)

The same as G_lookup_colors(cell, r, g, b, set, n, colors).

Parameters:
cell 
r 
g 
b 
set 
n 
colors 
Returns:
int

Definition at line 78 of file color_look.c.

References G__lookup_colors(), G__organize_colors(), and G_zero().

Referenced by G_lookup_colors().

int G_lookup_colors ( CELL *  cell,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
unsigned char *  set,
int  n,
struct Colors *  colors 
)

lookup an array of colors

Extracts colors for an array of raster values. The colors for the n values in the raster array are stored in the red, green, and blue arrays. The values in the set array will indicate if the corresponding raster value has a color or not (1 means it does, 0 means it does not). The programmer must allocate the red, green, blue, and set arrays to be at least dimension n. Note. The red, green, and blue intensities will be in the range 0 -­ 255.

Parameters:
raster 
red 
green 
blue 
set 
n 
colors 
Returns:
int
Modified to return a color for NULL-values.

Returns:
int

Definition at line 38 of file color_look.c.

References G_lookup_c_raster_colors().

Referenced by G_get_color().

int G_lookup_d_raster_colors ( DCELL *  dcell,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
unsigned char *  set,
int  n,
struct Colors *  colors 
)

Converts the n floating-point values in the dcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.

Parameters:
dcell 
r 
g 
b 
set 
n 
colors 
Returns:
int

Definition at line 195 of file color_look.c.

References G__lookup_colors(), G__organize_colors(), and G_zero().

int G_lookup_f_raster_colors ( FCELL *  fcell,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
unsigned char *  set,
int  n,
struct Colors *  colors 
)

Converts the n floating-point values in the fcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.

Parameters:
fcell 
r 
g 
b 
set 
n 
colors 
Returns:
int

Definition at line 160 of file color_look.c.

References G__lookup_colors(), G__organize_colors(), and G_zero().

int G_lookup_raster_colors ( void *  raster,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
unsigned char *  set,
int  n,
struct Colors *  colors,
RASTER_MAP_TYPE  map_type 
)

If the cell_type is CELL_TYPE, calls G_lookup_colors((CELL *)cell, r, g, b, set, n, colors); If the cell_type is FCELL_TYPE, calls G_lookup_f_raster_colors(FCELL *)cell, r, g, b, set, n, colors); If the cell_type is DCELL_TYPE, calls G_lookup_d_raster_colors(DCELL *)cell, r, g, b, set, n, colors);.

Parameters:
rast 
r 
g 
b 
set 
n 
colors 
cell_type 
Returns:
int

Definition at line 120 of file color_look.c.

References G__lookup_colors(), G__organize_colors(), and G_zero().

Referenced by G_get_c_raster_color(), G_get_d_raster_color(), G_get_f_raster_color(), G_get_raster_color(), and G_get_raster_row_colors().


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