Changeset 3285


Ignore:
Timestamp:
10/17/07 10:11:30 (12 years ago)
Author:
melissa
Message:

If bmpColorsUsed == 0, set it to 2bitsPerPixel.

File:
1 edited

Legend:

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

    r3220 r3285  
    2828import java.util.Vector; 
    2929import loci.formats.*; 
    30 import loci.formats.codec.BitBuffer; 
    3130import loci.formats.codec.*; 
    3231 
     
    4847  private static final int MSRLE = 1; 
    4948  private static final int MS_VIDEO = 1296126531; 
     49  private static final int CINEPAK = 1684633187; 
    5050 
    5151  // -- Fields -- 
     
    311311                  // bits per pixel 
    312312                  bmpActualColorsUsed = 1 << bmpBitsPerPixel; 
     313                  bmpColorsUsed = bmpActualColorsUsed; 
    313314                } 
    314315 
    315316                if (bmpCompression != MSRLE && bmpCompression != 0 && 
    316                   bmpCompression != MS_VIDEO) 
     317                  bmpCompression != MS_VIDEO && bmpCompression != CINEPAK) 
    317318                { 
    318319                  throw new FormatException("Unsupported compression type " + 
     
    396397                  type.substring(2).equals("dc")) 
    397398                { 
     399                  /* debug */ System.out.println("adding offset"); 
    398400                  offsets.add(new Long(in.getFilePointer())); 
    399401                  lengths.add(new Long(size)); 
     
    459461 
    460462    if (bmpCompression != 0) core.pixelType[0] = FormatTools.UINT8; 
     463 
     464    /* debug */ 
     465    System.out.println("count : " + core.imageCount[0]); 
     466    System.out.println("Z : " + core.sizeZ[0]); 
     467    System.out.println("C : " + core.sizeC[0]); 
     468    System.out.println("T : " + core.sizeT[0]); 
     469    /* end debug */ 
    461470 
    462471    MetadataStore store = getMetadataStore(); 
     
    503512      return buf; 
    504513    } 
     514    else if (bmpCompression == CINEPAK) { 
     515      Object[] options = new Object[2]; 
     516      options[0] = new Integer(bmpBitsPerPixel); 
     517      options[1] = lastImage; 
     518 
     519      CinepakCodec codec = new CinepakCodec(); 
     520      buf = codec.decompress(b, options); 
     521      lastImage = buf; 
     522      if (no == core.imageCount[0] - 1) lastImage = null; 
     523      return buf; 
     524    } 
    505525    throw new FormatException("Unsupported compression : " + bmpCompression); 
    506526  } 
Note: See TracChangeset for help on using the changeset viewer.