Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie post. Problem with two samplers.



Hi Folks,
I'm very confused about how sampler coordinates work. I've read the manuals and a fair bit of theory. It's the practice I'm sticking on.

If anyone could offer any advice it would be much appreciated.

I'm writing a kernel app that will take change an image to black and white. The threshold is the image's average colour. Anything darker than average becomes black, and anything lighter than average becomes white.

In Quartz Composer I have the Area Average filter running fine. I can see the one pixel value that's generated and it looks good.

Here's the test code for this. For now "imageSampler" is ignored....

kernel vec4 threshold(sampler imageSampler, sampler averageSampler)
{
    vec4 vec4Average =  sample(averageSampler, samplerCoord(averageSampler));
    return vec4Average;
}

Now, here's the funny thing. When I connect my video capture device input to the imageSampler parameter above, the billboard output goes black. Despite the fact I've made no coding changes.

I can only guess that it's something to do with coordinates. Perhaps samplerCoord no longer returns my 1 pixel average. I've tried replacing this with samplerTransform, etc. but no dice.

Any idea why this might be?

Many thanks,
Max
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.