diff --git a/doc/reference/libvips-docs.sgml.in b/doc/reference/libvips-docs.sgml.in
index 9112c37a..2e08d140 100644
--- a/doc/reference/libvips-docs.sgml.in
+++ b/doc/reference/libvips-docs.sgml.in
@@ -47,6 +47,11 @@
+
+
+
+
+
@@ -54,7 +59,6 @@
-
@@ -62,6 +66,7 @@
+
diff --git a/libvips/include/vips/Makefile.am b/libvips/include/vips/Makefile.am
index 6894dd95..24189f65 100644
--- a/libvips/include/vips/Makefile.am
+++ b/libvips/include/vips/Makefile.am
@@ -14,6 +14,7 @@ pkginclude_HEADERS = \
error.h \
fmask.h \
format.h \
+ inplace.h \
generate.h \
header.h \
histograms_lut.h \
@@ -25,10 +26,12 @@ pkginclude_HEADERS = \
memory.h \
meta.h \
morphology.h \
- mosaic.h \
+ mosaicing.h \
+ other.h \
+ video.h \
+ cimg_funcs.h \
object.h \
private.h \
- proto.h \
rect.h \
region.h \
relational.h \
diff --git a/libvips/include/vips/cimg_funcs.h b/libvips/include/vips/cimg_funcs.h
new file mode 100644
index 00000000..5e6b3005
--- /dev/null
+++ b/libvips/include/vips/cimg_funcs.h
@@ -0,0 +1,49 @@
+/* cimg_funcs.h
+ *
+ * 20/9/09
+ * - from proto.h
+ */
+
+/*
+
+ This file is part of VIPS.
+
+ VIPS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ */
+
+/*
+
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
+
+ */
+
+#ifndef IM_CIMG_FUNCS_H
+#define IM_CIMG_FUNCS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+int im_greyc_mask( IMAGE *in, IMAGE *out, IMAGE *mask,
+ int iterations, float amplitude, float sharpness, float anisotropy,
+ float alpha, float sigma, float dl, float da, float gauss_prec,
+ int interpolation, int fast_approx );
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /*IM_CIMG_FUNCS_H*/
diff --git a/libvips/include/vips/inplace.h b/libvips/include/vips/inplace.h
new file mode 100644
index 00000000..56fa1aab
--- /dev/null
+++ b/libvips/include/vips/inplace.h
@@ -0,0 +1,63 @@
+/* inplace.h
+ *
+ * 3/11/09
+ * - from proto.h
+ */
+
+/*
+
+ This file is part of VIPS.
+
+ VIPS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ */
+
+/*
+
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
+
+ */
+
+#ifndef IM_INPLACE_H
+#define IM_INPLACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+int im_plotmask( IMAGE *, int, int, PEL *, PEL *, Rect * );
+int im_smear( IMAGE *, int, int, Rect * );
+int im_smudge( IMAGE *, int, int, Rect * );
+int im_paintrect( IMAGE *, Rect *, PEL * );
+int im_circle( IMAGE *, int, int, int, int );
+int im_insertplace( IMAGE *, IMAGE *, int, int );
+int im_line( IMAGE *, int, int, int, int, int );
+int im_fastlineuser();
+int im_readpoint( IMAGE *, int, int, PEL * );
+int im_flood( IMAGE *, int, int, PEL *, Rect * );
+int im_flood_blob( IMAGE *, int, int, PEL *, Rect * );
+int im_flood_blob_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink );
+int im_flood_other( IMAGE *mask, IMAGE *test, int x, int y, int serial );
+int im_flood_other_copy( IMAGE *mask, IMAGE *test, IMAGE *out,
+ int x, int y, int serial );
+int im_segment( IMAGE *test, IMAGE *mask, int *segments );
+int im_lineset( IMAGE *in, IMAGE *out, IMAGE *mask, IMAGE *ink,
+ int n, int *x1v, int *y1v, int *x2v, int *y2v );
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /*IM_INPLACE_H*/
diff --git a/libvips/include/vips/mask.h b/libvips/include/vips/mask.h
index 40f7c844..5e5db843 100644
--- a/libvips/include/vips/mask.h
+++ b/libvips/include/vips/mask.h
@@ -37,8 +37,6 @@
extern "C" {
#endif /*__cplusplus*/
-int poop( int poop );
-
typedef struct im__INTMASK {
int xsize;
int ysize;
diff --git a/libvips/include/vips/mosaic.h b/libvips/include/vips/mosaic.h
deleted file mode 100644
index dc2d26a8..00000000
--- a/libvips/include/vips/mosaic.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* @(#) Local definitions used by the mosaicing program
- * @(#) If MAXPOINTS change please ensure that it is still a multiple of
- * @(#) AREAS or else AREAS must change as well. Initial setup is for
- * @(#) MAXPOINTS = 60, AREAS = 3.
- * @(#)
- * Copyright: 1990, 1991 N. Dessipris
- * Author: Nicos Dessipris
- * Written on: 07/11/1989
- * Modified on : 29/11/1989
- */
-
-/*
-
- This file is part of VIPS.
-
- VIPS is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- */
-
-/*
-
- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
-
- */
-
-#ifndef IM_MOSAIC_H
-#define IM_MOSAIC_H
-
-#define MAXPOINTS 60 /* MAXPOINTS % AREAS (in im_calcon) must be zero */
-
-typedef struct {
- char *reference; /* filename of reference */
- char *secondary; /* filename of secondary */
- int deltax; /* initial estimate of displacement */
- int deltay; /* initial estimate of displacement */
- int nopoints; /* must be multiple of AREAS and <= MAXPOINTS */
- int halfcorsize; /* recommended 5 */
- int halfareasize; /* recommended 8 */
-
- /* x, y_reference and contrast found by im_calcon()
- */
- int x_reference[MAXPOINTS], y_reference[MAXPOINTS];
- int contrast[MAXPOINTS];
-
- /* x, y_secondary and correlation set by im_chkpair()
- */
- int x_secondary[MAXPOINTS], y_secondary[MAXPOINTS];
-
- /* returns the corrected best correlation
- * as detected in 2*halfareasize+1
- * centered at point (x2, y2) and using
- * correlation area 2*halfareasize+1
- */
- double correlation[MAXPOINTS];
-
- /* Coefficients calculated by im_clinear()
- */
- double l_scale, l_angle, l_deltax, l_deltay;
-
- /* used by im_clinear()
- */
- double dx[MAXPOINTS], dy[MAXPOINTS];
- double deviation[MAXPOINTS];
-} TIE_POINTS;
-
-int im_clinear( TIE_POINTS *points );
-int im__chkpair( IMAGE *, IMAGE *, TIE_POINTS *point );
-int im__initialize( TIE_POINTS *points );
-int im__improve( TIE_POINTS *inpoints, TIE_POINTS *outpoints );
-int im__avgdxdy( TIE_POINTS *points, int *dx, int *dy );
-int im__lrcalcon( IMAGE *ref, TIE_POINTS *points );
-int im__tbcalcon( IMAGE *ref, TIE_POINTS *points );
-
-#endif /*IM_MOSAIC_H*/
diff --git a/libvips/include/vips/mosaicing.h b/libvips/include/vips/mosaicing.h
new file mode 100644
index 00000000..44f487d8
--- /dev/null
+++ b/libvips/include/vips/mosaicing.h
@@ -0,0 +1,99 @@
+/* mosaicing.h
+ *
+ * 20/9/09
+ * - from proto.h
+ */
+
+/*
+
+ This file is part of VIPS.
+
+ VIPS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ */
+
+/*
+
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
+
+ */
+
+#ifndef IM_MOSAICING_H
+#define IM_MOSAICING_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+int im_lrmerge( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int dx, int dy, int mwidth );
+int im_tbmerge( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int dx, int dy, int mwidth );
+
+int im_lrmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int xr1, int yr1, int xs1, int ys1,
+ int xr2, int yr2, int xs2, int ys2,
+ int mwidth );
+int im_tbmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int xr1, int yr1, int xs1, int ys1,
+ int xr2, int yr2, int xs2, int ys2,
+ int mwidth );
+
+int im_lrmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int bandno,
+ int xref, int yref, int xsec, int ysec,
+ int halfcorrelation, int halfarea,
+ int balancetype,
+ int mwidth );
+int im_tbmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int bandno,
+ int xref, int yref, int xsec, int ysec,
+ int halfcorrelation, int halfarea,
+ int balancetype,
+ int mwidth );
+
+int im_lrmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int bandno,
+ int xr1, int yr1, int xs1, int ys1,
+ int xr2, int yr2, int xs2, int ys2,
+ int halfcorrelation, int halfarea,
+ int balancetype,
+ int mwidth );
+int im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out,
+ int bandno,
+ int xr1, int yr1, int xs1, int ys1,
+ int xr2, int yr2, int xs2, int ys2,
+ int halfcorrelation, int halfarea,
+ int balancetype,
+ int mwidth );
+
+int im_global_balance( IMAGE *in, IMAGE *out, double gamma );
+int im_global_balancef( IMAGE *in, IMAGE *out, double gamma );
+
+int im_correl( IMAGE *ref, IMAGE *sec,
+ int xref, int yref, int xsec, int ysec,
+ int hwindowsize, int hsearchsize,
+ double *correlation, int *x, int *y );
+int im_remosaic( IMAGE *in, IMAGE *out,
+ const char *old_str, const char *new_str );
+
+int im_align_bands( IMAGE *in, IMAGE *out );
+int im_maxpos_subpel( IMAGE *in, double *x, double *y );
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /*IM_MOSAICING_H*/
diff --git a/libvips/include/vips/other.h b/libvips/include/vips/other.h
new file mode 100644
index 00000000..4d315982
--- /dev/null
+++ b/libvips/include/vips/other.h
@@ -0,0 +1,75 @@
+/* other.h
+ *
+ * 20/9/09
+ * - from proto.h
+ */
+
+/*
+
+ This file is part of VIPS.
+
+ VIPS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ */
+
+/*
+
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
+
+ */
+
+#ifndef IM_OTHER_H
+#define IM_OTHER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+int im_feye( IMAGE *image,
+ const int xsize, const int ysize, const double factor );
+int im_eye( IMAGE *image,
+ const int xsize, const int ysize, const double factor );
+int im_zone( IMAGE *im, int size );
+int im_fzone( IMAGE *im, int size );
+int im_grey( IMAGE *im, const int xsize, const int ysize );
+int im_fgrey( IMAGE *im, const int xsize, const int ysize );
+int im_make_xy( IMAGE *out, const int xsize, const int ysize );
+int im_benchmarkn( IMAGE *in, IMAGE *out, int n );
+int im_benchmark2( IMAGE *in, double *out );
+
+int im_cooc_matrix( IMAGE *im, IMAGE *m,
+ int xp, int yp, int xs, int ys, int dx, int dy, int flag );
+int im_cooc_asm( IMAGE *m, double *asmoment );
+int im_cooc_contrast( IMAGE *m, double *contrast );
+int im_cooc_correlation( IMAGE *m, double *correlation );
+int im_cooc_entropy( IMAGE *m, double *entropy );
+
+int im_glds_matrix( IMAGE *im, IMAGE *m,
+ int xpos, int ypos, int xsize, int ysize, int dx, int dy );
+int im_glds_asm( IMAGE *m, double *asmoment );
+int im_glds_contrast( IMAGE *m, double *contrast );
+int im_glds_entropy( IMAGE *m, double *entropy );
+int im_glds_mean( IMAGE *m, double *mean );
+
+int im_simcontr( IMAGE *image, int xs, int ys );
+int im_sines( IMAGE *image,
+ int xsize, int ysize, double horfreq, double verfreq );
+int im_spatres( IMAGE *in, IMAGE *out, int step );
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /*IM_OTHER_H*/
diff --git a/libvips/include/vips/proto.h b/libvips/include/vips/proto.h
deleted file mode 100644
index 0dd4ff70..00000000
--- a/libvips/include/vips/proto.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/* @(#) Header file for Birkbeck/VIPS Image Processing Library
- * Authors: N. Dessipris, K. Martinez, Birkbeck College, London.
- * and J. Cupitt The National Gallery, London.
- *
- * Sept 94
- *
- * 15/7/96 JC
- * - now does C++ extern stuff
- * - many more protos
- * 15/4/97 JC
- * - protos split out here, more of them
- * - still not complete tho' ...
- * 8/4/99 JC
- * - lots of consts added to please C++
- * - and more protos added
- * 11/9/06
- * - internal protos cut out to help SWIG
- */
-
-/*
-
- This file is part of VIPS.
-
- VIPS is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- */
-
-/*
-
- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
-
- */
-
-#ifndef IM_PROTO_H
-#define IM_PROTO_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /*__cplusplus*/
-
-/* Need these for some protos.
- */
-#include
-#include
-#include
-
-/* If we're being parsed by SWIG, remove gcc attributes.
- */
-#ifdef SWIG
-# ifndef __attribute__
-# define __attribute__(x) /*NOTHING*/
-# endif
-#endif /*SWIG*/
-
-/* cimg
- */
-int im_greyc_mask( IMAGE *in, IMAGE *out, IMAGE *mask,
- int iterations, float amplitude, float sharpness, float anisotropy,
- float alpha, float sigma, float dl, float da, float gauss_prec,
- int interpolation, int fast_approx );
-
-/* other
- */
-int im_feye( IMAGE *image,
- const int xsize, const int ysize, const double factor );
-int im_eye( IMAGE *image,
- const int xsize, const int ysize, const double factor );
-int im_zone( IMAGE *im, int size );
-int im_fzone( IMAGE *im, int size );
-int im_grey( IMAGE *im, const int xsize, const int ysize );
-int im_fgrey( IMAGE *im, const int xsize, const int ysize );
-int im_make_xy( IMAGE *out, const int xsize, const int ysize );
-int im_benchmarkn( IMAGE *in, IMAGE *out, int n );
-int im_benchmark2( IMAGE *in, double *out );
-
-int im_cooc_matrix( IMAGE *im, IMAGE *m,
- int xp, int yp, int xs, int ys, int dx, int dy, int flag );
-int im_cooc_asm( IMAGE *m, double *asmoment );
-int im_cooc_contrast( IMAGE *m, double *contrast );
-int im_cooc_correlation( IMAGE *m, double *correlation );
-int im_cooc_entropy( IMAGE *m, double *entropy );
-
-int im_glds_matrix( IMAGE *im, IMAGE *m,
- int xpos, int ypos, int xsize, int ysize, int dx, int dy );
-int im_glds_asm( IMAGE *m, double *asmoment );
-int im_glds_contrast( IMAGE *m, double *contrast );
-int im_glds_entropy( IMAGE *m, double *entropy );
-int im_glds_mean( IMAGE *m, double *mean );
-
-int im_simcontr( IMAGE *image, int xs, int ys );
-int im_sines( IMAGE *image,
- int xsize, int ysize, double horfreq, double verfreq );
-int im_spatres( IMAGE *in, IMAGE *out, int step );
-
-/* mosaicing
- */
-int im_lrmerge( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int dx, int dy, int mwidth );
-int im_tbmerge( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int dx, int dy, int mwidth );
-
-int im_lrmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int xr1, int yr1, int xs1, int ys1,
- int xr2, int yr2, int xs2, int ys2,
- int mwidth );
-int im_tbmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int xr1, int yr1, int xs1, int ys1,
- int xr2, int yr2, int xs2, int ys2,
- int mwidth );
-
-int im_lrmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int bandno,
- int xref, int yref, int xsec, int ysec,
- int halfcorrelation, int halfarea,
- int balancetype,
- int mwidth );
-int im_tbmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int bandno,
- int xref, int yref, int xsec, int ysec,
- int halfcorrelation, int halfarea,
- int balancetype,
- int mwidth );
-
-int im_lrmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int bandno,
- int xr1, int yr1, int xs1, int ys1,
- int xr2, int yr2, int xs2, int ys2,
- int halfcorrelation, int halfarea,
- int balancetype,
- int mwidth );
-int im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out,
- int bandno,
- int xr1, int yr1, int xs1, int ys1,
- int xr2, int yr2, int xs2, int ys2,
- int halfcorrelation, int halfarea,
- int balancetype,
- int mwidth );
-
-int im_global_balance( IMAGE *in, IMAGE *out, double gamma );
-int im_global_balancef( IMAGE *in, IMAGE *out, double gamma );
-
-int im_correl( IMAGE *ref, IMAGE *sec,
- int xref, int yref, int xsec, int ysec,
- int hwindowsize, int hsearchsize,
- double *correlation, int *x, int *y );
-int im_remosaic( IMAGE *in, IMAGE *out,
- const char *old_str, const char *new_str );
-
-int im_align_bands( IMAGE *in, IMAGE *out );
-int im_maxpos_subpel( IMAGE *in, double *x, double *y );
-
-/* inplace
- */
-int im_plotmask( IMAGE *, int, int, PEL *, PEL *, Rect * );
-int im_smear( IMAGE *, int, int, Rect * );
-int im_smudge( IMAGE *, int, int, Rect * );
-int im_paintrect( IMAGE *, Rect *, PEL * );
-int im_circle( IMAGE *, int, int, int, int );
-int im_insertplace( IMAGE *, IMAGE *, int, int );
-int im_line( IMAGE *, int, int, int, int, int );
-int im_fastlineuser();
-int im_readpoint( IMAGE *, int, int, PEL * );
-int im_flood( IMAGE *, int, int, PEL *, Rect * );
-int im_flood_blob( IMAGE *, int, int, PEL *, Rect * );
-int im_flood_blob_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink );
-int im_flood_other( IMAGE *mask, IMAGE *test, int x, int y, int serial );
-int im_flood_other_copy( IMAGE *mask, IMAGE *test, IMAGE *out,
- int x, int y, int serial );
-int im_segment( IMAGE *test, IMAGE *mask, int *segments );
-int im_lineset( IMAGE *in, IMAGE *out, IMAGE *mask, IMAGE *ink,
- int n, int *x1v, int *y1v, int *x2v, int *y2v );
-
-/* video
- */
-int im_video_v4l1( IMAGE *im, const char *device,
- int channel, int brightness, int colour, int contrast, int hue,
- int ngrabs );
-int im_video_test( IMAGE *im, int brightness, int error );
-
-#ifdef __cplusplus
-}
-#endif /*__cplusplus*/
-
-#endif /*IM_PROTO_H*/
diff --git a/libvips/include/vips/video.h b/libvips/include/vips/video.h
new file mode 100644
index 00000000..1516f59a
--- /dev/null
+++ b/libvips/include/vips/video.h
@@ -0,0 +1,49 @@
+/* video.h
+ *
+ * 20/9/09
+ * - from proto.h
+ */
+
+/*
+
+ This file is part of VIPS.
+
+ VIPS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ */
+
+/*
+
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
+
+ */
+
+#ifndef IM_VIDEO_H
+#define IM_VIDEO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+int im_video_v4l1( IMAGE *im, const char *device,
+ int channel, int brightness, int colour, int contrast, int hue,
+ int ngrabs );
+int im_video_test( IMAGE *im, int brightness, int error );
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /*IM_VIDEO_H*/
diff --git a/libvips/include/vips/vips.h b/libvips/include/vips/vips.h
index 168ab2de..2e3aa428 100644
--- a/libvips/include/vips/vips.h
+++ b/libvips/include/vips/vips.h
@@ -85,6 +85,14 @@ extern "C" {
#include
#include
+/* If we're being parsed by SWIG, remove gcc attributes.
+ */
+#ifdef SWIG
+# ifndef __attribute__
+# define __attribute__(x) /*NOTHING*/
+# endif
+#endif /*SWIG*/
+
#include
#include
@@ -112,18 +120,22 @@ extern "C" {
#include
#include
-#include
#include
#include
#include
#include
#include
#include
+#include
#include
#include
#include
#include
#include
+#include
+#include
+#include
+#include
#ifdef IM_ENABLE_DEPRECATED
#include
diff --git a/libvips/mosaicing/mosaic.h b/libvips/mosaicing/mosaic.h
index 2aca9fa8..4195a61b 100644
--- a/libvips/mosaicing/mosaic.h
+++ b/libvips/mosaicing/mosaic.h
@@ -73,23 +73,23 @@ typedef struct {
double deviation[IM_MAXPOINTS];
} TIE_POINTS;
-extern int im__chkpair( IMAGE *, IMAGE *, TIE_POINTS *point );
-extern int im__initialize( TIE_POINTS *points );
-extern int im__improve( TIE_POINTS *inpoints, TIE_POINTS *outpoints );
-extern int im__avgdxdy( TIE_POINTS *points, int *dx, int *dy );
-extern int im__lrcalcon( IMAGE *ref, TIE_POINTS *points );
-extern int im__tbcalcon( IMAGE *ref, TIE_POINTS *points );
-extern int im__coeff( int xr1, int yr1, int xs1, int ys1,
+int im__chkpair( IMAGE *, IMAGE *, TIE_POINTS *point );
+int im__initialize( TIE_POINTS *points );
+int im__improve( TIE_POINTS *inpoints, TIE_POINTS *outpoints );
+int im__avgdxdy( TIE_POINTS *points, int *dx, int *dy );
+int im__lrcalcon( IMAGE *ref, TIE_POINTS *points );
+int im__tbcalcon( IMAGE *ref, TIE_POINTS *points );
+int im__coeff( int xr1, int yr1, int xs1, int ys1,
int xr2, int yr2, int xs2, int ys2,
double *a, double *b, double *dx, double *dy );
-extern int im__clinear( TIE_POINTS *points );
-extern int im__find_lroverlap( IMAGE *ref_in, IMAGE *sec_in, IMAGE *out,
+int im__clinear( TIE_POINTS *points );
+int im__find_lroverlap( IMAGE *ref_in, IMAGE *sec_in, IMAGE *out,
int bandno_in,
int xref, int yref, int xsec, int ysec,
int halfcorrelation, int halfarea,
int *dx0, int *dy0,
double *scale1, double *angle1, double *dx1, double *dy1 );
-extern int im__find_tboverlap( IMAGE *ref_in, IMAGE *sec_in, IMAGE *out,
+int im__find_tboverlap( IMAGE *ref_in, IMAGE *sec_in, IMAGE *out,
int bandno_in,
int xref, int yref, int xsec, int ysec,
int halfcorrelation, int halfarea,