Table of Contents

## Name

im_iterate - PIO input from image

## Synopsis

#include <vips/vips.h>
#include <vips/region.h>

int im_iterate( im, start_fn, scan_fn, stop_fn, a, b )
IMAGE *im;
void *(*start_fn)();
int (*scan_fn)();
int (*stop_fn)();
void *a, *b;

where, typically,

void *start_fn( im, a, b )
IMAGE *im;
void *a, *b;

int scan_fn( or, seq, a, b )
REGION *or;
void *seq;
void *a, *b;

int stop_fn( seq, a, b )
void *seq;
void *a, *b;

## Description

im_iterate(3) is used for PIO image input. See `VIPS Library Programmers' guide,' in the accompanying documentation, for an introduction to this function.

im_iterate(3) makes one or more regions on im, and starts one or more sequences running over the image. im_iterate(3) guarantees that

- scan_fn() will see each of the pels in im exactly once
- start_fn() and stop_fn() are both exclusive

See the guide, the man page for im_generate(3) , and the source to im_deviate(3) for examples.

On machines with SVR4 threads and several CPUs, im_generate(3) and im_iterate(3) automatically parallelise programs. You can set the desired concurrency level with the environment variable IM_CONCURRENCY, for example

example% setenv IM_CONCURRENCY 2
example% stats fred.v

will run stats with enough concurrency to keep 2 CPUs fully occupied. If IM_CONCURRENCY is not set, then it defaults to 1.

## Return Value

All functions return 0 on success and non-zero on error.

## See Also

im_generate(3) , `VIPS Library Programmers' Guide,' in accompanying documentation.

## Copyright

National Gallery, 1993

## Author

J. Cupitt - 23/7/93

Table of Contents

- Name
- Synopsis
- Description
- Return Value
- See Also
- Copyright
- Author