Function

CVMetalTextureGetCleanTexCoords(_:_:_:_:_:)

Returns convenient normalized texture coordinates for the part of the image that should be displayed.

Declaration

func CVMetalTextureGetCleanTexCoords(_ image: CVMetalTexture, _ lowerLeft: UnsafeMutablePointer<Float>, _ lowerRight: UnsafeMutablePointer<Float>, _ upperRight: UnsafeMutablePointer<Float>, _ upperLeft: UnsafeMutablePointer<Float>)

Parameters

image

A CoreVideo Metal texture-based image buffer.

float lowerLeft[2],

An array that holds two float values. Upon return, the array contains the s and t texture coordinates for the lower left corner of the image.

float lowerRight[2],

An array that holds two float values. Upon return, the array contains the s and t texture coordinates for the lower right corner of the image.

float upperRight[2],

An array that holds two float values. Upon return, the array contains the s and t texture coordinates for the upper right corner of the image.

float upperLeft[2]

An array that holds two float values. Upon return, the array contains the s and t texture coordinates for the upper left corner of the image.

Discussion

This function automatically takes into account whether or not the texture is flipped.

See Also

Inspecting Textures

func CVMetalTextureGetTexture(CVMetalTexture) -> MTLTexture?

Returns the Metal texture object for the image buffer.

func CVMetalTextureIsFlipped(CVMetalTexture) -> Bool

Returns a Boolean value indicating whether the texture image is vertically flipped.

func CVMetalTextureGetTypeID() -> CFTypeID

Returns the Core Foundation type identifier for a CoreVideo Metal texture-based image buffer.