kernel Ripple < nameSpace: "popforge::ImageProcessing"; vendor: "joa ebert"; version: 1; description: "applies a sine wave distortion"; > { parameter float2 frequency< minValue: float2(0.0,0.0); maxValue: float2(0.5,0.5); defaultValue: float2(0.06125,0.06125); description: "frequency of the sine wave"; >; parameter float2 amplitude< minValue: float2(0.0,0.0); maxValue: float2(64.0,64.0); defaultValue: float2(4.0,4.0); description: "amplitude of the sine wave"; >; void evaluatePixel(in image4 source, out pixel4 result) { float2 xy = outCoord(); xy = xy + amplitude * sin( xy.yx * frequency.xy ); result = sampleLinear(source,xy); } }