[GRASS5] r.in.gdal updates?
Glynn Clements
glynn.clements at virgin.net
Sat Mar 1 01:11:22 EST 2003
Frank Warmerdam wrote:
> > >I would like to ask if a developer is willing to update r.in.gdal
> > >(Frank Warmerdam told me that he won't do that at time):
> > >
> > >Outstanding
> > > - fix the grey color tables issue for RGB maps
> >
> >
> > The main problem here is determining the overall range of the data,
> > i.e. which values correspond to black and white. Black is almost
> > certain to be 0, but determining white is more difficult. Usually it's
> > ((1<<bit_depth)-1), but you need to know what bit_depth is.
> >
> > Once that's been determined, generating the colour table is trivial.
> >
> > NB: this is why d.rgb, r.composite etc need the grey-scale colour
> > tables; so that they can translate a cell value to an intensity.
>
> Glynn,
>
> After completing the raster import, the GRASS library will have min/max
> information won't it, using the G_get_fp_range_min_max()?
That isn't the right information. What's required are the values which
correspond to 0% and 100% intensity; e.g. for a 24-bpp colour image,
the appropriate values are 0 and 255, regardless of the minimum and
maximum values which occur in the data.
> If that isn't practical, the GDALComputeRasterMinMax() function could be
> used. In some cases it is optimized to use range info in the source file
I don't know for certain what that function does, but the name leads
me to suspect that it isn't the right tool.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list