[Gdal-dev] Can GDAL GDALDataset return compressed image data

Frank Warmerdam warmerdam at pobox.com
Sun Jun 10 17:21:26 EDT 2007


Alison Luo wrote:
> Hi Ivan,
> 
> Thank you so much for your help. I have more questions
> regarding the block of code you referred to in
> nitifdataset.cpp. I also took a look of class
> NITFSegmentInfo in nitflilb.h:
> 
> NITFSegmentInfo has a member hAccess, which is the
> NITF image stream.

Alison,

It is a pointer to the NITFImage structure for image segemnts.

 >  I suppose other pasSegmentInfo
> member     
>     GUInt32 nSegmentHeaderStart;
>     GUInt32 nSegmentHeaderSize;
>     GUInt32 nSegmentStart;
>     GUInt32 nSegmentSize;
> would somehow indicate how to get the encoded jpeg
> stream from hAccess? Could you please explain how the
> jpeg buffer is filled given this information?

They are information on where the image header, and image
data chunks are in the file.  So compressed data stream
would consist of nSegmentSize bytes started at byte nSegmentStart
in the file.

> Why doesn't GDAL provide APIs to access encoded image
> stream, but only provide API to get raw image stream?

GDAL does not provide direct access to compressed datastreams
because the purpose of GDAL is to provide a "normalized" view to
different datasets, not to provide low level access.

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