[gdal-dev] Proper parameters for GDALBeginAsyncReader() for RGB
Zermeno, Robert J CIV NAVAIR, 472100D
robert.zermeno at navy.mil
Wed Jun 16 12:51:38 EDT 2010
I hope someone can clarify my issue when it comes to an RGB jpeg2000 image call
Using GDALBeginAsyncReader(). I can use this function already for Grayscale images, but
Having problems getting RGB colors to work.
In streaming jpeg2000 images (JPIP),How do you properly use GDALBeginAsyncReader() parameters in conjunction with GDALARGetNextUpdatedRegion().
So far, I usually get a AccessViolation which fails on the GDALARGetNextUpdatedRegion() call. That
would mean the way I provide the parameter information is not correct.
Do I call GDALBeginAsyncReader() three times like RasterIO? One call for Red, one for Blue,
If I am correct, GDALBeginAsyncReader only needs to be called once. This function asks for
the BandCount (1 for GrayScale, 3 for RGB) and Bandmap (Where 1 is GrayScale, and when in
case for RGB, 1 == Red Band 2 == Blue Band 3 == Green Band).
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) )
On top of this, can someone give me an example call to GDALBeginAsyncReader() with parameters
for an RGB image.
Example not exact:
ImageWidth = 800
ImageHeight = 400
BufferXSize = 400
BufferYSize = 400
colorScheme = 3 (For RGB)
Bandmap = 1, Bandmap = 2, Bandmap = 3
BYTE* JPIP_Buffer = (BYTE*)CLPMalloc(BufferXSize * BufferYSize * colorScheme)
Now, would I call the function as:
0, 0, //Start at top-left position
BufferXSize * colorScheme,
How is the image data stored in JPIP_Buffer. Whould it be:
Thanks in advanced!!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4926 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100616/5de9fc17/smime.bin
More information about the gdal-dev