Changeset 5673


Ignore:
Timestamp:
11/05/09 15:13:27 (10 years ago)
Author:
curtis
Message:

Preallocate byte buffer.

File:
1 edited

Legend:

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

    r5672 r5673  
    250250 
    251251  void BioFormatsImageIO::Read(void* pData) { 
    252     char* data = (char*) pData; 
    253252    itkDebugMacro("BioFormatsImageIO::Read"); 
    254253 
     
    326325      int imageCount = reader->getImageCount(); 
    327326 
    328       jbyte* jData = (jbyte*) data; 
    329       //ByteArray buf(bytesPerPlane); // pre-allocate buffer 
     327      jbyte* jData = (jbyte*) pData; 
     328      ByteArray buf(bytesPerPlane); // pre-allocate buffer 
    330329      for (int c=cStart; c<cCount; c++) { 
    331330        for (int t=tStart; t<tCount; t++) { 
     
    335334              << " (Z=" << z << ", T=" << t << ", C=" << c << ")" 
    336335              << " of " << imageCount << " available planes)"); 
    337             //reader->openBytes(no, buf, xStart, yStart, xCount, yCount); 
    338             ByteArray buf = reader->openBytes(no, 
    339               xStart, yStart, xCount, yCount); 
     336            reader->openBytes(no, buf, xStart, yStart, xCount, yCount); 
    340337 
    341338            // copy raw byte array 
Note: See TracChangeset for help on using the changeset viewer.