Changeset 3194


Ignore:
Timestamp:
09/26/07 10:46:43 (12 years ago)
Author:
curtis
Message:

Add printout of indexed color and LUT information to showinf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/tools/ImageInfo.java

    r3193 r3194  
    261261      int effSizeC = reader.getEffectiveSizeC(); 
    262262      int rgbChanCount = reader.getRGBChannelCount(); 
     263      boolean indexed = reader.isIndexed(); 
     264      byte[][] table8 = reader.get8BitLookupTable(); 
     265      short[][] table16 = reader.get16BitLookupTable(); 
    263266      int[] cLengths = reader.getChannelDimLengths(); 
    264267      String[] cTypes = reader.getChannelDimTypes(); 
     
    278281      if (merge) LogTools.print(" (merged)"); 
    279282      else if (separate) LogTools.print(" (separated)"); 
     283      LogTools.println(); 
    280284      if (rgb != (rgbChanCount != 1)) { 
    281285        LogTools.println("\t************ Warning: RGB mismatch ************"); 
    282286      } 
     287      LogTools.println("\tInterleaved = " + interleaved); 
     288      LogTools.print("\tIndexed = " + indexed); 
     289      if (table8 != null) { 
     290        int len0 = table8.length; 
     291        int len1 = table8[0].length; 
     292        LogTools.print(" (8-bit LUT: " + table8.length + " x "); 
     293        LogTools.print(table8[0] == null ? "null" : "" + table8[0].length); 
     294        LogTools.print(")"); 
     295      } 
     296      if (table16 != null) { 
     297        int len0 = table16.length; 
     298        int len1 = table16[0].length; 
     299        LogTools.print(" (16-bit LUT: " + table16.length + " x "); 
     300        LogTools.print(table16[0] == null ? "null" : "" + table16[0].length); 
     301        LogTools.print(")"); 
     302      } 
    283303      LogTools.println(); 
    284       LogTools.println("\tInterleaved = " + interleaved); 
     304      if (indexed) { 
     305        if (table8 == null && table16 == null) { 
     306          LogTools.println("\t************ Warning: no LUT ************"); 
     307        } 
     308        else if (table8 != null && table16 != null) { 
     309          LogTools.println( 
     310            "\t************ Warning: multiple LUTs ************"); 
     311        } 
     312      } 
    285313      LogTools.println("\tWidth = " + sizeX); 
    286314      LogTools.println("\tHeight = " + sizeY); 
Note: See TracChangeset for help on using the changeset viewer.