Contents

init(mtlTexture:options:)

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

Declaration

init?(mtlTexture texture: any MTLTexture, options: [CIImageOption : Any]? = nil)

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 init(mtlDevice:) method, and call the render(_:to:commandBuffer:bounds:colorSpace:) method to create an output image in another Metal texture object.

See Also

Creating an Image