Changeset 1811


Ignore:
Timestamp:
11/17/06 10:58:09 (13 years ago)
Author:
curtis
Message:

Also create only one blank bytes array, similar to blank image logic,
for FileStitcher to return when image counts vary between files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FileStitcher.java

    r1810 r1811  
    6565  private IFormatReader[] readers; 
    6666 
    67   /** Blank image to use when image counts are not consistent between files. */ 
    68   private BufferedImage blank; 
     67  /** Blank buffered image, for use when image counts vary between files. */ 
     68  private BufferedImage blankImage; 
     69 
     70  /** Blank image bytes, for use when image counts vary between files. */ 
     71  private byte[] blankBytes; 
    6972 
    7073  /** Image dimensions. */ 
     
    321324    // return a blank image to cover for the fact that 
    322325    // this file does not contain enough image planes 
    323     if (blank == null) { 
    324       blank = ImageTools.blankImage(width, height, 
     326    if (blankImage == null) { 
     327      blankImage = ImageTools.blankImage(width, height, 
    325328        sizeC, getPixelType(currentId)); 
    326329    } 
    327     return blank; 
     330    return blankImage; 
    328331  } 
    329332 
     
    337340      return readers[fno].openBytes(files[fno], ino); 
    338341    } 
    339  
    340342    // return a blank image to cover for the fact that 
    341343    // this file does not contain enough image planes 
    342     int bytes = FormatReader.getBytesPerPixel(getPixelType(currentId)); 
    343     return new byte[width * height * bytes * sizeC]; 
     344    if (blankBytes == null) { 
     345      int bytes = FormatReader.getBytesPerPixel(getPixelType(currentId)); 
     346      blankBytes = new byte[width * height * bytes * sizeC]; 
     347    } 
     348    return blankBytes; 
    344349  } 
    345350 
     
    377382    } 
    378383    readers = null; 
    379     blank = null; 
     384    blankImage = null; 
     385    blankBytes = null; 
    380386    currentId = null; 
    381387  } 
Note: See TracChangeset for help on using the changeset viewer.