Ignore:
Timestamp:
03/03/09 16:51:42 (11 years ago)
Author:
curtis
Message:

Reuse the same buffer for each image plane, and remove obsolete comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/native/itk-plugin/itkBioFormatsImageIO.cxx

    r4890 r4892  
    102102 
    103103    // call Bio-Formats to check file type 
    104  
    105     // NB: On Linux, reader->isThisType() causes a symbol lookup error on: 
    106     //       _ZNK4jace5proxy5types8JBooleancvaEv 
    107104    bool isType = reader->isThisType(filename); 
    108105    PRINT("BioFormatsImageIO::CanReadFile: isType=" << isType); 
     
    128125 
    129126    // get byte order 
    130  
    131     // NB: On Linux, reader->isLittleEndian() causes a symbol lookup error on: 
    132     //       _ZNK4jace5proxy5types8JBooleancvaEv 
    133127    bool little = reader->isLittleEndian(); 
    134128    if (little) SetByteOrderToLittleEndian(); // m_ByteOrder 
     
    136130 
    137131    // get component type 
    138  
    139     // NB: On Linux, FormatTools::UINT8() causes a symbol lookup error on: 
    140     //       _ZN4jace6helper15deleteGlobalRefEP10_Jv_JNIEnvP9__jobject 
    141132    int pixelType = reader->getPixelType(); 
    142133    int bpp = FormatTools::getBytesPerPixel(pixelType); 
     
    240231 
    241232    int p = 0; 
    242     //ByteArray buf(bytesPerSubPlane); // pre-allocate buffer 
     233    ByteArray buf(bytesPerSubPlane); // pre-allocate buffer 
    243234    for (int no=pIndex; no<pIndex+pCount; no++) 
    244235    { 
     
    246237        " (" << (no - pIndex + 1) << "/" << pCount << 
    247238        " of " << reader->getImageCount() << " available planes)"); 
    248       const ByteArray& buf = reader->openBytes(no, 
    249         xIndex, yIndex, xCount, yCount); 
    250       if (buf.isNull()) 
    251       { 
    252         itkExceptionMacro(<<"Image data is null."); 
    253       } 
    254       else if ((int) buf.length() != bytesPerSubPlane) 
    255       { 
    256         itkExceptionMacro(<<"Invalid image buffer size: " << 
    257           buf.length() << " (expected " << bytesPerSubPlane << ")"); 
    258       } 
    259  
    260       // NB: On Linux, brackets with a JArray cause a symbol lookup error on: 
    261       //       _ZN4jace6helper12newGlobalRefEP10_Jv_JNIEnvP9__jobject 
     239      reader->openBytes(no, buf, xIndex, yIndex, xCount, yCount); 
    262240      for (int i=0; i<bytesPerSubPlane; i++) data[p++] = buf[i]; 
    263241    } 
Note: See TracChangeset for help on using the changeset viewer.