mirror of
https://github.com/status-im/react-native-transparent-video.git
synced 2025-01-09 14:25:50 +00:00
6640e69a81
Signed-off-by: Brian Sztamfater <brian@status.im>
24 lines
685 B
Swift
24 lines
685 B
Swift
//
|
|
// CIKernelExtension.swift
|
|
// MyTransparentVideoExample
|
|
//
|
|
// Created by Quentin Fasquel on 22/03/2020.
|
|
// Copyright © 2020 Quentin Fasquel. All rights reserved.
|
|
//
|
|
|
|
import CoreImage
|
|
import Metal
|
|
|
|
private func defaultMetalLibrary() throws -> Data {
|
|
let url = Bundle.main.url(forResource: "default", withExtension: "metallib")!
|
|
return try Data(contentsOf: url)
|
|
}
|
|
|
|
extension CIKernel {
|
|
/// Init CI kernel with just a `functionName` directly from default metal library
|
|
convenience init(functionName: String) throws {
|
|
let metalLibrary = try defaultMetalLibrary()
|
|
try self.init(functionName: functionName, fromMetalLibraryData: metalLibrary)
|
|
}
|
|
}
|