Merge remote-tracking branch 'origin/gobject-introspection' into goi-merge

Conflicts:
	TODO
	libvips/arithmetic/im_recomb.c
	libvips/arithmetic/im_stats.c
	libvips/deprecated/im_measure.c
	libvips/include/vips/header.h
	libvips/include/vips/image.h
	libvips/include/vips/object.h
	libvips/iofuncs/header.c
	libvips/iofuncs/image.c
	libvips/iofuncs/object.c
This commit is contained in:
John Cupitt 2011-12-24 17:36:55 +00:00
commit 0983b50905
55 changed files with 395 additions and 250 deletions

2
.gitignore vendored
View File

@ -4,6 +4,8 @@ Makefile.in
TAGS
tags
*.o
Vips-8.0.gir
Vips-8.0.typelib
.*.swp
*.lo
*.bak

View File

@ -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

31
TODO
View File

@ -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:
<unknown>:: Fatal: Vips: Unknown namespace for identifier 'vips_save_string'
- look at libpeas for plugin support
http://live.gnome.org/Libpeas

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -38,6 +38,7 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
#include <vips/vector.h>
#define VIPS_TYPE_ARITHMETIC (vips_arithmetic_get_type())

View File

@ -30,6 +30,10 @@
#ifndef VIPS_BINARY_H
#define VIPS_BINARY_H
#include <vips/vips.h>
#include "arithmetic.h"
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/

View File

@ -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 )

View File

@ -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

View File

@ -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@

View File

@ -58,6 +58,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_CFITSIO
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -736,3 +738,5 @@ vips__fits_write( VipsImage *in, const char *filename )
return( 0 );
}
#endif /*HAVE_CFITSIO*/

View File

@ -39,6 +39,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_CFITSIO
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -122,3 +124,5 @@ static void
vips_foreign_load_fits_init( VipsForeignLoadFits *fits )
{
}
#endif /*HAVE_CFITSIO*/

View File

@ -40,6 +40,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_CFITSIO
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -134,3 +136,5 @@ static void
vips_foreign_save_fits_init( VipsForeignSaveFits *fits )
{
}
#endif /*HAVE_CFITSIO*/

View File

@ -79,6 +79,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_JPEG
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -1010,3 +1012,4 @@ vips__isjpeg( const char *filename )
return( 0 );
}
#endif /*HAVE_JPEG*/

View File

@ -42,6 +42,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_JPEG
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -301,3 +303,4 @@ vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer )
{
}
#endif /*HAVE_JPEG*/

View File

@ -40,6 +40,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_JPEG
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -323,3 +325,5 @@ static void
vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime )
{
}
#endif /*HAVE_JPEG*/

View File

@ -75,6 +75,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_MAGICK
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -706,3 +708,5 @@ vips__magick_read_header( const char *filename, VipsImage *im )
return( 0 );
}
#endif /*HAVE_MAGICK*/

View File

@ -39,6 +39,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_MAGICK
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -153,3 +155,5 @@ static void
vips_foreign_load_magick_init( VipsForeignLoadMagick *magick )
{
}
#endif /*HAVE_MAGICK*/

View File

@ -56,6 +56,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_MATIO
#include <stdio.h>
#include <stdlib.h>
@ -304,3 +306,5 @@ vips__mat_ismat( const char *filename )
}
const char *vips__mat_suffs[] = { ".mat", NULL };
#endif /*HAVE_MATIO*/

View File

@ -39,6 +39,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_MATIO
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -134,3 +136,5 @@ static void
vips_foreign_load_mat_init( VipsForeignLoadMat *mat )
{
}
#endif /*HAVE_MATIO*/

View File

@ -67,6 +67,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_OPENEXR
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
@ -404,3 +406,5 @@ vips__openexr_read( const char *filename, VipsImage *out )
return( 0 );
}
#endif /*HAVE_OPENEXR*/

View File

@ -39,6 +39,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_OPENEXR
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -143,3 +145,5 @@ static void
vips_foreign_load_openexr_init( VipsForeignLoadOpenexr *openexr )
{
}
#endif /*HAVE_OPENEXR*/

View File

@ -55,6 +55,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_OPENSLIDE
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
@ -351,3 +353,4 @@ vips__openslide_read_associated( const char *filename, VipsImage *out,
return( 0 );
}
#endif /*HAVE_OPENSLIDE*/

View File

@ -39,6 +39,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_OPENSLIDE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -201,3 +203,5 @@ static void
vips_foreign_load_openslide_init( VipsForeignLoadOpenslide *openslide )
{
}
#endif /*HAVE_OPENSLIDE*/

View File

@ -47,6 +47,8 @@
#include <vips/buf.h>
#include <vips/internal.h>
#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*/

View File

@ -40,6 +40,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_PNG
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -234,3 +236,5 @@ static void
vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer )
{
}
#endif /*HAVE_PNG*/

View File

@ -162,6 +162,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_TIFF
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -1554,3 +1556,5 @@ vips__istiff( const char *filename )
return( FALSE );
}
#endif /*HAVE_TIFF*/

View File

@ -39,6 +39,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_TIFF
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -153,3 +155,5 @@ static void
vips_foreign_load_tiff_init( VipsForeignLoadTiff *tiff )
{
}
#endif /*HAVE_TIFF*/

View File

@ -40,6 +40,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_TIFF
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -276,3 +278,5 @@ vips_foreign_save_tiff_init( VipsForeignSaveTiff *tiff )
tiff->xres = 1.0;
tiff->yres = 1.0;
}
#endif /*HAVE_TIFF*/

View File

@ -85,6 +85,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_JPEG
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -1112,3 +1114,5 @@ vips__jpeg_write_buffer( VipsImage *in,
}
const char *vips__jpeg_suffs[] = { ".jpg", ".jpeg", ".jpe", NULL };
#endif /*HAVE_JPEG*/

View File

@ -163,6 +163,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_TIFF
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
@ -1538,3 +1540,4 @@ vips__tiff_write( VipsImage *in, const char *filename,
return( 0 );
}
#endif /*HAVE_TIFF*/

View File

@ -70,6 +70,8 @@
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#ifdef HAVE_PNG
#include <stdio.h>
#include <stdlib.h>
@ -686,3 +688,4 @@ vips__png_write_buf( VipsImage *in,
return( 0 );
}
#endif /*HAVE_PNG*/

View File

@ -34,6 +34,8 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
/* 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.
*/

View File

@ -37,6 +37,8 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
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,

View File

@ -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 {

View File

@ -37,6 +37,8 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
typedef enum {
VIPS_MASK_IDEAL_HIGHPASS = 0,
VIPS_MASK_IDEAL_LOWPASS = 1,

View File

@ -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,

View File

@ -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 );

View File

@ -37,6 +37,8 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
int im_lrmerge( VipsImage *ref, VipsImage *sec, VipsImage *out,
int dx, int dy, int mwidth );
int im_tbmerge( VipsImage *ref, VipsImage *sec, VipsImage *out,

View File

@ -34,6 +34,8 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
#define VIPS_TYPE_OPERATION (vips_operation_get_type())
#define VIPS_OPERATION( obj ) \
(G_TYPE_CHECK_INSTANCE_CAST( (obj), \

View File

@ -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*/

View File

@ -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 );

View File

@ -40,6 +40,9 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
#include <vips/thread.h>
/* Implement our own semaphores.
*/
typedef struct {

View File

@ -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
*

View File

@ -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

View File

@ -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

View File

@ -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 )

View File

@ -37,6 +37,9 @@
extern "C" {
#endif /*__cplusplus*/
#include <vips/vips.h>
#include <vips/thread.h>
/* Base for sink.c / sinkdisc.c / sinkmemory.c
*/
typedef struct _SinkBase {

View File

@ -105,7 +105,7 @@ G_DEFINE_TYPE( VipsInterpolateBicubic, vips_interpolate_bicubic,
*/
template <typename T, int min_value, int max_value>
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 <typename T>
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 <typename T>
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

View File

@ -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 )

View File

@ -581,7 +581,7 @@ lbbicubic( const double c00,
*/
#define LBB_CONVERSION( conversion ) \
template <typename T> 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 )

View File

@ -1224,8 +1224,8 @@ lbbicubic( const double c00,
*/
#define NOHALO_CONVERSION( conversion ) \
template <typename T> 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 )

View File

@ -178,7 +178,7 @@ typedef struct _VipsInterpolateVsqbsClass {
*/
#define VSQBS_CONVERSION( conversion ) \
template <typename T> 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 )

View File

@ -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')