Upgrade to Pro — share decks privately, control downloads, hide ads and more …

New iPhone Camera Hack!

New iPhone Camera Hack!

Mobile Act NAGOYA #2 の LT 資料
https://mobileactnagoya.connpass.com/event/38805/

- iPhone 7 Plus Dual Camera
- iOS 10 camera API

Tomoki Kobayashi

October 01, 2016
Tweet

More Decks by Tomoki Kobayashi

Other Decks in Programming

Transcript

  1. AVCapturePhotoOutput let types = photoOutput.availableRawPhotoPixelFormatTypes let type = types.first!.uint32Value let

    settings = AVCapturePhotoSettings(rawPixelFormatType: type) photoOutput.capturePhoto(with: settings, delegate: self)
  2. AVCapturePhotoCaptureDelegate rawSampleBuffer: CMSampleBuffer? func capture(_ captureOutput: AVCapturePhotoOutput, didFinishProcessingRawPhotoSampleBuffer rawSampleBuffer: CMSampleBu

    previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) { }
  3. import CoreImage.framework CIFilter CIFilter CIImage let rawFilter = CIFilter(imageURL: rawURL,

    options: nil) // Noise Reduction let nrKey = kCIInputLuminanceNoiseReductionAmountKey if let nr = rawFilter?.value(forKey: nrKey) { rawFilter.setValue(nr.doubleValue + 0.1, forKey: nrKey) } let image: CIImage? = rawFilter?.outputImage // ‐> CGImage, UIImage, JPEG, ...