[Gdal-dev] pabydata declaration in GDALRasterBand::ReadBlock documentation

Frank Warmerdam warmerdam at pobox.com
Fri Jun 4 10:55:46 EDT 2004


Tim Sutton wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi
> 
> I have been going through the documentation & examples in 
> GDALRasterBand::ReadBlock and am wondering what the declaration for pabyData 
> is? It is used in the example but never declared (see below).

Tim,

It should be "GByte *pabyData".  I have fixed it in CVS.

>  CPLErr GetHistogram( GDALRasterBand *poBand, int *panHistogram )
> 
>  {
>      int        nXBlocks, nYBlocks, nXBlockSize, nYBlockSize;
>      int        iXBlock, iYBlock;
> 
>      memset( panHistogram, 0, sizeof(int) * 256 );
> 
>      CPLAssert( poBand->GetRasterDataType() == GDT_Byte );
> 
>      poBand->GetBlockSize( &nXBlockSize, &nYBlockSize );
>      nXBlocks = (poBand->GetXSize() + nXBlockSize - 1) / nXBlockSize;
>      nYBlocks = (poBand->GetYSize() + nYBlockSize - 1) / nYBlockSize;
> 
>      pabyData = (GByte *) CPLMalloc(nXBlockSize * nYBlockSize);
> 
> 
> .
> .
> .
> example continues...
> 
> 
> Regards
> 
> Tim Sutton
> 
> - -- 
> The only reason for time is so that everything doesn't happen at once 
>  --Albert Einstein 
> 
> Get my public keys from:
> 
> http://tim.suttonfamily.co.uk/modules.php?name=Content&pa=showpage&pid=2
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> 
> iD8DBQFAuvDfWvXTJUo0BDoRAnAGAJ92bIjWbH4eNz/nD3vvK5vLJzWy4QCfXYGs
> 6f2oclNKZGyIWsGw4TlzTNY=
> =MM1K
> -----END PGP SIGNATURE-----
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at remotesensing.org
> http://remotesensing.org/mailman/listinfo/gdal-dev
> 


-- 
---------------------------------------+--------------------------------------
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