I'm trying to create a linear image effect in quartz
composer like the one that can be found here
http://processing.org/learning/examples/linearimage.html
In the core image kernel I basically have to iterate
through each pixel in the image and set the value of
that pixel to the same value as a pixel with the same
x coordinate value that is currently selected.
I still haven't got my head around whether I can
access setting individual pixels in a sampler or I
have to read the sampler into an array of vec4 to do
this??
Either way I got an error saying data dependent for
statements are unsupported when trying to emulate the
Processing example.
I have been able to sample an individual pixel but
returning that gives a whole image of that colour
which adds a little to my confusion about what a
sampler exactly is.
Below is my attempt so far.
-Nick
kernel vec4 linearImage(sampler image, float xcoord,
float ycoord)
{
vec4 t;
vec2 size = samplerSize(image);
vec2 xy = vec2(xcoord, ycoord);
int width = size.x;
int height = size.y;
//t = sample(image, samplerCoord(image));
vec4 test = sample(image, xy);
vec2 pt = samplerCoord(image);
vec4 pix = sample(image, pt);
for (int i=0; i<width; i++) { //This is the part
where
t = sample(image, xy); //I'm having
trouble
}
return test;
}
Send instant messages to your online friends http://au.messenger.yahoo.com
_______________________________________________
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