forked from GottaYotta/GPUImage2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some API renaming to bring things in line with Swift 3.
- Loading branch information
1 parent
f478f48
commit f9fc518
Showing
61 changed files
with
155 additions
and
157 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
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
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
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
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
public struct Color { | ||
public let red:Float | ||
public let green:Float | ||
public let blue:Float | ||
public let alpha:Float | ||
public let redComponent:Float | ||
public let greenComponent:Float | ||
public let blueComponent:Float | ||
public let alphaComponent:Float | ||
|
||
public init(red:Float, green:Float, blue:Float, alpha:Float = 1.0) { | ||
self.red = red | ||
self.green = green | ||
self.blue = blue | ||
self.alpha = alpha | ||
self.redComponent = red | ||
self.greenComponent = green | ||
self.blueComponent = blue | ||
self.alphaComponent = alpha | ||
} | ||
|
||
public static let Black = Color(red:0.0, green:0.0, blue:0.0, alpha:1.0) | ||
public static let White = Color(red:1.0, green:1.0, blue:1.0, alpha:1.0) | ||
public static let Red = Color(red:1.0, green:0.0, blue:0.0, alpha:1.0) | ||
public static let Green = Color(red:0.0, green:1.0, blue:0.0, alpha:1.0) | ||
public static let Blue = Color(red:0.0, green:0.0, blue:1.0, alpha:1.0) | ||
public static let Transparent = Color(red:0.0, green:0.0, blue:0.0, alpha:0.0) | ||
} | ||
public static let black = Color(red:0.0, green:0.0, blue:0.0, alpha:1.0) | ||
public static let white = Color(red:1.0, green:1.0, blue:1.0, alpha:1.0) | ||
public static let red = Color(red:1.0, green:0.0, blue:0.0, alpha:1.0) | ||
public static let green = Color(red:0.0, green:1.0, blue:0.0, alpha:1.0) | ||
public static let blue = Color(red:0.0, green:0.0, blue:1.0, alpha:1.0) | ||
public static let transparent = Color(red:0.0, green:0.0, blue:0.0, alpha:0.0) | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
public class BulgeDistortion: BasicOperation { | ||
public var radius:Float = 0.25 { didSet { uniformSettings["radius"] = radius } } | ||
public var scale:Float = 0.5 { didSet { uniformSettings["scale"] = scale } } | ||
public var center:Position = Position.Center { didSet { uniformSettings["center"] = center } } | ||
public var center:Position = Position.center { didSet { uniformSettings["center"] = center } } | ||
|
||
public init() { | ||
super.init(fragmentShader:BulgeDistortionFragmentShader, numberOfInputs:1) | ||
|
||
({radius = 0.25})() | ||
({scale = 0.5})() | ||
({center = Position.Center})() | ||
({center = Position.center})() | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
public class ChromaKeyBlend: BasicOperation { | ||
public var thresholdSensitivity:Float = 0.4 { didSet { uniformSettings["thresholdSensitivity"] = thresholdSensitivity } } | ||
public var smoothing:Float = 0.1 { didSet { uniformSettings["smoothing"] = smoothing } } | ||
public var colorToReplace:Color = Color.Green { didSet { uniformSettings["colorToReplace"] = colorToReplace } } | ||
public var colorToReplace:Color = Color.green { didSet { uniformSettings["colorToReplace"] = colorToReplace } } | ||
|
||
public init() { | ||
super.init(fragmentShader:ChromaKeyBlendFragmentShader, numberOfInputs:2) | ||
|
||
({thresholdSensitivity = 0.4})() | ||
({smoothing = 0.1})() | ||
({colorToReplace = Color.Green})() | ||
({colorToReplace = Color.green})() | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
public class ChromaKeying: BasicOperation { | ||
public var thresholdSensitivity:Float = 0.4 { didSet { uniformSettings["thresholdSensitivity"] = thresholdSensitivity } } | ||
public var smoothing:Float = 0.1 { didSet { uniformSettings["smoothing"] = smoothing } } | ||
public var colorToReplace:Color = Color.Green { didSet { uniformSettings["colorToReplace"] = colorToReplace } } | ||
public var colorToReplace:Color = Color.green { didSet { uniformSettings["colorToReplace"] = colorToReplace } } | ||
|
||
public init() { | ||
super.init(fragmentShader:ChromaKeyFragmentShader, numberOfInputs:1) | ||
|
||
({thresholdSensitivity = 0.4})() | ||
({smoothing = 0.1})() | ||
({colorToReplace = Color.Green})() | ||
({colorToReplace = Color.green})() | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
public class ColorMatrixFilter: BasicOperation { | ||
public var intensity:Float = 1.0 { didSet { uniformSettings["intensity"] = intensity } } | ||
public var colorMatrix:Matrix4x4 = Matrix4x4.Identity { didSet { uniformSettings["colorMatrix"] = colorMatrix } } | ||
public var colorMatrix:Matrix4x4 = Matrix4x4.identity { didSet { uniformSettings["colorMatrix"] = colorMatrix } } | ||
|
||
public init() { | ||
|
||
super.init(fragmentShader:ColorMatrixFragmentShader, numberOfInputs:1) | ||
|
||
({intensity = 1.0})() | ||
({colorMatrix = Matrix4x4.Identity})() | ||
({colorMatrix = Matrix4x4.identity})() | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
public class Convolution3x3: TextureSamplingOperation { | ||
public var convolutionKernel:Matrix3x3 = Matrix3x3.CenterOnly { didSet { uniformSettings["convolutionMatrix"] = convolutionKernel } } | ||
public var convolutionKernel:Matrix3x3 = Matrix3x3.centerOnly { didSet { uniformSettings["convolutionMatrix"] = convolutionKernel } } | ||
|
||
public init() { | ||
super.init(fragmentShader:Convolution3x3FragmentShader) | ||
|
||
({convolutionKernel = Matrix3x3.CenterOnly})() | ||
({convolutionKernel = Matrix3x3.centerOnly})() | ||
} | ||
} | ||
} |
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
Oops, something went wrong.