Commit 9cb5ae9e by Daniel Dahan

updated CapturePreview with comments

parent 22717582
...@@ -32,23 +32,26 @@ import UIKit ...@@ -32,23 +32,26 @@ import UIKit
import AVFoundation import AVFoundation
public class CapturePreview : MaterialView { public class CapturePreview : MaterialView {
/**
:name: layerClass
*/
public override class func layerClass() -> AnyClass { public override class func layerClass() -> AnyClass {
return AVCaptureVideoPreviewLayer.self return AVCaptureVideoPreviewLayer.self
} }
/** /**
:name: captureDevicePointOfInterestForPoint Converts a point in layer coordinates to a point of interest
*/ in the coordinate space of the capture device providing input
public func captureDevicePointOfInterestForPoint(point: CGPoint) -> CGPoint { to the layer.
- Returns: A CGPoint that is converted.
*/
public func captureDevicePointOfInterestForPoint(point: CGPoint) -> CGPoint {
return (layer as! AVCaptureVideoPreviewLayer).captureDevicePointOfInterest(for: point) return (layer as! AVCaptureVideoPreviewLayer).captureDevicePointOfInterest(for: point)
} }
/** /**
:name: pointForCaptureDevicePointOfInterest Converts a point of interest in the coordinate space of the
*/ capture device providing input to the layer to a point in
layer coordinates.
- Returns: A CGPoint that is converted.
*/
public func pointForCaptureDevicePointOfInterest(point: CGPoint) -> CGPoint { public func pointForCaptureDevicePointOfInterest(point: CGPoint) -> CGPoint {
return (layer as! AVCaptureVideoPreviewLayer).pointForCaptureDevicePoint(ofInterest: point) return (layer as! AVCaptureVideoPreviewLayer).pointForCaptureDevicePoint(ofInterest: point)
} }
...@@ -65,9 +68,7 @@ public class CapturePreview : MaterialView { ...@@ -65,9 +68,7 @@ public class CapturePreview : MaterialView {
preparePreviewLayer() preparePreviewLayer()
} }
/** /// Prepares the previewLayer.
:name: preparePreviewLayer
*/
private func preparePreviewLayer() { private func preparePreviewLayer() {
layer.backgroundColor = Color.black.cgColor layer.backgroundColor = Color.black.cgColor
layer.masksToBounds = true layer.masksToBounds = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment