Changeset 2801


Ignore:
Timestamp:
05/20/07 15:04:18 (13 years ago)
Author:
curtis
Message:

Style.

Location:
trunk/loci/formats
Files:
7 edited

Legend:

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

    r2800 r2801  
    375375 
    376376  /* @see IFormatReader#setGroupFiles(boolean) */ 
    377   public void setGroupFiles(boolean group) { 
     377  public void setGroupFiles(boolean groupFiles) { 
    378378    FormatTools.assertId(currentId, false, 1); 
    379     this.group = group; 
     379    group = groupFiles; 
    380380  } 
    381381 
  • trunk/loci/formats/IFormatReader.java

    r2800 r2801  
    6060   * @return the pixel type as an enumeration from <code>FormatTools</code> 
    6161   * <i>static</i> pixel types such as <code>INT8</code>. 
    62    * @throws FormatException if there was a problem parsing file metadata. 
    63    * @throws IOException if there was an error reading from the file. 
    6462   */ 
    6563  int getPixelType(); 
  • trunk/loci/formats/codec/CBZip2InputStream.java

    r2782 r2801  
    4848package loci.formats.codec; 
    4949 
     50import java.io.IOException; 
    5051import java.io.InputStream; 
    51 import java.io.IOException; 
    5252 
    5353/** 
     
    179179 
    180180  public int read(final byte[] dest, final int offs, final int len) 
    181     throws IOException { 
     181    throws IOException 
     182  { 
    182183    if (offs < 0) { 
    183184      throw new IndexOutOfBoundsException("offs(" + offs + ") < 0."); 
     
    293294      // allocate it if the input file is empty. 
    294295      if (this.data == null) { 
    295          this.data = new Data(this.blockSize100k); 
     296        this.data = new Data(this.blockSize100k); 
    296297      } 
    297298 
     
    733734 
    734735  private void setupBlock() throws IOException { 
    735      if (this.data == null) return; 
    736  
    737      final int[] cftab = this.data.cftab; 
    738      final int[] tt   = this.data.initTT(this.last + 1); 
    739      final byte[] ll8  = this.data.ll8; 
    740      cftab[0] = 0; 
    741      System.arraycopy(this.data.unzftab, 0, cftab, 1, 256); 
    742  
    743      for (int i = 1, c = cftab[0]; i <= 256; i++) { 
    744        c += cftab[i]; 
    745        cftab[i] = c; 
    746      } 
    747  
    748      for (int i = 0, lastShadow = this.last; i <= lastShadow; i++) { 
    749        tt[cftab[ll8[i] & 0xff]++] = i; 
    750      } 
    751  
    752      if ((this.origPtr < 0) || (this.origPtr >= tt.length)) { 
    753        throw new IOException("stream corrupted"); 
    754      } 
    755  
    756      this.suTPos = tt[this.origPtr]; 
    757      this.suCount = 0; 
    758      this.suI2 = 0; 
    759      this.suCh2 = 256;  /* not a char and not EOF */ 
    760  
    761      if (this.blockRandomised) { 
    762        this.suRNToGo = 0; 
    763        this.suRTPos = 0; 
    764        setupRandPartA(); 
    765      } 
    766      else setupNoRandPartA(); 
     736    if (this.data == null) return; 
     737 
     738    final int[] cftab = this.data.cftab; 
     739    final int[] tt   = this.data.initTT(this.last + 1); 
     740    final byte[] ll8  = this.data.ll8; 
     741    cftab[0] = 0; 
     742    System.arraycopy(this.data.unzftab, 0, cftab, 1, 256); 
     743 
     744    for (int i = 1, c = cftab[0]; i <= 256; i++) { 
     745      c += cftab[i]; 
     746      cftab[i] = c; 
     747    } 
     748 
     749    for (int i = 0, lastShadow = this.last; i <= lastShadow; i++) { 
     750      tt[cftab[ll8[i] & 0xff]++] = i; 
     751    } 
     752 
     753    if ((this.origPtr < 0) || (this.origPtr >= tt.length)) { 
     754      throw new IOException("stream corrupted"); 
     755    } 
     756 
     757    this.suTPos = tt[this.origPtr]; 
     758    this.suCount = 0; 
     759    this.suI2 = 0; 
     760    this.suCh2 = 256;  /* not a char and not EOF */ 
     761 
     762    if (this.blockRandomised) { 
     763      this.suRNToGo = 0; 
     764      this.suRTPos = 0; 
     765      setupRandPartA(); 
     766    } 
     767    else setupNoRandPartA(); 
    767768  } 
    768769 
     
    773774      this.suTPos = this.data.tt[this.suTPos]; 
    774775      if (this.suRNToGo == 0) { 
    775          this.suRNToGo = BZip2Constants.R_NUMS[this.suRTPos] - 1; 
    776          if (++this.suRTPos == 512) { 
    777             this.suRTPos = 0; 
    778          } 
     776        this.suRNToGo = BZip2Constants.R_NUMS[this.suRTPos] - 1; 
     777        if (++this.suRTPos == 512) this.suRTPos = 0; 
    779778      } 
    780779      else this.suRNToGo--; 
     
    793792 
    794793  private void setupNoRandPartA() throws IOException { 
    795      if (this.suI2 <= this.last) { 
    796        this.suChPrev = this.suCh2; 
    797        int suCh2Shadow = this.data.ll8[this.suTPos] & 0xff; 
    798        this.suCh2 = suCh2Shadow; 
    799        this.suTPos = this.data.tt[this.suTPos]; 
    800        this.suI2++; 
    801        this.currentChar = suCh2Shadow; 
    802        this.currentState = NO_RAND_PART_B_STATE; 
    803        this.crc.updateCRC(suCh2Shadow); 
    804      } 
    805      else { 
    806        this.currentState = NO_RAND_PART_A_STATE; 
    807        endBlock(); 
    808        initBlock(); 
    809        setupBlock(); 
    810      } 
     794    if (this.suI2 <= this.last) { 
     795      this.suChPrev = this.suCh2; 
     796      int suCh2Shadow = this.data.ll8[this.suTPos] & 0xff; 
     797      this.suCh2 = suCh2Shadow; 
     798      this.suTPos = this.data.tt[this.suTPos]; 
     799      this.suI2++; 
     800      this.currentChar = suCh2Shadow; 
     801      this.currentState = NO_RAND_PART_B_STATE; 
     802      this.crc.updateCRC(suCh2Shadow); 
     803    } 
     804    else { 
     805      this.currentState = NO_RAND_PART_A_STATE; 
     806      endBlock(); 
     807      initBlock(); 
     808      setupBlock(); 
     809    } 
    811810  } 
    812811 
     
    829828      this.suJ2 = 0; 
    830829      this.currentState = RAND_PART_C_STATE; 
    831       if (this.suRNToGo == 1) { 
    832          this.suZ ^= 1; 
    833       } 
     830      if (this.suRNToGo == 1) this.suZ ^= 1; 
    834831      setupRandPartC(); 
    835832    } 
     
    932929     * files. 
    933930     */ 
    934     final int[] initTT(int length) { 
     931    int[] initTT(int length) { 
    935932      int[] ttShadow = this.tt; 
    936933 
     
    940937      // than others. 
    941938      if ((ttShadow == null) || (ttShadow.length < length)) { 
    942          this.tt = ttShadow = new int[length]; 
     939        this.tt = ttShadow = new int[length]; 
    943940      } 
    944941 
  • trunk/loci/formats/gui/DataConverter.java

    r2790 r2801  
    455455 
    456456      if (zLabel.getText().indexOf("Time") != -1) { 
    457         order = order.replace('Z', 'T') ; 
     457        order = order.replace('Z', 'T'); 
    458458      } 
    459459      else if (zLabel.getText().indexOf("Channel") != -1) { 
  • trunk/loci/formats/in/FlexReader.java

    r2769 r2801  
    197197  // -- Helper classes -- 
    198198 
     199  /** SAX handler for parsing XML. */ 
    199200  public class FlexHandler extends DefaultHandler { 
    200201    private Vector names, factors; 
  • trunk/loci/formats/in/LIFReader.java

    r2800 r2801  
    520520  // -- Helper class -- 
    521521 
     522  /** SAX handler for parsing XML. */ 
    522523  class LIFHandler extends DefaultHandler { 
    523524    private String series; 
  • trunk/loci/formats/ome/OMEWriter.java

    r2800 r2801  
    170170    if (pixelsId == -1) { 
    171171      try { 
     172        String pixelTypeString = metadata.getPixelType(null); 
     173        int pixelType = FormatTools.pixelTypeFromString(pixelTypeString); 
    172174        pixelsId = is.newPixels(metadata.getSizeX(null).intValue(), 
    173175          metadata.getSizeY(null).intValue(), z, c, t, 
    174           FormatTools.getBytesPerPixel(FormatTools.pixelTypeFromString( 
    175           metadata.getPixelType(null))), false, 
    176           metadata.getPixelType(null).equals("float")); 
     176          FormatTools.getBytesPerPixel(pixelType), false, 
     177          pixelTypeString.equals("float")); 
    177178      } 
    178179      catch (ImageServerException e) { 
     
    182183 
    183184    try { 
     185      String pixelTypeString = metadata.getPixelType(null); 
     186      int pixelType = FormatTools.pixelTypeFromString(pixelTypeString); 
    184187      int planeLength = metadata.getSizeX(null).intValue() * 
    185         metadata.getSizeY(null).intValue() * FormatTools.getBytesPerPixel( 
    186         FormatTools.pixelTypeFromString(metadata.getPixelType(null))); 
     188        metadata.getSizeY(null).intValue() * 
     189        FormatTools.getBytesPerPixel(pixelType); 
    187190      byte[][] b = ImageTools.splitChannels(bytes, bytes.length / planeLength, 
    188191        false, true); 
Note: See TracChangeset for help on using the changeset viewer.