Renders a region of an image to a Metal texture.
- iOS 9.0+
- macOS 10.11+
- tvOS 9.0+
- Core Image
A Core Image image object.
The destination Metal texture object.
The Metal command buffer into which to schedule Core Image rendering tasks.
The rectangle in the destination texture to draw into.
The color space of the destination texture.
If you specify
nil for the
command parameter, Core Image manages its own Metal command buffer. To combine Core Image rendering with other Metal rendering tasks—for example, to use Core Image filters on textures whose content is generated by a Metal render-to-texture operation, or to use Core Image output later in the same Metal rendering pass—pass the same
MTLCommand object you use for those tasks.
Rendering to a Metal texture requires a Metal-based context created with the
init(mtl method. Calling this method on any other context raises an exception. This method renders only to Metal textures whose texture type is
MTLTexture and whose
sample value is 1.