Skip to content

Commit

Permalink
Merge branch 'master' into swift3
Browse files Browse the repository at this point in the history
# Conflicts:
#	framework/Source/Mac/Camera.swift
#	framework/Source/iOS/Camera.swift
  • Loading branch information
BradLarson committed Sep 8, 2016
2 parents 668dbd9 + fa7ee67 commit 494b28a
Show file tree
Hide file tree
Showing 106 changed files with 1,289 additions and 1,149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Sunset Lake Software LLC";
TargetAttributes = {
BC1E133A1C9F82B4008F844F = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -381,6 +382,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.FilterShowcase;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -393,6 +395,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sunsetlakesoftware.FilterShowcase;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

var windowController:FilterShowcaseWindowController?

func applicationDidFinishLaunching(aNotification: NSNotification) {
func applicationDidFinishLaunching(_ aNotification: Notification) {
self.windowController = FilterShowcaseWindowController(windowNibName:"FilterShowcaseWindowController")
self.windowController?.showWindow(self)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import Foundation
import GPUImage

enum FilterSliderSetting {
case Disabled
case Enabled(minimumValue:Float, maximumValue:Float, initialValue:Float)
case disabled
case enabled(minimumValue:Float, maximumValue:Float, initialValue:Float)
}

typealias FilterSetupFunction = (camera:Camera, filter:ImageProcessingOperation, outputView:RenderView) -> ImageSource?
typealias FilterSetupFunction = (Camera, ImageProcessingOperation, RenderView) -> ImageSource?

enum FilterOperationType {
case SingleInput
case Blend
case Custom(filterSetupFunction:FilterSetupFunction)
case singleInput
case blend
case custom(filterSetupFunction:FilterSetupFunction)
}

protocol FilterOperationInterface {
Expand All @@ -22,8 +22,8 @@ protocol FilterOperationInterface {
var sliderConfiguration: FilterSliderSetting { get }
var filterOperationType: FilterOperationType { get }

func configureCustomFilter(secondInput:ImageSource?)
func updateBasedOnSliderValue(sliderValue:Float)
func configureCustomFilter(_ secondInput:ImageSource?)
func updateBasedOnSliderValue(_ sliderValue:Float)
}

class FilterOperation<FilterClass: ImageProcessingOperation>: FilterOperationInterface {
Expand All @@ -36,8 +36,8 @@ class FilterOperation<FilterClass: ImageProcessingOperation>: FilterOperationInt
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) {
let sliderUpdateCallback: ((FilterClass, Float) -> ())?
init(filter:@escaping () -> FilterClass, listName: String, titleName: String, sliderConfiguration: FilterSliderSetting, sliderUpdateCallback:((FilterClass, Float) -> ())?, filterOperationType: FilterOperationType) {
self.listName = listName
self.titleName = titleName
self.sliderConfiguration = sliderConfiguration
Expand All @@ -50,11 +50,11 @@ class FilterOperation<FilterClass: ImageProcessingOperation>: FilterOperationInt
return internalFilter
}

func configureCustomFilter(secondInput:ImageSource?) {
func configureCustomFilter(_ secondInput:ImageSource?) {
self.secondInput = secondInput
}

func updateBasedOnSliderValue(sliderValue:Float) {
sliderUpdateCallback?(filter:internalFilter, sliderValue:sliderValue)
func updateBasedOnSliderValue(_ sliderValue:Float) {
sliderUpdateCallback?(internalFilter, sliderValue)
}
}
}
Loading

0 comments on commit 494b28a

Please sign in to comment.