Changeset 6863


Ignore:
Timestamp:
09/01/10 11:59:31 (9 years ago)
Author:
melissa
Message:

Added missing methods that prevented r6862 from compiling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/tiff/IFD.java

    r6823 r6863  
    815815  } 
    816816 
     817  /** 
     818   * Retrieve the X resolution (TIFF tag XResolution) from this IFD. 
     819   * The resolution will be normalized to microns per pixel. 
     820   * 
     821   * @return the X resolution, in microns per pixel 
     822   * @throws FormatException if there is a problem parsing the IFD metadata. 
     823   */ 
     824  public double getXResolution() throws FormatException { 
     825    TiffRational xResolution = getIFDRationalValue(X_RESOLUTION); 
     826    double x = xResolution == null ? 0 : 1 / xResolution.doubleValue(); 
     827 
     828    int resolutionUnit = getIFDIntValue(RESOLUTION_UNIT); 
     829    int multiplier = resolutionUnit == 2 ? 25400 : 10000; 
     830    return x * multiplier; 
     831  } 
     832 
     833  /** 
     834   * Retrieve the Y resolution (TIFF tag YResolution) from this IFD. 
     835   * The resolution will be normalized to microns per pixel. 
     836   * 
     837   * @return the Y resolution, in microns per pixel 
     838   * @throws FormatException if there is a problem parsing the IFD metadata. 
     839   */ 
     840  public double getYResolution() throws FormatException { 
     841    TiffRational yResolution = getIFDRationalValue(Y_RESOLUTION); 
     842    double y = yResolution == null ? 0 : 1 / yResolution.doubleValue(); 
     843 
     844    int resolutionUnit = getIFDIntValue(RESOLUTION_UNIT); 
     845    int multiplier = resolutionUnit == 2 ? 25400 : 10000; 
     846    return y * multiplier; 
     847  } 
     848 
    817849  // -- IFD population methods -- 
    818850 
Note: See TracChangeset for help on using the changeset viewer.