[GRASS5] Suggested color function names

Glynn Clements glynn at gclements.plus.com
Sat Apr 22 08:00:01 EDT 2006


Cedric Shock wrote:

> Hamish added a red, green, blue, alpha color structure to gis.h.
> 
> I'd like to add the following to gis.h as well:
> 
> /* RGBA_Color set values */
> #define RGBA_COLOR_SET    1
> #define RGBA_COLOR_UNSET  0
> #define RGBA_COLOR_NONE  -1
> 
> I also think it would be apropos to add some more functions that deal with 
> this structure instead of red, green, and blue integers. New functions means 
> new names. My current best idea is adding RGBA to the existing analogous 
> names.
> 
> We currently have
> 
> int G_str_to_color (str * name, int * red, int * green, int * blue);
> int R_RGB_color(unsigned char,unsigned char,unsigned char);
> int R_reset_color(unsigned char,unsigned char,unsigned char,int);
> int R_reset_colors(int,int,unsigned char *,unsigned char *,unsigned char *);
> 
> How are these suggested names for new "functions":
> 
> int G_str_to_RGBA_color (str * name, RGBA_Color * color);
> int R_RGBA_color(RGBA_Color * color);
> int R_reset_RGBA_color(RGBA_Color * color, int);
> int R_reset_colors(int,int,RGBA_Color ** colors);
> 
> The R_ functions would just use the existing protocol (no alpha support).

Alpha support in the current display architecture isn't going to
happen (I reverted the last attempt to add it, and will do likewise in
future). The core X API doesn't support it, and hacking it in is
grossly inefficient (read-modify-write cycles aren't practical on a
remote display).

Developers' time would be better spent replacing the modules which are
tied to the current architecture so that it can be discarded in favour
of a from-scratch replacement.

I'm referring to anything which uses R_get_location_with_*, primarily
v.digit and i.points.

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




More information about the grass-dev mailing list