text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```swift
open class TextureSamplingOperation: BasicOperation {
public var overriddenTexelSize:Size?
public init(vertexShader:String = NearbyTexelSamplingVertexShader, fragmentShader:String, numberOfInputs:UInt = 1) {
super.init(vertexShader:vertexShader, fragmentShader:fragmentShader, numberOfInput... | /content/code_sandbox/framework/Source/TextureSamplingOperation.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 158 |
```swift
import Foundation
#if os(iOS)
import UIKit
#endif
public struct Position {
public let x:Float
public let y:Float
public let z:Float?
public init (_ x:Float, _ y:Float, _ z:Float? = nil) {
self.x = x
self.y = y
self.z = z
}
#if !os(Linux)
public init(p... | /content/code_sandbox/framework/Source/Position.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 156 |
```swift
import XCTest
public let TestVertexShader = "attribute vec4 position;\n attribute vec4 inputTextureCoordinate;\n \n varying vec2 textureCoordinate;\n \n void main()\n {\n gl_Position = position;\n textureCoordinate = inputTextureCoordinate.xy;\n }\n "
public let TestFragmentShader = "varying vec2 text... | /content/code_sandbox/framework/Tests/ShaderProgram_Tests.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 697 |
```swift
public enum ImageOrientation {
case portrait
case portraitUpsideDown
case landscapeLeft
case landscapeRight
func rotationNeededForOrientation(_ targetOrientation:ImageOrientation) -> Rotation {
switch (self, targetOrientation) {
case (.portrait, .portrait), (.portra... | /content/code_sandbox/framework/Source/ImageOrientation.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 435 |
```swift
// Note: the original name of YUVToRGBConversion.swift for this file chokes the compiler on Linux for some reason
// BT.601, which is the standard for SDTV.
public let colorConversionMatrix601Default = Matrix3x3(rowMajorValues:[
1.164, 1.164, 1.164,
0.0, -0.392, 2.017,
1.596, -0.813, 0.0
])
//... | /content/code_sandbox/framework/Source/CameraConversion.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 517 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public class RawDataOutput: ImageConsumer {
public var dataAvailableCallback:(([UInt8]) -> ())?
publ... | /content/code_sandbox/framework/Source/RawDataOutput.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 310 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
let GL_BGRA = GL_RGBA // A hack: Raspberry Pi needs this or framebuffer creation fails
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public enum PixelFormat {
... | /content/code_sandbox/framework/Source/RawDataInput.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 389 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
// TODO: Add mechanism to purge framebuffers on low memory
public class FramebufferCache {
var framebufferCa... | /content/code_sandbox/framework/Source/FramebufferCache.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 557 |
```swift
open class TwoStageOperation: BasicOperation {
public var overrideDownsamplingOptimization:Bool = false
// override var outputFramebuffer:Framebuffer { get { return Framebuffer } }
var downsamplingFactor:Float?
override func internalRenderFunction(_ inputFramebuffer:Framebuffer, textureProper... | /content/code_sandbox/framework/Source/TwoStageOperation.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 822 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
import Foundation
struct ShaderCompileError:Error {
let compileLog:String
}
enum ShaderType {
case ver... | /content/code_sandbox/framework/Source/ShaderProgram.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 2,044 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public class TextureInput: ImageSource {
public let targets = TargetContainer()
let textureFramebuff... | /content/code_sandbox/framework/Source/TextureInput.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 218 |
```swift
import Foundation
public var standardProcessingQueue:DispatchQueue {
if #available(iOS 10, OSX 10.10, *) {
return DispatchQueue.global(qos: .default)
} else {
return DispatchQueue.global(priority: .default)
}
}
public var lowProcessingQueue:DispatchQueue {
if #available(iOS 10, OSX 10.10,... | /content/code_sandbox/framework/Source/SerialDispatch.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 565 |
```swift
#if !os(Linux)
import QuartzCore
#endif
public struct Matrix4x4 {
public let m11:Float, m12:Float, m13:Float, m14:Float
public let m21:Float, m22:Float, m23:Float, m24:Float
public let m31:Float, m32:Float, m33:Float, m34:Float
public let m41:Float, m42:Float, m43:Float, m44:Float
pub... | /content/code_sandbox/framework/Source/Matrix.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 1,267 |
```swift
#if os(Linux)
import Glibc
#endif
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public enum FillMode {
case stretch
case preserveAspectRatio
case preserveAspectRatioAndFill
func transformVerti... | /content/code_sandbox/framework/Source/FillMode.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 1,036 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public class TextureOutput: ImageConsumer {
public var newTextureAvailableCallback:((GLuint) -> ())?
... | /content/code_sandbox/framework/Source/TextureOutput.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 153 |
```swift
public class ImageGenerator: ImageSource {
public var size:Size
public let targets = TargetContainer()
var imageFramebuffer:Framebuffer!
public init(size:Size) {
self.size = size
do {
imageFramebuffer = try Framebuffer(context:sharedImageProcessingContext, orientat... | /content/code_sandbox/framework/Source/ImageGenerator.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 156 |
```swift
open class OperationGroup: ImageProcessingOperation {
let inputImageRelay = ImageRelay()
let outputImageRelay = ImageRelay()
public var sources:SourceContainer { get { return inputImageRelay.sources } }
public var targets:TargetContainer { get { return outputImageRelay.targets } }
publ... | /content/code_sandbox/framework/Source/OperationGroup.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 207 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public struct ShaderUniformSettings {
private var uniformValues = [String:Any]()
public init() {
... | /content/code_sandbox/framework/Source/ShaderUniformSettings.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 825 |
```swift
#if os(Linux)
import Glibc
#endif
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
let GL_BGRA = GL_RGBA // A hack: Raspberry Pi needs this or framebuffer creation fails
#endif
#if canImport(COpenGL)
import COpenGL... | /content/code_sandbox/framework/Source/Framebuffer.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 2,358 |
```swift
// MARK: -
// MARK: Basic types
import Foundation
import Dispatch
public protocol ImageSource {
var targets:TargetContainer { get }
func transmitPreviousImage(to target:ImageConsumer, atIndex:UInt)
}
public protocol ImageConsumer:AnyObject {
var maximumInputs:UInt { get }
var sources:SourceCo... | /content/code_sandbox/framework/Source/Pipeline.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 1,310 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
let GL_DEPTH24_STENCIL8 = GL_DEPTH24_STENCIL8_OES
let GL_TRUE = GLboolean(1)
let GL_FALSE = GLboolean(0)
#endif
#if canImport(COpenGL)
import COpenGL
#endif
import F... | /content/code_sandbox/framework/Source/OpenGLRendering.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 2,610 |
```swift
public struct Color {
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.redComponent = red
self.greenComponent = green
... | /content/code_sandbox/framework/Source/Color.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 280 |
```swift
import Foundation
// This reimplements CMTime such that it can reach across to Linux
public struct TimestampFlags: OptionSet {
public let rawValue:UInt32
public init(rawValue:UInt32) { self.rawValue = rawValue }
public static let valid = TimestampFlags(rawValue: 1 << 0)
public static let ... | /content/code_sandbox/framework/Source/Timestamp.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 671 |
```swift
import Foundation
public func defaultVertexShaderForInputs(_ inputCount:UInt) -> String {
switch inputCount {
case 1: return OneInputVertexShader
case 2: return TwoInputVertexShader
case 3: return ThreeInputVertexShader
case 4: return FourInputVertexShader
case 5: r... | /content/code_sandbox/framework/Source/BasicOperation.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 1,596 |
```swift
public struct Size {
public let width:Float
public let height:Float
public init(width:Float, height:Float) {
self.width = width
self.height = height
}
}
``` | /content/code_sandbox/framework/Source/Size.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 46 |
```swift
public class SmoothToonFilter: OperationGroup {
public var blurRadiusInPixels: Float = 2.0 { didSet { gaussianBlur.blurRadiusInPixels = blurRadiusInPixels } }
public var threshold: Float = 0.2 { didSet { toonFilter.threshold = threshold } }
public var quantizationLevels: Float = 10.0 { didSet { too... | /content/code_sandbox/framework/Source/Operations/SmoothToonFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 184 |
```swift
public class MedianFilter: TextureSamplingOperation {
public init() {
super.init(fragmentShader:MedianFragmentShader)
}
}
``` | /content/code_sandbox/framework/Source/Operations/MedianFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 28 |
```swift
public class PolarPixellate: BasicOperation {
public var pixelSize:Size = Size(width:0.05, height:0.05) { didSet { uniformSettings["pixelSize"] = pixelSize } }
public var center:Position = Position.center { didSet { uniformSettings["center"] = center } }
public init() {
super.init(fragment... | /content/code_sandbox/framework/Source/Operations/PolarPixellate.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 121 |
```swift
#if canImport(OpenGL)
import OpenGL.GL
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public class CrosshairGenerator: ImageGenerator {
public var crosshairWidth:Float = 5.0 { didSet { unifo... | /content/code_sandbox/framework/Source/Operations/CrosshairGenerator.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 417 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
import Foundation
public let sharedImageProcessingContext = OpenGLContext()
extension OpenGLContext {
publ... | /content/code_sandbox/framework/Source/OpenGLContext_Shared.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 975 |
```swift
public class Vibrance: BasicOperation {
public var vibrance:Float = 0.0 { didSet { uniformSettings["vibrance"] = vibrance } }
public init() {
super.init(fragmentShader:VibranceFragmentShader, numberOfInputs:1)
({vibrance = 0.0})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/Vibrance.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 75 |
```swift
public class LuminanceRangeReduction: BasicOperation {
public var rangeReductionFactor:Float = 0.6 { didSet { uniformSettings["rangeReduction"] = rangeReductionFactor } }
public init() {
super.init(fragmentShader:LuminanceRangeFragmentShader, numberOfInputs:1)
({rangeReduc... | /content/code_sandbox/framework/Source/Operations/LuminanceRangeReduction.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 84 |
```swift
public class ThresholdSobelEdgeDetection: TextureSamplingOperation {
public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } }
public var threshold:Float = 0.25 { didSet { uniformSettings["threshold"] = threshold } }
public init() {
super.init(fr... | /content/code_sandbox/framework/Source/Operations/ThresholdSobelEdgeDetection.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 105 |
```swift
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.gree... | /content/code_sandbox/framework/Source/Operations/ChromaKeying.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 151 |
```swift
public class HighlightsAndShadows: BasicOperation {
public var shadows:Float = 0.0 { didSet { uniformSettings["shadows"] = shadows } }
public var highlights:Float = 1.0 { didSet { uniformSettings["highlights"] = highlights } }
public init() {
super.init(fragmentShader:HighlightShadowFr... | /content/code_sandbox/framework/Source/Operations/HighlightsAndShadows.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 107 |
```swift
public class DissolveBlend: BasicOperation {
public var mix:Float = 0.5 { didSet { uniformSettings["mixturePercent"] = mix } }
public init() {
super.init(fragmentShader:DissolveBlendFragmentShader, numberOfInputs:2)
({mix = 0.5})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/DissolveBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 71 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public class TransformOperation: BasicOperation {
public var transform:Matrix4x4 = Matrix4x4.identity { didS... | /content/code_sandbox/framework/Source/Operations/TransformOperation.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 393 |
```swift
public class HistogramDisplay: BasicOperation {
public init() {
super.init(vertexShader:HistogramDisplayVertexShader, fragmentShader:HistogramDisplayFragmentShader, numberOfInputs:1)
}
}
``` | /content/code_sandbox/framework/Source/Operations/HistogramDisplay.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 41 |
```swift
public class CGAColorspaceFilter: BasicOperation {
public init() {
super.init(fragmentShader:CGAColorspaceFragmentShader, numberOfInputs:1)
}
}
``` | /content/code_sandbox/framework/Source/Operations/CGAColorspaceFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 38 |
```swift
/** A photo filter based on Photoshop action by Amatorka
path_to_url
*/
// Note: If you want to use this effect you have to add lookup_amatorka.png
// from Resources folder to your application bundle.
#if !os(Linux)
public class AmatorkaFilter: LookupFilter {
public override init() {
sup... | /content/code_sandbox/framework/Source/Operations/AmatorkaFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 114 |
```swift
#if os(Linux)
import Glibc
#endif
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
let GL_BGRA = GL_RGBA // A hack: Raspberry Pi needs this or framebuffer creation fails
#endif
#if canImport(COpenGL)
import COpenGL... | /content/code_sandbox/framework/Source/Operations/AverageColorExtractor.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 834 |
```swift
public class BrightnessAdjustment: BasicOperation {
public var brightness:Float = 0.0 { didSet { uniformSettings["brightness"] = brightness } }
public init() {
super.init(fragmentShader:BrightnessFragmentShader, numberOfInputs:1)
({brightness = 1.0})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/BrightnessAdjustment.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 68 |
```swift
public class KuwaharaRadius3Filter: BasicOperation {
public init() {
super.init(fragmentShader:KuwaharaRadius3FragmentShader, numberOfInputs:1)
}
}
``` | /content/code_sandbox/framework/Source/Operations/KuwaharaRadius3Filter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 42 |
```swift
public class ColorBlend: BasicOperation {
public init() {
super.init(fragmentShader:ColorBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/ColorBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 33 |
```swift
public class KuwaharaFilter: BasicOperation {
public var radius:Int = 3 { didSet { uniformSettings["radius"] = radius } }
public init() {
super.init(fragmentShader:KuwaharaFragmentShader, numberOfInputs:1)
({radius = 3})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/KuwaharaFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 68 |
```swift
public class NormalBlend: BasicOperation {
public init() {
super.init(fragmentShader:NormalBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/NormalBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 33 |
```swift
public class SobelEdgeDetection: TextureSamplingOperation {
public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } }
public init() {
super.init(fragmentShader:SobelEdgeDetectionFragmentShader)
({edgeStrength = 1.0})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/SobelEdgeDetection.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 71 |
```swift
public class PrewittEdgeDetection: TextureSamplingOperation {
public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } }
public init() {
super.init(fragmentShader:PrewittEdgeDetectionFragmentShader)
({edgeStrength = 1.0})()
}
}
``... | /content/code_sandbox/framework/Source/Operations/PrewittEdgeDetection.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 73 |
```swift
public class ToonFilter: TextureSamplingOperation {
public var threshold:Float = 0.2 { didSet { uniformSettings["threshold"] = threshold } }
public var quantizationLevels:Float = 10.0 { didSet { uniformSettings["quantizationLevels"] = quantizationLevels } }
public init() {
super.init(f... | /content/code_sandbox/framework/Source/Operations/ToonFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 106 |
```swift
public class GlassSphereRefraction: BasicOperation {
public var radius:Float = 0.25 { didSet { uniformSettings["radius"] = radius } }
public var refractiveIndex:Float = 0.71 { didSet { uniformSettings["refractiveIndex"] = refractiveIndex } }
public var center:Position = Position.center { didSet { u... | /content/code_sandbox/framework/Source/Operations/GlassSphereRefraction.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 172 |
```swift
public class Vignette: BasicOperation {
public var center:Position = Position.center { didSet { uniformSettings["vignetteCenter"] = center } }
public var color:Color = Color.black { didSet { uniformSettings["vignetteColor"] = color } }
public var start:Float = 0.3 { didSet { uniformSettings["vignet... | /content/code_sandbox/framework/Source/Operations/Vignette.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 173 |
```swift
public class ColorDodgeBlend: BasicOperation {
public init() {
super.init(fragmentShader:ColorDodgeBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/ColorDodgeBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 37 |
```swift
public class SingleComponentGaussianBlur: TwoStageOperation {
public var blurRadiusInPixels:Float {
didSet {
let (sigma, downsamplingFactor) = sigmaAndDownsamplingForBlurRadius(blurRadiusInPixels, limit:8.0, override:overrideDownsamplingOptimization)
sharedImageProcessingCon... | /content/code_sandbox/framework/Source/Operations/SingleComponentGaussianBlur.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 1,074 |
```swift
public class LuminanceThreshold: BasicOperation {
public var threshold:Float = 0.5 { didSet { uniformSettings["threshold"] = threshold } }
public init() {
super.init(fragmentShader:LuminanceThresholdFragmentShader, numberOfInputs:1)
({threshold = 0.5})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/LuminanceThreshold.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 71 |
```swift
public class ExclusionBlend: BasicOperation {
public init() {
super.init(fragmentShader:ExclusionBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/ExclusionBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 35 |
```swift
public class LuminosityBlend: BasicOperation {
public init() {
super.init(fragmentShader:LuminosityBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/LuminosityBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 36 |
```swift
public class ExposureAdjustment: BasicOperation {
public var exposure:Float = 0.0 { didSet { uniformSettings["exposure"] = exposure } }
public init() {
super.init(fragmentShader:ExposureFragmentShader, numberOfInputs:1)
({exposure = 0.0})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/ExposureAdjustment.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 71 |
```swift
public class SubtractBlend: BasicOperation {
public init() {
super.init(fragmentShader:SubtractBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/SubtractBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 34 |
```swift
public class ColorInversion: BasicOperation {
public init() {
super.init(fragmentShader:ColorInvertFragmentShader, numberOfInputs:1)
}
}
``` | /content/code_sandbox/framework/Source/Operations/ColorInversion.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 35 |
```swift
public class SepiaToneFilter: ColorMatrixFilter {
override public init() {
super.init()
({colorMatrix = Matrix4x4(rowMajorValues:[0.3588, 0.7044, 0.1368, 0.0,
0.2990, 0.5870, 0.1140, 0.0,
0.... | /content/code_sandbox/framework/Source/Operations/SepiaToneFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 131 |
```swift
public class Sharpen: BasicOperation {
public var sharpness:Float = 0.0 { didSet { uniformSettings["sharpness"] = sharpness } }
public var overriddenTexelSize:Size?
public init() {
super.init(vertexShader:SharpenVertexShader, fragmentShader:SharpenFragmentShader, numberOfInputs:1)
... | /content/code_sandbox/framework/Source/Operations/Sharpen.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 176 |
```swift
public class OpacityAdjustment: BasicOperation {
public var opacity:Float = 0.0 { didSet { uniformSettings["opacity"] = opacity } }
public init() {
super.init(fragmentShader:OpacityFragmentShader, numberOfInputs:1)
({opacity = 0.0})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/OpacityAdjustment.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 69 |
```swift
/* This is based on "Accelerating image recognition on mobile devices using GPGPU" by Miguel Bordallo Lopez, Henri Nykanen, Jari Hannuksela, Olli Silven and Markku Vehvilainen
path_to_url~jhannuks/publications/SPIE2011a.pdf
Right pixel is the most significant bit, traveling clockwise to get to the upper rig... | /content/code_sandbox/framework/Source/Operations/LocalBinaryPattern.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 173 |
```swift
public class ScreenBlend: BasicOperation {
public init() {
super.init(fragmentShader:ScreenBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/ScreenBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 33 |
```swift
public class WhiteBalance: BasicOperation {
public var temperature:Float = 5000.0 { didSet { uniformSettings["temperature"] = temperature < 5000.0 ? 0.0004 * (temperature - 5000.0) : 0.00006 * (temperature - 5000.0) } }
public var tint:Float = 0.0 { didSet { uniformSettings["tint"] = tint / 100.0 } }
... | /content/code_sandbox/framework/Source/Operations/WhiteBalance.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 148 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public enum Line {
case infinite(slope:Float, intercept:Float)
case segment(p1:Position, p2:Position)
... | /content/code_sandbox/framework/Source/Operations/LineGenerator.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 534 |
```swift
public class HighlightAndShadowTint: BasicOperation {
public var shadowTintIntensity:Float = 0.0 { didSet { uniformSettings["shadowTintIntensity"] = shadowTintIntensity } }
public var highlightTintIntensity:Float = 0.0 { didSet { uniformSettings["highlightTintIntensity"] = highlightTintIntensity } }
... | /content/code_sandbox/framework/Source/Operations/HighlightAndShadowTint.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 196 |
```swift
public class DifferenceBlend: BasicOperation {
public init() {
super.init(fragmentShader:DifferenceBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/DifferenceBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 33 |
```swift
public class Convolution3x3: TextureSamplingOperation {
public var convolutionKernel:Matrix3x3 = Matrix3x3.centerOnly { didSet { uniformSettings["convolutionMatrix"] = convolutionKernel } }
public init() {
super.init(fragmentShader:Convolution3x3FragmentShader)
({convoluti... | /content/code_sandbox/framework/Source/Operations/Convolution3x3.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 83 |
```swift
public class TiltShift: OperationGroup {
public var blurRadiusInPixels:Float = 7.0 { didSet { gaussianBlur.blurRadiusInPixels = blurRadiusInPixels } }
public var topFocusLevel:Float = 0.4 { didSet { tiltShift.uniformSettings["topFocusLevel"] = topFocusLevel } }
public var bottomFocusLevel:Float = 0... | /content/code_sandbox/framework/Source/Operations/TiltShift.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 263 |
```swift
public class HistogramEqualization: OperationGroup {
public var downsamplingFactor: UInt = 16 { didSet { histogram.downsamplingFactor = downsamplingFactor } }
let histogram:Histogram
let rawDataInput = RawDataInput()
let rawDataOutput = RawDataOutput()
let equalizationFilter:BasicOpera... | /content/code_sandbox/framework/Source/Operations/HistogramEqualization.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 772 |
```swift
public class RGBAdjustment: BasicOperation {
public var red:Float = 1.0 { didSet { uniformSettings["redAdjustment"] = red } }
public var blue:Float = 1.0 { didSet { uniformSettings["blueAdjustment"] = blue } }
public var green:Float = 1.0 { didSet { uniformSettings["greenAdjustment"] = green } }
... | /content/code_sandbox/framework/Source/Operations/RGBAdjustmentFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 142 |
```swift
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 } }... | /content/code_sandbox/framework/Source/Operations/BulgeDistortion.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 134 |
```swift
/** Shi-Tomasi feature detector
This is the Shi-Tomasi feature detector, as described in
J. Shi and C. Tomasi. Good features to track. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 593-600, June 1994.
*/
public class ShiTomasiFeatureDetector: HarrisCornerDetector {
... | /content/code_sandbox/framework/Source/Operations/ShiTomasiFeatureDetector.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 96 |
```swift
// TODO: Have this adjust in real time to changing crop sizes
// TODO: Verify at all orientations
public class Crop: BasicOperation {
public var cropSizeInPixels: Size?
public var locationOfCropInPixels: Position?
public init() {
super.init(fragmentShader:PassthroughFragmentShader, nu... | /content/code_sandbox/framework/Source/Operations/Crop.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 519 |
```swift
public class ImageBuffer: ImageProcessingOperation {
// TODO: Dynamically release framebuffers on buffer resize
public var bufferSize:UInt = 1
public var activatePassthroughOnNextFrame = true
public let maximumInputs:UInt = 1
public let targets = TargetContainer()
public let source... | /content/code_sandbox/framework/Source/Operations/ImageBuffer.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 238 |
```swift
public class AlphaBlend: BasicOperation {
public var mix:Float = 0.5 { didSet { uniformSettings["mixturePercent"] = mix } }
public init() {
super.init(fragmentShader:AlphaBlendFragmentShader, numberOfInputs:2)
({mix = 0.5})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/AlphaBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 70 |
```swift
public class Posterize: BasicOperation {
public var colorLevels:Float = 10.0 { didSet { uniformSettings["colorLevels"] = colorLevels } }
public init() {
super.init(fragmentShader:PosterizeFragmentShader, numberOfInputs:1)
({colorLevels = 10.0})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/Posterize.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 72 |
```swift
public class HardLightBlend: BasicOperation {
public init() {
super.init(fragmentShader:HardLightBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/HardLightBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 35 |
```swift
public class Pixellate: BasicOperation {
public var fractionalWidthOfAPixel:Float = 0.01 {
didSet {
let imageWidth = 1.0 / Float(self.renderFramebuffer?.size.width ?? 2048)
uniformSettings["fractionalWidthOfPixel"] = max(fractionalWidthOfAPixel, imageWidth)
}
}
... | /content/code_sandbox/framework/Source/Operations/Pixellate.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 120 |
```swift
public class Haze: BasicOperation {
public var distance:Float = 0.2 { didSet { uniformSettings["hazeDistance"] = distance } }
public var slope:Float = 0.0 { didSet { uniformSettings["slope"] = slope } }
public init() {
super.init(fragmentShader:HazeFragmentShader, numberOfInputs:1)
... | /content/code_sandbox/framework/Source/Operations/Haze.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 102 |
```swift
public class MultiplyBlend: BasicOperation {
public init() {
super.init(fragmentShader:MultiplyBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/MultiplyBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 33 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
public class AverageLuminanceExtractor: BasicOperation {
public var extractedLuminanceCallback:((Float) -> ()... | /content/code_sandbox/framework/Source/Operations/AverageLuminanceExtractor.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 501 |
```swift
public class MotionDetector: OperationGroup {
public var lowPassStrength:Float = 1.0 { didSet {lowPassFilter.strength = lowPassStrength}}
public var motionDetectedCallback:((Position, Float) -> ())?
let lowPassFilter = LowPassFilter()
let motionComparison = BasicOperation(fragmentShader:Mo... | /content/code_sandbox/framework/Source/Operations/MotionDetector.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 193 |
```swift
public class Dilation: TwoStageOperation {
public var radius:UInt {
didSet {
switch radius {
case 0, 1:
shader = crashOnShaderCompileFailure("Dilation"){try sharedImageProcessingContext.programForVertexShader(ErosionDilation1VertexShader, fragmentShader:Dilat... | /content/code_sandbox/framework/Source/Operations/Dilation.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 314 |
```swift
#if os(Linux)
import Glibc
let M_PI = 3.14159265359 // TODO: remove this once Foundation pulls this in on Linux
#endif
import Foundation
public class GaussianBlur: TwoStageOperation {
public var blurRadiusInPixels:Float {
didSet {
let (sigma, downsamplingFactor) = sigmaAndDownsampling... | /content/code_sandbox/framework/Source/Operations/GaussianBlur.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 2,746 |
```swift
public class LinearBurnBlend: BasicOperation {
public init() {
super.init(fragmentShader:LinearBurnBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/LinearBurnBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 35 |
```swift
public class FalseColor: BasicOperation {
public var firstColor:Color = Color(red:0.0, green:0.0, blue:0.5, alpha:1.0) { didSet { uniformSettings["firstColor"] = firstColor } }
public var secondColor:Color = Color.red { didSet { uniformSettings["secondColor"] = secondColor } }
public init() {
... | /content/code_sandbox/framework/Source/Operations/FalseColor.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 146 |
```swift
public class AddBlend: BasicOperation {
public init() {
super.init(fragmentShader:AddBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/AddBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 33 |
```swift
/* Noble corner detector
This is the Noble variant on the Harris detector, from
Alison Noble, "Descriptions of Image Surfaces", PhD thesis, Department of Engineering Science, Oxford University 1989, p45.
*/
public class NobleCornerDetector: HarrisCornerDetector {
public init() {
super.init(fra... | /content/code_sandbox/framework/Source/Operations/NobleCornerDetector.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 76 |
```swift
public class ColorBurnBlend: BasicOperation {
public init() {
super.init(fragmentShader:ColorBurnBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/ColorBurnBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 35 |
```swift
public class Crosshatch: BasicOperation {
public var crossHatchSpacing:Float = 0.03 { didSet { uniformSettings["crossHatchSpacing"] = crossHatchSpacing } }
public var lineWidth:Float = 0.003 { didSet { uniformSettings["lineWidth"] = lineWidth } }
public init() {
super.init(fragmentShad... | /content/code_sandbox/framework/Source/Operations/Crosshatch.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 117 |
```swift
public class SwirlDistortion: BasicOperation {
public var radius:Float = 0.5 { didSet { uniformSettings["radius"] = radius } }
public var angle:Float = 1.0 { didSet { uniformSettings["angle"] = angle } }
public var center:Position = Position.center { didSet { uniformSettings["center"] = center } }
... | /content/code_sandbox/framework/Source/Operations/SwirlDistortion.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 132 |
```swift
public class SourceOverBlend: BasicOperation {
public init() {
super.init(fragmentShader:SourceOverBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/SourceOverBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 35 |
```swift
public class HueBlend: BasicOperation {
public init() {
super.init(fragmentShader:HueBlendFragmentShader, numberOfInputs:2)
}
}
``` | /content/code_sandbox/framework/Source/Operations/HueBlend.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 33 |
```swift
#if canImport(OpenGL)
import OpenGL.GL3
#endif
#if canImport(OpenGLES)
import OpenGLES
#endif
#if canImport(COpenGLES)
import COpenGLES.gles2
#endif
#if canImport(COpenGL)
import COpenGL
#endif
/* Harris corner detector
First pass: reduce to luminance and take the derivative of the luminance texture (G... | /content/code_sandbox/framework/Source/Operations/HarrisCornerDetector.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 909 |
```swift
#if os(Linux)
import Glibc
#endif
import Foundation
public class MotionBlur: BasicOperation {
public var blurSize:Float = 2.5
public var blurAngle:Float = 0.0
public init() {
super.init(vertexShader:MotionBlurVertexShader, fragmentShader:MotionBlurFragmentShader, numberOfInputs:1)
... | /content/code_sandbox/framework/Source/Operations/MotionBlur.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 336 |
```swift
#if os(Linux)
import Glibc
#endif
import Foundation
public class BoxBlur: TwoStageOperation {
public var blurRadiusInPixels:Float {
didSet {
let (sigma, downsamplingFactor) = sigmaAndDownsamplingForBlurRadius(blurRadiusInPixels, limit:8.0, override:overrideDownsamplingOptimization)
... | /content/code_sandbox/framework/Source/Operations/BoxBlur.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 1,214 |
```swift
/** This applies the edge detection process described by John Canny in
Canny, J., A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8(6):679698, 1986.
and implemented in OpenGL ES by
A. Ensor, S. Hall. GPU-based Image Analysis on Mobile Devices. Proceed... | /content/code_sandbox/framework/Source/Operations/CannyEdgeDetection.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 486 |
```swift
public class SketchFilter: TextureSamplingOperation {
public var edgeStrength:Float = 1.0 { didSet { uniformSettings["edgeStrength"] = edgeStrength } }
public init() {
super.init(fragmentShader:SketchFragmentShader)
({edgeStrength = 1.0})()
}
}
``` | /content/code_sandbox/framework/Source/Operations/SketchFilter.swift | swift | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 67 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.