1IM_ITERATE(3) Library Functions Manual IM_ITERATE(3)
2
3
4
6 im_iterate - PIO input from image
7
9 #include <vips/vips.h>
10 #include <vips/region.h>
11
12 int im_iterate( im, start_fn, scan_fn, stop_fn, a, b )
13 IMAGE *im;
14 void *(*start_fn)();
15 int (*scan_fn)();
16 int (*stop_fn)();
17 void *a, *b;
18
19 where, typically,
20
21 void *start_fn( im, a, b )
22 IMAGE *im;
23 void *a, *b;
24
25 int scan_fn( or, seq, a, b )
26 REGION *or;
27 void *seq;
28 void *a, *b;
29
30 int stop_fn( seq, a, b )
31 void *seq;
32 void *a, *b;
33
35 im_iterate(3) is used for PIO image input. See `VIPS Library Program‐
36 mers' guide,' in the accompanying documentation, for an introduction to
37 this function.
38
39 im_iterate(3) makes one or more regions on im, and starts one or more
40 sequences running over the image. im_iterate(3) guarantees that
41
42 - scan_fn() will see each of the pels in im exactly once
43 - start_fn() and stop_fn() are both exclusive
44
45 See the guide, the man page for im_generate(3), and the source to
46 im_deviate(3) for examples.
47
48 On machines with SVR4 threads and several CPUs, im_generate(3) and
49 im_iterate(3) automatically parallelise programs. You can set the
50 desired concurrency level with the environment variable IM_CONCURRENCY,
51 for example
52
53 example% setenv IM_CONCURRENCY 2
54 example% stats fred.v
55
56 will run stats with enough concurrency to keep 2 CPUs fully occupied.
57 If IM_CONCURRENCY is not set, then it defaults to 1.
58
60 All functions return 0 on success and non-zero on error.
61
63 im_generate(3), `VIPS Library Programmers' Guide,' in accompanying doc‐
64 umentation.
65
67 National Gallery, 1993
68
70 J. Cupitt - 23/7/93
71
72
73
74 30 October 1992 IM_ITERATE(3)