Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <languageVersion : 1.0;>
- kernel PolarFilter
- < namespace : "Your Namespace";
- vendor : "Your Vendor";
- version : 1;
- description : "your description";
- >
- {
- input image4 src;
- output pixel4 dst;
- parameter float2 size <
- minValue: float2(-2000, -2000);
- maxValue: float2(2000, 2000);
- defaultValue: float2(1200, 320);
- >;
- parameter float2 center <
- minValue: float2(-1000, -1000);
- maxValue: float2(1000, 1000);
- defaultValue: float2(600, 160);
- >;
- parameter float scale <
- minValue: 0.;
- maxValue: 10.;
- defaultValue: 1.;
- >;
- const float PI = 3.1415926535897932384;
- const float TWO_PI = 6.2831853071795864769;
- parameter float angleOffset <
- minValue: 0.;
- maxValue: 2.*PI;
- defaultValue: 0.;
- >;
- void
- evaluatePixel()
- {
- float2 c = outCoord();
- float2 d = c-center;
- //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.));
- dst = sampleNearest(src, float2((mod((atan(d.y, d.x)+angleOffset)/TWO_PI+0.5, 1.))*size.x, size.y-length(d)*2.*scale));
- //dst = sampleNearest(src, c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement