Instance Method

canBeCompressed(using:)

Tests whether the receiver can be compressed by the specified compression scheme.

Declaration

func canBeCompressed(using compression: NSBitmapImageRep.TIFFCompression) -> Bool

Parameters

compression

A TIFF compression type. For more information, see the constants in NSBitmapImageRep.TIFFCompression.

Return Value

true if the receiver's data matches compression with this type, false if the data doesn’t match compression or if compression is unsupported..

Discussion

Legal values for compression can be found in NSBitmapImageRep.h and are described in TIFF Compression in NSBitmapImageReps. This method returns true if the receiver’s data matches compression; for example, if compression is NSTIFFCompressionCCITTFAX3, then the data must be 1 bit per sample and 1 sample per pixel.

See Also

Managing Compression Types

class func getTIFFCompressionTypes(UnsafeMutablePointer<UnsafePointer<NSBitmapImageRep.TIFFCompression>?>, count: UnsafeMutablePointer<Int>)

Returns by indirection an array of all available compression types that can be used when writing a TIFF image.

class func localizedName(forTIFFCompressionType: NSBitmapImageRep.TIFFCompression) -> String?

Returns an autoreleased string containing the localized name for the specified compression type.

func setCompression(NSBitmapImageRep.TIFFCompression, factor: Float)

Sets the receiver’s compression type and compression factor.

func getCompression(UnsafeMutablePointer<NSBitmapImageRep.TIFFCompression>?, factor: UnsafeMutablePointer<Float>?)

Returns by indirection the receiver’s compression type and compression factor.

func value(forProperty: NSBitmapImageRep.PropertyKey) -> Any?

Returns the value for the specified property.

enum NSBitmapImageRep.TIFFCompression

Constants representing the supported TIFF data-compression schemes.