Changeset 3284


Ignore:
Timestamp:
10/17/07 10:05:02 (12 years ago)
Author:
melissa
Message:

Corrected pixel type for 5-5-5 RGB data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/PictReader.java

    r3279 r3284  
    241241    } 
    242242    else { 
    243       // 16 bit data 
    244       short[] data = new short[3 * core.sizeY[0] * core.sizeX[0]]; 
     243      byte[] data = new byte[3 * core.sizeY[0] * core.sizeX[0]]; 
    245244 
    246245      int outIndex = 0; 
     
    251250          if (j < core.sizeX[0]) { 
    252251            if (outIndex >= data.length - 2) break; 
    253             int s0 = (row[j] & 0x1f); 
    254             int s1 = (row[j] & 0x3e0) >> 5; // 0x1f << 5; 
    255             int s2 = (row[j] & 0x7c00) >> 10; // 0x1f << 10; 
    256             data[outIndex] = (short) s2; 
    257             data[outIndex+1] = (short) s1; 
    258             data[outIndex+2] = (short) s0; 
     252            data[outIndex] = (byte) ((row[j] & 0x7c00) >> 10); 
     253            data[outIndex+1] = (byte) ((row[j] & 0x3e0) >> 5); 
     254            data[outIndex+2] = (byte) (row[j] & 0x1f); 
    259255          } 
    260256          else j = row.length; 
     
    263259 
    264260      if (debug) { 
    265         debug("openBytes: 16-bit data, " + core.sizeX[0] + " x " + 
     261        debug("openBytes: 8-bit RGB data, " + core.sizeX[0] + " x " + 
    266262          core.sizeY[0] + ", length=" + data.length); 
    267263      } 
Note: See TracChangeset for help on using the changeset viewer.