[gdal-dev] Information about GDAL JP2Kakadu supported datatypes

Frank Warmerdam warmerdam at pobox.com
Mon Dec 17 13:50:36 EST 2007


Daniele Romagnoli wrote:
> Hi list,
> I have a very simple question for you :)
> 
> Which data types are supported as input of the JP2K driver based on Kakadu?
> Looking at jp2kakdataset.cpp I noticed the presence of an if-else chain 
> which checks the bit_depth of the codestream. (supporting signed 16 bit 
> bands, unsigned 16 bit, float 32 bit and bytes).
> How other datatypes are treated? (I mean, as an instance, a 3 bands 
> image with 12bits for each band).

Daniele,

I believe if the bits don't match an existing condition the file will
be treated as having 8bit unsigned bands (GDT_Byte).

I suspect the logic looking for get_bit_depth() == 16 ought to look
for get_bit_depth() > 8 && get_bit_depth() <= 16 though I haven't run
into 12bit jpeg files myself.

> Finally, which datatypes may be written to a JP2K file?

Apparently GDT_Byte, GDT_UInt16 and GDT_Int16.  You can do something like:

gdalinfo --format jp2kak

and the line:

   Creation Datatypes: Byte Int16 UInt16

tells you what creation data types the driver claims to support.

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 gdal-dev mailing list