tiffRepresentation(using:factor:)
Returns a TIFF representation of the image using the specified compression.
Declaration
func tiffRepresentation(using comp: NSBitmapImageRep.TIFFCompression, factor: Float) -> Data?Parameters
- comp:
An enum constant that represents a TIFF data-compression scheme. Legal values for
compressioncan be found in Tiffcompression. - factor:
A
floatvalue that provides a hint for those compression types that implement variable compression ratios.Currently only JPEG compression uses a compression factor. JPEG compression in TIFF files is not supported, and
factoris ignored.
Discussion
If the compression type isn’t supported for writing TIFF data (for example, NSBitmapImageRep.TIFFCompression.next), the stored compression is changed to NSBitmapImageRep.TIFFCompression.none before the TIFF representation is generated.
If a problem is encountered during generation of the TIFF, tiffRepresentation(using:factor:) raises an NSTIFFException or an NSBadBitmapParametersException.