Highlighted

Use src_rect with iterate_generic

Explorer ,
May 09, 2020

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 ?

TOPICS
SDK

Views

281

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Use src_rect with iterate_generic

Explorer ,
May 09, 2020

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 ?

TOPICS
SDK

Views

282

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 09, 2020 0
Adobe Community Professional ,
May 20, 2020

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++) {

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 20, 2020 0