Maciej Sieczka wrote:

> > What do you guys think of a flag in r.colors to apply an _inverted_ color
> > scale?
> 
> Sounds really usefull to me.

Sounds really trivial to implement, too.

"struct Colors" already has an "invert" field, which can be inverted
with G_invert_colors().

AFAICT, you just need e.g.:

    flag.n = G_define_flag();
    flag.n->key = 'n';  
    flag.n->description = _("Invert colors");

        ...

    if (flag.n->answer)
    {
        G_invert_colors(&colors);
        colors = colors_tmp;
    }

The only issue is whether the inversion should come before or after
logarithmic scaling (I think that it matters, although I haven't
actually checked).

As more transforms are added, it's looking more important to replace
the various flags with an option, e.g. trans=log,eq,inv.

NOTE: this will add another situation where the GUI's assumption that
opt->multiple=YES implies a set (rather than a list) will fail.

-- 
Glynn Clements <[EMAIL PROTECTED]>

_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to