TiffEncodeOptions

class TiffEncodeOptions(val compression: TiffCompression = TiffCompression.Deflate, val photometric: TiffPhotometric = TiffPhotometric.Auto, val predictor: Boolean = true, val quality: Int = 90, val rowsPerStrip: Int = 0, val tileWidth: Int = 0, val tileLength: Int = 0)(source)

The settings of a TIFF encode (#184), for ImageKodec.encodeTiff, ImageKodec.encodeTiff16 and ImageKodec.encodeTiffCmyk. The defaults give the bytes the calls without options give.

Compression, photometric and depth must fit together: the CCITT compressions take a bi-level page only (and TiffPhotometric.Auto then means bi-level), TiffCompression.Jpeg takes 8-bit gray or colour without alpha, and a palette or bi-level page takes 8-bit pixels. A combination that does not fit throws IllegalArgumentException from the encode, naming it.

Throws

if a value is out of its range, or tiles are asked for together with rowsPerStrip

Constructors

Link copied to clipboard
constructor(compression: TiffCompression = TiffCompression.Deflate, photometric: TiffPhotometric = TiffPhotometric.Auto, predictor: Boolean = true, quality: Int = 90, rowsPerStrip: Int = 0, tileWidth: Int = 0, tileLength: Int = 0)

Properties

Link copied to clipboard

how each strip or tile is compressed.

Link copied to clipboard

the kind of samples written.

Link copied to clipboard

difference each sample from the one to its left first (TIFF Predictor 2), which makes LZW and Deflate smaller on photographs. Used with TiffCompression.Lzw and TiffCompression.Deflate on samples of 8 or 16 bits, and never on palette indices; ignored otherwise.

Link copied to clipboard

0 to 100, higher is better: the JPEG quality, as ImageKodec.encodeJpeg reads it (0 is read as 1). From 91 up the chroma is kept whole (YCbCr 4:4:4), below it is halved both ways (4:2:0). Used by TiffCompression.Jpeg only.

Link copied to clipboard

the rows in each strip, or 0 for strips of about 8 KiB of samples, as the calls without options write. A JPEG strip that is not the last must hold a whole number of rows of blocks: a multiple of 16 rows at 4:2:0 and of 8 at 4:4:4.

Link copied to clipboard

Whether the page is written in tiles rather than strips.

Link copied to clipboard

the height of each tile, a positive multiple of 16, or 0 to write strips. The tiles at the right and bottom edges are written whole, padded with zero samples (or, under JPEG, with the edge pixels).

Link copied to clipboard

the width of each tile, a positive multiple of 16, or 0 to write strips.

Functions

Link copied to clipboard
open override fun toString(): String