[GRASS-dev] problem with Rast_get_c_color()

Hamish hamish_b at yahoo.com
Mon Aug 15 11:58:41 EDT 2011


Martin:
> when I define
> 
> Rast_make_colors(colors, "ryg", (CELL) 1, (CELL) 2);
> val = 3;
> 
> fn
> 
> Rast_get_c_color((const CELL *) &val, &red, &grn, &blu, colors)
> 
> returns 1 (color rule defined). I would expect no color
> rules defined (return code 0) or am I wrong?

perhaps it is returning the "default" (color_rules.c) color,
or "*" color (color_read.c^) and so out-of-known rules returns
the 'valid' color for out-of-range^^?


[^]
 * optional lines are
 *    invert            invert color table
 *    shift:n           where n is the amount to shift the color table
 *    nv:r:g:b          color to use for NULL values
 *    *:r:g:b           color to use for undefined (beyond color rules)


[^^] sometime seen when FP max goes beyond integer max, or color
table borrowed from a nearby raster who's range isn't quite as
big.


don't really know, just some ideas,
Hamish



More information about the grass-dev mailing list