Created
March 4, 2016 00:06
-
-
Save jrsa/d0d40755fb57e7bec93f to your computer and use it in GitHub Desktop.
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
/* | |
A Core Image kernel routine that computes a multiply effect. | |
The code looks up the source pixel in the sampler and then multiplies it by the value passed to the routine. | |
*/ | |
kernel vec4 basicSharp(sampler image, float width) | |
{ | |
vec2 center = sample(image, samplerCoord(image)); | |
// width = 1.0 /width; | |
vec2 _00 = sample(image, samplerTransform(image, samplerCoord(image) + vec2(-width, -width))); | |
vec2 _10 = sample(image, samplerTransform(image, samplerCoord(image) + vec2( width, -width))); | |
vec2 _11 = sample(image, samplerTransform(image, samplerCoord(image) + vec2(-width, width))); | |
vec2 _01 = sample(image, samplerTransform(image, samplerCoord(image) + vec2( width, width))); | |
return vec4(5.) * center - ( _00 + _10 + _11 + _01); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment