Search in sources :

Example 26 with TiffCompression

use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.

the class TiffCompressionDecompressTest method testLURAWAVE.

@Test(expectedExceptions = { FormatException.class })
public void testLURAWAVE() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.LURAWAVE;
    assertNotNull(compression.decompress(DATA, OPTIONS));
}
Also used : TiffCompression(loci.formats.tiff.TiffCompression) Test(org.testng.annotations.Test)

Example 27 with TiffCompression

use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.

the class TiffCompressionTest method testLookupUncompressed.

@Test
public void testLookupUncompressed() {
    TiffCompression pi = TiffCompression.get(1);
    assertEquals(TiffCompression.UNCOMPRESSED, pi);
}
Also used : TiffCompression(loci.formats.tiff.TiffCompression) Test(org.testng.annotations.Test)

Example 28 with TiffCompression

use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.

the class TiffCompressionCompressTest method testTHUNDERSCAN.

@Test(expectedExceptions = { FormatException.class })
public void testTHUNDERSCAN() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.THUNDERSCAN;
    CodecOptions options = compression.getCompressionCodecOptions(ifd);
    compression.compress(data, options);
}
Also used : CodecOptions(loci.formats.codec.CodecOptions) JPEG2000CodecOptions(loci.formats.codec.JPEG2000CodecOptions) TiffCompression(loci.formats.tiff.TiffCompression) Test(org.testng.annotations.Test)

Example 29 with TiffCompression

use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.

the class TiffCompressionCompressTest method testJPEG_2000_ResetQuality.

@Test(enabled = true)
public void testJPEG_2000_ResetQuality() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.JPEG_2000;
    JPEG2000CodecOptions opt = JPEG2000CodecOptions.getDefaultOptions();
    opt.quality = 1.0f;
    CodecOptions options = compression.getCompressionCodecOptions(ifd, opt);
    assertEquals(options.quality, opt.quality);
    compression = TiffCompression.JPEG_2000_LOSSY;
    options = compression.getCompressionCodecOptions(ifd, opt);
    assertEquals(options.quality, opt.quality);
    compression = TiffCompression.ALT_JPEG2000;
    options = compression.getCompressionCodecOptions(ifd, opt);
    assertEquals(options.quality, opt.quality);
}
Also used : CodecOptions(loci.formats.codec.CodecOptions) JPEG2000CodecOptions(loci.formats.codec.JPEG2000CodecOptions) TiffCompression(loci.formats.tiff.TiffCompression) JPEG2000CodecOptions(loci.formats.codec.JPEG2000CodecOptions) Test(org.testng.annotations.Test)

Example 30 with TiffCompression

use of loci.formats.tiff.TiffCompression in project bioformats by openmicroscopy.

the class TiffCompressionCompressTest method testJPEG_2000_LOSSY.

@Test
public void testJPEG_2000_LOSSY() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.JPEG_2000_LOSSY;
    CodecOptions options = compression.getCompressionCodecOptions(ifd);
    byte[] compressed = compression.compress(data, options);
    assertNotNull(compressed);
}
Also used : CodecOptions(loci.formats.codec.CodecOptions) JPEG2000CodecOptions(loci.formats.codec.JPEG2000CodecOptions) TiffCompression(loci.formats.tiff.TiffCompression) Test(org.testng.annotations.Test)

Aggregations

TiffCompression (loci.formats.tiff.TiffCompression)33 Test (org.testng.annotations.Test)31 CodecOptions (loci.formats.codec.CodecOptions)18 JPEG2000CodecOptions (loci.formats.codec.JPEG2000CodecOptions)18 NikonCodecOptions (loci.formats.codec.NikonCodecOptions)1 IFD (loci.formats.tiff.IFD)1 IFDList (loci.formats.tiff.IFDList)1 PhotoInterp (loci.formats.tiff.PhotoInterp)1 TiffRational (loci.formats.tiff.TiffRational)1