kernel warp < namespace : "Genie Effect"; vendor : "Christoph Atteneder"; version : 1; description : "Very quick and dirty Genie Effect"; > { parameter float verticalAxis < minValue : float( 1.0 ); maxValue : float( 1000.0 ); defaultValue : float (576.0 ); description : "Vertical Axis"; >; parameter float height < minValue : float( 1.0 ); maxValue : float( 1000.0 ); defaultValue : float (599.0 ); description : "Image Height"; >; parameter float offset < minValue : float( 0.0 ); maxValue : float( 576.0 ); defaultValue : float (0.0); description : "Vertical Offset"; >; parameter float2 anchor1 < minValue : float2( 0.0,0.0 ); maxValue : float2( 362.0, 362.0 ); defaultValue : float2 (0.0,0.0 ); description : "First Anchor Point"; >; parameter float2 anchor2 < minValue : float2( 0.0,0.0 ); maxValue : float2( 576.0, 362.0 ); defaultValue : float2 (0.0,0.0 ); description : "Second Anchor Point"; >; parameter float2 control1 < minValue : float2( 0.0,0.0 ); maxValue : float2( 362.0, 362.0 ); defaultValue : float2 (0.0,100.0 ); description : "First Control Point"; >; parameter float2 control2 < minValue : float2( 0.0, 0.0 ); maxValue : float2( 576.0, 384.0 ); defaultValue : float2 (0.0,200.0 ); description : "Second Control Point"; >; input image4 src; output pixel4 dst; void evaluatePixel() { float2 pos = outCoord(); float u = float(pos.y/height); float posx = pow(u,3.0)*(anchor2.x+3.0*(control1.x-control2.x)-anchor1.x) +3.0*pow(u,2.0)*(anchor1.x-2.0*control1.x+control2.x) +3.0*u*(control1.x-anchor1.x)+anchor1.x; if(pos.x > posx) { float tmpPosx = ((pos.x-posx)/(verticalAxis-posx))*verticalAxis; dst = sampleLinear(src, float2(tmpPosx, pos.y-offset)); } else { dst = pixel4(0.0,0.0,0.0,0); } } }