[Gdal-dev] GDAL and MrSID

Craig cspeirs at softree.com
Wed Sep 27 14:12:28 EDT 2006


I am new to GDAL and trying to read and display Mr. SID files. I am finding the performance is horrific  (2 minutes to read a 7Mb sid image).

I am using RasterIO (see snippet of code below).  Setting GDAL_ONE_BIG_READ has no effect.  What am I missing?  Is there some code somewhere which shows how to read Mr.SID into a raster of RGB triples?  Am I better off to user the Mr. SID API directly instead of GDAL?

Thanks in advance.

Craig Speirs

//////////////////////////////////////////////////////////////
.......................
  for (int iBand=1,nBandsRead=0;iBand<=nBands; iBand ++)
  {
   iColorOffset = 0;
   iColorInterp = poDataset->GetRasterBand(iBand)->GetColorInterpretation();
   switch(iColorInterp)
   { 
    case GCI_RedBand : iColorOffset = 2; 
     break;
    case GCI_GreenBand : iColorOffset = 1;
     break;
    case GCI_BlueBand : iColorOffset = 0;
     break;
    default : continue ;
   }
   gdErr = poDataset->GetRasterBand(iBand)->RasterIO(GF_Read,0,0,
poDataset->GetRasterXSize(), poDataset->GetRasterYSize(),((LPBYTE)pBits) + iColorOffset,bmi.biWidth,abs(bmi.biHeight),GDT_Byte,3,dwBytesPerLine);
   nBandsRead ++;
  }
...................
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060927/7f480be3/attachment.html


More information about the Gdal-dev mailing list