[fdo-internals] FDO RFC 1 - Support Property FdoIRaster::BitsUsedPerPixel

Frank Warmerdam warmerdam at pobox.com
Thu Mar 15 13:30:23 EDT 2007


Greg Boone wrote:
> Hi All,
> 
> I am submitting the following RFC for open discussion and comments:
> 
> http://trac.osgeo.org/fdo/wiki/FDORfc1
> 
> Please respond to the list with any feedback.

Greg,

I read the RFC over.

1) Is it assumed that if GetUsedBitsPerPixel() is less than GetBitsPerPixel()
that the used bits will be the low order bits, and the high order bits will
be zero?

2) What are the applications using this information for?  To do a linear
contrast stretch?  If so, would it be better to supply min/max values
instead of a number of bits?  If an image has values from 0 to 300 and
GetUsedBitsPerPixel() returns 9 the application would still do a
0-511 linear stretch which isn't too great for 0-300 values.

3) For many file formats there isn't any way to find out how many bits
are actually being used.  Is this going to be a problem?  Is there going
to be a way for providers to return an indicator that they don't
know how many bits are actually being used?

4) Is there going to be a default implementation provide that just returns
GetBitsPerPixel()?

5) In GDAL I have a concept of NBITS as metadata from some drivers.  This is
primarily just returned by drivers reading 1, 2, and 4 bit images and returning
them as 8bit.  This can be mapped to the GetUsedBitsPerPixel() call.

Overall, I'd like to understand the rationale better (is it just for linear
stretches).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the fdo-internals mailing list