[gdal-dev] Proper parameters for GDALBeginAsyncReader() for RGB images

Frank Warmerdam warmerdam at pobox.com
Wed Jun 16 13:04:54 EDT 2010


On Wed, Jun 16, 2010 at 12:51 PM, Zermeno, Robert J CIV NAVAIR,
472100D <robert.zermeno at navy.mil> wrote:

> Do I call GDALBeginAsyncReader() three times like RasterIO?  One call for Red, one for Blue,
> and Green?

Robert,

The AsyncReader API allows reading multiple bands in one pass, much
like the RasterIO call on the GDALDataset.

> Am I correct so far?  For the Length of Buffer where I want to place the bytes, Should I have the
> parameter as  (xSize * GDALGetRasterCount(fileDataset) )

This is correct,

> On to
> GDALBeginAsyncReader(fileDataset,
>        0, 0,                           //Start at top-left position
>        BufferXSize, BufferYSize,
>        JPIP_Buffer,
>        BufferXSize * colorScheme,
>        BufferYSize,
>        GDT_Byte,
>        colorScheme,
>        Bandmap,
>        0,
>        0,
>        0,
>        0);

I think the problem is your passing of BufferXSize * colorScheme.
That arguments should be the number of pixels in X, but not taking
in account the number of bands.

> How is the image data stored in JPIP_Buffer. Whould it be:
> 1.rgbrgbrgbrgb
> 2.rrrrggggbbbb
> 3.bgrbgrbgrbgr

By default (if all zero for the interleaving options) the image will
be returned in band sequential form.  So option '2' above.

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    | Geospatial Programmer for Rent


More information about the gdal-dev mailing list