[GRASS5] [5.7] d.vect & d.zoom

Glynn Clements glynn.clements at virgin.net
Wed May 12 06:23:11 EDT 2004


Hamish wrote:

> d.vect fcolor= and d.zoom both use grey as their default color.
> So when you try to zoom over a large area, the box dissapears as you
> move over the area.. it looks bad.
> 
> I would like to change the d.zoom box that is drawn with
> lib/raster/Get_w_box.c   R_get_location_with_box()  to use 111:111:111,
> but can't seem to find where that is set. Other options include using
> DEFAULT_FG_COLOR or changing d.vect fcolor='s default. I think it's best
> to make the d.zoom box the oddball color though, as many other maps or
> display items probably want to use "grey" as well.

The line/box used by Get_location_with_{line,box} are drawn using XOR
plotting with the all-ones bit pattern. The actual colour will depend
upon what's beneath it; for a black background, the line/box should be
white.

However, for TrueColor visuals, there will always be a case where the
XOR'd colour is almost identical to the original, i.e. 50% grey (e.g. 
XORing 0x7F with 0xFF gives 0x80, which is likely to be
indistinguishable).

The code in question is in:

	src/display/devices/XDRIVER/XDRIVER24/Get_w_line.c
	src/display/devices/XDRIVER/XDRIVER24/Get_w_box.c

In both cases:

	    gcValues.foreground = 0xffffffff;

Actually, the plane_mask field should probably be set to AllPlanes,
although the existing setting will work in most cases (i.e. where
BlackPixel is all-zeroes and WhitePixel is all-ones).

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list