Instance Method

layerPointConverted(fromCaptureDevicePoint:)

Converts a point from the coordinate space of the capture device to the coordinate space of the layer.

Declaration

func layerPointConverted(fromCaptureDevicePoint captureDevicePointOfInterest: CGPoint) -> CGPoint

Parameters

captureDevicePointOfInterest

A scalar point whose coordinates are relative to the coordinate system of the capture device that is providing input to the layer. The coordinates in this point must be in the range 0.0 to 1.0, where the point (0.0, 0.0) corresponds to the top left corner of the unrotated picture and the point (1.0, 1.0) represents the bottom right corner of the unrotated picture.

Return Value

A point in the coordinate system of this layer object. The coordinates of this point represent pixel values.

Discussion

The conversion performed by this method takes the layer’s frame size and its videoGravity into consideration.

See Also

Converting Between Coordinate Systems

func captureDevicePointConverted(fromLayerPoint: CGPoint) -> CGPoint

Converts a point from layer coordinates to the coordinate space of the capture device.

func layerRectConverted(fromMetadataOutputRect: CGRect) -> CGRect

Converts a rectangle in the coordinate system used for metadata outputs to one in the preview layer’s coordinate system.

func metadataOutputRectConverted(fromLayerRect: CGRect) -> CGRect

Converts a rectangle in the preview layer’s coordinate system to one in the coordinate system used for metadata outputs.

func transformedMetadataObject(for: AVMetadataObject) -> AVMetadataObject?

Converts a metadata object’s visual properties to layer coordinates.