Skip to content

Commit

Permalink
Including additional files left out of previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLarson committed Jun 12, 2019
1 parent 7985645 commit 9ea12d7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 174 deletions.
34 changes: 25 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,49 @@ let platformTargets: [Target] = [
name: "GPUImage",
path: "framework/Source",
exclude: platformExcludes)]
let platformProducts: [Product] = [
.library(
name: "GPUImage",
targets: ["GPUImage"]),
]
#elseif os(Linux)
// TODO: Add back in RPi support
// TODO: Move the remote system library packages into this project
let platformDependencies: [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 = ["Apple", "Operations/Shaders", "Linux/RPiRenderWindow.swift", "Linux/OpenGLContext-RPi.swift", "Linux/V4LSupplement"]
let platformExcludes = ["Apple", "Operations/Shaders", "Linux/RPiRenderWindow.swift", "Linux/OpenGLContext-RPi.swift", "Linux/V4LSupplement", "Linux/V4LCamera"]
let platformTargets: [Target] = [
.target(
name: "lodepng",
path: "framework/Packages/lodepng"),
.target(
name: "GPUImage",
dependencies: ["lodepng"],
path: "framework/Source",
exclude: platformExcludes),
.target(
name: "V4LSupplement",
path: "framework/Source/Linux/V4LSupplement"),
.target(
name: "GPUImageV4LCamera",
dependencies: ["GPUImage", "V4LSupplement"],
path: "framework/Source/Linux/V4LCamera")]
let platformProducts: [Product] = [
.library(
name: "GPUImage",
dependencies: ["V4LSupplement"],
path: "framework/Source",
exclude: platformExcludes)]
targets: ["GPUImage"]),
.library(
name: "GPUImageV4LCamera",
targets: ["GPUImageV4LCamera"]),
]
#endif


let package = Package(
name: "GPUImage",
products: [
.library(
name: "GPUImage",
targets: ["GPUImage"]),
],
products: platformProducts,
dependencies: platformDependencies,
targets: platformTargets,
swiftLanguageVersions: [.v4]
Expand Down
34 changes: 0 additions & 34 deletions examples/Linux-OpenGL/SimpleVideoFilter/Package.resolved

This file was deleted.

2 changes: 1 addition & 1 deletion examples/Linux-OpenGL/SimpleVideoFilter/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
targets: [
.target(
name: "SimpleVideoFilter",
dependencies: ["GPUImage"],
dependencies: ["GPUImage", "GPUImageV4LCamera"],
path: "Sources")
]
)
3 changes: 2 additions & 1 deletion examples/Linux-OpenGL/SimpleVideoFilter/Sources/main.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import GPUImage
import GPUImageV4LCamera

// For now, GLUT initialization is done in the render window, so that must come first in sequence
let renderWindow = GLUTRenderWindow(width:1280, height:720, title:"Simple Video Filter")
Expand All @@ -8,4 +9,4 @@ let edgeDetection = SobelEdgeDetection()
camera --> edgeDetection --> renderWindow

camera.startCapture()
renderWindow.loopWithFunction(camera.grabFrame)
renderWindow.loopWithFunction(camera.grabFrame)
4 changes: 2 additions & 2 deletions framework/Source/Framebuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ public class Framebuffer {
}
}

func sizeForTargetOrientation(_ targetOrientation:ImageOrientation) -> GLSize {
public func sizeForTargetOrientation(_ targetOrientation:ImageOrientation) -> GLSize {
if self.orientation.rotationNeededForOrientation(targetOrientation).flipsDimensions() {
return GLSize(width:size.height, height:size.width)
} else {
return size
}
}

func aspectRatioForRotation(_ rotation:Rotation) -> Float {
public func aspectRatioForRotation(_ rotation:Rotation) -> Float {
if rotation.flipsDimensions() {
return Float(size.width) / Float(size.height)
} else {
Expand Down
2 changes: 1 addition & 1 deletion framework/Source/Linux/OpenGLContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import COpenGL
import Dispatch

public class OpenGLContext: SerialDispatch {
lazy var framebufferCache:FramebufferCache = {
public lazy var framebufferCache:FramebufferCache = {
return FramebufferCache(context:self)
}()
var shaderCache:[String:ShaderProgram] = [:]
Expand Down
126 changes: 0 additions & 126 deletions framework/Source/Linux/V4LCamera.swift

This file was deleted.

0 comments on commit 9ea12d7

Please sign in to comment.