Hello Troy,

thanks for pointing me on the right path.
Now it looks much better than it did before even it is now a non- executable filter. But I still get strange effects when resizing the window or apply a scale after my filter. I get the same effect on resizing the window in QuartzComposer when taking the "image filter" template. But it looks fine when using it in a default composition with a normal image or video as input.

I've took a screen video to show you the effect.
http://kwasi.beiheringzuheim.de/ImageUnit.mp4

You can even see the effect in Safari when opening this url and shrink the window.
http://kwasi.beiheringzuheim.de/LensCorrectionFilter.qtz

In my eyes it looks like samplerSize returns a value that is rounded up to the next power of two number.

Regards,

Michael


Am 18.02.2008 um 18:31 schrieb Troy Koelling:

I think you probably need to transform the point into the coordinate space of the sampler. This post by John Harper has a good summary of the coordinate spaces:

http://lists.apple.com/archives/Quartzcomposer-dev/2005/Jun//msg00080.html


Troy

On Feb 17, 2008, at 7:10 AM, Michael Kwasnicki wrote:
Hello there,

I'm trying to write an ImageUnit which depends on the size of the image. At first I tried around with the QuartzComposer Kernel Filter to write the core function. There everything works fine. I was using "samplerSize( scrImage );" to get the correct dimensions for the filter.

Then I wrapped an ImageUnit around that and tested it against Core Image Fun House.
There the results highly depend on the image size.
If the image is small enough to fit into the screen then it looks as expected. If not then the filter uses somehow wrong parameters. It looks like the samplerSize returns the dimensions of the window of the scaled down image but applies the filter to the full sized image. The result is that the center of my filter moves into the lower left corner and does no longer result in a centric distortion.

How can I pass the dimensions to the CIKernel ?
I Tried an extent.size.width but it does not work. The ImageUnitAnalyzer fails and Core Image Fun House does not show any effect but the Console.log shows :

17.02.08 15:53:41 Core Image Fun House[2203] CoreImageUnitsFilter: CoreImageUnitsFilter: nil value for argument #2 (Width)

piece of code:

- (CIImage *)outputImage
{
    float radius = 0.0f;
    CISampler *src;

    src = [CISampler samplerWithImage:inputImage];
    return [self apply:_kwasiImageUnitsFilterKernel, src,
        [NSNumber numberWithFloat: [inputAmount floatValue]],
[inputImage extent].size.width, [inputImage extent].size.height, nil];
}

Thanks in advance,

Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/tkoelling%40apple.com

This email sent to [EMAIL PROTECTED]


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to