[GRASS-dev] patch: foreground color in d.rast

Hello list!

Attached you find a quick patch which adds a fg=color option to d.rast.
It draws cells with cat=1 in the specified color.
I created this for personal use as I frequently overlay binary rasters
to have a quick visual comparison.

We probably don't want to have this patch applied to CVS as it
1) can be replaced with r.colors
2) works with binary (1,NULL) CELL raters only
3) it does not adhere to the "new color logic" (uses G_set_color)

If the developers are of the opinion that 1) is a non-issue and d.rast
should have the fg=color option added then we have to discuss whether 2)
should be expanded to for example, "color all non-NULL cells of any
given raster type". Once this is decided, one can implement the functionality
using the "new color logic" functions (G_add_color_rule).

For now, I'll just post the patch as a service for anyone who'd like to
have the limited functionality today.

cheers,
\flo.

--
Florian Kindl
Institute of Geography
University of Innsbruck

(attachments)

d.rast.fg.patch (3.34 KB)

Florian Kindl wrote:

Attached you find a quick patch which adds a fg=color option to d.rast.
It draws cells with cat=1 in the specified color.
I created this for personal use as I frequently overlay binary rasters
to have a quick visual comparison.

We probably don't want to have this patch applied to CVS as it
1) can be replaced with r.colors
2) works with binary (1,NULL) CELL raters only
3) it does not adhere to the "new color logic" (uses G_set_color)

If the developers are of the opinion that 1) is a non-issue and d.rast
should have the fg=color option added then we have to discuss whether 2)
should be expanded to for example, "color all non-NULL cells of any
given raster type". Once this is decided, one can implement the functionality
using the "new color logic" functions (G_add_color_rule).

For now, I'll just post the patch as a service for anyone who'd like to
have the limited functionality today.

FWIW, I don't support applying this to CVS due to #1.

--
Glynn Clements <glynn@gclements.plus.com>