Search in sources :

Example 16 with TiffCompression

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

the class TiffCompressionCompressTest method testLURAWAVE.

@Test(expectedExceptions = { FormatException.class })
public void testLURAWAVE() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.LURAWAVE;
    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 17 with TiffCompression

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

the class TiffCompressionCompressTest method testGROUP_3_FAX.

@Test(expectedExceptions = { FormatException.class })
public void testGROUP_3_FAX() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.GROUP_3_FAX;
    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 18 with TiffCompression

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

the class TiffCompressionCompressTest method testPACK_BITS.

@Test(expectedExceptions = { FormatException.class })
public void testPACK_BITS() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.PACK_BITS;
    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 19 with TiffCompression

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

the class TiffCompressionCompressTest method testCCITT_1D.

@Test(expectedExceptions = { FormatException.class })
public void testCCITT_1D() throws FormatException, IOException {
    TiffCompression compression = TiffCompression.CCITT_1D;
    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 20 with TiffCompression

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

the class TiffWriter method formatCompression.

/**
 * Sets the compression code for the specified IFD.
 *
 * @param ifd The IFD table to handle.
 */
private void formatCompression(IFD ifd) throws FormatException {
    if (compression == null)
        compression = "";
    TiffCompression compressType = TiffCompression.UNCOMPRESSED;
    if (compression.equals(COMPRESSION_LZW)) {
        compressType = TiffCompression.LZW;
    } else if (compression.equals(COMPRESSION_J2K)) {
        compressType = TiffCompression.JPEG_2000;
    } else if (compression.equals(COMPRESSION_J2K_LOSSY)) {
        compressType = TiffCompression.JPEG_2000_LOSSY;
    } else if (compression.equals(COMPRESSION_JPEG)) {
        compressType = TiffCompression.JPEG;
    }
    Object v = ifd.get(new Integer(IFD.COMPRESSION));
    if (v == null)
        ifd.put(new Integer(IFD.COMPRESSION), compressType.getCode());
}
Also used : TiffCompression(loci.formats.tiff.TiffCompression)

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