[GRASS5] Re: Large XDRIVER in 5.0pre1

Glynn Clements glynn.clements at virgin.net
Thu May 24 18:42:35 EDT 2001


> As part of the fix to XDRIVER's colour handling, it no longer
> artificially limits the colour resolution to 32 levels per channel
> (32768 colours). If it is being run on a 24-bit display, and a client
> queries the number of colours (R_get_num_colors()), it will now
> receive the value 16777216.
> 
> This suggests that something in either d.rast or displaylib is causing
> XDRIVER to allocate memory proportional to the total number of colours
> available.
> 
> Whilst I did perform some checks to see if this broke anything, I
> didn't check for memory utilisation (I didn't check float maps either,
> now that I think of it).
> 
> I'll look into this, although I may need some input on how to fix it. 
> R_get_num_colors() is undocumented, and it is far from obvious what
> the return value should signify. I'm fairly sure that whoever designed
> it hadn't considered TrueColor/DirectColor visuals.

I've hacked D_set_colors() not to use more than 32 levels for RGB
(32768 colours) or 256 levels for grey. This puts the quality of
d.rast's output back where it was before; however, d.rgb (and anything
else which uses the RGB raster functions) will get full 24-bpp output.

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



More information about the grass-dev mailing list