TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by HFCoreUI.
Depends on: | |
TinyLog | >= 0 |
GPUImage | >= 0 |
PureLayout | >= 0 |
To run the example project, clone the repo, and run pod install
from the Example directory first.
I’m writing this since I couldn’t find a open source with complete basic source to start develop camera application from, and is based on GPUImage library inside.
This example contains the following features.
front camera preview / still capture / video capture
back camera preview / still capture / video capture
flipping camera
torch control
tap to focus
add/remove filter
face detection
pinch to zoom in/out
I’m going to add more features that every camera application must have.
Please don’t hesitate to contribute on this project. Any advice and suggestions will be greatly appreciated.
takePhoto({ image in
let photoVC = PhotoViewController()
photoVC.image = image
self.present(photoVC, animated: true, completion: nil)
})
flipCamera()
switch cameraPosition {
// do something
}
torchMode = .on
torchMode = .off
torchMode = .auto
add(filter: filter)
removeFilters()
// set true somewhere
isFaceDetectorEnabled = true
// handle result
func cameraPreview(_ controller: CameraPreviewController, detected faceFeatures: [CIFaceFeature]?, aperture: CGRect, orientation: UIDeviceOrientation) {
guard let faces = faceFeatures, faces.count > 0 else {
return
}
// do something
}
Xcode8, Swift 3
Sample: TinyLog, GPUImage, AttachLayout, SwiftARGB
Pods: TinyLog, GPUImage, AttachLayout
CameraPreviewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CameraPreviewController"
DragonCherry, [email protected]
CameraPreviewController is available under the MIT license. See the LICENSE file for more info.