use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.
the class TiffCompressionDecompressTest method testNIKON.
@Test
public void testNIKON() throws FormatException, IOException {
TiffCompression compression = TiffCompression.NIKON;
NikonCodecOptions options = new NikonCodecOptions();
options.interleaved = OPTIONS.interleaved;
options.littleEndian = OPTIONS.littleEndian;
options.maxBytes = OPTIONS.maxBytes;
options.curve = new int[] { 1 };
options.vPredictor = new int[] { 1 };
options.lossless = true;
options.split = 1;
assertNotNull(compression.decompress(DATA, options));
}
use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.
the class TiffCompressionDecompressTest method testJPEG.
// Needs to have a "properly" encoded JPEG, throws an NPE otherwise
@Test(expectedExceptions = { NullPointerException.class })
public void testJPEG() throws FormatException, IOException {
TiffCompression compression = TiffCompression.JPEG;
assertNotNull(compression.decompress(DATA, OPTIONS));
}
use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.
the class TiffCompressionCompressTest method testGROUP_4_FAX.
@Test(expectedExceptions = { FormatException.class })
public void testGROUP_4_FAX() throws FormatException, IOException {
TiffCompression compression = TiffCompression.GROUP_3_FAX;
CodecOptions options = compression.getCompressionCodecOptions(ifd);
compression.compress(data, options);
}
use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.
the class TiffCompressionCompressTest method testJPEG_2000_ResetNumberDecompositionLevel.
@Test(enabled = true)
public void testJPEG_2000_ResetNumberDecompositionLevel() throws FormatException, IOException {
TiffCompression compression = TiffCompression.JPEG_2000;
JPEG2000CodecOptions opt = JPEG2000CodecOptions.getDefaultOptions();
int v = 16;
opt.numDecompositionLevels = v;
CodecOptions options = compression.getCompressionCodecOptions(ifd, opt);
assertTrue(options instanceof JPEG2000CodecOptions);
JPEG2000CodecOptions j2k = (JPEG2000CodecOptions) options;
assertEquals(j2k.numDecompositionLevels, opt.numDecompositionLevels);
compression = TiffCompression.JPEG_2000_LOSSY;
options = compression.getCompressionCodecOptions(ifd, opt);
assertTrue(options instanceof JPEG2000CodecOptions);
j2k = (JPEG2000CodecOptions) options;
assertEquals(j2k.numDecompositionLevels, opt.numDecompositionLevels);
compression = TiffCompression.ALT_JPEG2000;
options = compression.getCompressionCodecOptions(ifd, opt);
j2k = (JPEG2000CodecOptions) options;
assertEquals(j2k.numDecompositionLevels, opt.numDecompositionLevels);
}
use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.
the class TiffCompressionCompressTest method testLZW.
@Test
public void testLZW() throws FormatException, IOException {
TiffCompression compression = TiffCompression.LZW;
CodecOptions options = compression.getCompressionCodecOptions(ifd);
byte[] compressed = compression.compress(data, options);
assertNotNull(compressed);
}
Aggregations