This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by はるふ on 2017/12/11. | |
// Copyright © 2017年 ha1f. All rights reserved. | |
// | |
import Foundation | |
import CoreImage | |
import AVFoundation | |
extension CIFilter { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIImage { | |
var grayscaled: UIImage? { | |
guard let openGLContext = EAGLContext(api: .openGLES2) else { return self } | |
let ciContext = CIContext(eaglContext: openGLContext) | |
guard let currentFilter = CIFilter(name: "CIPhotoEffectNoir") else { return self } | |
currentFilter.setValue(CIImage(image: self), forKey: kCIInputImageKey) | |
if let output = currentFilter.outputImage, | |
let cgImage = ciContext.createCGImage(output, from: output.extent) { | |
return UIImage(cgImage: cgImage, scale: scale, orientation: imageOrientation) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ti:app xmlns:ti="http://ti.appcelerator.org"> | |
<id>com.myname.xxx</id> | |
<deployment-targets> | |
<target device="tizen">false</target> | |
<target device="mobileweb">false</target> | |
<target device="iphone">true</target> | |
<target device="ipad">false</target> | |
<target device="android">false</target> | |
<target device="blackberry">false</target> |