Changeset 1879


Ignore:
Timestamp:
11/30/06 09:26:01 (13 years ago)
Author:
curtis
Message:

Remove some unnecessary local variables; add some additional comments.

Location:
trunk/loci
Files:
2 edited

Legend:

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

    r1868 r1879  
    11951195 
    11961196    if (needsPadding) { 
    1197       int totalX = width - img.getWidth(); 
    1198       int totalY = height - img.getHeight(); 
    1199  
    1200       int xpad = totalX / 2; 
    1201       int ypad = totalY / 2; 
    1202  
    1203       if (xpad == 0 && totalX > 0) xpad = totalX; 
    1204       if (ypad == 0 && totalY > 0) ypad = totalY; 
    1205  
    12061197      Object pixels = getPixels(img); 
    12071198 
     
    12551246 
    12561247  /** 
    1257    * Pad the byte array to the given width and height. The image will be 
    1258    * centered within the new bounds. 
     1248   * Pads (or crops) the byte array to the given width and height. 
     1249   * The image will be centered within the new bounds. 
    12591250   */ 
    12601251  public static byte[] padImage(byte[] b, boolean interleaved, int c, 
     
    13001291 
    13011292  /** 
    1302    * Pad the short array to the given width and height. The image will be 
    1303    * centered within the new bounds. 
     1293   * Pads (or crops) the short array to the given width and height. 
     1294   * The image will be centered within the new bounds. 
    13041295   */ 
    13051296  public static short[] padImage(short[] b, boolean interleaved, int c,  
     
    13451336 
    13461337  /** 
    1347    * Pad the int array to the given width and height. The image will be 
    1348    * centered within the new bounds. 
     1338   * Pads (or crops) the int array to the given width and height. 
     1339   * The image will be centered within the new bounds. 
    13491340   */ 
    13501341  public static int[] padImage(int[] b, boolean interleaved, int c,  
     
    13901381 
    13911382  /** 
    1392    * Pad the float array to the given width and height. The image will be 
    1393    * centered within the new bounds. 
     1383   * Pads (or crops) the float array to the given width and height. 
     1384   * The image will be centered within the new bounds. 
    13941385   */ 
    13951386  public static float[] padImage(float[] b, boolean interleaved, int c,  
     
    14351426 
    14361427  /** 
    1437    * Pad the double array to the given width and height. The image will be 
    1438    * centered within the new bounds. 
     1428   * Pads (or crops) the double array to the given width and height. 
     1429   * The image will be centered within the new bounds. 
    14391430   */ 
    14401431  public static double[] padImage(double[] b, boolean interleaved, int c,  
     
    14811472  /** Perform demosaicing on a byte array, assuming a {B, G, G, R} mosaic. */ 
    14821473  public static short[][] demosaic(short[][] input, int w, int h) { 
    1483  
    14841474    for (int i=0; i<input[0].length; i++) { 
    14851475      // determine which color components need to be calculated 
  • trunk/loci/plugins/Importer.java

    r1878 r1879  
    463463 
    464464          if (b.length != w * h * c * bpp) { 
     465            // HACK - byte array dimensions are incorrect - image is probably 
     466            // a different size, but we have no way of knowing what size; 
     467            // so open this plane as a BufferedImage instead 
    465468            BufferedImage bi = r.openImage(id, j); 
    466469            b = ImageTools.padImage(b, r.isInterleaved(id), c,  
    467               bi.getWidth()*bpp, w, h); 
     470              bi.getWidth() * bpp, w, h); 
    468471          } 
    469472           
Note: See TracChangeset for help on using the changeset viewer.