• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Use src_rect with iterate_generic

Contributor ,
May 09, 2020 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

403

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
community guidelines
Community Expert ,
May 20, 2020 May 20, 2020

Copy link to clipboard

Copied

LATEST

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

}

Votes

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
community guidelines