Instance Method

initWithCIImage:

Returns an NSBitmapImageRep object created from a Core Image object.

Declaration

- (instancetype)initWithCIImage:(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

+ imageRepWithData:

Creates and returns an NSBitmapImageRep object initialized with the first image in the supplied data.

+ imageRepsWithData:

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

- initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:

Initializes the receiver, a newly allocated NSBitmapImageRep object, so it can render the specified image.

- initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:

Initializes the receiver, a newly allocated NSBitmapImageRep object, so it can render the specified image.

- initWithCGImage:

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

- initWithData:

Initializes a newly allocated NSBitmapImageRep from the provided data.

- initWithFocusedViewRect:

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

Deprecated
- initForIncrementalLoad

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