--- On Mon, 22/12/08, Christopher Wright <[email protected]> wrote:

> From: Christopher Wright <[email protected]>
> Subject: Re: Applying Filter Kernel To Only Part of a Image
> To: "Chris Wood" <[email protected]>
> Cc: [email protected], [email protected]
> Date: Monday, 22 December, 2008, 10:15 PM
> > Can you not just change the return value depending on
> the y position in the filter? Something like:
> > 
> > return y<pos1?
> >     (formula 1) :
> >     y<pos2?
> >     (formula 2):
> >     y<pos3?
> >     (formula 3) : (formula 4);
> > At least that's how I tend to do this kind of
> thing.. although I seem to remember conditionals being
> somewhat more limited in core image, so you have to plan a
> bit.
> 
> 
> He was wanting to avoid the ternary operator, since it can
> force the filter to run in software mode.   :/

Exactly. Also, I got the impression that even if it doesn't force 
software-fallback, it might cause all the various options to be evaluated for 
every pixel, before the correct answer is picked from the calculated results. I 
was just trying to circumvent this by making sure that each pass of the filter 
did only the work that it needed to do for that particular section of the input 
image.
 
> That said, At this point, I'm all for "Just pick a
> stinking plan already" and then profile to see what
> needs to be accelerated.  The Perfect is the enemy of the
> Good.

Nice phrase.
Actually, though, I had an ulterior motive anyway. I can think of other uses 
for a filter that applies a particular effect to a programmatically (ie 
JavaScript)-selectable  part of the image, without the filter kernel itself 
having to test if the current working pixel is inside or outside a particular 
rect, for every single pixel of an image. How about a 'glitch' filter that 
glitches-up random sections of the image according to numbers generated by the 
JavaScript Math.random() function, for example?

But yes, you're right. I should try different methods, and profile it. The 
thing is, I'd like to be able to try the method I outlined, for comparison, but 
haven't
a. been able to get it to work and
b. been able to get a straight answer on whether it's actually possible, anyway.

a|x



 _______________________________________________
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