|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-f6f2c534ea
|
Raster Library - Lookup array of colors. More...

Go to the source code of this file.
Raster Library - Lookup array of colors.
(C) 1999-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file color_look.c.
| void Rast__interpolate_color_rule | ( | DCELL | val, |
| unsigned char * | red, | ||
| unsigned char * | grn, | ||
| unsigned char * | blu, | ||
| const struct _Color_Rule_ * | rule | ||
| ) |
Interpolate color rules.
| val | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| rule | pointer to _Color_Rule which holds color rules info |
Definition at line 422 of file color_look.c.
References _Color_Rule_::high.
Referenced by Rast__lookup_colors().
| void Rast__lookup_colors | ( | const 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 | ||
| ) |
Lookup an array of colors.
| raster | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| set | array which indicates if color is set or not | |
| n | number of values | |
| colors | pointer to Colors structure which holds color info | |
| mod | ||
| rules_only | ||
| data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 195 of file color_look.c.
References b, CELL_TYPE, Colors::fixed, g, G_incr_void_ptr, _Color_Rule_::high, Colors::invert, max, min, Colors::modular, _Color_Rule_::next, NULL, r, Rast__interpolate_color_rule(), Rast_cell_size(), Rast_get_d_value(), Rast_get_default_color(), Rast_get_null_value_color(), Rast_is_null_value(), Rast_raster_cmp(), and Colors::shift.
Referenced by Rast_lookup_c_colors(), Rast_lookup_colors(), Rast_lookup_d_colors(), and Rast_lookup_f_colors().
| void Rast_lookup_c_colors | ( | const 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 cell values. The colors for the n values in the cell array are stored in the red, green, and blue arrays. The values in the set array will indicate if the corresponding cell 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.
Modified to return a color for NULL-values.
| cell | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| set | array which indicates if color is set or not | |
| n | number of values | |
| colors | pointer to Colors structure which holds color info |
Definition at line 45 of file color_look.c.
References CELL_TYPE, G_zero(), Rast__lookup_colors(), and Rast__organize_colors().
Referenced by Gs_build_256lookup(), Gs_pack_colors(), Rast_print_colors(), and Rast_print_json_colors().
| void Rast_lookup_colors | ( | const void * | raster, |
| unsigned char * | red, | ||
| unsigned char * | grn, | ||
| unsigned char * | blu, | ||
| unsigned char * | set, | ||
| int | n, | ||
| struct Colors * | colors, | ||
| RASTER_MAP_TYPE | map_type | ||
| ) |
Lookup an array of colors.
| raster | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| set | array which indicates if color is set or not | |
| n | number of values | |
| colors | pointer to Colors structure which holds color info | |
| map_type | raster type (CELL, FCELL, DCELL) |
Definition at line 79 of file color_look.c.
References G_zero(), Rast__lookup_colors(), and Rast__organize_colors().
Referenced by D_draw_raster_RGB(), Rast_get_color(), Rast_get_row_colors(), and Rast_map_to_img_str().
| void Rast_lookup_d_colors | ( | const DCELL * | dcell, |
| unsigned char * | red, | ||
| unsigned char * | grn, | ||
| unsigned char * | blu, | ||
| unsigned char * | set, | ||
| int | n, | ||
| struct Colors * | colors | ||
| ) |
Lookup an array of colors (DCELL)
Converts the n double-precision values in the dcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.
| dcell | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| set | array which indicates if color is set or not | |
| n | number of values | |
| colors | pointer to Colors structure which holds color info |
Definition at line 146 of file color_look.c.
References DCELL_TYPE, G_zero(), Rast__lookup_colors(), and Rast__organize_colors().
| void Rast_lookup_f_colors | ( | const FCELL * | fcell, |
| unsigned char * | red, | ||
| unsigned char * | grn, | ||
| unsigned char * | blu, | ||
| unsigned char * | set, | ||
| int | n, | ||
| struct Colors * | colors | ||
| ) |
Lookup an array of colors (FCELL)
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.
| fcell | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| set | array which indicates if color is set or not | |
| n | number of values | |
| colors | pointer to Colors structure which holds color info |
Definition at line 112 of file color_look.c.
References FCELL_TYPE, G_zero(), Rast__lookup_colors(), and Rast__organize_colors().
Referenced by Gs_pack_colors_float().