mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
43 lines
1.5 KiB
Swift
43 lines
1.5 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
@exported import QuartzCore // Clang module
|
|
|
|
// sdk overlays:
|
|
extension CIFilter {
|
|
convenience init(name : String!, elements: (NSCopying, AnyObject)...) {
|
|
var dict = NSMutableDictionary()
|
|
for i in 0..elements.count {
|
|
dict[i] = NSMutableDictionary(object: elements[i].1, forKey: elements[i].0)
|
|
}
|
|
|
|
// @objc(filterWithName:withInputParameters:)
|
|
// init(name: String!,
|
|
// withInputParameters params: NSDictionary!) -> CIFilter
|
|
self.init(name: name, withInputParameters: dict)
|
|
}
|
|
}
|
|
|
|
// sdk overlays:
|
|
extension CISampler {
|
|
convenience init(im: CIImage!, elements: (NSCopying, AnyObject)...) {
|
|
var dict = NSMutableDictionary()
|
|
for i in 0..elements.count {
|
|
dict[i] = NSMutableDictionary(object: elements[i].1, forKey: elements[i].0)
|
|
}
|
|
// @objc(initWithImage:options:)
|
|
// init(image im: CIImage!,
|
|
// options dict: NSDictionary!)
|
|
self.init(image: im, options: dict)
|
|
}
|
|
}
|