An object that wraps a matting image for a particular semantic segmentation.


class AVSemanticSegmentationMatte : NSObject


The matting image stores its pixel data as CVPixelBuffer objects in kCVPixelFormatType_OneComponent8 format. The image file contains the semantic segmentation matte as an auxiliary image, accessible using the ImageIO framework’s CGImageSourceCopyAuxiliaryDataInfoAtIndex(_:_:_:) function.


Creating a Segmentation Matte

init(fromImageSourceAuxiliaryDataType: CFString, dictionaryRepresentation: [AnyHashable : Any])

Returns a new semantic segmentation matte instance from auxiliary image information in an image file.

func replacingSemanticSegmentationMatte(with: CVPixelBuffer) -> Self

Returns a semantic segmentation matte instance that wraps the replacement pixel buffer.

func applyingExifOrientation(CGImagePropertyOrientation) -> Self

Returns a new semantic segmentation matte instance with the specified Exif orientation applied.

func dictionaryRepresentation(forAuxiliaryDataType: AutoreleasingUnsafeMutablePointer<NSString?>?) -> [AnyHashable : Any]?

Returns a dictionary of primitive map information to use when writing an image file with a semantic segmentation matte.

Inspecting a Segmentation Matte

var matteType: AVSemanticSegmentationMatte.MatteType

The semantic segmentation matte image type.

struct AVSemanticSegmentationMatte.MatteType

A structure that defines the types of segmentation matte images that you can capture along with the primary image.

var mattingImage: CVPixelBuffer

The semantic segmentation matte’s internal image.

var pixelFormatType: OSType

The pixel format type for this object’s internal matting image.


Inherits From

Conforms To

See Also

Depth Data Capture

Capturing Photos with Depth

Get a depth map with a photo to create effects like the system camera’s Portrait mode (on compatible devices).

AVCamFilter: Applying Filters to a Capture Stream

Render a capture stream with rose-colored filtering and depth effects.

Streaming Depth Data from the TrueDepth Camera

Visualize depth data in 2D and 3D from the TrueDepth camera.

Enhancing Live Video by Leveraging TrueDepth Camera Data

Apply your own background to a live capture feed streamed from the front-facing TrueDepth camera.

class AVCaptureDepthDataOutput

A capture output that records scene depth information on compatible camera devices.

class AVDepthData

A container for per-pixel distance or disparity information captured by compatible camera devices.

class AVPortraitEffectsMatte

An auxiliary image used to separate foreground from background with high resolution.