encodeTiff16

Encode bitmap as a 16-bit TIFF, keeping every bit decode16 gives: gray for one or two channels, RGB for three or four, the second or fourth an unassociated alpha sample. Otherwise written as encodeTiff writes an 8-bit bitmap, and lossless: decode16 returns the same samples.


Encode pages as one multi-page 16-bit TIFF, each page as encodeTiff16 writes one.

Throws


fun encodeTiff16(bitmap: KiteBitmap16, options: TiffEncodeOptions, metadata: ImageMetadata = ImageMetadata(), cancellationCheck: () -> Unit? = null): ByteArray(source)

Encode bitmap as a 16-bit TIFF as options says: none, PackBits, LZW or Deflate, strips or tiles, gray or RGB samples. TiffPhotometric.Auto keeps the channels bitmap has, as encodeTiff16 without options does. TiffPhotometric.Rgb repeats a gray sample three times, and TiffPhotometric.Gray takes the luma of a colour pixel. Alpha is kept. Metadata and cancellation as encodeTiff with options.

Throws

for a CCITT or JPEG compression, or bi-level or palette samples, which have no 16-bit form


fun encodeTiff16(pages: List<KiteBitmap16>, options: TiffEncodeOptions, metadata: ImageMetadata = ImageMetadata(), cancellationCheck: () -> Unit? = null): ByteArray(source)

Encode pages as one multi-page 16-bit TIFF, each page as encodeTiff16 with options writes one.

Throws

if pages is empty, or as encodeTiff16 with options does