Changeset 7580


Ignore:
Timestamp:
01/24/11 08:20:19 (9 years ago)
Author:
melissa
Message:

The JPEG-2000 writer can now use lossy or lossless compression. Closes #651.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/out/JPEG2000Writer.java

    r7264 r7580  
    4444public class JPEG2000Writer extends FormatWriter { 
    4545 
     46  // -- Constants -- 
     47 
     48  private static final String LOSSY = "Lossy"; 
     49  private static final String LOSSLESS = "Lossless"; 
     50 
    4651  // -- Constructor -- 
    4752 
    4853  public JPEG2000Writer() { 
    4954    super("JPEG-2000", "jp2"); 
     55    compressionTypes = new String[] {LOSSY, LOSSLESS}; 
    5056  } 
    5157 
     
    8086    options.littleEndian = littleEndian; 
    8187    options.interleaved = interleaved; 
     88    options.lossless = compression == null || compression.equals(LOSSLESS); 
    8289 
    8390    out.write(new JPEG2000Codec().compress(buf, options)); 
  • trunk/components/bio-formats/src/loci/formats/out/JPEG2000Writer.java

    r7225 r7580  
    4444public class JPEG2000Writer extends FormatWriter { 
    4545 
     46  // -- Constants -- 
     47 
     48  private static final String LOSSY = "Lossy"; 
     49  private static final String LOSSLESS = "Lossless"; 
     50 
    4651  // -- Constructor -- 
    4752 
    4853  public JPEG2000Writer() { 
    4954    super("JPEG-2000", "jp2"); 
     55    compressionTypes = new String[] {LOSSY, LOSSLESS}; 
    5056  } 
    5157 
     
    8086    options.littleEndian = littleEndian; 
    8187    options.interleaved = interleaved; 
     88    options.lossless = compression == null || compression.equals(LOSSLESS); 
    8289 
    8390    out.write(new JPEG2000Codec().compress(buf, options)); 
Note: See TracChangeset for help on using the changeset viewer.