forked from MetalPetal/MetalPetal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
1,085 additions
and
1,061 deletions.
There are no files selected for viewing
This file contains 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
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) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: df2043ba79a0e14a3b6fa8c077f6906b2b3a68bd | ||
|
||
COCOAPODS: 1.9.1 | ||
COCOAPODS: 1.9.3 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.