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

Glynn Clements glynn at gclements.plus.com
Wed Apr 11 12:24:17 EDT 2007


Markus Neteler wrote:

> > It wouldn't be hard to change it to map log(min) to black. I'm not so
> > sure about the histogram equalisation part.
> > 
> > The main issue is whether someone might be relying upon the existing
> > behaviour.
> 
> Maybe not too much since it is "only" a color table.

I've fixed this.

> > Beyond that, it would be nice to be able to apply histogram
> > equalisation and/or logarithmic scaling to any colour table, rather
> > than just grey.
> 
> Absolutely. A long standing wish...

I've added two new functions to libgis:

	int G_histogram_eq_colors(struct Colors *, struct Colors *, struct Cell_stats *);
	int G_log_colors(struct Colors *, struct Colors *, int);

Eac function creates a new colour table from an existing colour table. 
In both cases, the new table covers the same range as the old table,
but the mapping across the range is either equalised or
logarithmically scaled.

The next step is to add corresponding options to r.colors.

Beyond that, I'd like to propose eliminating most of the individual
G_make_*_colors() functions in favour of a general purpose function
which takes the name of a rules file as an argument.

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




More information about the grass-dev mailing list