[gdal-dev] question about overview?

gisfans gisfans gispowerfan at gmail.com
Wed Mar 17 09:46:36 EDT 2010


hi,

    Recently I  am writing  a driver(such as driver_a) for GDAL, and the
driver need overview function. there are a question about
band::IReadBlock(int nBlockXOff, int BlockYOff, void *pImage), you know  the
memory of pImage is malloced in the gdal core code such  as  new datablock
function, gdal has buildin cache management, and Its size is corresponding
overview band size, for example, origin image is 512*512, block size is
256,256, I need to get the 3rd layer of pyramid, in fact, the overview level
3 of the image is 128*128, so the memory of pImage is128*128*byte, but the
standard block of my program is 256*256, in  the function of
band::IReadBlock(), I need to adjust the size of pixel data, such as

if ( blockcol<nColumnBlockSize || blockrow<nRowBlockSize )
{
....
}

memcpy( pImage , pabyBlockBuf, nGDALBlockBytes );

and copy the pabyBlockBuf into PImage, but now the PImage is 128*128, and
pabyBlockBuf is 256*256, so there are some mistakes. and suggestion?

gispowerfan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100317/49035c66/attachment.html


More information about the gdal-dev mailing list