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
0 parents
commit 2257aff
Showing
487 changed files
with
24,039 additions
and
0 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,25 @@ | ||
# Exclude the build directory | ||
build/* | ||
examples/FilterShowcase/build* | ||
|
||
# Exclude temp nibs and swap files | ||
*~.nib | ||
*.swp | ||
|
||
# Exclude OS X folder attributes | ||
.DS_Store | ||
.svn | ||
|
||
# Exclude user-specific XCode 3 and 4 files | ||
*.mode1 | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.perspective | ||
*.perspectivev3 | ||
*.pbxuser | ||
*.xcworkspace | ||
xcuserdata | ||
|
||
# Documentation | ||
documentation/* | ||
|
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,9 @@ | ||
Copyright (c) 2015, Brad Larson. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Large diffs are not rendered by default.
Oops, something went wrong.
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,10 @@ | ||
import GPUImage | ||
|
||
let camera = V4LCamera(size:Size(width:1280.0, height:720.0)) | ||
let renderWindow = GLUTRenderWindow(width:1280, height:720, title:"Simple Video Filter") | ||
let edgeDetection = SobelEdgeDetection() | ||
|
||
camera --> edgeDetection --> renderWindow | ||
|
||
camera.startCapture() | ||
renderWindow.loopWithFunction(camera.grabFrame) |
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 @@ | ||
swiftc Source/main.swift -o SimpleVideoFilter -I ../../../framework -L ../../../framework -lGPUImage |
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,14 @@ | ||
import GPUImage | ||
|
||
let camera = V4LCamera(size:Size(width:1280.0, height:720.0)) | ||
let renderWindow = RPiRenderWindow(width:1280, height:720) | ||
let edgeDetection = SobelEdgeDetection() | ||
|
||
camera --> edgeDetection --> renderWindow | ||
|
||
var terminate:Int = 0 | ||
|
||
camera.startCapture() | ||
while (terminate == 0) { | ||
camera.grabFrame() | ||
} |
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 @@ | ||
swiftc Source/main.swift -o SimpleVideoFilter -I ../../../framework -L ../../../framework -lGPUImage |
423 changes: 423 additions & 0 deletions
423
examples/Mac/FilterShowcase/FilterShowcase.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
examples/Mac/FilterShowcase/FilterShowcase/AppDelegate.swift
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,15 @@ | ||
import Cocoa | ||
|
||
@NSApplicationMain | ||
class AppDelegate: NSObject, NSApplicationDelegate { | ||
|
||
@IBOutlet weak var window: NSWindow! | ||
|
||
var windowController:FilterShowcaseWindowController? | ||
|
||
func applicationDidFinishLaunching(aNotification: NSNotification) { | ||
self.windowController = FilterShowcaseWindowController(windowNibName:"FilterShowcaseWindowController") | ||
self.windowController?.showWindow(self) | ||
} | ||
} | ||
|
667 changes: 667 additions & 0 deletions
667
examples/Mac/FilterShowcase/FilterShowcase/Base.lproj/MainMenu.xib
Large diffs are not rendered by default.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
examples/Mac/FilterShowcase/FilterShowcase/FilterOperationTypes.swift
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,60 @@ | ||
import Foundation | ||
import GPUImage | ||
|
||
enum FilterSliderSetting { | ||
case Disabled | ||
case Enabled(minimumValue:Float, maximumValue:Float, initialValue:Float) | ||
} | ||
|
||
typealias FilterSetupFunction = (camera:Camera, filter:ImageProcessingOperation, outputView:RenderView) -> ImageSource? | ||
|
||
enum FilterOperationType { | ||
case SingleInput | ||
case Blend | ||
case Custom(filterSetupFunction:FilterSetupFunction) | ||
} | ||
|
||
protocol FilterOperationInterface { | ||
var filter: ImageProcessingOperation { get } | ||
var secondInput:ImageSource? { get } | ||
var listName: String { get } | ||
var titleName: String { get } | ||
var sliderConfiguration: FilterSliderSetting { get } | ||
var filterOperationType: FilterOperationType { get } | ||
|
||
func configureCustomFilter(secondInput:ImageSource?) | ||
func updateBasedOnSliderValue(sliderValue:Float) | ||
} | ||
|
||
class FilterOperation<FilterClass: ImageProcessingOperation>: FilterOperationInterface { | ||
lazy var internalFilter:FilterClass = { | ||
return self.filterCreationFunction() | ||
}() | ||
let filterCreationFunction:() -> FilterClass | ||
var secondInput:ImageSource? | ||
let listName:String | ||
let titleName:String | ||
let sliderConfiguration:FilterSliderSetting | ||
let filterOperationType:FilterOperationType | ||
let sliderUpdateCallback: ((filter:FilterClass, sliderValue:Float) -> ())? | ||
init(filter:() -> FilterClass, listName: String, titleName: String, sliderConfiguration: FilterSliderSetting, sliderUpdateCallback:((filter:FilterClass, sliderValue:Float) -> ())?, filterOperationType: FilterOperationType) { | ||
self.listName = listName | ||
self.titleName = titleName | ||
self.sliderConfiguration = sliderConfiguration | ||
self.filterOperationType = filterOperationType | ||
self.sliderUpdateCallback = sliderUpdateCallback | ||
self.filterCreationFunction = filter | ||
} | ||
|
||
var filter: ImageProcessingOperation { | ||
return internalFilter | ||
} | ||
|
||
func configureCustomFilter(secondInput:ImageSource?) { | ||
self.secondInput = secondInput | ||
} | ||
|
||
func updateBasedOnSliderValue(sliderValue:Float) { | ||
sliderUpdateCallback?(filter:internalFilter, sliderValue:sliderValue) | ||
} | ||
} |
Oops, something went wrong.