Changeset 4759


Ignore:
Timestamp:
01/29/09 10:46:57 (11 years ago)
Author:
melissa
Message:

Do not adjust pixel values for signed images when a BufferedImage is opened.

Location:
trunk/components
Files:
2 edited

Legend:

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

    r4521 r4759  
    304304        for (int c=0; c<numRGB; c++) { 
    305305          double v = pixels.getSampleDouble(x, y, c); 
     306          /* 
    306307          if (signed) { 
    307308            long threshold = (long) Math.pow(2, bytes * 8 - 1); 
    308309            v -= threshold; 
    309310          } 
     311          */ 
    310312 
    311313          if (v > chanMax[series][cBase + c]) { 
     
    375377        int idx = bytes * (interleaved ? i * numRGB + c : c * pixels + i); 
    376378        long bits = DataTools.bytesToLong(b, idx, bytes, little); 
     379        /* 
    377380        if (signed) { 
    378381          long threshold = (long) Math.pow(2, bytes * 8 - 1); 
    379382          if (bits >= threshold) bits -= 2*threshold; 
    380383        } 
     384        */ 
    381385        double v = (double) bits; 
    382386        if (pixelType == FormatTools.FLOAT) { 
  • trunk/components/common/src/loci/common/DataTools.java

    r4688 r4759  
    530530  { 
    531531    if (bpp == 1) { 
    532       if (signed) b = makeSigned(b); 
    533532      return b; 
    534533    } 
     
    538537        s[i] = bytesToShort(b, i*2, 2, little); 
    539538      } 
    540       if (signed) s = makeSigned(s); 
    541539      return s; 
    542540    } 
     
    553551        i[j] = bytesToInt(b, j*4, 4, little); 
    554552      } 
    555       if (signed) i = makeSigned(i); 
    556553      return i; 
    557554    } 
Note: See TracChangeset for help on using the changeset viewer.