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]