Copy link to clipboard
Copied
Hi. In iterate_origin, you can use
origin.h = in_data->output_origin_x;
origin.v = in_data->output_origin_y;
areaR.top = areaR.left = 0;
areaR.right = 1;
areaR.bottom = output->height;
This will define the smaller active area that needs processing. However, my algorithms are currently using iterate_generic. How would I implement the origin and area limits here ?
One method I can think of is to pass origin and areaR as a part of refcon and iterate output->height times. In this case do I only use pixel in the input buffer from the offset "origin" ?
Also, in the Smartypants example, why is areaR.right = 1 and not output->width ?
Copy link to clipboard
Copied
when using iterate_generic you specify the number of iterations as one of the args of the call.
assuming you wish to iterate over buffer lines, you'd want to set the iteration number to (areaR.buttom - areaR.top), and inside your line handling function you'd want to iterate starting at areaR.left like so:
for(int x = areaR.left; x < areaR.right; x++) {
}