[gdal-dev] Kakadu JP2 Output Overviews possible?
Zermeno, Robert J CIV NAVAIR, 472100D
robert.zermeno at navy.mil
Wed Jul 11 13:21:22 PDT 2012
I noticed GDAL has a utility program gdaladdo which embeds new overviews to a supplied file. Does gdal have a utility program that allows me to extract overviews to a file?
If not, how would I be able to programmatically extract a specified overview within a JP2 image (using C/C++)?
What is the easiest way to get a reduced overview?
>From your website I think there is two options:
1. Use GDALRasterIO() and set nBufXSize and nBufYSize to be smaller than the window size forcing GDAL to try and use a suitable overview as explained from:
1. Check if GDALGetOverviewCount() > 0. If true, then we have embedded overviews
2. Call GDALGetOverview(Band,1) //For 1st overview band. This will store the overview raster band in Band. What happens if the image is RGB? How do I obtain the R,G,B raster band of the overview at index 1?
3. Call GDALRasterBandXSize and GDALRasterBandYSize
4. Once have all RasterBands and their sizes known, call GDALRasterIO to acquire the image.
How would you guys go about it? I think I am on the right track.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5695 bytes
Desc: not available
More information about the gdal-dev