replacingSemanticSegmentationMatte(with:)
Returns a semantic segmentation matte instance that wraps the replacement pixel buffer.
Declaration
func replacingSemanticSegmentationMatte(with pixelBuffer: CVPixelBuffer) throws -> SelfParameters
- pixelBuffer:
A pixel buffer containing a semantic segmentation matting image, represented as Kcvpixelformattype_onecomponent8 with a Kcvimagebuffertransferfunction_linear transfer function.
Return Value
A new semantic segmentation matte instance, or nil if the pixel buffer is malformed.
Discussion
When applying complex edits to media containing a semantic segmentation matte, you may create a derivative matte with arbitrary transforms applied to it. You can then use this method to create a new semantic segmentation matte instance.