[GRASS-dev] problem with r.colors on Mac

Glynn Clements glynn at gclements.plus.com
Tue Apr 10 22:04:03 EDT 2007


Michael Barton wrote:

> I just have been having problems with r.colors on the Mac. This is from cvs
> source code I downloaded and compiled today.
> 
> r.colors will crash the GUI when I run it with either grey.eq or grey.log as
> the color map. It seems to calculate the equalization stretch OK with
> grey.eq, though, in spite of crashing.

My guess is the gronsole code. Running r.colors from the command line
with GRASS_MESSAGE_FORMAT=gui doesn't show anything unusual.

As I've mentioned before, the use of "read" with non-blocking I/O is
likely to be problematic if the program generates output quickly. If
there's a problem here, r.colors is a good candidate to trigger it as
it will generate percentage output relatively fast.

> r.colors gives me a blank (i.e. white) image if I use grey.log. I list the
> color table below. As you can see, it¹s just white.
> 
> color table from grey.log
> 
> % 43844 43964
> nv:255
> 43844:254 43963:254
> 43964:255 43964:255

This is expected behaviour; grey.log maps a value of x to
255*log(x)/log(max); the minimum value is ignored. IOW, it *doesn't*
map the minimum value to black, it maps 1 to black (log(1) == 0).

I don't know whether this is a good idea, but it is how grey.log has
always behaved.

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




More information about the grass-dev mailing list