I've written an CI Kernel in Quartz Composer.
The CI Kernel patch works well and I wanted to make an Image Unit out
of this.
Unfortunately it does not work as assumed.
The output image from the Image Unit has infinite dimensions.
But I noticed that even the input image has infinite dimensions and I
don't know what to do.
I'm using
vec2 imageDimension = samplerSize(src) / 2.0;
to find the center and do some transformations relative to the center.
It works well directly in QuartzComposer.
As an Image Unit it works well in Core Image Fun House on images that
are smaller than the screen resolution.
As soon as the Image is larger than the screen, it fails.
Same in QuartzComposer, while the plain code in a CI Kernel patch
works great, the Image Unit creates the same issue as in CoreImage
Fun House PLUS the output has infinite dimensions.
Hope someone can help me.
-Michael
here is the source code :
kernel vec4 fisheye( sampler src, float p)
{
//cubic barrel or pincusion distortion determined by coefficients.
vec2 t1, t2;
vec2 ctr = samplerSize(src) / 2.0;
t1 = destCoord();
float a = -0.0;
float b = -.1 * p ;
float c = -.0;
float d = 1.0 - 1.1 * ( a + b + c );
float r1, r2;
float unit = length(ctr) / 2.0;