Instance Method

initWithMTLTexture:options:

Initializes an image object with data supplied by a Metal texture.

Declaration

- (instancetype)initWithMTLTexture:(id<MTLTexture>)texture options:(NSDictionary<CIImageOption, id> *)options;

Parameters

texture

The Metal texture from which to use image data.

options

A dictionary specifying image options. (See Image Dictionary Keys.)

Return Value

The initialized image object, or nil if the image could not be initialized.

Discussion

To render the image using Metal, use this image with a Metal-based CIContext object created with the contextWithMTLDevice: method, and call the render:toMTLTexture:commandBuffer:bounds:colorSpace: method to create an output image in another Metal texture object.

See Also

Initializing an Image

- initWithColor:

Initializes an image of infinite extent whose entire content is the specified color.

- initWithBitmapData:bytesPerRow:size:format:colorSpace:

Initializes an image object with bitmap data.

- initWithCGImage:

Initializes an image object with a Quartz 2D image.

- initWithCGImage:options:

Initializes an image object with a Quartz 2D image, using the specified options.

- initWithBitmapImageRep:

Initializes an image object with the specified bitmap image representation.

- initWithImage:

Initializes an image object with the specified UIKit image object.

- initWithImage:options:

Initializes an image object with the specified UIKit image object, using the specified options.

- initWithCGLayer:

Initializes an image object from the contents supplied by a CGLayer object.

Deprecated
- initWithCGLayer:options:

Initializes an image object from the contents supplied by a CGLayer object, using the specified options.

Deprecated
- initWithContentsOfURL:

Initializes an image object by reading an image from a URL.

- initWithContentsOfURL:options:

Initializes an image object by reading an image from a URL, using the specified options.

- initWithCVImageBuffer:

Initializes an image object from the contents of a Core Video image buffer.

- initWithCVImageBuffer:options:

Initializes an image object from the contents of a Core Video image buffer, using the specified options.

- initWithCVPixelBuffer:

Initializes an image object from the contents of a Core Video pixel buffer.

- initWithCVPixelBuffer:options:

Initializes an image object from the contents of a Core Video pixel buffer using the specified options.

- initWithData:

Initializes an image object with the supplied image data.

- initWithData:options:

Initializes an image object with the supplied image data, using the specified options.

- initWithImageProvider:size::format:colorSpace:options:

Initializes an image object with data provided by an image provider, using the specified options.

kCIImageProviderTileSize

A key for the image tiles size. The associated value is an NSArray that containsNSNumber objects for the dimensions of the image tiles requested from the image provider.

kCIImageProviderUserInfo

A key for data needed by the image provider. The associated value is an object that contains the needed data.

- initWithTexture:size:flipped:colorSpace:

Initializes an image object with data supplied by an OpenGL texture.

Deprecated
- initWithTexture:size:flipped:options:

Initializes an image object with data supplied by an OpenGL texture.

Deprecated
- initWithIOSurface:

Initializes an image with the contents of an IOSurface.

- initWithIOSurface:options:

Initializes, using the specified options, an image with the contents of an IOSurface.

- initWithIOSurface:plane:format:options:

Initializes, using the specified format and options, an image with the contents of a specific data plane in an IOSurface.

Deprecated