diff --git a/configure.in b/configure.in index 1810bb14..6850ba81 100644 --- a/configure.in +++ b/configure.in @@ -182,13 +182,13 @@ expand () { } expand $libdir -my_libdir=$expanded_value +IM_LIBDIR=$expanded_value # vips.c/im_guess_prefix.c need to know the exe suffix and (as a fallback) # the configure-time install prefix AC_DEFINE_UNQUOTED(IM_EXEEXT,"$EXEEXT",[extension for executable files]) AC_DEFINE_UNQUOTED(IM_PREFIX,"$prefix",[configure-time install prefix]) -AC_DEFINE_UNQUOTED(IM_LIBDIR,"$my_libdir",[configure-time library directory]) +AC_DEFINE_UNQUOTED(IM_LIBDIR,"$IM_LIBDIR",[configure-time library directory]) # i18n GETTEXT_PACKAGE=vips-$IM_MAJOR_VERSION.$IM_MINOR_VERSION diff --git a/doc/src/pio.tex b/doc/src/pio.tex index c9906135..f2e45e01 100644 --- a/doc/src/pio.tex +++ b/doc/src/pio.tex @@ -371,7 +371,7 @@ number of bytes across the region. \fref{fg:paverage} is a version of \verb+average()+ which uses regions rather than WIO input. Two things: first, we should really be -using \verb+im_iterate()+, see \pref{sec:sequence}, to do the rectangle +using \verb+vips_sink()+, see \pref{sec:sequence}, to do the rectangle algebra for us. Secondly, note that we call \verb+im_pincheck()+ rather than \verb+im_incheck()+. \verb+im_pincheck()+ signals to the IO system that you are a PIO-aware function, giving \verb+im_prepare()+ much more @@ -491,13 +491,13 @@ int The values \verb+a+ and \verb+b+ are carried around by VIPS for your use. For functions like \verb+average()+ which consume images but produce no image -output, VIPS provides \verb+im_iterate()+. This has type: +output, VIPS provides \verb+vips_sink()+. This has type: \begin{verbatim} -int im_iterate( IMAGE *in, - void *(*start_fn)(), - int (*process_fn)(), - int (*stop_fn)(), +int vips_sink( VipsImage *in, + VipsStart start, + VipsGenerate generate, + VipsStop stop, void *a, void *b ) \end{verbatim} @@ -510,11 +510,6 @@ make it possible for the sequences to each contribute to the result of the function in an orderly manner, VIPS also guarantees that all start and stop functions are mutually exclusive. -A note on types: \verb++ declares prototypes for -\verb+im_iterate()+ and \verb+im_generate()+ (see \pref{sec:generate}), -but does not give prototypes for the function arguments. This loses a -little type-safety, but gains some convenience. - An example should make this clearer. This version of \verb+average()+ is very similar to the average function in the VIPS library --- it is only missing polymorphism. @@ -626,7 +621,7 @@ average( IMAGE *im, double *out ) /* Loop over the image in pieces, and possibly in parallel. */ - if( im_iterate( im, + if( vips_sink( im, average_start, average_process, average_stop, >otal, NULL ) ) return( -1 ); @@ -651,8 +646,8 @@ There are a couple of variations on \verb+im_prepare()+: you can use Regions are written to in just the same way they are read from --- by writing to a pointer found with the \verb+IM_REGION_ADDR()+ macro. -\verb+im_iterate()+ does input --- \verb+im_generate()+ does output. It -has the same type as \verb+im_iterate()+: +\verb+vips_sink()+ does input --- \verb+im_generate()+ does output. It +has the same type as \verb+vips_sink()+: \begin{verbatim} int @@ -665,7 +660,7 @@ im_generate( IMAGE *out, The region given to the process function is ready for output. Each time the process function is called, it should fill in the pels in the region -it was given. Note that, unlike \verb+im_iterate()+, the areas the process +it was given. Note that, unlike \verb+vips_sink()+, the areas the process function is asked to produce are not guaranteed to be either disjoint or complete. Again, VIPS may start up many process functions if it sees fit.