Advertisement
Guest User

Untitled

a guest
May 28th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <languageVersion : 1.0;>
  2.  
  3. kernel PolarFilter
  4. <   namespace : "Your Namespace";
  5.     vendor : "Your Vendor";
  6.     version : 1;
  7.     description : "your description";
  8. >
  9. {
  10.     input image4 src;
  11.     output pixel4 dst;
  12.  
  13.     parameter float2 size <
  14.         minValue: float2(-2000, -2000);
  15.         maxValue: float2(2000, 2000);
  16.         defaultValue: float2(1200, 320);
  17.     >;
  18.     parameter float2 center <
  19.         minValue: float2(-1000, -1000);
  20.         maxValue: float2(1000, 1000);
  21.         defaultValue: float2(600, 160);
  22.     >;
  23.     parameter float scale <
  24.         minValue: 0.;
  25.         maxValue: 10.;
  26.         defaultValue: 1.;
  27.     >;
  28.    
  29.     const float PI     = 3.1415926535897932384;
  30.     const float TWO_PI = 6.2831853071795864769;
  31.  
  32.     parameter float angleOffset <
  33.         minValue: 0.;
  34.         maxValue: 2.*PI;
  35.         defaultValue: 0.;
  36.     >;
  37.    
  38.     void
  39.     evaluatePixel()
  40.     {
  41.         float2 c = outCoord();
  42.         float2 d = c-center;
  43.         //dst = sampleNearest(src, float2((mod((atan(d.y, d.x)+offset)/TWO_PI+0.5, 1.))*size.x, size.y-(d.x*d.x+d.y*d.y)/size.y*4.));
  44.         dst = sampleNearest(src, float2((mod((atan(d.y, d.x)+angleOffset)/TWO_PI+0.5, 1.))*size.x, size.y-length(d)*2.*scale));
  45.         //dst = sampleNearest(src, c);
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement