Skip to content

Commit

Permalink
improve swift api
Browse files Browse the repository at this point in the history
  • Loading branch information
YuAo committed Jul 24, 2020
1 parent aafc0e2 commit b5254c1
Show file tree
Hide file tree
Showing 4 changed files with 1,085 additions and 1,061 deletions.
20 changes: 20 additions & 0 deletions Frameworks/MetalPetal/MTIContext.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// MTIContext.swift
// MetalPetal
//
// Created by YuAo on 2020/7/24.
//

import Foundation

#if SWIFT_PACKAGE
import MetalPetalObjectiveC.Core
#endif

extension MTIContext {
public func startTaskToCreateCGImage(from image: MTIImage, colorSpace: CGColorSpace? = nil, completion: ((MTIRenderTask) -> Void)? = nil) throws -> (image: CGImage, task: MTIRenderTask) {
var outputCGImage: CGImage?
let task = try self.startTask(toCreate: &outputCGImage, from: image, colorSpace: colorSpace, completion: completion)
return (outputCGImage!, task)
}
}
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: df2043ba79a0e14a3b6fa8c077f6906b2b3a68bd

COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
2 changes: 1 addition & 1 deletion Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b5254c1

Please sign in to comment.