color_look.c File Reference

#include <math.h>
#include "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, mod, 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 467 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,
mod  ,
rules_only  ,
RASTER_MAP_TYPE  data_type 
)

Definition at line 234 of file color_look.c.

References b, cat, g, G__interpolate_color_rule(), G_get_default_color(), G_get_null_value_color(), G_get_raster_value_d(), G_incr_void_ptr(), G_is_null_value(), G_raster_cmp(), G_raster_size(), NULL, and r.

Referenced by G_lookup_c_raster_colors(), G_lookup_d_raster_colors(), G_lookup_f_raster_colors(), and G_lookup_raster_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).

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

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 198 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 Wed Aug 23 17:49:31 2006 for GRASS by  doxygen 1.4.7