Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
9cb5ae9e
Commit
9cb5ae9e
authored
Jul 13, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated CapturePreview with comments
parent
22717582
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
Sources/iOS/CapturePreview.swift
+13
-12
No files found.
Sources/iOS/CapturePreview.swift
View file @
9cb5ae9e
...
...
@@ -32,23 +32,26 @@ import UIKit
import
AVFoundation
public
class
CapturePreview
:
MaterialView
{
/**
:name: layerClass
*/
public
override
class
func
layerClass
()
->
AnyClass
{
return
AVCaptureVideoPreviewLayer
.
self
}
/**
:name: captureDevicePointOfInterestForPoint
*/
public
func
captureDevicePointOfInterestForPoint
(
point
:
CGPoint
)
->
CGPoint
{
/**
Converts a point in layer coordinates to a point of interest
in the coordinate space of the capture device providing input
to the layer.
- Returns: A CGPoint that is converted.
*/
public
func
captureDevicePointOfInterestForPoint
(
point
:
CGPoint
)
->
CGPoint
{
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
{
return
(
layer
as!
AVCaptureVideoPreviewLayer
)
.
pointForCaptureDevicePoint
(
ofInterest
:
point
)
}
...
...
@@ -65,9 +68,7 @@ public class CapturePreview : MaterialView {
preparePreviewLayer
()
}
/**
:name: preparePreviewLayer
*/
/// Prepares the previewLayer.
private
func
preparePreviewLayer
()
{
layer
.
backgroundColor
=
Color
.
black
.
cgColor
layer
.
masksToBounds
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment