Initializer

init(ciImage:)

Returns an NSBitmapImageRep object created from a Core Image object.

Declaration

init(ciImage: CIImage)

Parameters

ciImage

A Core Image object whose contents are to be copied to the receiver. This image rectangle must be of a finite size.

Return Value

An NSBitmapImageRep object initialized from the contents of the Core Image (CIImage) object.

Discussion

The image in the ciImage parameter must be fully rendered before the receiver can be initialized. If you specify an object whose rendering was deferred (and thus does not have any pixels available now), this method forces the image to be rendered immediately. Rendering the image could result in a performance penalty if the image has a complex rendering chain or accelerated rendering hardware is not available. Rendering uses the current graphics context in the thread from which this method is called; to ensure consistent results across multiple threads, set the current context using the NSGraphicsContext class before calling this method.

By the time this method returns, the resultant NSBitmapImageRep object can have its raw pixel data inspected, can be put on the pasteboard, and can be encoded to any of the standard image formats that NSBitmapImageRep supports (JPEG, TIFF, and so on.)

If you pass in a CIImage object whose extents are not finite, this method raises an exception.

See Also

Creating an NSBitmapImageRep Object

class func imageReps(with: Data) -> [NSImageRep]

Creates and returns an array of initialized NSBitmapImageRep objects corresponding to the images in the supplied data.

init(cgImage: CGImage)

Returns an NSBitmapImageRep object created from a Core Graphics image object.

init?(data: Data)

Initializes a newly allocated NSBitmapImageRep from the provided data.

init?(focusedViewRect: NSRect)

Initializes the receiver, a newly allocated NSBitmapImageRep object, with bitmap data read from a rendered image.

Deprecated
init(forIncrementalLoad: ())

Initializes and returns the receiver, a newly allocated NSBitmapImageRep object, for incremental loading.