\batchmode
\documentclass[a4paper,twocolumn,dvips]{book}
\RequirePackage{ifthen}


\usepackage[dvips]{graphicx,color}
\usepackage{fancyhdr}
\usepackage{html}


%
\providecommand{\ct}[1]{\texttt{#1}}
%
\providecommand{\ctr}[1]{\texttt{#1}$\Rightarrow$\-}
%
\newenvironment{ctd}{\begin{quote}\tt}{\end{quote}}
\pagecolor{white}
%
\providecommand{\ip}{\texttt{ip}}%
\providecommand{\vips}{\texttt{vips}}%
\providecommand{\bs}{$\backslash$}%
\providecommand{\rtp}{\^{ }}%
\providecommand{\cielab}{\emph{CIE~}$L^{*}a^{*}b^{*}$}%
\providecommand{\ciexyz}{\emph{CIE XYZ}}
%
\providecommand{\pref}[1]{\S\ref{#1}}
%
\providecommand{\fig}[2]{
	\begin{center}
	\includegraphics[height=#1]{figs/#2}
	\end{center}
}
%
\providecommand{\figw}[2]{
	\begin{center}
	\includegraphics[width=#1]{figs/#2}
	\end{center}
}
%
\newenvironment{fig2}{\begin{figure*}}{\end{figure*}}\renewenvironment{fig2}{\begin{figure}}{\end{figure}}%
\newenvironment{tab2}{\begin{table*}}{\end{table*}}\renewenvironment{tab2}{\begin{table}}{\end{table}}%
\newenvironment{ipdef}{


\samepage
\begin{quote}\tt \begin{tabular}{@{\hspace{0.2em}}ll@{\hspace{0.2em}}ll@{\hspace{0.2em}}ll@{\hspace{0.2em}}ll@{\hspace{0.2em}}ll@{\hspace{0.2em}}ll@{\hspace{0.2em}}ll@{\hspace{0.2em}}lllllllllllllllllllllllllllll}
~~~ & ~ & ~~~ & ~ & ~~~ & ~ & ~~~ & ~ & ~~~ & ~ & ~~~ & ~ & ~~~ & ~ & ~~~ & \\[-1.3em]
}{
\end{tabular}\end{quote}

}
%
\providecommand{\dtxt}[1]{\multicolumn{25}{l}{#1}}
%
\providecommand{\blankpage}{%%
\newpage
~~~~
\pagestyle{plain}
\newpage
~~~~
\newpage
\pagestyle{fancy}
}
\addtolength{\textwidth}{0.5in}\addtolength{\oddsidemargin}{-0.25in}\addtolength{\evensidemargin}{-0.25in}
\addtolength{\topmargin}{-0.5em}\addtolength{\headsep}{0.5em}\addtolength{\footskip}{0.5em}
\newlength{\fred}\setlength{\fred}{\oddsidemargin}\setlength{\oddsidemargin}{\evensidemargin}\setlength{\evensidemargin}{\fred}

\fancyhead{} %% clear all fields
\fancyhead[LE,RO]{\leftmark}		%% left-even, right-odd
\fancyhead[RE,LO]{Library Programmers' Guide}%% right-even, left-odd
\fancyfoot[LE,RO]{\thepage }		%% left-even, right-odd
\fancyfoot[RE,LO]{September 2002}		


\usepackage[latin1]{inputenc}



\makeatletter

\makeatletter
\count@=\the\catcode`\_ \catcode`\_=8 
\newenvironment{tex2html_wrap}{}{}%
\catcode`\<=12\catcode`\_=\count@
\newcommand{\providedcommand}[1]{\expandafter\providecommand\csname #1\endcsname}%
\newcommand{\renewedcommand}[1]{\expandafter\providecommand\csname #1\endcsname{}%
  \expandafter\renewcommand\csname #1\endcsname}%
\newcommand{\newedenvironment}[1]{\newenvironment{#1}{}{}\renewenvironment{#1}}%
\let\newedcommand\renewedcommand
\let\renewedenvironment\newedenvironment
\makeatother
\let\mathon=$
\let\mathoff=$
\ifx\AtBeginDocument\undefined \newcommand{\AtBeginDocument}[1]{}\fi
\newbox\sizebox
\setlength{\hoffset}{0pt}\setlength{\voffset}{0pt}
\addtolength{\textheight}{\footskip}\setlength{\footskip}{0pt}
\addtolength{\textheight}{\topmargin}\setlength{\topmargin}{0pt}
\addtolength{\textheight}{\headheight}\setlength{\headheight}{0pt}
\addtolength{\textheight}{\headsep}\setlength{\headsep}{0pt}
\setlength{\textwidth}{349pt}
\newwrite\lthtmlwrite
\makeatletter
\let\realnormalsize=\normalsize
\global\topskip=2sp
\def\preveqno{}\let\real@float=\@float \let\realend@float=\end@float
\def\@float{\let\@savefreelist\@freelist\real@float}
\def\liih@math{\ifmmode$\else\bad@math\fi}
\def\end@float{\realend@float\global\let\@freelist\@savefreelist}
\let\real@dbflt=\@dbflt \let\end@dblfloat=\end@float
\let\@largefloatcheck=\relax
\let\if@boxedmulticols=\iftrue
\def\@dbflt{\let\@savefreelist\@freelist\real@dbflt}
\def\adjustnormalsize{\def\normalsize{\mathsurround=0pt \realnormalsize
 \parindent=0pt\abovedisplayskip=0pt\belowdisplayskip=0pt}%
 \def\phantompar{\csname par\endcsname}\normalsize}%
\def\lthtmltypeout#1{{\let\protect\string \immediate\write\lthtmlwrite{#1}}}%
\newcommand\lthtmlhboxmathA{\adjustnormalsize\setbox\sizebox=\hbox\bgroup\kern.05em }%
\newcommand\lthtmlhboxmathB{\adjustnormalsize\setbox\sizebox=\hbox to\hsize\bgroup\hfill }%
\newcommand\lthtmlvboxmathA{\adjustnormalsize\setbox\sizebox=\vbox\bgroup %
 \let\ifinner=\iffalse \let\)\liih@math }%
\newcommand\lthtmlboxmathZ{\@next\next\@currlist{}{\def\next{\voidb@x}}%
 \expandafter\box\next\egroup}%
\newcommand\lthtmlmathtype[1]{\gdef\lthtmlmathenv{#1}}%
\newcommand\lthtmllogmath{\lthtmltypeout{l2hSize %
:\lthtmlmathenv:\the\ht\sizebox::\the\dp\sizebox::\the\wd\sizebox.\preveqno}}%
\newcommand\lthtmlfigureA[1]{\let\@savefreelist\@freelist
       \lthtmlmathtype{#1}\lthtmlvboxmathA}%
\newcommand\lthtmlpictureA{\bgroup\catcode`\_=8 \lthtmlpictureB}%
\newcommand\lthtmlpictureB[1]{\lthtmlmathtype{#1}\egroup
       \let\@savefreelist\@freelist \lthtmlhboxmathB}%
\newcommand\lthtmlpictureZ[1]{\hfill\lthtmlfigureZ}%
\newcommand\lthtmlfigureZ{\lthtmlboxmathZ\lthtmllogmath\copy\sizebox
       \global\let\@freelist\@savefreelist}%
\newcommand\lthtmldisplayA{\bgroup\catcode`\_=8 \lthtmldisplayAi}%
\newcommand\lthtmldisplayAi[1]{\lthtmlmathtype{#1}\egroup\lthtmlvboxmathA}%
\newcommand\lthtmldisplayB[1]{\edef\preveqno{(\theequation)}%
  \lthtmldisplayA{#1}\let\@eqnnum\relax}%
\newcommand\lthtmldisplayZ{\lthtmlboxmathZ\lthtmllogmath\lthtmlsetmath}%
\newcommand\lthtmlinlinemathA{\bgroup\catcode`\_=8 \lthtmlinlinemathB}
\newcommand\lthtmlinlinemathB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA
  \vrule height1.5ex width0pt }%
\newcommand\lthtmlinlineA{\bgroup\catcode`\_=8 \lthtmlinlineB}%
\newcommand\lthtmlinlineB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA}%
\newcommand\lthtmlinlineZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %
  \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetinline}
\newcommand\lthtmlinlinemathZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %
  \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetmath}
\newcommand\lthtmlindisplaymathZ{\egroup %
  \centerinlinemath\lthtmllogmath\lthtmlsetmath}
\def\lthtmlsetinline{\hbox{\vrule width.1em \vtop{\vbox{%
  \kern.1em\copy\sizebox}\ifdim\dp\sizebox>0pt\kern.1em\else\kern.3pt\fi
  \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}}
\def\lthtmlsetmath{\hbox{\vrule width.1em\kern-.05em\vtop{\vbox{%
  \kern.1em\kern0.8 pt\hbox{\hglue.17em\copy\sizebox\hglue0.8 pt}}\kern.3pt%
  \ifdim\dp\sizebox>0pt\kern.1em\fi \kern0.8 pt%
  \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}}
\def\centerinlinemath{%
  \dimen1=\ifdim\ht\sizebox<\dp\sizebox \dp\sizebox\else\ht\sizebox\fi
  \advance\dimen1by.5pt \vrule width0pt height\dimen1 depth\dimen1 
 \dp\sizebox=\dimen1\ht\sizebox=\dimen1\relax}

\def\lthtmlcheckvsize{\ifdim\ht\sizebox<\vsize 
  \ifdim\wd\sizebox<\hsize\expandafter\hfill\fi \expandafter\vfill
  \else\expandafter\vss\fi}%
\providecommand{\selectlanguage}[1]{}%
\makeatletter \tracingstats = 1 


\begin{document}
\pagestyle{empty}\thispagestyle{empty}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength hsize=\the\hsize}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength vsize=\the\vsize}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength hoffset=\the\hoffset}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength voffset=\the\voffset}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength topmargin=\the\topmargin}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength topskip=\the\topskip}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength headheight=\the\headheight}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength headsep=\the\headsep}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength parskip=\the\parskip}\lthtmltypeout{}%
\lthtmltypeout{latex2htmlLength oddsidemargin=\the\oddsidemargin}\lthtmltypeout{}%
\makeatletter
\if@twoside\lthtmltypeout{latex2htmlLength evensidemargin=\the\evensidemargin}%
\else\lthtmltypeout{latex2htmlLength evensidemargin=\the\oddsidemargin}\fi%
\lthtmltypeout{}%
\makeatother
\setcounter{page}{1}
\onecolumn

% !!! IMAGES START HERE !!!

\stepcounter{chapter}
\stepcounter{section}
\stepcounter{section}
\stepcounter{section}
\stepcounter{chapter}
\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{figure481}%
\begin{figure}\begin{quote}
\begin{verbatim}

#include <stdio.h>
#include <stdlib.h>

#include <vips/vips.h>

int
average( IMAGE *im, double *out )
{
   int x, y;
   long total;

   /* Prepare for reading.
    */
   if( im_incheck( im ) )
      return( -1 );

   /* Check that this is the kind of image we can process.
    */
   if( im->BandFmt != IM_BANDFMT_UCHAR || 
      im->Coding != IM_CODING_NONE ) {
      im_errormsg( "average: uncoded uchar images only" );
      return( -1 );
   }

   /* Loop over the image, summing pixels.
    */
   total = 0;
   for( y = 0; y < im->Ysize; y++ ) {
      unsigned char *p = (unsigned char *) IM_IMAGE_ADDR( im, 0, y );

      for( x = 0; x < IM_IMAGE_N_ELEMENTS( im ); x++ )
          total += p[x];
   }

   /* Calculate average.
    */
   *out = (double) total / 
     (IM_IMAGE_N_ELEMENTS( im ) * im->Ysize));

   /* Success!
    */
   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

\stepcounter{section}
\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{figure483}%
\begin{figure}\begin{quote}
\begin{verbatim}

#include <stdio.h>
#include <stdlib.h>

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

int
invert( IMAGE *in, IMAGE *out )
{
   int x, y;
   unsigned char *buffer;

   /* Check images.
    */
   if( im_iocheck( in, out ) )
      return( -1 );
   if( in->BandFmt != IM_BANDFMT_UCHAR || in->Coding != IM_CODING_NONE ) {
      im_errormsg( "invert: uncoded uchar images only" );
      return( -1 );
   }

   /* Make output image.
    */
   if( im_cp_desc( out, in ) )
      return( -1 );
   if( im_setupout( out ) )
      return( -1 );

   /* Allocate a line buffer and make sure it will be freed correctly.
    */
   if( !(buffer = IM_ARRAY( out, 
      IM_IMAGE_SIZEOF_LINE( in ), unsigned char )) )
      return( -1 );

   /* Loop over the image!
    */
   for( y = 0; y < in->Ysize; y++ ) {
      unsigned char *p = (unsigned char *) IM_IMAGE_ADDR( in, 0, y );

      for( x = 0; x < IM_IMAGE_N_ELEMENTS( in ); x++ )
          buffer[x] = 255 - p[x];
      if( im_writeline( y, out, buffer ) )
          return( -1 );
   }

   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{figure485}%
\begin{figure}\begin{quote}
\begin{verbatim}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

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

/* Exponential transform.
 */
int
exptra( IMAGE *in, IMAGE *out )
{
   int x, y;
   unsigned char *buffer;

   /* Check descriptors.
    */
   if( im_iocheck( in, out ) )
      return( -1 );
   if( in->Coding != IM_CODING_NONE || im_iscomplex( in ) ) {
      im_errormsg( "exptra: uncoded non-complex only" );
      return( -1 );
   }

   /* Make output image.
    */
   if( im_cp_desc( out, in ) )
      return( -1 );
   if( in->BandFmt != IM_BANDFMT_DOUBLE )
      out->BandFmt = IM_BANDFMT_FLOAT;
   if( im_setupout( out ) )
      return( -1 );\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

{\newpage\clearpage
\lthtmlfigureA{figure487}%
\begin{figure}\begin{quote}
\begin{verbatim}

   /* Allocate a line buffer.
    */
   if( !(buffer = IM_ARRAY( out, IM_IMAGE_SIZEOF_LINE( in ), unsigned char )) )
      return( -1 );

/* Our inner loop, parameterised for both the input and output
 * types. Note the use of `\', since macros have to be all on
 * one line.
 */
#define loop(IN, OUT) { \
  for( y = 0; y < in->Ysize; y++ ) { \
      IN *p = (IN *) IM_IMAGE_ADDR( in, 0, y ); \
      OUT *q = (OUT *) buffer; \
      \
      for( x = 0; x < IM_IMAGE_N_ELEMENTS( in ); x++ ) \
          q[x] = exp( p[x] ); \
      if( im_writeline( y, out, buffer ) ) \
          return( -1 ); \
   } \
}

   /* Switch for all the types we can handle.
    */
   switch( in->BandFmt ) {
   case IM_BANDFMT_UCHAR:   loop( unsigned char, float ); break;
   case IM_BANDFMT_CHAR:    loop( char, float ); break;
   case IM_BANDFMT_USHORT:  loop( unsigned short, float ); break;
   case IM_BANDFMT_SHORT:   loop( short, float ); break;
   case IM_BANDFMT_UINT:    loop( unsigned int, float ); break;
   case IM_BANDFMT_INT:     loop( int, float ); break;
   case IM_BANDFMT_FLOAT:   loop( float, float ); break;
   case IM_BANDFMT_DOUBLE:  loop( double, double ); break;
   default:
      im_errormsg( "exptra: internal error" );
      return( -1 );
   }

   /* Success.
    */
   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

\stepcounter{chapter}
\stepcounter{section}
\stepcounter{section}
\stepcounter{section}
{\newpage\clearpage
\lthtmlinlinemathA{tex2html_wrap_inline785}%
$(x,y)$%
\lthtmlinlinemathZ
\lthtmlcheckvsize\clearpage}

{\newpage\clearpage
\lthtmlfigureA{figure769}%
\begin{figure}\begin{quote}
\begin{verbatim}

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

int
average( IMAGE *im, double *out )
{
   int total, i, y;
   REGION *reg;
   Rect area, *r;

   /* Check im.
    */
   if( im_pincheck( im ) )
      return( -1 );
   if( im->BandFmt != IM_BANDFMT_UCHAR || im->Coding != IM_CODING_NONE ) {
      im_errormsg( "average: uncoded uchar images only" );
      return( -1 );
   }

   /* Make a region on im which we can use for reading.
    */
   if( !(reg = im_region_create( im )) )
      return( -1 );\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

{\newpage\clearpage
\lthtmlfigureA{figure771}%
\begin{figure}\begin{quote}
\begin{verbatim}

   /* Move area over the image in 100x100 pel chunks. 
    * im_prepare() will clip against the edges of the image 
    * for us.
    */
   total = 0;
   r = &reg->valid;     
   area.width = 100; area.height = 100;
   for( area.top = 0; area.top < im->Ysize; area.top += 100 )
      for( area.left = 0; area.left < im->Xsize; 
          area.left += 100 ) {
          /* Fill reg with pels.
           */
          if( im_prepare( reg, &area ) ) {
             /* We must free the region!
              */
             im_region_free( reg );
             return( -1 );
          }

          /* Loop over reg, adding to our total.
           */
          for( y = r->top; y < IM_RECT_BOTTOM( r ); y++ ) {
             unsigned char *p = IM_REGION_ADDR( reg, r->left, y );

             for( i = 0; i < IM_REGION_N_ELEMENTS( reg ); i++ )
                 total += p[i];
          }
      }

   /* Make sure we free the region.
    */
   im_region_free( reg );

   /* Find average.
    */
   *out = (double) total / (IM_IMAGE_N_ELEMENTS( im ) * im->Ysize);

   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{figure773}%
\begin{figure}\begin{quote}
\begin{verbatim}

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

/* Start function for average(). We allocate a small piece of
 * storage which this sequence will accumulate its total in. Our
 * sequence value is just a pointer to this storage area.
 *
 * The first of the two pointers VIPS carries around for us is a
 * pointer to the space where we store the grand total.
 */
static int *
average_start( IMAGE *out )
{
   int *seq = IM_NEW( out, int );

   if( !seq )
      return( NULL );
   *seq = 0;

   return( seq );
}

/* Stop function for average(). Add the total which has 
 * accumulated in our sequence value to the grand total for 
 * the program.
 */
static int
average_stop( int *seq, int *gtotal )
{
   /* Stop functions are mutually exclusive, so we can write 
    * to gtotal without clashing with any other stop functions.
    */
   *gtotal += *seq;

   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

{\newpage\clearpage
\lthtmlfigureA{figure775}%
\begin{figure}\begin{quote}
\begin{verbatim}

/* Process function for average(). Total this region, and 
 * add that total to the sequence value.
 */
static int
average_process( REGION *reg, int *seq )
{
   int total, i, y;
   Rect *r = &reg->valid;

   /* Get the appropriate part of the input image ready.
    */
   if( im_prepare( reg, r ) )
      return( -1 ); 

   /* Loop over the region.
    */
   total = 0;
   for( y = r->top; y < IM_RECT_BOTTOM( r ); y++ ) {
      unsigned char *p = IM_REGION_ADDR( reg, r->left, y );

      for( i = 0; i < IM_REGION_N_ELEMENTS( reg ); i++ )
          total += p[i];
   }

   /* Add to the total for this sequence.
    */
   *seq += total;

   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

{\newpage\clearpage
\lthtmlfigureA{figure777}%
\begin{figure}\begin{quote}
\begin{verbatim}

/* Find average of image.
 */
int
average( IMAGE *im, double *out )
{
   /* Accumulate grand total here.
    */
   int gtotal = 0;
   
   /* Prepare im for PIO reading.
    */
   if( im_pincheck( im ) )
      return( -1 );

   /* Check it is the sort of thing we can process.
    */
   if( im->BandFmt != IM_BANDFMT_UCHAR || 
      im->Coding != IM_CODING_NONE ) {
      im_errormsg( "average: uncoded uchar images only" );
      return( -1 );
   }

   /* Loop over the image in pieces, and possibly in parallel.
    */
   if( im_iterate( im, 
      average_start, average_process, average_stop,
      &gtotal, NULL ) )
      return( -1 );

   /* Calculate average.
    */
   *out = (double) gtotal / (IM_IMAGE_N_ELEMENTS( im ) * im->Ysize);

   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

\stepcounter{section}
{\newpage\clearpage
\lthtmlfigureA{figure779}%
\begin{figure}\begin{quote}
\begin{verbatim}

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

/* Process function for invert(). Build the pixels in or 
 * from the appropriate pixels in ir.
 */
static int
invert_process( REGION *or, REGION *ir )
{
   Rect *r = &or->valid;
   int i, y;

   /* Ask for the part of ir we need to make or. In this 
    * case, the two areas will be the same.
    */
   if( im_prepare( ir, r ) )
      return( -1 );
   
   /* Loop over or writing pels calculated from ir.
    */
   for( y = r->top; y < IM_RECT_BOTTOM( r ); y++ ) {
      unsigned char *p = IM_REGION_ADDR( ir, r->left, y );
      unsigned char *q = IM_REGION_ADDR( or, r->left, y );

      for( i = 0; i < IM_REGION_N_ELEMENTS( or ); i++ )
          q[i] = 255 - p[i];
   }

   /* Success!
    */
   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

{\newpage\clearpage
\lthtmlfigureA{figure781}%
\begin{figure}\begin{quote}
\begin{verbatim}

/* Invert an image.
 */
int
invert( IMAGE *in, IMAGE *out )
{
   /* Check descriptors for PIO compatibility.
    */
   if( im_piocheck( in, out ) )
      return( -1 );

   /* Check input image for compatibility with us.
    */
   if( in->BandFmt != IM_BANDFMT_UCHAR || in->Coding != IM_CODING_NONE ) {
      im_errormsg( "invert: uncoded uchar images only" );
      return( -1 );
   }

   /* out inherits from in, as before.
    */
   if( im_cp_desc( out, in ) )
      return( -1 );

   /* Set demand hints for out.
    */
   if( im_demand_hint( out, IM_THINSTRIP, in, NULL ) )
      return( -1 );

   /* Build out in pieces, and possibly in parallel!
    */
   if( im_generate( out,
      im_start_one, invert_process, im_stop_one,
      in, NULL ) )
      return( -1 );

   return( 0 );
}\end{verbatim}
\end{quote}
\end{figure}%
\lthtmlfigureZ
\lthtmlcheckvsize\clearpage}

\stepcounter{section}
\stepcounter{subsection}
\stepcounter{subsection}
\stepcounter{subsection}
\stepcounter{section}
\stepcounter{chapter}

\end{document}
