From ffd7b5a64a20535980d4e9eb156fe2ecbe41fc6a Mon Sep 17 00:00:00 2001 From: Brad Larson Date: Sat, 8 Jun 2019 16:43:10 -0500 Subject: [PATCH] Linux version is now working again, including the SimpleVideoFilter sample application. This time, full Swift Package Manager support is available. --- .gitignore | 3 + Package.swift | 36 +++++-- README.md | 26 +++-- .../Linux-OpenGL/SimpleVideoFilter/.gitignore | 4 + .../SimpleVideoFilter/Package.resolved | 34 ++++++ .../SimpleVideoFilter/Package.swift | 16 +++ .../{Source => Sources}/main.swift | 0 .../Linux-OpenGL/SimpleVideoFilter/compile.sh | 1 - .../FilterShowcase.xcodeproj/project.pbxproj | 5 +- .../FilterShowcaseSwift/AppDelegate.swift | 2 +- framework/GPUImage.xcodeproj/project.pbxproj | 2 - framework/LinuxCompilationGenerator.sh | 101 ------------------ framework/Source/Linux/GLUTRenderWindow.swift | 13 ++- framework/Source/Linux/OpenGLContext.swift | 21 +++- .../Linux/{V4LSupplement => }/V4LCamera.swift | 23 ++-- .../V4LSupplement/{ => include}/v4lfuncs.h | 0 framework/compile-LinuxGL.sh | 6 -- framework/compile-LinuxRPi.sh | 6 -- 18 files changed, 141 insertions(+), 158 deletions(-) create mode 100755 examples/Linux-OpenGL/SimpleVideoFilter/.gitignore create mode 100755 examples/Linux-OpenGL/SimpleVideoFilter/Package.resolved create mode 100755 examples/Linux-OpenGL/SimpleVideoFilter/Package.swift rename examples/Linux-OpenGL/SimpleVideoFilter/{Source => Sources}/main.swift (100%) delete mode 100755 examples/Linux-OpenGL/SimpleVideoFilter/compile.sh delete mode 100755 framework/LinuxCompilationGenerator.sh rename framework/Source/Linux/{V4LSupplement => }/V4LCamera.swift (90%) rename framework/Source/Linux/V4LSupplement/{ => include}/v4lfuncs.h (100%) delete mode 100644 framework/compile-LinuxGL.sh delete mode 100644 framework/compile-LinuxRPi.sh diff --git a/.gitignore b/.gitignore index b70efca6..5649d4e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Exclude the build directory build/* examples/FilterShowcase/build* +examples/Linux-OpenGL/SimpleVideoFilter/.build +.build +.swiftpm # Exclude temp nibs and swap files *~.nib diff --git a/Package.swift b/Package.swift index 800b41c0..33e3b4f3 100755 --- a/Package.swift +++ b/Package.swift @@ -1,18 +1,40 @@ -// swift-tools-version:4.0 -// The swift-tools-version declares the minimum version of Swift required to build this package. +// swift-tools-version:4.2 import PackageDescription #if os(macOS) let platformDepedencies: [Package.Dependency] = [] let platformExcludes = ["iOS", "Linux", "Operations/Shaders"] +let platformTargets: [Target] = [ + .target( + name: "GPUImage", + path: "framework/Source", + exclude: platformExcludes)] #elseif os(iOS) let platformDepedencies: [Package.Dependency] = [] let platformExcludes = ["Linux", "Mac", "Operations/Shaders"] +let platformTargets: [Target] = [ + .target( + name: "GPUImage", + path: "framework/Source", + exclude: platformExcludes)] #elseif os(Linux) // TODO: Add back in RPi support -let platformDepedencies: [Package.Dependency] = [.package(url: "https://github.com/BradLarson/COpenGL.git", from: "1.0.2"), .package(url: "https://github.com/BradLarson/CFreeGLUT.git", from: "1.0.1"), .package(url: "https://github.com/BradLarson/CVideo4Linux.git", from: "1.0.2")] +// TODO: Move the remote system library packages into this project +let platformDepedencies: [Package.Dependency] = [ + .package(url: "https://github.com/BradLarson/COpenGL.git", from: "1.0.2"), + .package(url: "https://github.com/BradLarson/CFreeGLUT.git", from: "1.0.1"), + .package(url: "https://github.com/BradLarson/CVideo4Linux.git", from: "1.0.2")] let platformExcludes = ["iOS", "Mac", "Operations/Shaders", "Linux/RPiRenderWindow.swift", "Linux/OpenGLContext-RPi.swift", "Linux/V4LSupplement"] +let platformTargets: [Target] = [ + .target( + name: "V4LSupplement", + path: "framework/Source/Linux/V4LSupplement"), + .target( + name: "GPUImage", + dependencies: ["V4LSupplement"], + path: "framework/Source", + exclude: platformExcludes)] #endif @@ -24,10 +46,6 @@ let package = Package( targets: ["GPUImage"]), ], dependencies: platformDepedencies, - targets: [ - .target( - name: "GPUImage", - path: "framework/Source", - exclude: platformExcludes), - ] + targets: platformTargets, + swiftLanguageVersions: [.v4] ) diff --git a/README.md b/README.md index 89c2d95d..2c0512db 100755 --- a/README.md +++ b/README.md @@ -54,15 +54,21 @@ Note that you may need to build your project once to parse and build the GPUImag ## Using GPUImage in a Linux application ## -Eventually, this project will support the Swift Package Manager, which will make it trivial to use with a Linux project. Unfortunately, that's not yet the case, so it can take a little work to get this to build for a Linux project. +This project supports the Swift Package Manager, so you should be able to add it as a dependency in your Package.swift file like the following: -Right now, there are two build scripts in the framework directory, one named compile-LinuxGL.sh and one named compile-RPi.sh. The former builds the framework for a Linux target using OpenGL and the latter builds for the Raspberry Pi. I can add other targets as I test them, but I've only gotten this operational in desktop Ubuntu, on Ubuntu running on a Jetson TK1 development board, and on Raspbian running on a Raspberry Pi 2 and Pi 3. +``` +.package(url: "https://github.com/BradLarson/GPUImage2.git", from: "0.0.1"), +``` -Before compiling the framework, you'll need to get Swift up and running on your system. For desktop Ubuntu installs, you can follow Apple's guidelines on their Downloads page. Those instructions also worked for me on the Jetson TK1 dev board. +along with an + +``` +import GPUImage +``` -For ARM Linux devices like the Raspberry Pi, follow these steps exactly to get a working Swift compiler installed. Pay close attention to the steps for getting Clang-2.6 installed and the use of update-alternatives. These are the steps I used to go from stock Raspbian to a Swift install on +in your application code. -I have noticed that Swift 2.2 compiler snapshots newer than January 11 or so are missing Foundation, which I need for the framework, so maybe go with a snaphot earlier than that. +Before compiling the framework, you'll need to get Swift up and running on your system. For desktop Ubuntu installs, you can follow Apple's guidelines on their Downloads page. After Swift, you'll need to install Video4Linux to get access to standard USB webcams as inputs: @@ -76,13 +82,15 @@ On the Raspberry Pi, you'll need to make sure that the Broadcom Videocore header sudo apt-get install libraspberrypi-dev ``` -For desktop Linux and other OpenGL devices (Jetson TK1), you'll need to make sure GLUT and the OpenGL headers are installed. The framework currently uses GLUT for its output. GLUT can be used on the Raspberry Pi via the new experimental OpenGL support there, but I've found that it's significantly slower than using the OpenGL ES APIs and the Videocore interface that ships with the Pi. Also, if you enable the OpenGL support you currently lock yourself out of using the Videocore interface. +For desktop Linux and other OpenGL devices (Jetson family), you'll need to make sure GLUT and the OpenGL headers are installed. The framework currently uses GLUT for its output. GLUT can be used on the Raspberry Pi via the new experimental OpenGL support there, but I've found that it's significantly slower than using the OpenGL ES APIs and the Videocore interface that ships with the Pi. Also, if you enable the OpenGL support you currently lock yourself out of using the Videocore interface. -Once all of that is set up, to build the framework go to the /framework directory and run the appropriate build script. This will compile and generate a Swift module and a shared library for the framework. Copy the shared library into a system-accessible library path, like /usr/lib. +Once all of that is set up, you can use -To build any of the sample applications, go to the examples/ subdirectory for that example (examples are platform-specific) and run the compile.sh build script to compile the example. The framework must be built before any example application. +``` +swift build +``` -As Swift becomes incorporated into more platforms, and as I add support for the Swift Package Manager, these Linux build steps will become much easier. My setup is kind of a hack at present. +in the main GPUImage directory to build the framework, or do the same in the examples/Linux-OpenGL/SimpleVideoFilter directory. This will build a sample application that filters live video from a USB camera and displays the results in real time to the screen. The application itself will be contained within the .build directory and its platform-specific subdirectories. Look for the SimpleVideoFilter binary and run that. ## Performing common tasks ## diff --git a/examples/Linux-OpenGL/SimpleVideoFilter/.gitignore b/examples/Linux-OpenGL/SimpleVideoFilter/.gitignore new file mode 100755 index 00000000..02c08753 --- /dev/null +++ b/examples/Linux-OpenGL/SimpleVideoFilter/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj diff --git a/examples/Linux-OpenGL/SimpleVideoFilter/Package.resolved b/examples/Linux-OpenGL/SimpleVideoFilter/Package.resolved new file mode 100755 index 00000000..df8b3274 --- /dev/null +++ b/examples/Linux-OpenGL/SimpleVideoFilter/Package.resolved @@ -0,0 +1,34 @@ +{ + "object": { + "pins": [ + { + "package": "CFreeGLUT", + "repositoryURL": "https://github.com/BradLarson/CFreeGLUT.git", + "state": { + "branch": null, + "revision": "efe8d33674300c032662f6031b84c93147b4a8b7", + "version": "1.0.1" + } + }, + { + "package": "COpenGL", + "repositoryURL": "https://github.com/BradLarson/COpenGL.git", + "state": { + "branch": null, + "revision": "328a86b37fcfc177b1b74c987f5f2198731fbdb2", + "version": "1.0.2" + } + }, + { + "package": "CVideo4Linux", + "repositoryURL": "https://github.com/BradLarson/CVideo4Linux.git", + "state": { + "branch": null, + "revision": "9598a1a7ce569119152572644debdca48c2d2a92", + "version": "1.0.2" + } + } + ] + }, + "version": 1 +} diff --git a/examples/Linux-OpenGL/SimpleVideoFilter/Package.swift b/examples/Linux-OpenGL/SimpleVideoFilter/Package.swift new file mode 100755 index 00000000..433fdad4 --- /dev/null +++ b/examples/Linux-OpenGL/SimpleVideoFilter/Package.swift @@ -0,0 +1,16 @@ +// swift-tools-version:4.2 + +import PackageDescription + +let package = Package( + name: "SimpleVideoFilter", + dependencies: [ + .package(path: "../../../../GPUImage2") + ], + targets: [ + .target( + name: "SimpleVideoFilter", + dependencies: ["GPUImage"], + path: "Sources") + ] +) diff --git a/examples/Linux-OpenGL/SimpleVideoFilter/Source/main.swift b/examples/Linux-OpenGL/SimpleVideoFilter/Sources/main.swift similarity index 100% rename from examples/Linux-OpenGL/SimpleVideoFilter/Source/main.swift rename to examples/Linux-OpenGL/SimpleVideoFilter/Sources/main.swift diff --git a/examples/Linux-OpenGL/SimpleVideoFilter/compile.sh b/examples/Linux-OpenGL/SimpleVideoFilter/compile.sh deleted file mode 100755 index 104f9407..00000000 --- a/examples/Linux-OpenGL/SimpleVideoFilter/compile.sh +++ /dev/null @@ -1 +0,0 @@ -swiftc Source/main.swift -o SimpleVideoFilter -I ../../../framework -L ../../../framework -lGPUImage diff --git a/examples/iOS/FilterShowcase/FilterShowcase.xcodeproj/project.pbxproj b/examples/iOS/FilterShowcase/FilterShowcase.xcodeproj/project.pbxproj index 5add9698..ec9e316a 100644 --- a/examples/iOS/FilterShowcase/FilterShowcase.xcodeproj/project.pbxproj +++ b/examples/iOS/FilterShowcase/FilterShowcase.xcodeproj/project.pbxproj @@ -220,6 +220,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -384,6 +385,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -431,6 +433,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; METAL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -450,7 +453,6 @@ PRODUCT_NAME = FilterShowcase; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -469,7 +471,6 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/examples/iOS/FilterShowcase/FilterShowcaseSwift/AppDelegate.swift b/examples/iOS/FilterShowcase/FilterShowcaseSwift/AppDelegate.swift index b0eaff90..d2b4d925 100644 --- a/examples/iOS/FilterShowcase/FilterShowcaseSwift/AppDelegate.swift +++ b/examples/iOS/FilterShowcase/FilterShowcaseSwift/AppDelegate.swift @@ -5,7 +5,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey:Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey:Any]?) -> Bool { return true } } diff --git a/framework/GPUImage.xcodeproj/project.pbxproj b/framework/GPUImage.xcodeproj/project.pbxproj index 45f33459..db8db35c 100755 --- a/framework/GPUImage.xcodeproj/project.pbxproj +++ b/framework/GPUImage.xcodeproj/project.pbxproj @@ -1876,7 +1876,6 @@ PRODUCT_NAME = GPUImage; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1898,7 +1897,6 @@ PRODUCT_NAME = GPUImage; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/framework/LinuxCompilationGenerator.sh b/framework/LinuxCompilationGenerator.sh deleted file mode 100755 index d7821cad..00000000 --- a/framework/LinuxCompilationGenerator.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/swift - -// This generates the compile scripts for the Linux targets -import Foundation - -enum LinuxTarget { - case OpenGL - case RaspberryPi - - init?(_ argument:String) { - switch argument { - case "rpi", "RPi", "RPI": self = .RaspberryPi - case "opengl", "gl", "GL", "OpenGL": self = .OpenGL - default: return nil - } - } - - func compilerFlags() -> String { - switch self { - case .OpenGL: return "-DGL" - case .RaspberryPi: return "-DGLES" - } - } - - func specificFiles() -> [String] { - switch self { - case .OpenGL: return ["Source/Linux/GLUTRenderWindow.swift", "Source/Linux/OpenGLContext.swift", "Source/Linux/V4LCamera.swift"] - case .RaspberryPi: return ["Source/Linux/RPiRenderWindow.swift", "Source/Linux/OpenGLContext-RPi.swift", "Source/Linux/V4LCamera.swift"] - } - } - - func includes() -> [String] { - switch self { - case .OpenGL: return ["./Packages/COpenGL", "./Packages/CFreeGLUT", "./Packages/CVideo4Linux"] - case .RaspberryPi: return ["./Packages/COpenGLES", "./Packages/CVideoCore", "./Packages/CVideo4Linux", "/opt/vc/include/", "/opt/vc/include/interface/vcos/pthreads/", "/opt/vc/include/interface/vmcs_host/linux/"] - } - } - - func linkLocations() -> [String] { - switch self { - case .OpenGL: return ["./"] - case .RaspberryPi: return ["./", "/opt/vc/lib"] - } - } - - func shaderFile() -> String { - switch self { - case .OpenGL: return "./Source/Operations/Shaders/ConvertedShaders_GL.swift" - case .RaspberryPi: return "./Source/Operations/Shaders/ConvertedShaders_GLES.swift" - } - } - -} - -func printWithPrefix(prefix:String, _ arguments:[String]) -> String { - return prefix + arguments.joinWithSeparator(" \(prefix)") -} - -func filenamesAtRelativePath(path:String) -> [String] { - do { - let contents = try NSFileManager.defaultManager().contentsOfDirectoryAtPath(path) - let swiftFiles = contents.filter{$0.hasSuffix(".swift")}.map{"\(path)/\($0)"} - return swiftFiles - } catch { - print("Can't find directory: \(path) with error \(error)") - exit(0) - } -} - -let baseDirectories = ["./Source", "./Source/Operations"] - -// The executable portion of the script - -guard (Process.arguments.count > 1) else { - print("Please specify a valid platform target: [rpi, opengl]") - exit(0) -} - -guard let target = LinuxTarget(Process.arguments[1]) else { - print("Please specify a valid platform target: [rpi, opengl]") - exit(0) -} - -let swiftFiles = baseDirectories.flatMap{filenamesAtRelativePath($0)} + [target.shaderFile()] + target.specificFiles() - -// let operationNames = [target.shaderFile(), "./Source/Operations/SobelEdgeDetection.swift", "./Source/Operations/Pixellate.swift"] - -// The actual lines of the compile script - -let initialV4LSetupLine = "clang -fPIC -c ./Source/Linux/v4lfuncs.c -o v4lfuncs.o\n" - -let moduleGenLine = "swiftc \(target.compilerFlags()) -module-name GPUImage -emit-module -import-objc-header ./Source/Linux/v4lfuncs.h \(printWithPrefix("-L ", target.linkLocations())) \(printWithPrefix("-I ", target.includes())) \(printWithPrefix("", swiftFiles)) \n" - -let libraryGenLine = "swiftc \(target.compilerFlags()) -module-name GPUImage -import-objc-header ./Source/Linux/v4lfuncs.h \(printWithPrefix("-L ", target.linkLocations())) \(printWithPrefix("-I ", target.includes())) \(printWithPrefix("-c ", swiftFiles)) \n" - -let linkerLine = "swiftc \(target.compilerFlags()) -module-name GPUImage -emit-library -import-objc-header ./Source/Linux/v4lfuncs.h \(printWithPrefix("-L ", target.linkLocations())) \(printWithPrefix("-I ", target.includes())) *.o \n" - -let terminalLine = "rm *.o\n" - -let completeScript = initialV4LSetupLine + moduleGenLine + libraryGenLine + linkerLine + terminalLine -print("\(completeScript)") \ No newline at end of file diff --git a/framework/Source/Linux/GLUTRenderWindow.swift b/framework/Source/Linux/GLUTRenderWindow.swift index fefea5a4..65019375 100755 --- a/framework/Source/Linux/GLUTRenderWindow.swift +++ b/framework/Source/Linux/GLUTRenderWindow.swift @@ -14,8 +14,11 @@ public class GLUTRenderWindow: ImageConsumer { public init(width:UInt32, height:UInt32, title:String) { - var localArgc = Process.argc - glutInit(&localArgc, Process.unsafeArgv) +// var localArgc = Process.argc +// glutInit(&localArgc, Process.unsafeArgv) + + var input1:Int32 = 1 + glutInit(&input1, nil) glutInitDisplayMode(UInt32(GLUT_DOUBLE)) glutInitWindowSize(Int32(width), Int32(height)) glutInitWindowPosition(100,100) @@ -28,7 +31,7 @@ public class GLUTRenderWindow: ImageConsumer { // glutReshapeFunc(void (*func)(int width, int height) // Maybe use this to get window reshape events } - public func newFramebufferAvailable(framebuffer:Framebuffer, fromSourceIndex:UInt) { + public func newFramebufferAvailable(_ framebuffer:Framebuffer, fromSourceIndex:UInt) { glBindFramebuffer(GLenum(GL_FRAMEBUFFER), 0) glBindRenderbuffer(GLenum(GL_RENDERBUFFER), 0) @@ -39,12 +42,12 @@ public class GLUTRenderWindow: ImageConsumer { glClearColor(0.0, 0.0, 0.0, 0.0) glClear(GLenum(GL_COLOR_BUFFER_BIT)) - renderQuadWithShader(self.displayShader, vertices:verticallyInvertedImageVertices, inputTextures:[framebuffer.texturePropertiesForTargetOrientation(.Portrait)]) + renderQuadWithShader(self.displayShader, vertices:verticallyInvertedImageVertices, inputTextures:[framebuffer.texturePropertiesForTargetOrientation(.portrait)]) framebuffer.unlock() glutSwapBuffers() } - public func loopWithFunction(idleFunction:() -> ()) { + public func loopWithFunction(_ idleFunction:@escaping () -> ()) { loopFunction = idleFunction glutIdleFunc(glutCallbackFunction) glutMainLoop() diff --git a/framework/Source/Linux/OpenGLContext.swift b/framework/Source/Linux/OpenGLContext.swift index e56337d9..3ca21ae9 100755 --- a/framework/Source/Linux/OpenGLContext.swift +++ b/framework/Source/Linux/OpenGLContext.swift @@ -1,11 +1,17 @@ import COpenGL +import Dispatch public class OpenGLContext: SerialDispatch { lazy var framebufferCache:FramebufferCache = { return FramebufferCache(context:self) }() var shaderCache:[String:ShaderProgram] = [:] - + public let standardImageVBO:GLuint + var textureVBOs:[Rotation:GLuint] = [:] + + public let serialDispatchQueue:DispatchQueue = DispatchQueue(label:"com.sunsetlakesoftware.GPUImage.processingQueue", attributes: []) + public let dispatchQueueKey = DispatchSpecificKey() + lazy var passthroughShader:ShaderProgram = { return crashOnShaderCompileFailure("OpenGLContext"){return try self.programForVertexShader(OneInputVertexShader, fragmentShader:PassthroughFragmentShader)} }() @@ -14,7 +20,11 @@ public class OpenGLContext: SerialDispatch { // MARK: Initialization and teardown init() { - + serialDispatchQueue.setSpecific(key:dispatchQueueKey, value:81) + + standardImageVBO = generateVBO(for:standardImageVertices) + generateTextureVBOs() + glDisable(GLenum(GL_DEPTH_TEST)) glEnable(GLenum(GL_TEXTURE_2D)) } @@ -22,7 +32,7 @@ public class OpenGLContext: SerialDispatch { // MARK: - // MARK: Rendering - func makeCurrentContext() { + public func makeCurrentContext() { } func presentBufferForDisplay() { @@ -49,7 +59,8 @@ public class OpenGLContext: SerialDispatch { lazy var extensionString:String = { return self.runOperationSynchronously{ self.makeCurrentContext() - return String.fromCString(UnsafePointer(glGetString(GLenum(GL_EXTENSIONS))))! + return String(cString:unsafeBitCast(glGetString(GLenum(GL_EXTENSIONS)), to:UnsafePointer.self)) +// return String.fromCString(UnsafePointer(glGetString(GLenum(GL_EXTENSIONS))))! } }() -} \ No newline at end of file +} diff --git a/framework/Source/Linux/V4LSupplement/V4LCamera.swift b/framework/Source/Linux/V4LCamera.swift similarity index 90% rename from framework/Source/Linux/V4LSupplement/V4LCamera.swift rename to framework/Source/Linux/V4LCamera.swift index 0f26146f..5abbbe45 100755 --- a/framework/Source/Linux/V4LSupplement/V4LCamera.swift +++ b/framework/Source/Linux/V4LCamera.swift @@ -1,11 +1,13 @@ -#if GLES - import COpenGLES.gles2 -#else - import COpenGL +#if canImport(COpenGL) +import COpenGL +#endif + +#if canImport(COpenGLES) +import COpenGLES.gles2 #endif -/* import CVideo4Linux +import V4LSupplement import Glibc import Foundation @@ -65,7 +67,7 @@ public class V4LCamera:ImageSource { let startTime = NSDate() - let luminanceFramebuffer = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.Portrait, size:GLSize(size), textureOnly:true) + let luminanceFramebuffer = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.portrait, size:GLSize(size), textureOnly:true) luminanceFramebuffer.lock() glActiveTexture(GLenum(GL_TEXTURE0)) @@ -73,14 +75,14 @@ public class V4LCamera:ImageSource { glTexImage2D(GLenum(GL_TEXTURE_2D), 0, GL_LUMINANCE, GLsizei(round(Double(size.width))), GLsizei(round(Double(size.height))), 0, GLenum(GL_LUMINANCE), GLenum(GL_UNSIGNED_BYTE), buffers[Int(currentBuffer)].start) // YUV 420 chrominance is split into two planes in V4L - let chrominanceFramebuffer1 = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.Portrait, size:GLSize(width:GLint(round(Double(size.width) / 2.0)), height:GLint(round(Double(size.height) / 2.0))), textureOnly:true) + let chrominanceFramebuffer1 = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.portrait, size:GLSize(width:GLint(round(Double(size.width) / 2.0)), height:GLint(round(Double(size.height) / 2.0))), textureOnly:true) chrominanceFramebuffer1.lock() glActiveTexture(GLenum(GL_TEXTURE1)) glBindTexture(GLenum(GL_TEXTURE_2D), chrominanceFramebuffer1.texture) glTexImage2D(GLenum(GL_TEXTURE_2D), 0, GL_LUMINANCE, GLsizei(round(Double(size.width) / 2.0)), GLsizei(round(Double(size.height) / 2.0)), 0, GLenum(GL_LUMINANCE), GLenum(GL_UNSIGNED_BYTE), buffers[Int(currentBuffer)].start + (Int(round(Double(size.width))) * Int(round(Double(size.height))))) - let chrominanceFramebuffer2 = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.Portrait, size:GLSize(width:GLint(round(Double(size.width) / 2.0)), height:GLint(round(Double(size.height) / 2.0))), textureOnly:true) + let chrominanceFramebuffer2 = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.portrait, size:GLSize(width:GLint(round(Double(size.width) / 2.0)), height:GLint(round(Double(size.height) / 2.0))), textureOnly:true) chrominanceFramebuffer2.lock() glActiveTexture(GLenum(GL_TEXTURE2)) @@ -94,7 +96,7 @@ public class V4LCamera:ImageSource { currentBuffer = 0 } - let cameraFramebuffer = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.Portrait, size:luminanceFramebuffer.sizeForTargetOrientation(.Portrait), textureOnly:false) + let cameraFramebuffer = sharedImageProcessingContext.framebufferCache.requestFramebufferWithProperties(orientation:.portrait, size:luminanceFramebuffer.sizeForTargetOrientation(.portrait), textureOnly:false) let conversionMatrix = colorConversionMatrix601FullRangeDefault convertYUVToRGB(shader:self.yuvConversionShader!, luminanceFramebuffer:luminanceFramebuffer, chrominanceFramebuffer:chrominanceFramebuffer1, secondChrominanceFramebuffer:chrominanceFramebuffer2, resultFramebuffer:cameraFramebuffer, colorConversionMatrix:conversionMatrix) @@ -118,8 +120,7 @@ public class V4LCamera:ImageSource { } } - public func transmitPreviousImageToTarget(target:ImageConsumer, atIndex:UInt) { + public func transmitPreviousImage(to target:ImageConsumer, atIndex:UInt) { // Not needed for camera inputs } } -*/ \ No newline at end of file diff --git a/framework/Source/Linux/V4LSupplement/v4lfuncs.h b/framework/Source/Linux/V4LSupplement/include/v4lfuncs.h similarity index 100% rename from framework/Source/Linux/V4LSupplement/v4lfuncs.h rename to framework/Source/Linux/V4LSupplement/include/v4lfuncs.h diff --git a/framework/compile-LinuxGL.sh b/framework/compile-LinuxGL.sh deleted file mode 100644 index 6b88fa3e..00000000 --- a/framework/compile-LinuxGL.sh +++ /dev/null @@ -1,6 +0,0 @@ -clang -fPIC -c ./Source/Linux/v4lfuncs.c -o v4lfuncs.o -swiftc -DGL -module-name GPUImage -emit-module -import-objc-header ./Source/Linux/v4lfuncs.h -L ./ -I ./Packages/COpenGL -I ./Packages/CFreeGLUT -I ./Packages/CVideo4Linux ./Source/BasicOperation.swift ./Source/CameraConversion.swift ./Source/Color.swift ./Source/FillMode.swift ./Source/Framebuffer.swift ./Source/FramebufferCache.swift ./Source/ImageGenerator.swift ./Source/ImageOrientation.swift ./Source/Matrix.swift ./Source/OpenGLContext_Shared.swift ./Source/OpenGLRendering.swift ./Source/OperationGroup.swift ./Source/Pipeline.swift ./Source/Position.swift ./Source/RawDataInput.swift ./Source/RawDataOutput.swift ./Source/SerialDispatch.swift ./Source/ShaderProgram.swift ./Source/ShaderUniformSettings.swift ./Source/Size.swift ./Source/TextureInput.swift ./Source/TextureOutput.swift ./Source/TextureSamplingOperation.swift ./Source/Timestamp.swift ./Source/TwoStageOperation.swift ./Source/Operations/AdaptiveThreshold.swift ./Source/Operations/AddBlend.swift ./Source/Operations/AlphaBlend.swift ./Source/Operations/AmatorkaFilter.swift ./Source/Operations/AverageColorExtractor.swift ./Source/Operations/AverageLuminanceExtractor.swift ./Source/Operations/AverageLuminanceThreshold.swift ./Source/Operations/BilateralBlur.swift ./Source/Operations/BoxBlur.swift ./Source/Operations/BrightnessAdjustment.swift ./Source/Operations/BulgeDistortion.swift ./Source/Operations/CannyEdgeDetection.swift ./Source/Operations/CGAColorspaceFilter.swift ./Source/Operations/ChromaKeyBlend.swift ./Source/Operations/ChromaKeying.swift ./Source/Operations/CircleGenerator.swift ./Source/Operations/ClosingFilter.swift ./Source/Operations/ColorBlend.swift ./Source/Operations/ColorBurnBlend.swift ./Source/Operations/ColorDodgeBlend.swift ./Source/Operations/ColorInversion.swift ./Source/Operations/ColorLocalBinaryPattern.swift ./Source/Operations/ColorMatrixFilter.swift ./Source/Operations/ColourFASTFeatureDetection.swift ./Source/Operations/ContrastAdjustment.swift ./Source/Operations/Convolution3x3.swift ./Source/Operations/Crop.swift ./Source/Operations/CrosshairGenerator.swift ./Source/Operations/Crosshatch.swift ./Source/Operations/DarkenBlend.swift ./Source/Operations/DifferenceBlend.swift ./Source/Operations/Dilation.swift ./Source/Operations/DissolveBlend.swift ./Source/Operations/DivideBlend.swift ./Source/Operations/EmbossFilter.swift ./Source/Operations/Erosion.swift ./Source/Operations/ExclusionBlend.swift ./Source/Operations/ExposureAdjustment.swift ./Source/Operations/FalseColor.swift ./Source/Operations/GammaAdjustment.swift ./Source/Operations/GaussianBlur.swift ./Source/Operations/GlassSphereRefraction.swift ./Source/Operations/Halftone.swift ./Source/Operations/HardLightBlend.swift ./Source/Operations/HarrisCornerDetector.swift ./Source/Operations/Haze.swift ./Source/Operations/HighlightAndShadowTint.swift ./Source/Operations/HighlightsAndShadows.swift ./Source/Operations/HighPassFilter.swift ./Source/Operations/Histogram.swift ./Source/Operations/HistogramDisplay.swift ./Source/Operations/HistogramEqualization.swift ./Source/Operations/HueAdjustment.swift ./Source/Operations/HueBlend.swift ./Source/Operations/ImageBuffer.swift ./Source/Operations/iOSBlur.swift ./Source/Operations/KuwaharaFilter.swift ./Source/Operations/KuwaharaRadius3Filter.swift ./Source/Operations/LanczosResampling.swift ./Source/Operations/Laplacian.swift ./Source/Operations/LevelsAdjustment.swift ./Source/Operations/LightenBlend.swift ./Source/Operations/LinearBurnBlend.swift ./Source/Operations/LineGenerator.swift ./Source/Operations/LocalBinaryPattern.swift ./Source/Operations/LookupFilter.swift ./Source/Operations/LowPassFilter.swift ./Source/Operations/Luminance.swift ./Source/Operations/LuminanceRangeReduction.swift ./Source/Operations/LuminanceThreshold.swift ./Source/Operations/LuminosityBlend.swift ./Source/Operations/MedianFilter.swift ./Source/Operations/MissEtikateFilter.swift ./Source/Operations/MonochromeFilter.swift ./Source/Operations/MotionBlur.swift ./Source/Operations/MotionDetector.swift ./Source/Operations/MultiplyBlend.swift ./Source/Operations/NobleCornerDetector.swift ./Source/Operations/NormalBlend.swift ./Source/Operations/OpacityAdjustment.swift ./Source/Operations/OpeningFilter.swift ./Source/Operations/OverlayBlend.swift ./Source/Operations/PinchDistortion.swift ./Source/Operations/Pixellate.swift ./Source/Operations/PolarPixellate.swift ./Source/Operations/PolkaDot.swift ./Source/Operations/Posterize.swift ./Source/Operations/PrewittEdgeDetection.swift ./Source/Operations/RGBAdjustmentFilter.swift ./Source/Operations/SaturationAdjustment.swift ./Source/Operations/SaturationBlend.swift ./Source/Operations/ScreenBlend.swift ./Source/Operations/SepiaToneFilter.swift ./Source/Operations/Sharpen.swift ./Source/Operations/ShiTomasiFeatureDetector.swift ./Source/Operations/SingleComponentGaussianBlur.swift ./Source/Operations/SketchFilter.swift ./Source/Operations/SmoothToonFilter.swift ./Source/Operations/SobelEdgeDetection.swift ./Source/Operations/SoftElegance.swift ./Source/Operations/SoftLightBlend.swift ./Source/Operations/Solarize.swift ./Source/Operations/SolidColorGenerator.swift ./Source/Operations/SourceOverBlend.swift ./Source/Operations/SphereRefraction.swift ./Source/Operations/StretchDistortion.swift ./Source/Operations/SubtractBlend.swift ./Source/Operations/SwirlDistortion.swift ./Source/Operations/ThresholdSketch.swift ./Source/Operations/ThresholdSobelEdgeDetection.swift ./Source/Operations/TiltShift.swift ./Source/Operations/ToonFilter.swift ./Source/Operations/TransformOperation.swift ./Source/Operations/UnsharpMask.swift ./Source/Operations/Vibrance.swift ./Source/Operations/Vignette.swift ./Source/Operations/WhiteBalance.swift ./Source/Operations/ZoomBlur.swift ./Source/Operations/Shaders/ConvertedShaders_GL.swift Source/Linux/GLUTRenderWindow.swift Source/Linux/OpenGLContext.swift Source/Linux/V4LCamera.swift -swiftc -DGL -module-name GPUImage -import-objc-header ./Source/Linux/v4lfuncs.h -L ./ -I ./Packages/COpenGL -I ./Packages/CFreeGLUT -I ./Packages/CVideo4Linux -c ./Source/BasicOperation.swift -c ./Source/CameraConversion.swift -c ./Source/Color.swift -c ./Source/FillMode.swift -c ./Source/Framebuffer.swift -c ./Source/FramebufferCache.swift -c ./Source/ImageGenerator.swift -c ./Source/ImageOrientation.swift -c ./Source/Matrix.swift -c ./Source/OpenGLContext_Shared.swift -c ./Source/OpenGLRendering.swift -c ./Source/OperationGroup.swift -c ./Source/Pipeline.swift -c ./Source/Position.swift -c ./Source/RawDataInput.swift -c ./Source/RawDataOutput.swift -c ./Source/SerialDispatch.swift -c ./Source/ShaderProgram.swift -c ./Source/ShaderUniformSettings.swift -c ./Source/Size.swift -c ./Source/TextureInput.swift -c ./Source/TextureOutput.swift -c ./Source/TextureSamplingOperation.swift -c ./Source/Timestamp.swift -c ./Source/TwoStageOperation.swift -c ./Source/Operations/AdaptiveThreshold.swift -c ./Source/Operations/AddBlend.swift -c ./Source/Operations/AlphaBlend.swift -c ./Source/Operations/AmatorkaFilter.swift -c ./Source/Operations/AverageColorExtractor.swift -c ./Source/Operations/AverageLuminanceExtractor.swift -c ./Source/Operations/AverageLuminanceThreshold.swift -c ./Source/Operations/BilateralBlur.swift -c ./Source/Operations/BoxBlur.swift -c ./Source/Operations/BrightnessAdjustment.swift -c ./Source/Operations/BulgeDistortion.swift -c ./Source/Operations/CannyEdgeDetection.swift -c ./Source/Operations/CGAColorspaceFilter.swift -c ./Source/Operations/ChromaKeyBlend.swift -c ./Source/Operations/ChromaKeying.swift -c ./Source/Operations/CircleGenerator.swift -c ./Source/Operations/ClosingFilter.swift -c ./Source/Operations/ColorBlend.swift -c ./Source/Operations/ColorBurnBlend.swift -c ./Source/Operations/ColorDodgeBlend.swift -c ./Source/Operations/ColorInversion.swift -c ./Source/Operations/ColorLocalBinaryPattern.swift -c ./Source/Operations/ColorMatrixFilter.swift -c ./Source/Operations/ColourFASTFeatureDetection.swift -c ./Source/Operations/ContrastAdjustment.swift -c ./Source/Operations/Convolution3x3.swift -c ./Source/Operations/Crop.swift -c ./Source/Operations/CrosshairGenerator.swift -c ./Source/Operations/Crosshatch.swift -c ./Source/Operations/DarkenBlend.swift -c ./Source/Operations/DifferenceBlend.swift -c ./Source/Operations/Dilation.swift -c ./Source/Operations/DissolveBlend.swift -c ./Source/Operations/DivideBlend.swift -c ./Source/Operations/EmbossFilter.swift -c ./Source/Operations/Erosion.swift -c ./Source/Operations/ExclusionBlend.swift -c ./Source/Operations/ExposureAdjustment.swift -c ./Source/Operations/FalseColor.swift -c ./Source/Operations/GammaAdjustment.swift -c ./Source/Operations/GaussianBlur.swift -c ./Source/Operations/GlassSphereRefraction.swift -c ./Source/Operations/Halftone.swift -c ./Source/Operations/HardLightBlend.swift -c ./Source/Operations/HarrisCornerDetector.swift -c ./Source/Operations/Haze.swift -c ./Source/Operations/HighlightAndShadowTint.swift -c ./Source/Operations/HighlightsAndShadows.swift -c ./Source/Operations/HighPassFilter.swift -c ./Source/Operations/Histogram.swift -c ./Source/Operations/HistogramDisplay.swift -c ./Source/Operations/HistogramEqualization.swift -c ./Source/Operations/HueAdjustment.swift -c ./Source/Operations/HueBlend.swift -c ./Source/Operations/ImageBuffer.swift -c ./Source/Operations/iOSBlur.swift -c ./Source/Operations/KuwaharaFilter.swift -c ./Source/Operations/KuwaharaRadius3Filter.swift -c ./Source/Operations/LanczosResampling.swift -c ./Source/Operations/Laplacian.swift -c ./Source/Operations/LevelsAdjustment.swift -c ./Source/Operations/LightenBlend.swift -c ./Source/Operations/LinearBurnBlend.swift -c ./Source/Operations/LineGenerator.swift -c ./Source/Operations/LocalBinaryPattern.swift -c ./Source/Operations/LookupFilter.swift -c ./Source/Operations/LowPassFilter.swift -c ./Source/Operations/Luminance.swift -c ./Source/Operations/LuminanceRangeReduction.swift -c ./Source/Operations/LuminanceThreshold.swift -c ./Source/Operations/LuminosityBlend.swift -c ./Source/Operations/MedianFilter.swift -c ./Source/Operations/MissEtikateFilter.swift -c ./Source/Operations/MonochromeFilter.swift -c ./Source/Operations/MotionBlur.swift -c ./Source/Operations/MotionDetector.swift -c ./Source/Operations/MultiplyBlend.swift -c ./Source/Operations/NobleCornerDetector.swift -c ./Source/Operations/NormalBlend.swift -c ./Source/Operations/OpacityAdjustment.swift -c ./Source/Operations/OpeningFilter.swift -c ./Source/Operations/OverlayBlend.swift -c ./Source/Operations/PinchDistortion.swift -c ./Source/Operations/Pixellate.swift -c ./Source/Operations/PolarPixellate.swift -c ./Source/Operations/PolkaDot.swift -c ./Source/Operations/Posterize.swift -c ./Source/Operations/PrewittEdgeDetection.swift -c ./Source/Operations/RGBAdjustmentFilter.swift -c ./Source/Operations/SaturationAdjustment.swift -c ./Source/Operations/SaturationBlend.swift -c ./Source/Operations/ScreenBlend.swift -c ./Source/Operations/SepiaToneFilter.swift -c ./Source/Operations/Sharpen.swift -c ./Source/Operations/ShiTomasiFeatureDetector.swift -c ./Source/Operations/SingleComponentGaussianBlur.swift -c ./Source/Operations/SketchFilter.swift -c ./Source/Operations/SmoothToonFilter.swift -c ./Source/Operations/SobelEdgeDetection.swift -c ./Source/Operations/SoftElegance.swift -c ./Source/Operations/SoftLightBlend.swift -c ./Source/Operations/Solarize.swift -c ./Source/Operations/SolidColorGenerator.swift -c ./Source/Operations/SourceOverBlend.swift -c ./Source/Operations/SphereRefraction.swift -c ./Source/Operations/StretchDistortion.swift -c ./Source/Operations/SubtractBlend.swift -c ./Source/Operations/SwirlDistortion.swift -c ./Source/Operations/ThresholdSketch.swift -c ./Source/Operations/ThresholdSobelEdgeDetection.swift -c ./Source/Operations/TiltShift.swift -c ./Source/Operations/ToonFilter.swift -c ./Source/Operations/TransformOperation.swift -c ./Source/Operations/UnsharpMask.swift -c ./Source/Operations/Vibrance.swift -c ./Source/Operations/Vignette.swift -c ./Source/Operations/WhiteBalance.swift -c ./Source/Operations/ZoomBlur.swift -c ./Source/Operations/Shaders/ConvertedShaders_GL.swift -c Source/Linux/GLUTRenderWindow.swift -c Source/Linux/OpenGLContext.swift -c Source/Linux/V4LCamera.swift -swiftc -DGL -module-name GPUImage -emit-library -import-objc-header ./Source/Linux/v4lfuncs.h -L ./ -I ./Packages/COpenGL -I ./Packages/CFreeGLUT -I ./Packages/CVideo4Linux *.o -rm *.o - diff --git a/framework/compile-LinuxRPi.sh b/framework/compile-LinuxRPi.sh deleted file mode 100644 index 156360d2..00000000 --- a/framework/compile-LinuxRPi.sh +++ /dev/null @@ -1,6 +0,0 @@ -clang -fPIC -c ./Source/Linux/v4lfuncs.c -o v4lfuncs.o -swiftc -DGLES -module-name GPUImage -emit-module -import-objc-header ./Source/Linux/v4lfuncs.h -L ./ -L /opt/vc/lib -I ./Packages/COpenGLES -I ./Packages/CVideoCore -I ./Packages/CVideo4Linux -I /opt/vc/include/ -I /opt/vc/include/interface/vcos/pthreads/ -I /opt/vc/include/interface/vmcs_host/linux/ ./Source/BasicOperation.swift ./Source/CameraConversion.swift ./Source/Color.swift ./Source/FillMode.swift ./Source/Framebuffer.swift ./Source/FramebufferCache.swift ./Source/ImageGenerator.swift ./Source/ImageOrientation.swift ./Source/Matrix.swift ./Source/OpenGLContext_Shared.swift ./Source/OpenGLRendering.swift ./Source/OperationGroup.swift ./Source/Pipeline.swift ./Source/Position.swift ./Source/RawDataInput.swift ./Source/RawDataOutput.swift ./Source/SerialDispatch.swift ./Source/ShaderProgram.swift ./Source/ShaderUniformSettings.swift ./Source/Size.swift ./Source/TextureInput.swift ./Source/TextureOutput.swift ./Source/TextureSamplingOperation.swift ./Source/Timestamp.swift ./Source/TwoStageOperation.swift ./Source/Operations/AdaptiveThreshold.swift ./Source/Operations/AddBlend.swift ./Source/Operations/AlphaBlend.swift ./Source/Operations/AmatorkaFilter.swift ./Source/Operations/AverageColorExtractor.swift ./Source/Operations/AverageLuminanceExtractor.swift ./Source/Operations/AverageLuminanceThreshold.swift ./Source/Operations/BilateralBlur.swift ./Source/Operations/BoxBlur.swift ./Source/Operations/BrightnessAdjustment.swift ./Source/Operations/BulgeDistortion.swift ./Source/Operations/CannyEdgeDetection.swift ./Source/Operations/CGAColorspaceFilter.swift ./Source/Operations/ChromaKeyBlend.swift ./Source/Operations/ChromaKeying.swift ./Source/Operations/CircleGenerator.swift ./Source/Operations/ClosingFilter.swift ./Source/Operations/ColorBlend.swift ./Source/Operations/ColorBurnBlend.swift ./Source/Operations/ColorDodgeBlend.swift ./Source/Operations/ColorInversion.swift ./Source/Operations/ColorLocalBinaryPattern.swift ./Source/Operations/ColorMatrixFilter.swift ./Source/Operations/ColourFASTFeatureDetection.swift ./Source/Operations/ContrastAdjustment.swift ./Source/Operations/Convolution3x3.swift ./Source/Operations/Crop.swift ./Source/Operations/CrosshairGenerator.swift ./Source/Operations/Crosshatch.swift ./Source/Operations/DarkenBlend.swift ./Source/Operations/DifferenceBlend.swift ./Source/Operations/Dilation.swift ./Source/Operations/DissolveBlend.swift ./Source/Operations/DivideBlend.swift ./Source/Operations/EmbossFilter.swift ./Source/Operations/Erosion.swift ./Source/Operations/ExclusionBlend.swift ./Source/Operations/ExposureAdjustment.swift ./Source/Operations/FalseColor.swift ./Source/Operations/GammaAdjustment.swift ./Source/Operations/GaussianBlur.swift ./Source/Operations/GlassSphereRefraction.swift ./Source/Operations/Halftone.swift ./Source/Operations/HardLightBlend.swift ./Source/Operations/HarrisCornerDetector.swift ./Source/Operations/Haze.swift ./Source/Operations/HighlightAndShadowTint.swift ./Source/Operations/HighlightsAndShadows.swift ./Source/Operations/HighPassFilter.swift ./Source/Operations/Histogram.swift ./Source/Operations/HistogramDisplay.swift ./Source/Operations/HistogramEqualization.swift ./Source/Operations/HueAdjustment.swift ./Source/Operations/HueBlend.swift ./Source/Operations/ImageBuffer.swift ./Source/Operations/iOSBlur.swift ./Source/Operations/KuwaharaFilter.swift ./Source/Operations/KuwaharaRadius3Filter.swift ./Source/Operations/LanczosResampling.swift ./Source/Operations/Laplacian.swift ./Source/Operations/LevelsAdjustment.swift ./Source/Operations/LightenBlend.swift ./Source/Operations/LinearBurnBlend.swift ./Source/Operations/LineGenerator.swift ./Source/Operations/LocalBinaryPattern.swift ./Source/Operations/LookupFilter.swift ./Source/Operations/LowPassFilter.swift ./Source/Operations/Luminance.swift ./Source/Operations/LuminanceRangeReduction.swift ./Source/Operations/LuminanceThreshold.swift ./Source/Operations/LuminosityBlend.swift ./Source/Operations/MedianFilter.swift ./Source/Operations/MissEtikateFilter.swift ./Source/Operations/MonochromeFilter.swift ./Source/Operations/MotionBlur.swift ./Source/Operations/MotionDetector.swift ./Source/Operations/MultiplyBlend.swift ./Source/Operations/NobleCornerDetector.swift ./Source/Operations/NormalBlend.swift ./Source/Operations/OpacityAdjustment.swift ./Source/Operations/OpeningFilter.swift ./Source/Operations/OverlayBlend.swift ./Source/Operations/PinchDistortion.swift ./Source/Operations/Pixellate.swift ./Source/Operations/PolarPixellate.swift ./Source/Operations/PolkaDot.swift ./Source/Operations/Posterize.swift ./Source/Operations/PrewittEdgeDetection.swift ./Source/Operations/RGBAdjustmentFilter.swift ./Source/Operations/SaturationAdjustment.swift ./Source/Operations/SaturationBlend.swift ./Source/Operations/ScreenBlend.swift ./Source/Operations/SepiaToneFilter.swift ./Source/Operations/Sharpen.swift ./Source/Operations/ShiTomasiFeatureDetector.swift ./Source/Operations/SingleComponentGaussianBlur.swift ./Source/Operations/SketchFilter.swift ./Source/Operations/SmoothToonFilter.swift ./Source/Operations/SobelEdgeDetection.swift ./Source/Operations/SoftElegance.swift ./Source/Operations/SoftLightBlend.swift ./Source/Operations/Solarize.swift ./Source/Operations/SolidColorGenerator.swift ./Source/Operations/SourceOverBlend.swift ./Source/Operations/SphereRefraction.swift ./Source/Operations/StretchDistortion.swift ./Source/Operations/SubtractBlend.swift ./Source/Operations/SwirlDistortion.swift ./Source/Operations/ThresholdSketch.swift ./Source/Operations/ThresholdSobelEdgeDetection.swift ./Source/Operations/TiltShift.swift ./Source/Operations/ToonFilter.swift ./Source/Operations/TransformOperation.swift ./Source/Operations/UnsharpMask.swift ./Source/Operations/Vibrance.swift ./Source/Operations/Vignette.swift ./Source/Operations/WhiteBalance.swift ./Source/Operations/ZoomBlur.swift ./Source/Operations/Shaders/ConvertedShaders_GLES.swift Source/Linux/RPiRenderWindow.swift Source/Linux/OpenGLContext-RPi.swift Source/Linux/V4LCamera.swift -swiftc -DGLES -module-name GPUImage -import-objc-header ./Source/Linux/v4lfuncs.h -L ./ -L /opt/vc/lib -I ./Packages/COpenGLES -I ./Packages/CVideoCore -I ./Packages/CVideo4Linux -I /opt/vc/include/ -I /opt/vc/include/interface/vcos/pthreads/ -I /opt/vc/include/interface/vmcs_host/linux/ -c ./Source/BasicOperation.swift -c ./Source/CameraConversion.swift -c ./Source/Color.swift -c ./Source/FillMode.swift -c ./Source/Framebuffer.swift -c ./Source/FramebufferCache.swift -c ./Source/ImageGenerator.swift -c ./Source/ImageOrientation.swift -c ./Source/Matrix.swift -c ./Source/OpenGLContext_Shared.swift -c ./Source/OpenGLRendering.swift -c ./Source/OperationGroup.swift -c ./Source/Pipeline.swift -c ./Source/Position.swift -c ./Source/RawDataInput.swift -c ./Source/RawDataOutput.swift -c ./Source/SerialDispatch.swift -c ./Source/ShaderProgram.swift -c ./Source/ShaderUniformSettings.swift -c ./Source/Size.swift -c ./Source/TextureInput.swift -c ./Source/TextureOutput.swift -c ./Source/TextureSamplingOperation.swift -c ./Source/Timestamp.swift -c ./Source/TwoStageOperation.swift -c ./Source/Operations/AdaptiveThreshold.swift -c ./Source/Operations/AddBlend.swift -c ./Source/Operations/AlphaBlend.swift -c ./Source/Operations/AmatorkaFilter.swift -c ./Source/Operations/AverageColorExtractor.swift -c ./Source/Operations/AverageLuminanceExtractor.swift -c ./Source/Operations/AverageLuminanceThreshold.swift -c ./Source/Operations/BilateralBlur.swift -c ./Source/Operations/BoxBlur.swift -c ./Source/Operations/BrightnessAdjustment.swift -c ./Source/Operations/BulgeDistortion.swift -c ./Source/Operations/CannyEdgeDetection.swift -c ./Source/Operations/CGAColorspaceFilter.swift -c ./Source/Operations/ChromaKeyBlend.swift -c ./Source/Operations/ChromaKeying.swift -c ./Source/Operations/CircleGenerator.swift -c ./Source/Operations/ClosingFilter.swift -c ./Source/Operations/ColorBlend.swift -c ./Source/Operations/ColorBurnBlend.swift -c ./Source/Operations/ColorDodgeBlend.swift -c ./Source/Operations/ColorInversion.swift -c ./Source/Operations/ColorLocalBinaryPattern.swift -c ./Source/Operations/ColorMatrixFilter.swift -c ./Source/Operations/ColourFASTFeatureDetection.swift -c ./Source/Operations/ContrastAdjustment.swift -c ./Source/Operations/Convolution3x3.swift -c ./Source/Operations/Crop.swift -c ./Source/Operations/CrosshairGenerator.swift -c ./Source/Operations/Crosshatch.swift -c ./Source/Operations/DarkenBlend.swift -c ./Source/Operations/DifferenceBlend.swift -c ./Source/Operations/Dilation.swift -c ./Source/Operations/DissolveBlend.swift -c ./Source/Operations/DivideBlend.swift -c ./Source/Operations/EmbossFilter.swift -c ./Source/Operations/Erosion.swift -c ./Source/Operations/ExclusionBlend.swift -c ./Source/Operations/ExposureAdjustment.swift -c ./Source/Operations/FalseColor.swift -c ./Source/Operations/GammaAdjustment.swift -c ./Source/Operations/GaussianBlur.swift -c ./Source/Operations/GlassSphereRefraction.swift -c ./Source/Operations/Halftone.swift -c ./Source/Operations/HardLightBlend.swift -c ./Source/Operations/HarrisCornerDetector.swift -c ./Source/Operations/Haze.swift -c ./Source/Operations/HighlightAndShadowTint.swift -c ./Source/Operations/HighlightsAndShadows.swift -c ./Source/Operations/HighPassFilter.swift -c ./Source/Operations/Histogram.swift -c ./Source/Operations/HistogramDisplay.swift -c ./Source/Operations/HistogramEqualization.swift -c ./Source/Operations/HueAdjustment.swift -c ./Source/Operations/HueBlend.swift -c ./Source/Operations/ImageBuffer.swift -c ./Source/Operations/iOSBlur.swift -c ./Source/Operations/KuwaharaFilter.swift -c ./Source/Operations/KuwaharaRadius3Filter.swift -c ./Source/Operations/LanczosResampling.swift -c ./Source/Operations/Laplacian.swift -c ./Source/Operations/LevelsAdjustment.swift -c ./Source/Operations/LightenBlend.swift -c ./Source/Operations/LinearBurnBlend.swift -c ./Source/Operations/LineGenerator.swift -c ./Source/Operations/LocalBinaryPattern.swift -c ./Source/Operations/LookupFilter.swift -c ./Source/Operations/LowPassFilter.swift -c ./Source/Operations/Luminance.swift -c ./Source/Operations/LuminanceRangeReduction.swift -c ./Source/Operations/LuminanceThreshold.swift -c ./Source/Operations/LuminosityBlend.swift -c ./Source/Operations/MedianFilter.swift -c ./Source/Operations/MissEtikateFilter.swift -c ./Source/Operations/MonochromeFilter.swift -c ./Source/Operations/MotionBlur.swift -c ./Source/Operations/MotionDetector.swift -c ./Source/Operations/MultiplyBlend.swift -c ./Source/Operations/NobleCornerDetector.swift -c ./Source/Operations/NormalBlend.swift -c ./Source/Operations/OpacityAdjustment.swift -c ./Source/Operations/OpeningFilter.swift -c ./Source/Operations/OverlayBlend.swift -c ./Source/Operations/PinchDistortion.swift -c ./Source/Operations/Pixellate.swift -c ./Source/Operations/PolarPixellate.swift -c ./Source/Operations/PolkaDot.swift -c ./Source/Operations/Posterize.swift -c ./Source/Operations/PrewittEdgeDetection.swift -c ./Source/Operations/RGBAdjustmentFilter.swift -c ./Source/Operations/SaturationAdjustment.swift -c ./Source/Operations/SaturationBlend.swift -c ./Source/Operations/ScreenBlend.swift -c ./Source/Operations/SepiaToneFilter.swift -c ./Source/Operations/Sharpen.swift -c ./Source/Operations/ShiTomasiFeatureDetector.swift -c ./Source/Operations/SingleComponentGaussianBlur.swift -c ./Source/Operations/SketchFilter.swift -c ./Source/Operations/SmoothToonFilter.swift -c ./Source/Operations/SobelEdgeDetection.swift -c ./Source/Operations/SoftElegance.swift -c ./Source/Operations/SoftLightBlend.swift -c ./Source/Operations/Solarize.swift -c ./Source/Operations/SolidColorGenerator.swift -c ./Source/Operations/SourceOverBlend.swift -c ./Source/Operations/SphereRefraction.swift -c ./Source/Operations/StretchDistortion.swift -c ./Source/Operations/SubtractBlend.swift -c ./Source/Operations/SwirlDistortion.swift -c ./Source/Operations/ThresholdSketch.swift -c ./Source/Operations/ThresholdSobelEdgeDetection.swift -c ./Source/Operations/TiltShift.swift -c ./Source/Operations/ToonFilter.swift -c ./Source/Operations/TransformOperation.swift -c ./Source/Operations/UnsharpMask.swift -c ./Source/Operations/Vibrance.swift -c ./Source/Operations/Vignette.swift -c ./Source/Operations/WhiteBalance.swift -c ./Source/Operations/ZoomBlur.swift -c ./Source/Operations/Shaders/ConvertedShaders_GLES.swift -c Source/Linux/RPiRenderWindow.swift -c Source/Linux/OpenGLContext-RPi.swift -c Source/Linux/V4LCamera.swift -swiftc -DGLES -module-name GPUImage -emit-library -import-objc-header ./Source/Linux/v4lfuncs.h -L ./ -L /opt/vc/lib -I ./Packages/COpenGLES -I ./Packages/CVideoCore -I ./Packages/CVideo4Linux -I /opt/vc/include/ -I /opt/vc/include/interface/vcos/pthreads/ -I /opt/vc/include/interface/vmcs_host/linux/ *.o -rm *.o -