Contents

encodeRender(to:frameAttributes:sourceImage:sourceDisparity:destinationLuma:destinationChroma:)

Encode a command to render a shallow depth of field (SDoF) image to two metal textures as luma and chroma.

Declaration

func encodeRender(to commandBuffer: any MTLCommandBuffer, frameAttributes: CNRenderingSession.FrameAttributes, sourceImage: CVPixelBuffer, sourceDisparity: CVPixelBuffer, destinationLuma: any MTLTexture, destinationChroma: any MTLTexture) -> Bool

Parameters

  • commandBuffer:

    The metal command buffer on which to encode the command

  • frameAttributes:

    Controls the focus distance and aperture of the rendering

  • sourceImage:

    A pixel buffer read from the cinematicVideoTrack

  • sourceDisparity:

    A pixel buffer read from the cinematicDisparityTrack

  • destinationLuma:

    A metal texture to which the luma of the SDoF image is rendered

  • destinationChroma:

    A metal texture to which the chroma of the SDoF image is rendered

Return Value

Whether encoding the render command was successful