diff --git a/.gitignore b/.gitignore index 5bad4b18..bfb0425b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ Makefile.in TAGS tags *.o +Vips-8.0.gir +Vips-8.0.typelib .*.swp *.lo *.bak diff --git a/Makefile.am b/Makefile.am index 8cebcbc8..2c92948b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,4 +56,6 @@ uninstall-hook: -chmod -R u+w ${DESTDIR}$(datadir)/doc/vips -rm -rf ${DESTDIR}$(datadir)/doc/vips -DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc +ACLOCAL_AMFLAGS = -I m4 + +DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-introspection diff --git a/TODO b/TODO index ef40c40f..94991d1d 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,32 @@ -- python/* is too old, keep for reference, but we need to use the - introspection stuff to get current gobject bindings +- automake conditionals are breaking introspection - look at that brancg again + we need to build all of them, but use ifdefs to knock chunks out + + + + +- test goi merge + + + +- looks like we need to have all includes in all .h files, and to scan them + all explicitly + + at the moment Vips-8.0.gir just has the stuff directly in vips.h + + ... is this correct? many includes are working finw without this + +- currently stuck on: + + :: Fatal: Vips: Unknown namespace for identifier 'vips_save_string' + + + + + +- look at libpeas for plugin support + + http://live.gnome.org/Libpeas diff --git a/bootstrap.sh b/bootstrap.sh index fb81b48e..547924fb 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -26,6 +26,7 @@ cp $ACDIR/iconv.m4 m4 cp $ACDIR/isc-posix.m4 m4 cp $ACDIR/lcmessage.m4 m4 cp $ACDIR/progtest.m4 m4 +cp $ACDIR/introspection.m4 m4 gtkdocize --copy --docdir doc/reference --flavour no-tmpl || exit 1 diff --git a/configure.in b/configure.in index 01dcbfdf..3b3fa56b 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,14 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(libvips/include/vips/colour.h) + +# also update the version number in the m4 macros below + +AC_INIT(vips, 7.25.0, vipsip@jiscmail.ac.uk) +# required for gobject-introspection +AC_PREREQ(2.62) + +# gobject-introspection recommends this +AM_INIT_AUTOMAKE([-Wno-portability]) + AM_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR(m4) @@ -10,14 +19,48 @@ m4_define([vips_micro_version], [0]) m4_define([vips_version], [vips_major_version.vips_minor_version.vips_micro_version]) -VIPS_MAJOR_VERSION=vips_major_version -VIPS_MINOR_VERSION=vips_minor_version -VIPS_MICRO_VERSION=vips_micro_version +VIPS_MAJOR_VERSION=vips_major_version() +VIPS_MINOR_VERSION=vips_minor_version() +VIPS_MICRO_VERSION=vips_micro_version() VIPS_VERSION=vips_version() VIPS_VERSION_STRING=$VIPS_VERSION-`date` -VERSION=$VIPS_VERSION -PACKAGE=vips +# init introspection support +GOBJECT_INTROSPECTION_CHECK([0.6.7]) + +# gir needs a list of source files to scan for introspection +# build with a glob and a list of files to exclude from scanning +# see also IGNORE_HFILES in doc/reference/Makefile.am +# the only header we include is the main vips.h one, it'll pull in everything +# else in the public API +introspection_sources=`cd libvips ; find . -name "*.c"` +filter_list="deprecated im_video_v4l1.c" + +introspection_sources2= +for name in $introspection_sources; do + found=0 + for filter in $filter_list; do + # FIXME .. argh a bash-ism :( not sure of a nice, portable way to do + # regexp matching + if [[[ $name == *${filter}* ]]]; then + found=1 + fi + done + + if [[ $found -eq 0 ]]; then + introspection_sources2="$introspection_sources2 $name" + fi +done +vips_introspection_sources="$introspection_sources2" + +# add headers that form the public vips8 API .. don't do a find and exclude, +# we end up excluding almost everything argh +headers="vips.h object.h image.h error.h foreign.h interpolate.h header.h operation.h enumtypes.h arithmetic.h conversion.h" +for name in $headers; do + vips_introspection_sources="$vips_introspection_sources include/vips/$name" +done + +AC_SUBST(vips_introspection_sources) # libtool library versioning ... not user-visible (except as part of the # library file name) and does not correspond to major/minor/micro above @@ -32,8 +75,6 @@ LIBRARY_CURRENT=30 LIBRARY_REVISION=5 LIBRARY_AGE=15 -AM_INIT_AUTOMAKE($PACKAGE,$VERSION) - # patched into include/vips/version.h AC_SUBST(VIPS_VERSION) AC_SUBST(VIPS_VERSION_STRING) @@ -388,12 +429,6 @@ if test x"$with_magick" != "xno"; then LIBS=$save_LIBS fi -if test x"$with_magick" = x"yes"; then - AM_CONDITIONAL(HAVE_MAGICK, true) -else - AM_CONDITIONAL(HAVE_MAGICK, false) -fi - # orc AC_ARG_WITH([orc], AS_HELP_STRING([--without-orc], [build without orc (default: test)])) @@ -444,17 +479,11 @@ if test x"$with_OpenEXR" != "xno"; then ]) fi -if test x"$with_OpenEXR" = x"yes"; then - AM_CONDITIONAL(HAVE_OPENEXR, true) -else - AM_CONDITIONAL(HAVE_OPENEXR, false) -fi - # OpenSlide AC_ARG_WITH([openslide], AS_HELP_STRING([--without-openslide], [build without OpenSlide (default: test)])) -if test x"$with_openslide" != "xno"; then +if test x"$with_openslide" != x"no"; then PKG_CHECK_MODULES(OPENSLIDE, openslide >= 3.2.0, [AC_DEFINE(HAVE_OPENSLIDE,1,[define if you have OpenSlide >= 3.2.0 installed.]) with_openslide=yes @@ -464,12 +493,6 @@ if test x"$with_openslide" != "xno"; then ]) fi -if test x"$with_openslide" = x"yes"; then - AM_CONDITIONAL(HAVE_OPENSLIDE, true) -else - AM_CONDITIONAL(HAVE_OPENSLIDE, false) -fi - # matio AC_ARG_WITH([matio], AS_HELP_STRING([--without-matio], [build without matio (default: test)])) @@ -484,12 +507,6 @@ if test x"$with_matio" != "xno"; then ]) fi -if test x"$with_openslide" = x"yes"; then - AM_CONDITIONAL(HAVE_MATIO, true) -else - AM_CONDITIONAL(HAVE_MATIO, false) -fi - # cfitsio AC_ARG_WITH([cfitsio], AS_HELP_STRING([--without-cfitsio], [build without cfitsio (default: test)])) @@ -504,12 +521,6 @@ if test x"$with_cfitsio" != "xno"; then ]) fi -if test x"$with_cfitsio" = x"yes"; then - AM_CONDITIONAL(HAVE_CFITSIO, true) -else - AM_CONDITIONAL(HAVE_CFITSIO, false) -fi - # pangoft2 AC_ARG_WITH([pangoft2], AS_HELP_STRING([--without-pangoft2], @@ -532,12 +543,6 @@ FIND_TIFF( with_tiff=no ]) -if test x"$with_tiff" = x"yes"; then - AM_CONDITIONAL(HAVE_TIFF, true) -else - AM_CONDITIONAL(HAVE_TIFF, false) -fi - FIND_ZIP( [with_zip=yes], [AC_MSG_WARN([libz not found; disabling ZIP support]) @@ -560,24 +565,12 @@ if test x"$with_png" != "xno"; then ]) fi -if test x"$with_png" = x"yes"; then - AM_CONDITIONAL(HAVE_PNG, true) -else - AM_CONDITIONAL(HAVE_PNG, false) -fi - FIND_JPEG( [with_jpeg=yes], [AC_MSG_WARN([libjpeg not found; disabling JPEG support]) with_jpeg=no ]) -if test x"$with_jpeg" = x"yes"; then - AM_CONDITIONAL(HAVE_JPEG, true) -else - AM_CONDITIONAL(HAVE_JPEG, false) -fi - # libexif AC_ARG_WITH([libexif], AS_HELP_STRING([--without-libexif], [build without libexif (default: test)])) @@ -736,6 +729,7 @@ enable debug: $enable_debug build C++ components: $enable_cxx evaluate with threads: $enable_threads build docs with gtkdoc $enable_gtk_doc +gobject introspection $found_introspection * optional packages and modules use fftw3 for FFT: $with_fftw3 diff --git a/libvips/Makefile.am b/libvips/Makefile.am index fe89add4..e1bd997c 100644 --- a/libvips/Makefile.am +++ b/libvips/Makefile.am @@ -72,3 +72,41 @@ libvips_la_LDFLAGS = \ EXTRA_DIST = \ $(C_DIST_DIR) + +CLEANFILES = + +-include $(INTROSPECTION_MAKEFILE) +INTROSPECTION_GIRS = +INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) + +if HAVE_INTROSPECTION +# we can't get the _SOURCES lists from the subdirs directly, we get passed it +# by configure instead +introspection_sources = @vips_introspection_sources@ + +# we make the vips8 API +Vips-8.0.gir: libvips.la +Vips_8_0_gir_INCLUDES = GObject-2.0 +Vips_8_0_gir_CFLAGS = $(INCLUDES) -I${top_srcdir}/libvips/include +Vips_8_0_gir_LIBS = libvips.la +Vips_8_0_gir_FILES = $(introspection_sources) +Vips_8_0_gir_SCANNERFLAGS = \ + --warn-all \ + --verbose \ + --namespace=Vips \ + --identifier-prefix=Vips \ + --identifier-prefix=vips \ + --symbol-prefix=vips \ + --symbol-prefix=im \ + --symbol-prefix=im_ +INTROSPECTION_GIRS += Vips-8.0.gir + +girdir = $(datadir)/gir-1.0 +gir_DATA = $(INTROSPECTION_GIRS) + +typelibdir = $(libdir)/girepository-1.0 +typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) + +CLEANFILES += $(gir_DATA) $(typelib_DATA) +endif diff --git a/libvips/arithmetic/arithmetic.h b/libvips/arithmetic/arithmetic.h index c7120e80..9841b930 100644 --- a/libvips/arithmetic/arithmetic.h +++ b/libvips/arithmetic/arithmetic.h @@ -38,6 +38,7 @@ extern "C" { #endif /*__cplusplus*/ +#include #include #define VIPS_TYPE_ARITHMETIC (vips_arithmetic_get_type()) diff --git a/libvips/arithmetic/binary.h b/libvips/arithmetic/binary.h index 3d40b5e8..a00b785d 100644 --- a/libvips/arithmetic/binary.h +++ b/libvips/arithmetic/binary.h @@ -30,6 +30,10 @@ #ifndef VIPS_BINARY_H #define VIPS_BINARY_H +#include + +#include "arithmetic.h" + #ifdef __cplusplus extern "C" { #endif /*__cplusplus*/ diff --git a/libvips/deprecated/dispatch_types.c b/libvips/deprecated/dispatch_types.c index 9151e024..9e7e17e2 100644 --- a/libvips/deprecated/dispatch_types.c +++ b/libvips/deprecated/dispatch_types.c @@ -722,9 +722,8 @@ im__dmsprint( im_object obj ) /* Print statistics band stats eg: 2 bands:b 0,1 */ - printf( "\ -band minimum maximum sum sum^2 mean deviation\ -\n" ); + printf( "band minimum maximum sum " + "sum^2 mean deviation\n" ); for( j = 0; j < mask->ysize; j++ ) { row = mask->coeff + j * mask->xsize; if( j == 0 ) diff --git a/libvips/deprecated/format.c b/libvips/deprecated/format.c index 390b0802..dc91acca 100644 --- a/libvips/deprecated/format.c +++ b/libvips/deprecated/format.c @@ -241,7 +241,7 @@ format_compare( VipsFormatClass *a, VipsFormatClass *b ) } /** - * vips_format_map: + * vips_format_map: (skip) * @fn: function to apply to each #VipsFormatClass * @a: user data * @b: user data diff --git a/libvips/foreign/Makefile.am b/libvips/foreign/Makefile.am index dfaa7eef..1649da73 100644 --- a/libvips/foreign/Makefile.am +++ b/libvips/foreign/Makefile.am @@ -20,117 +20,39 @@ libforeign_la_SOURCES = \ analyzeload.c \ analyze2vips.c \ analyze2vips.h \ - foreign.c + foreign.c \ + matlab.h \ + matlab.c \ + matload.c + magick.h \ + magick2vips.c \ + magickload.c + pngload.c \ + pngsave.c \ + vipspng.h \ + vipspng.c + openexr2vips.h \ + openexr2vips.c \ + openexrload.c + fits.h \ + fits.c \ + fitsload.c \ + fitssave.c + tiff.h \ + vips2tiff.c \ + tiff2vips.c \ + tiffload.c \ + tiffsave.c + openslide2vips.h \ + openslide2vips.c \ + openslideload.c + vips2jpeg.c \ + jpeg2vips.c \ + jpeg.h \ + jpegload.c \ + jpegsave.c EXTRA_DIST = -if HAVE_MATIO -libforeign_la_SOURCES += \ - matlab.h \ - matlab.c \ - matload.c -else -EXTRA_DIST += \ - matlab.h \ - matlab.c \ - matload.c -endif - -if HAVE_MAGICK -libforeign_la_SOURCES += \ - magick.h \ - magick2vips.c \ - magickload.c -else -EXTRA_DIST += \ - magick.h \ - magick2vips.c \ - magickload.c -endif - -if HAVE_PNG -libforeign_la_SOURCES += \ - pngload.c \ - pngsave.c \ - vipspng.h \ - vipspng.c -else -EXTRA_DIST += \ - pngload.c \ - pngsave.c \ - vipspng.h \ - vipspng.c -endif - -if HAVE_OPENEXR -libforeign_la_SOURCES += \ - openexr2vips.h \ - openexr2vips.c \ - openexrload.c -else -EXTRA_DIST += \ - openexr2vips.h \ - openexr2vips.c \ - openexrload.c -endif - -if HAVE_CFITSIO -libforeign_la_SOURCES += \ - fits.h \ - fits.c \ - fitsload.c \ - fitssave.c -else -EXTRA_DIST += \ - fits.h \ - fits.c \ - fitsload.c \ - fitssave.c -endif - -if HAVE_TIFF -libforeign_la_SOURCES += \ - tiff.h \ - vips2tiff.c \ - tiff2vips.c \ - tiffload.c \ - tiffsave.c -else -EXTRA_DIST += \ - tiff.h \ - vips2tiff.c \ - tiff2vips.c \ - tiffload.c \ - tiffsave.c -endif - -if HAVE_OPENSLIDE -libforeign_la_SOURCES += \ - openslide2vips.h \ - openslide2vips.c \ - openslideload.c -else -EXTRA_DIST += \ - openslide2vips.h \ - openslide2vips.c \ - openslideload.c -endif - -if HAVE_JPEG -libforeign_la_SOURCES += \ - vips2jpeg.c \ - jpeg2vips.c \ - jpeg.h \ - jpegload.c \ - jpegsave.c -else -EXTRA_DIST += \ - vips2jpeg.c \ - jpeg2vips.c \ - jpeg.h \ - jpegload.c \ - jpegsave.c -endif - INCLUDES = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@ diff --git a/libvips/foreign/fits.c b/libvips/foreign/fits.c index d3f4d770..7132149d 100644 --- a/libvips/foreign/fits.c +++ b/libvips/foreign/fits.c @@ -58,6 +58,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_CFITSIO + #include #include #include @@ -736,3 +738,5 @@ vips__fits_write( VipsImage *in, const char *filename ) return( 0 ); } + +#endif /*HAVE_CFITSIO*/ diff --git a/libvips/foreign/fitsload.c b/libvips/foreign/fitsload.c index 49a6a5d2..d43f01f0 100644 --- a/libvips/foreign/fitsload.c +++ b/libvips/foreign/fitsload.c @@ -39,6 +39,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_CFITSIO + #include #include #include @@ -122,3 +124,5 @@ static void vips_foreign_load_fits_init( VipsForeignLoadFits *fits ) { } + +#endif /*HAVE_CFITSIO*/ diff --git a/libvips/foreign/fitssave.c b/libvips/foreign/fitssave.c index 9d8975ef..7e829444 100644 --- a/libvips/foreign/fitssave.c +++ b/libvips/foreign/fitssave.c @@ -40,6 +40,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_CFITSIO + #include #include #include @@ -134,3 +136,5 @@ static void vips_foreign_save_fits_init( VipsForeignSaveFits *fits ) { } + +#endif /*HAVE_CFITSIO*/ diff --git a/libvips/foreign/jpeg2vips.c b/libvips/foreign/jpeg2vips.c index b746f684..f7d72ad5 100644 --- a/libvips/foreign/jpeg2vips.c +++ b/libvips/foreign/jpeg2vips.c @@ -79,6 +79,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_JPEG + #include #include #include @@ -1010,3 +1012,4 @@ vips__isjpeg( const char *filename ) return( 0 ); } +#endif /*HAVE_JPEG*/ diff --git a/libvips/foreign/jpegload.c b/libvips/foreign/jpegload.c index ae702819..4e67b080 100644 --- a/libvips/foreign/jpegload.c +++ b/libvips/foreign/jpegload.c @@ -42,6 +42,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_JPEG + #include #include #include @@ -301,3 +303,4 @@ vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer ) { } +#endif /*HAVE_JPEG*/ diff --git a/libvips/foreign/jpegsave.c b/libvips/foreign/jpegsave.c index 08b4e8a3..d4ce398a 100644 --- a/libvips/foreign/jpegsave.c +++ b/libvips/foreign/jpegsave.c @@ -40,6 +40,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_JPEG + #include #include #include @@ -323,3 +325,5 @@ static void vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime ) { } + +#endif /*HAVE_JPEG*/ diff --git a/libvips/foreign/magick2vips.c b/libvips/foreign/magick2vips.c index 79a2ca4e..6344e130 100644 --- a/libvips/foreign/magick2vips.c +++ b/libvips/foreign/magick2vips.c @@ -75,6 +75,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_MAGICK + #include #include #include @@ -706,3 +708,5 @@ vips__magick_read_header( const char *filename, VipsImage *im ) return( 0 ); } +#endif /*HAVE_MAGICK*/ + diff --git a/libvips/foreign/magickload.c b/libvips/foreign/magickload.c index e79a8c2c..940b2afd 100644 --- a/libvips/foreign/magickload.c +++ b/libvips/foreign/magickload.c @@ -39,6 +39,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_MAGICK + #include #include #include @@ -153,3 +155,5 @@ static void vips_foreign_load_magick_init( VipsForeignLoadMagick *magick ) { } + +#endif /*HAVE_MAGICK*/ diff --git a/libvips/foreign/matlab.c b/libvips/foreign/matlab.c index cbf76f77..0519755d 100644 --- a/libvips/foreign/matlab.c +++ b/libvips/foreign/matlab.c @@ -56,6 +56,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_MATIO + #include #include @@ -304,3 +306,5 @@ vips__mat_ismat( const char *filename ) } const char *vips__mat_suffs[] = { ".mat", NULL }; + +#endif /*HAVE_MATIO*/ diff --git a/libvips/foreign/matload.c b/libvips/foreign/matload.c index a98905fb..56378339 100644 --- a/libvips/foreign/matload.c +++ b/libvips/foreign/matload.c @@ -39,6 +39,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_MATIO + #include #include #include @@ -134,3 +136,5 @@ static void vips_foreign_load_mat_init( VipsForeignLoadMat *mat ) { } + +#endif /*HAVE_MATIO*/ diff --git a/libvips/foreign/openexr2vips.c b/libvips/foreign/openexr2vips.c index 582999ef..bcec2328 100644 --- a/libvips/foreign/openexr2vips.c +++ b/libvips/foreign/openexr2vips.c @@ -67,6 +67,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_OPENEXR + #include #include #include @@ -404,3 +406,5 @@ vips__openexr_read( const char *filename, VipsImage *out ) return( 0 ); } + +#endif /*HAVE_OPENEXR*/ diff --git a/libvips/foreign/openexrload.c b/libvips/foreign/openexrload.c index 60264138..261bc1c5 100644 --- a/libvips/foreign/openexrload.c +++ b/libvips/foreign/openexrload.c @@ -39,6 +39,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_OPENEXR + #include #include #include @@ -143,3 +145,5 @@ static void vips_foreign_load_openexr_init( VipsForeignLoadOpenexr *openexr ) { } + +#endif /*HAVE_OPENEXR*/ diff --git a/libvips/foreign/openslide2vips.c b/libvips/foreign/openslide2vips.c index d50724c9..4e99fda0 100644 --- a/libvips/foreign/openslide2vips.c +++ b/libvips/foreign/openslide2vips.c @@ -55,6 +55,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_OPENSLIDE + #include #include #include @@ -351,3 +353,4 @@ vips__openslide_read_associated( const char *filename, VipsImage *out, return( 0 ); } +#endif /*HAVE_OPENSLIDE*/ diff --git a/libvips/foreign/openslideload.c b/libvips/foreign/openslideload.c index 51571e42..4beb4ce8 100644 --- a/libvips/foreign/openslideload.c +++ b/libvips/foreign/openslideload.c @@ -39,6 +39,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_OPENSLIDE + #include #include #include @@ -201,3 +203,5 @@ static void vips_foreign_load_openslide_init( VipsForeignLoadOpenslide *openslide ) { } + +#endif /*HAVE_OPENSLIDE*/ diff --git a/libvips/foreign/pngload.c b/libvips/foreign/pngload.c index 0e56d465..64410ad5 100644 --- a/libvips/foreign/pngload.c +++ b/libvips/foreign/pngload.c @@ -47,6 +47,8 @@ #include #include +#ifdef HAVE_PNG + #include "vipspng.h" typedef struct _VipsForeignLoadPng { @@ -134,3 +136,5 @@ static void vips_foreign_load_png_init( VipsForeignLoadPng *png ) { } + +#endif /*HAVE_PNG*/ diff --git a/libvips/foreign/pngsave.c b/libvips/foreign/pngsave.c index 9451997e..3ebbb2ef 100644 --- a/libvips/foreign/pngsave.c +++ b/libvips/foreign/pngsave.c @@ -40,6 +40,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_PNG + #include #include #include @@ -234,3 +236,5 @@ static void vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer ) { } + +#endif /*HAVE_PNG*/ diff --git a/libvips/foreign/tiff2vips.c b/libvips/foreign/tiff2vips.c index 6b43bf85..1d9b892b 100644 --- a/libvips/foreign/tiff2vips.c +++ b/libvips/foreign/tiff2vips.c @@ -162,6 +162,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_TIFF + #include #include #include @@ -1554,3 +1556,5 @@ vips__istiff( const char *filename ) return( FALSE ); } + +#endif /*HAVE_TIFF*/ diff --git a/libvips/foreign/tiffload.c b/libvips/foreign/tiffload.c index d2fd30e2..ca3b8fc5 100644 --- a/libvips/foreign/tiffload.c +++ b/libvips/foreign/tiffload.c @@ -39,6 +39,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_TIFF + #include #include #include @@ -153,3 +155,5 @@ static void vips_foreign_load_tiff_init( VipsForeignLoadTiff *tiff ) { } + +#endif /*HAVE_TIFF*/ diff --git a/libvips/foreign/tiffsave.c b/libvips/foreign/tiffsave.c index 89adcdec..34c373a3 100644 --- a/libvips/foreign/tiffsave.c +++ b/libvips/foreign/tiffsave.c @@ -40,6 +40,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_TIFF + #include #include #include @@ -276,3 +278,5 @@ vips_foreign_save_tiff_init( VipsForeignSaveTiff *tiff ) tiff->xres = 1.0; tiff->yres = 1.0; } + +#endif /*HAVE_TIFF*/ diff --git a/libvips/foreign/vips2jpeg.c b/libvips/foreign/vips2jpeg.c index 34cb8e3d..84b34814 100644 --- a/libvips/foreign/vips2jpeg.c +++ b/libvips/foreign/vips2jpeg.c @@ -85,6 +85,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_JPEG + #include #include #include @@ -1112,3 +1114,5 @@ vips__jpeg_write_buffer( VipsImage *in, } const char *vips__jpeg_suffs[] = { ".jpg", ".jpeg", ".jpe", NULL }; + +#endif /*HAVE_JPEG*/ diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index f5c87a9c..66636d57 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -163,6 +163,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_TIFF + #include #include #ifdef HAVE_UNISTD_H @@ -1538,3 +1540,4 @@ vips__tiff_write( VipsImage *in, const char *filename, return( 0 ); } +#endif /*HAVE_TIFF*/ diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index 1ff4343e..d4cc67f6 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -70,6 +70,8 @@ #endif /*HAVE_CONFIG_H*/ #include +#ifdef HAVE_PNG + #include #include @@ -686,3 +688,4 @@ vips__png_write_buf( VipsImage *in, return( 0 ); } +#endif /*HAVE_PNG*/ diff --git a/libvips/include/vips/buf.h b/libvips/include/vips/buf.h index e0328d6a..b4f928ac 100644 --- a/libvips/include/vips/buf.h +++ b/libvips/include/vips/buf.h @@ -34,6 +34,8 @@ extern "C" { #endif /*__cplusplus*/ +#include + /* A string in the process of being written to ... multiple calls to * vips_buf_append add to it, on overflow append "..." and block further writes. */ diff --git a/libvips/include/vips/cimg_funcs.h b/libvips/include/vips/cimg_funcs.h index 6c8a00b4..6a10723a 100644 --- a/libvips/include/vips/cimg_funcs.h +++ b/libvips/include/vips/cimg_funcs.h @@ -37,6 +37,8 @@ extern "C" { #endif /*__cplusplus*/ +#include + int im_greyc_mask( VipsImage *in, VipsImage *out, VipsImage *mask, int iterations, float amplitude, float sharpness, float anisotropy, float alpha, float sigma, float dl, float da, float gauss_prec, diff --git a/libvips/include/vips/colour.h b/libvips/include/vips/colour.h index 2e4e3a30..6f6ea93d 100644 --- a/libvips/include/vips/colour.h +++ b/libvips/include/vips/colour.h @@ -182,8 +182,6 @@ int im_lab_morph( VipsImage *in, VipsImage *out, double L_offset, double L_scale, double a_scale, double b_scale ); -void im_col_make_tables_UCS( void ); - /* Render intents for icc wrappers. */ typedef enum { diff --git a/libvips/include/vips/freq_filt.h b/libvips/include/vips/freq_filt.h index 440a42a1..5d01caad 100644 --- a/libvips/include/vips/freq_filt.h +++ b/libvips/include/vips/freq_filt.h @@ -37,6 +37,8 @@ extern "C" { #endif /*__cplusplus*/ +#include + typedef enum { VIPS_MASK_IDEAL_HIGHPASS = 0, VIPS_MASK_IDEAL_LOWPASS = 1, diff --git a/libvips/include/vips/header.h b/libvips/include/vips/header.h index f5604327..82f50e58 100644 --- a/libvips/include/vips/header.h +++ b/libvips/include/vips/header.h @@ -99,7 +99,7 @@ int vips_image_get_xoffset( const VipsImage *image ); int vips_image_get_yoffset( const VipsImage *image ); const char *vips_image_get_filename( const VipsImage *image ); const char *vips_image_get_mode( const VipsImage *image ); -void *vips_image_get_data( VipsImage *image );; +void *vips_image_get_data( VipsImage *image ); void vips_image_init_fields( VipsImage *image, int xsize, int ysize, int bands, @@ -119,14 +119,11 @@ GType vips_image_get_typeof( VipsImage *image, const char *field ); gboolean vips_image_remove( VipsImage *image, const char *field ); typedef void *(*VipsImageMapFn)( VipsImage *image, const char *field, GValue *value, void *a ); -void *vips_image_map( VipsImage *im, VipsImageMapFn fn, void *a ); +void *vips_image_map( VipsImage *image, VipsImageMapFn fn, void *a ); void vips_image_set_area( VipsImage *image, const char *field, VipsCallbackFn free_fn, void *data ); int vips_image_get_area( VipsImage *image, const char *field, void **data ); -void vips_image_set_string( VipsImage *image, - const char *field, const char *str ); -int vips_image_get_string( VipsImage *image, const char *field, char **str ); void vips_image_set_blob( VipsImage *image, const char *field, VipsCallbackFn free_fn, void *data, size_t length ); int vips_image_get_blob( VipsImage *image, const char *field, diff --git a/libvips/include/vips/interpolate.h b/libvips/include/vips/interpolate.h index c2781241..ffb59952 100644 --- a/libvips/include/vips/interpolate.h +++ b/libvips/include/vips/interpolate.h @@ -61,7 +61,7 @@ typedef struct _VipsInterpolate { * interpolate the value at position (x, y) in "in". */ typedef void (*VipsInterpolateMethod)( VipsInterpolate *interpolate, - PEL *out, VipsRegion *in, double x, double y ); + void *out, VipsRegion *in, double x, double y ); typedef struct _VipsInterpolateClass { VipsObjectClass parent_class; @@ -88,7 +88,7 @@ typedef struct _VipsInterpolateClass { GType vips_interpolate_get_type( void ); void vips_interpolate( VipsInterpolate *interpolate, - PEL *out, VipsRegion *in, double x, double y ); + void *out, VipsRegion *in, double x, double y ); VipsInterpolateMethod vips_interpolate_get_method( VipsInterpolate *interpolate ); int vips_interpolate_get_window_size( VipsInterpolate *interpolate ); int vips_interpolate_get_window_offset( VipsInterpolate *interpolate ); diff --git a/libvips/include/vips/mosaicing.h b/libvips/include/vips/mosaicing.h index f3c90cb4..3fabf772 100644 --- a/libvips/include/vips/mosaicing.h +++ b/libvips/include/vips/mosaicing.h @@ -37,6 +37,8 @@ extern "C" { #endif /*__cplusplus*/ +#include + int im_lrmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, int dx, int dy, int mwidth ); int im_tbmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, diff --git a/libvips/include/vips/operation.h b/libvips/include/vips/operation.h index ba69a706..0aa481d7 100644 --- a/libvips/include/vips/operation.h +++ b/libvips/include/vips/operation.h @@ -34,6 +34,8 @@ extern "C" { #endif /*__cplusplus*/ +#include + #define VIPS_TYPE_OPERATION (vips_operation_get_type()) #define VIPS_OPERATION( obj ) \ (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ diff --git a/libvips/include/vips/private.h b/libvips/include/vips/private.h index 1793c8c9..e2f6cb77 100644 --- a/libvips/include/vips/private.h +++ b/libvips/include/vips/private.h @@ -90,7 +90,7 @@ typedef struct { * update operation and we'd need to _remove() and _insert() on every list * operation. */ -typedef struct { +typedef struct _VipsBufferCacheList { GSList *buffers; /* GSList of VipsBuffer* */ GThread *thread; /* Just for sanity checking */ struct _VipsImage *im; @@ -99,7 +99,7 @@ typedef struct { /* What we track for each pixel buffer. */ -typedef struct { +typedef struct _VipsBuffer { int ref_count; /* # of regions referencing us */ struct _VipsImage *im; /* VipsImage we are attached to */ @@ -124,7 +124,7 @@ void vips_buffer_print( VipsBuffer *buffer ); /* Region types. */ -typedef enum region_type { +typedef enum _RegionType { VIPS_REGION_NONE, VIPS_REGION_BUFFER, /* A VipsBuffer */ VIPS_REGION_OTHER_REGION, /* Memory on another region */ @@ -160,6 +160,12 @@ int vips_region_fill( struct _VipsRegion *reg, int vips__image_wio_output( struct _VipsImage *image ); int vips__image_pio_output( struct _VipsImage *image ); +VipsArgumentInstance *vips__argument_get_instance( + VipsArgumentClass *argument_class, + VipsObject *object); +VipsArgument *vips__argument_table_lookup( VipsArgumentTable *table, + GParamSpec *pspec); + #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/libvips/include/vips/region.h b/libvips/include/vips/region.h index 352be997..b94cd658 100644 --- a/libvips/include/vips/region.h +++ b/libvips/include/vips/region.h @@ -99,7 +99,7 @@ typedef struct _VipsRegionClass { GType vips_region_get_type( void ); -VipsRegion *vips_region_new( VipsImage *im ); +VipsRegion *vips_region_new( VipsImage *image ); int vips_region_buffer( VipsRegion *reg, VipsRect *r ); int vips_region_image( VipsRegion *reg, VipsRect *r ); diff --git a/libvips/include/vips/semaphore.h b/libvips/include/vips/semaphore.h index 83560801..42621a02 100644 --- a/libvips/include/vips/semaphore.h +++ b/libvips/include/vips/semaphore.h @@ -40,6 +40,9 @@ extern "C" { #endif /*__cplusplus*/ +#include +#include + /* Implement our own semaphores. */ typedef struct { diff --git a/libvips/iofuncs/error.c b/libvips/iofuncs/error.c index c506f504..00db5f2d 100644 --- a/libvips/iofuncs/error.c +++ b/libvips/iofuncs/error.c @@ -1100,7 +1100,7 @@ vips_check_hist( const char *domain, VipsImage *im ) } /** - * vips_check_imask: + * vips_check_imask: (skip) * @domain: the originating domain for the error message * @mask: mask to check * @@ -1128,7 +1128,7 @@ vips_check_imask( const char *domain, INTMASK *mask ) } /** - * vips_check_dmask: + * vips_check_dmask: (skip) * @domain: the originating domain for the error message * @mask: mask to check * @@ -1156,7 +1156,7 @@ vips_check_dmask( const char *domain, DOUBLEMASK *mask ) } /** - * vips_check_dmask_1d: + * vips_check_dmask_1d: (skip) * @domain: the originating domain for the error message * @mask: mask to check * diff --git a/libvips/iofuncs/header.c b/libvips/iofuncs/header.c index ed552334..e9b80dbd 100644 --- a/libvips/iofuncs/header.c +++ b/libvips/iofuncs/header.c @@ -410,7 +410,7 @@ vips_image_get_mode( const VipsImage *image ) } /** - * vips_image_get_data: + * vips_image_get_data: (skip) * @image: image to get data for * * Return a pointer to the image's pixel data, if possible. This can involve @@ -436,9 +436,9 @@ vips_image_get_data( VipsImage *image ) * @xsize: image width * @ysize: image height * @bands: image bands - * @bandfmt: band format + * @format: band format * @coding: image coding - * @type: image type + * @interpretation: image type * @xres: horizontal resolution, pixels per millimetre * @yres: vertical resolution, pixels per millimetre * @@ -861,7 +861,7 @@ vips_image_map_fn( VipsMeta *meta, VipsImageMapFn fn, void *a ) } /** - * vips_image_map: + * vips_image_map: (skip) * @image: image to map over * @fn: function to call for each header field * @a: user data for function @@ -1017,7 +1017,7 @@ vips_image_set_blob( VipsImage *image, const char *field, } /** - * vips_image_get_blob: + * vips_image_get_blob: (skip) * @image: image to get the metadata from * @field: metadata name * @data: pointer to area of memory @@ -1352,7 +1352,7 @@ vips_image_history_printf( VipsImage *image, const char *fmt, ... ) /** * vips_image_history_args: - * @out: image to attach history line to + * @image: image to attach history line to * @name: program name * @argc: number of program arguments * @argv: program arguments diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 0e5d02f1..5d4a707a 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -402,7 +402,7 @@ static GOptionEntry option_entries[] = { }; /** - * vips_get_option_group: + * vips_get_option_group: (skip) * * vips_get_option_group() returns a GOptionGroup containing various VIPS * command-line options. It can be used with GOption to help diff --git a/libvips/iofuncs/object.c b/libvips/iofuncs/object.c index f41e6812..eb7d7541 100644 --- a/libvips/iofuncs/object.c +++ b/libvips/iofuncs/object.c @@ -303,7 +303,18 @@ vips_argument_table_destroy( VipsArgumentTable *table ) g_hash_table_destroy( table ); } -/* Loop over the vips_arguments to an object. +/** + * vips_argument_map: (skip) + * @object: object whose args should be enumerated + * @fn: call this function for every argument + * @a: client data + * @b: client data + * + * Loop over the vips_arguments to an object. Stop when @fn returns non-%NULL + * and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. */ void * vips_argument_map( VipsObject *object, @@ -1535,6 +1546,18 @@ vips_object_find_required( VipsObject *object ) vips_argument_is_required, NULL, NULL ) ); } +/** + * vips_object_new: (skip) + * @type: object to create + * @set: set arguments with this + * @a: client data + * @b: client data + * + * g_object_new() the object, set any arguments with @set, call + * vips_object_build() and return the complete object. + * + * Returns: the new object + */ VipsObject * vips_object_new( GType type, VipsObjectSetArguments set, void *a, void *b ) { @@ -1717,7 +1740,12 @@ vips_object_to_string_optional( VipsObject *object, return( NULL ); } -/* The inverse of vips_object_new_from_string(): turn an object into eg. +/** + * vips_object_to_string: (skip) + * @object: object to stringify + * @buf: write string here + * + * The inverse of vips_object_new_from_string(): turn an object into eg. * "VipsInterpolateSnohalo1(blur=.333333)". */ void @@ -1757,6 +1785,18 @@ vips_object_map_sub( VipsObject *key, VipsObject *value, args->result = args->fn( key, args->a, args->b ); } +/** + * vips_object_map: (skip) + * @fn: function to call for all objects + * @a: client data + * @b: client data + * + * Call a function for all alive objects. + * Stop when @fn returns non-%NULL and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. + */ void * vips_object_map( VipsSListMap2Fn fn, void *a, void *b ) { @@ -1780,7 +1820,18 @@ vips_object_map( VipsSListMap2Fn fn, void *a, void *b ) return( args.result ); } -/* Map over all a type's children. +/** + * vips_type_map: (skip) + * @base: base type + * @fn: call this function for every type + * @a: client data + * @b: client data + * + * Map over a type's children. Stop when @fn returns non-%NULL + * and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. */ void * vips_type_map( GType base, VipsTypeMap2Fn fn, void *a, void *b ) @@ -1799,7 +1850,17 @@ vips_type_map( GType base, VipsTypeMap2Fn fn, void *a, void *b ) return( result ); } -/* Loop over all the subtypes of a base type. +/** + * vips_type_map_all: (skip) + * @base: base type + * @fn: call this function for every type + * @a: client data + * + * Map over a type's children, direct and indirect. Stop when @fn returns + * non-%NULL and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. */ void * vips_type_map_all( GType base, VipsTypeMapFn fn, void *a ) @@ -1866,10 +1927,15 @@ test_name( VipsObjectClass *class, const char *nickname ) return( NULL ); } -/* Find a class ... search below base, return the first match on a nickname or - * a name. If basename is NULL, search all of VipsObject. +/** + * vips_class_find: (skip) + * @basename: name of base class + * @nickname: search for a class with this nickname * - * If not found, return NULL without setting an error message. + * Search below basename, return the first class whose name or nickname + * matches. + * + * Returns: the found class. */ VipsObjectClass * vips_class_find( const char *basename, const char *nickname ) diff --git a/libvips/iofuncs/sink.h b/libvips/iofuncs/sink.h index 1df31684..e520fc0c 100644 --- a/libvips/iofuncs/sink.h +++ b/libvips/iofuncs/sink.h @@ -37,6 +37,9 @@ extern "C" { #endif /*__cplusplus*/ +#include +#include + /* Base for sink.c / sinkdisc.c / sinkmemory.c */ typedef struct _SinkBase { diff --git a/libvips/resample/bicubic.cpp b/libvips/resample/bicubic.cpp index ed5bac83..ddbb01a5 100644 --- a/libvips/resample/bicubic.cpp +++ b/libvips/resample/bicubic.cpp @@ -105,7 +105,7 @@ G_DEFINE_TYPE( VipsInterpolateBicubic, vips_interpolate_bicubic, */ template static void inline -bicubic_int_tab( PEL *pout, const PEL *pin, +bicubic_int_tab( void *pout, const PEL *pin, const int bands, const int lskip, const int *cx, const int *cy ) { @@ -173,7 +173,7 @@ bicubic_int_tab( PEL *pout, const PEL *pin, */ template static void inline -bicubic_float_tab( PEL *pout, const PEL *pin, +bicubic_float_tab( void *pout, const PEL *pin, const int bands, const int lskip, const double *cx, const double *cy ) { @@ -236,7 +236,7 @@ bicubic_float_tab( PEL *pout, const PEL *pin, */ template static void inline -bicubic_notab( PEL *pout, const PEL *pin, +bicubic_notab( void *pout, const PEL *pin, const int bands, const int lskip, double x, double y ) { @@ -303,7 +303,7 @@ bicubic_notab( PEL *pout, const PEL *pin, static void vips_interpolate_bicubic_interpolate( VipsInterpolate *interpolate, - PEL *out, REGION *in, double x, double y ) + void *out, REGION *in, double x, double y ) { /* Find the mask index. We round-to-nearest, so we need to generate * indexes in 0 to VIPS_TRANSFORM_SCALE, 2^n + 1 values. We multiply diff --git a/libvips/resample/interpolate.c b/libvips/resample/interpolate.c index b414817e..e0b91460 100644 --- a/libvips/resample/interpolate.c +++ b/libvips/resample/interpolate.c @@ -196,7 +196,7 @@ vips_interpolate_init( VipsInterpolate *interpolate ) } /** - * vips_interpolate: + * vips_interpolate: (skip) * @interpolate: interpolator to use * @out: write result here * @in: read source data from here @@ -211,7 +211,7 @@ vips_interpolate_init( VipsInterpolate *interpolate ) */ void vips_interpolate( VipsInterpolate *interpolate, - PEL *out, REGION *in, double x, double y ) + void *out, REGION *in, double x, double y ) { VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate ); @@ -221,7 +221,7 @@ vips_interpolate( VipsInterpolate *interpolate, } /** - * vips_interpolate_get_method: + * vips_interpolate_get_method: (skip) * @interpolate: interpolator to use * * Look up the @interpolate method in the class and return it. Use this @@ -329,7 +329,7 @@ G_DEFINE_TYPE( VipsInterpolateNearest, vips_interpolate_nearest, static void vips_interpolate_nearest_interpolate( VipsInterpolate *interpolate, - PEL *out, REGION *in, double x, double y ) + void *out, REGION *in, double x, double y ) { /* Pel size and line size. */ @@ -342,11 +342,12 @@ vips_interpolate_nearest_interpolate( VipsInterpolate *interpolate, const int yi = (int) y; const PEL *p = (PEL *) IM_REGION_ADDR( in, xi, yi ); + PEL *q = (PEL *) out; int z; for( z = 0; z < ps; z++ ) - out[z] = p[z]; + q[z] = p[z]; } static void @@ -386,7 +387,7 @@ vips_interpolate_nearest_new( void ) * A convenience function that returns a nearest-neighbour interpolator you * don't need to free. * - * Returns: a nearest-neighbour interpolator + * Returns: (transfer none): a nearest-neighbour interpolator */ VipsInterpolate * vips_interpolate_nearest_static( void ) @@ -499,7 +500,7 @@ G_DEFINE_TYPE( VipsInterpolateBilinear, vips_interpolate_bilinear, static void vips_interpolate_bilinear_interpolate( VipsInterpolate *interpolate, - PEL *out, REGION *in, double x, double y ) + void *out, REGION *in, double x, double y ) { /* Pel size and line size. */ @@ -558,7 +559,7 @@ vips_interpolate_bilinear_new( void ) * A convenience function that returns a bilinear interpolator you * don't need to free. * - * Returns: a bilinear interpolator + * Returns: (transfer none): a bilinear interpolator */ VipsInterpolate * vips_interpolate_bilinear_static( void ) diff --git a/libvips/resample/lbb.cpp b/libvips/resample/lbb.cpp index e35c833e..ec3ae8af 100644 --- a/libvips/resample/lbb.cpp +++ b/libvips/resample/lbb.cpp @@ -581,7 +581,7 @@ lbbicubic( const double c00, */ #define LBB_CONVERSION( conversion ) \ template static void inline \ - lbb_ ## conversion( PEL* restrict pout, \ + lbb_ ## conversion( void* restrict pout, \ const PEL* restrict pin, \ const int bands, \ const int lskip, \ @@ -763,7 +763,7 @@ G_DEFINE_TYPE( VipsInterpolateLbb, vips_interpolate_lbb, static void vips_interpolate_lbb_interpolate( VipsInterpolate* restrict interpolate, - PEL* restrict out, + void* restrict out, REGION* restrict in, double absolute_x, double absolute_y ) diff --git a/libvips/resample/nohalo.cpp b/libvips/resample/nohalo.cpp index 2c6cead4..cbf75937 100644 --- a/libvips/resample/nohalo.cpp +++ b/libvips/resample/nohalo.cpp @@ -1224,8 +1224,8 @@ lbbicubic( const double c00, */ #define NOHALO_CONVERSION( conversion ) \ template static void inline \ - nohalo_ ## conversion( PEL* restrict pout, \ - const PEL* restrict pin, \ + nohalo_ ## conversion( void* restrict pout, \ + const void* restrict pin, \ const int bands, \ const int lskip, \ const double x_0, \ @@ -1479,7 +1479,7 @@ G_DEFINE_TYPE( VipsInterpolateNohalo, vips_interpolate_nohalo, static void vips_interpolate_nohalo_interpolate( VipsInterpolate* restrict interpolate, - PEL* restrict out, + void* restrict out, REGION* restrict in, double absolute_x, double absolute_y ) diff --git a/libvips/resample/vsqbs.cpp b/libvips/resample/vsqbs.cpp index bdc27b98..d0002e9a 100644 --- a/libvips/resample/vsqbs.cpp +++ b/libvips/resample/vsqbs.cpp @@ -178,7 +178,7 @@ typedef struct _VipsInterpolateVsqbsClass { */ #define VSQBS_CONVERSION( conversion ) \ template static void inline \ - vsqbs_ ## conversion( PEL* restrict pout, \ + vsqbs_ ## conversion( void* restrict pout, \ const PEL* restrict pin, \ const int bands, \ const int lskip, \ @@ -303,7 +303,7 @@ extern "C" { static void vips_interpolate_vsqbs_interpolate( VipsInterpolate* restrict interpolate, - PEL* restrict out, + void* restrict out, REGION* restrict in, double absolute_x, double absolute_y ) diff --git a/python/test_gobject.py b/python/test_gobject.py index a2ba97be..885f2256 100755 --- a/python/test_gobject.py +++ b/python/test_gobject.py @@ -1,36 +1,26 @@ #!/usr/bin/python -import logging import gc import sys -import ctypes -import gobject +# you might need this in your .bashrc +# export GI_TYPELIB_PATH=$VIPSHOME/lib/girepository-1.0 +from gi.repository import Vips -logging.basicConfig(level = logging.DEBUG) +a = Vips.Image() +a.props.filename = sys.argv[1] +a.props.mode = 'r' +if a.build() != 0: + print Vips.error_buffer() + sys.exit(-1) -# .15 is 7.25+ with the new vips8 API -libvips = ctypes.CDLL('libvips.so.15') -libvips.vips_init(sys.argv[0]) +print 'a.get_width() =', a.get_width() +print 'a.props.width =', a.props.width -# should be able to find vipsimage, hopefully -print gobject.type_from_name('VipsImage') +print 'starting shutdown ...' +del a +# sometimes have to do several GCs to get them all, not sure why +for i in range(10): + gc.collect () +print 'shutdown!' -_VipsImage = gobject.type_from_name('VipsImage') - -class VipsImage(_VipsImage): - def __new__(cls): - gobject.type_register(cls) - return gobject.GObject.__new__(cls) - - def __init__(self, filename = None, mode = None): - logging.debug('vipsimage: init') - - if filename != None: - self.props.filename = filename - - if mode != None: - self.props.mode = mode - -a = VipsImage('/home/john/pics/healthygirl.jpg') -# a = gobject.new(VipsImage, '/home/john/pics/healthygirl.jpg')