public OMEXMLWriter() { super("OME-XML", new String[] {"ome", "ome.xml"}); compressionTypes = new String[] {CompressionType.UNCOMPRESSED.getCompression(), CompressionType.ZLIB.getCompression()}; compression = compressionTypes[0]; }
@Test(expectedExceptions={ EnumException.class }) public void testUnknownCode() { CompressionType.get(-1); }
@Test public void testLookupName() { CompressionType type = CompressionType.get(1); assertEquals(CompressionType.UNCOMPRESSED, type); }
public OMEXMLWriter() { super("OME-XML", new String[] {"ome", "ome.xml"}); compressionTypes = new String[] {CompressionType.UNCOMPRESSED.getCompression(), CompressionType.ZLIB.getCompression()}; compression = compressionTypes[0]; }
/** Creates a new instance. */ public JPEG2000Writer() { super("JPEG-2000", "jp2"); compressionTypes = new String[] {CompressionType.J2K_LOSSY.getCompression(), CompressionType.J2K.getCompression()}; //The default codec options options = JPEG2000CodecOptions.getDefaultOptions(); }
/** Creates a new instance. */ public JPEG2000Writer() { super("JPEG-2000", "jp2"); compressionTypes = new String[] {CompressionType.J2K_LOSSY.getCompression(), CompressionType.J2K.getCompression()}; //The default codec options options = JPEG2000CodecOptions.getDefaultOptions(); }
public QTWriter() { super("QuickTime", "mov"); LegacyQTTools tools = new LegacyQTTools(); if (tools.canDoQT()) { compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression(), // NB: Writing to Motion JPEG-B with QTJava seems to be broken. /*"Motion JPEG-B",*/ CompressionType.CINEPAK.getCompression(), CompressionType.ANIMATION.getCompression(), CompressionType.H_263.getCompression(), CompressionType.SORENSON.getCompression(), CompressionType.SORENSON_3.getCompression(), CompressionType.MPEG_4.getCompression() }; } else compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression()}; }
public QTWriter() { super("QuickTime", "mov"); LegacyQTTools tools = new LegacyQTTools(); if (tools.canDoQT()) { compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression(), // NB: Writing to Motion JPEG-B with QTJava seems to be broken. /*"Motion JPEG-B",*/ CompressionType.CINEPAK.getCompression(), CompressionType.ANIMATION.getCompression(), CompressionType.H_263.getCompression(), CompressionType.SORENSON.getCompression(), CompressionType.SORENSON_3.getCompression(), CompressionType.MPEG_4.getCompression() }; } else compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression()}; }
@Test public void testJPEG() throws Exception { String ext = ".jpg"; String compression = CompressionType.JPEG.getCompression(); testCompressDecompress(ext, compression, true, 1, "uint8"); }
@Test public void testAPNG() throws Exception { String ext = ".png"; String[] pixelTypes = {"int8", "uint8", "int16", "uint16"}; for (String type : pixelTypes) { String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, 1, type); } }
@Test public void testICS() throws Exception { String ext = ".ics"; String[] pixelTypes = {"int8", "uint8", "int16", "uint16", "int32", "uint32", "float"}; for (String type : pixelTypes) { String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, 1, type); } }
@Test public void testEPS() throws Exception { String ext = ".eps"; String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, 1, "uint8"); }
@Test public void testAVI() throws Exception { String ext = ".avi"; String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, 1, "uint8"); }
@Test public void testQuickTime() throws Exception { String ext = ".mov"; String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, 1, "uint8"); }
@Test public void testJPEG2000() throws Exception { String ext = ".jp2"; String[] pixelTypes = {"int8", "uint8", "int16", "uint16"}; for (String type : pixelTypes) { String compression = CompressionType.J2K.getCompression(); testCompressDecompress(ext, compression, false, 1, type); compression = CompressionType.J2K_LOSSY.getCompression(); testCompressDecompress(ext, compression, true, 1, type); } }
@Test public void testOMEXML() throws Exception { String ext = ".ome"; int[] seriesCounts = {1, 2}; String[] types = {"int8", "uint8", "int16", "uint16", "int32", "uint32", "float"}; for (int seriesCount : seriesCounts) { for (String type : types) { String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, seriesCount, type); compression = CompressionType.ZLIB.getCompression(); testCompressDecompress(ext, compression, false, seriesCount, type); } } }
@Test public void testTIFF() throws Exception { String ext = ".tiff"; String[] jpegTypes = {"int8", "uint8", "int16", "uint16"}; String[] jpeg2000Types = {"int8", "uint8", "int16", "uint16", "int32", "uint32", "float"}; for (String jpegType : jpegTypes) { String compression = CompressionType.JPEG.getCompression(); testCompressDecompress(ext, compression, true, 1, jpegType); } for (String jpeg2KType : jpeg2000Types) { String compression = CompressionType.J2K.getCompression(); testCompressDecompress(ext, compression, false, 1, jpeg2KType); } for (String type : DEFAULT_TYPES) { String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, 1, type); compression = CompressionType.LZW.getCompression(); testCompressDecompress(ext, compression, false, 1, type); } }
@Test public void testOMETIFF() throws Exception { String ext = ".ome.tiff"; String[] jpegTypes = {"int8", "uint8", "int16", "uint16"}; String[] jpeg2000Types = {"int8", "uint8", "int16", "uint16", "int32", "uint32", "float"}; int[] seriesCounts = {1, 2}; for (int seriesCount : seriesCounts) { for (String jpegType : jpegTypes) { String compression = CompressionType.JPEG.getCompression(); testCompressDecompress(ext, compression, true, seriesCount, jpegType); } for (String jpeg2KType : jpeg2000Types) { String compression = CompressionType.J2K.getCompression(); testCompressDecompress( ext, compression, false, seriesCount, jpeg2KType); } for (String type : DEFAULT_TYPES) { String compression = CompressionType.UNCOMPRESSED.getCompression(); testCompressDecompress(ext, compression, false, seriesCount, type); compression = CompressionType.LZW.getCompression(); testCompressDecompress(ext, compression, false, seriesCount, type); } } }
options.interleaved = interleaved; options.lossless = compression == null || compression.equals(CompressionType.J2K.getCompression()); options.colorModel = getColorModel();
options.interleaved = interleaved; options.lossless = compression == null || compression.equals(CompressionType.J2K.getCompression()); options.colorModel = getColorModel();