Contents

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 compression can be found in Tiffcompression.

  • factor:

    A float value 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 factor is 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.

See Also

Related Documentation

Producing Other Representations of Images