Creates a Core Video Metal texture buffer from an existing image buffer.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- Core Video
CFAllocatorto use for allocating the texture.
The texture cache object that will create and manage the texture.
The Core Video image buffer from which to create a Metal texture.
A dictionary specifying options for creating the texture from the cache, or
NULLto use default options.
The Metal pixel format constant describing the image buffer’s data.
The width, in pixels, of the texture image.
The height, in pixels, of the texture image.
If the image buffer is planar, the index of the plane from which to map texture data. Ignored for non-planar image buffers.
Upon return, contains the newly created Metal texture buffer.
Upon successful creation of the texture, this function returns
This function creates or returns a cached Core Video Metal texture buffer mapped to an image buffer according to the specified, creating a live binding between a device-based image buffer and a
Note that Core Video does not explicitly declare any pixel format types to be Metal compatible. If you specify YES for the
k option when creating or requesting Core Video pixel buffers, those buffers will be Metal compatible. Thus, it is your responsibility to choose an appropriate pixel format for the buffers.
The following code snippet demonstrates some example mappings: