[Gdal-dev] GDALColorEntry? GDT_CInt16?

Frank Warmerdam warmerdam at pobox.com
Wed Mar 8 16:56:04 EST 2006


Marc A. Lepage wrote:
> After reading the docs, I remain confused about the exact types (and 
> ranges) of data in a few cases.
> 
>  
> 
> A GDALColorEntry has 4 shorts representing (e.g.) R, G, B, A. Are they 
> storing values from 0-255, or 0-32767? (I am assuming they are signed.) 
> When I get a value (say c1 representing red), how should I be reading 
> its value?

Marc,

The red, green, blue and alpha values are in the range 0 to 255.  A
short type was used because I was concerned that some color models
needed a larger type.  However, not having pursued other color models
it hasn't been an issue.

> For complex GDALDataType GDT_CInt16, is that a single 16-bit quantity 
> which is to be read as two 8-bit quantities? Or is it two 16-bit 
> quantities? Are they signed or unsigned?

GDT_CInt16 consists of two 16bit values, one for the "real" and one
for the "imaginary" component.

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 OSGF, http://osgeo.org




More information about the Gdal-dev mailing list