diff --git a/.gitignore b/.gitignore index dd485ac7..037cf724 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ po/vips7.*.pot test-driver +po/vips*.pot vips-*.tar.gz doc/reference/setup-build.stamp doc/reference/tmpl-build.stamp diff --git a/ChangeLog b/ChangeLog index 7ec08130..58d0a731 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ - version bump - oops, VImage.PIL_mode_from_vips() failed for CMYK, thanks Alessandro - fix no-pango build +- add im_vips2dz(): run the deepzoom writer from vips7 +- vips_magickload() has an option to read all images in a sequence 12/3/13 started 7.33.0 - vipsthumbnail lets you specify the sharpening mask @@ -17,6 +19,7 @@ 14/5/13 started 7.32.4 - icc import and export could segv on very wide images +- fix centos 5 build, thanks re-boot 16/4/13 started 7.32.3 - rename GETTEXT_PACKAGE as vips7.32 to help Debian (thanks Jay) diff --git a/configure.ac b/configure.ac index ad000ac4..76fdac52 100644 --- a/configure.ac +++ b/configure.ac @@ -325,7 +325,16 @@ PKG_CHECK_MODULES(THREADS, glib-2.0 >= 2.32,[ AC_DEFINE(HAVE_PRIVATE_INIT,1,[define if your glib has G_PRIVATE_INIT().]) AC_DEFINE(HAVE_VALUE_GET_SCHAR,1,[define if your glib has g_value_get_schar().]) ],[ - # no action if not found + # the old threading system ... we need to link against gthread + PKG_CHECK_MODULES(GTHREAD, gthread-2.0) + PACKAGES_USED="$PACKAGES_USED gthread-2.0" + ] +) + +# after 2.36 the type system inits itself +PKG_CHECK_MODULES(TYPE_INIT, glib-2.0 < 2.36,[ + AC_DEFINE(NEED_TYPE_INIT,1,[define if your glib needs g_type_init().]) + ],[ ] ) diff --git a/libvips/deprecated/Makefile.am b/libvips/deprecated/Makefile.am index 8986838b..f1fbfcd8 100644 --- a/libvips/deprecated/Makefile.am +++ b/libvips/deprecated/Makefile.am @@ -68,6 +68,7 @@ libdeprecated_la_SOURCES = \ im_vips2png.c \ im_vips2ppm.c \ im_vips2tiff.c \ + im_vips2dz.c \ matlab.c \ radiance.c \ raw.c diff --git a/libvips/deprecated/format_dispatch.c b/libvips/deprecated/format_dispatch.c index 77208bf7..40e9143f 100644 --- a/libvips/deprecated/format_dispatch.c +++ b/libvips/deprecated/format_dispatch.c @@ -63,6 +63,32 @@ static im_function jpeg2vips_desc = { jpeg2vips_args /* Arg list */ }; +static int +vips2dz_vec( im_object *argv ) +{ + IMAGE *in = argv[0]; + char *out = argv[1]; + + if( im_vips2dz( in, out ) ) + return( -1 ); + + return( 0 ); +} + +static im_arg_desc vips2dz_args[] = { + IM_INPUT_IMAGE( "in" ), + IM_INPUT_STRING( "out" ) +}; + +static im_function vips2dz_desc = { + "im_vips2dz", /* Name */ + "save as deepzoom", /* Description */ + 0, /* Flags */ + vips2dz_vec, /* Dispatch function */ + IM_NUMBER( vips2dz_args ), /* Size of arg list */ + vips2dz_args /* Arg list */ +}; + static int vips2jpeg_vec( im_object *argv ) { @@ -425,6 +451,7 @@ static im_function *list[] = { &analyze2vips_desc, &tiff2vips_desc, &vips2csv_desc, + &vips2dz_desc, &vips2jpeg_desc, &vips2mimejpeg_desc, &vips2png_desc, diff --git a/libvips/deprecated/im_magick2vips.c b/libvips/deprecated/im_magick2vips.c index ae41fc2e..183d0efe 100644 --- a/libvips/deprecated/im_magick2vips.c +++ b/libvips/deprecated/im_magick2vips.c @@ -48,7 +48,9 @@ int im_magick2vips( const char *filename, IMAGE *out ) { #ifdef HAVE_MAGICK - return( vips__magick_read( filename, out ) ); + /* Old behaviour was always to read all frames. + */ + return( vips__magick_read( filename, out, TRUE ) ); #else vips_error( "im_magick2vips", _( "no libMagick support in your libvips" ) ); diff --git a/libvips/deprecated/im_vips2dz.c b/libvips/deprecated/im_vips2dz.c new file mode 100644 index 00000000..15f8b31e --- /dev/null +++ b/libvips/deprecated/im_vips2dz.c @@ -0,0 +1,126 @@ +/* vips7 compat stub for vips_dzsave() + * + * 11/6/13 + * - from im_vips2tiff() + */ + +/* + + 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., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA + + */ + +/* + + These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +/* Turn on IM_REGION_ADDR() range checks, don't delete intermediates. +#define DEBUG + */ + +#ifdef HAVE_CONFIG_H +#include +#endif /*HAVE_CONFIG_H*/ +#include + +#include +#include +#include + +#include + +int +im_vips2dz( IMAGE *in, const char *filename ) +{ + char *p, *q; + char name[FILENAME_MAX]; + char mode[FILENAME_MAX]; + char buf[FILENAME_MAX]; + + int i; + VipsForeignDzLayout layout = VIPS_FOREIGN_DZ_LAYOUT_DZ; + char *suffix = ".jpeg"; + int overlap = 0; + int tile_size = 256; + VipsForeignDzDepth depth = VIPS_FOREIGN_DZ_DEPTH_1PIXEL; + gboolean centre = FALSE; + VipsAngle angle = VIPS_ANGLE_0; + + /* We can't use im_filename_split() --- it assumes that we have a + * filename with an extension before the ':', and filename here is + * actually a dirname. + * + * Just split on the first ':'. + */ + im_strncpy( name, filename, FILENAME_MAX ); + if( (p = strchr( name, ':' )) ) { + *p = '\0'; + im_strncpy( mode, p + 1, FILENAME_MAX ); + } + + strcpy( buf, mode ); + p = &buf[0]; + + if( (q = im_getnextoption( &p )) ) { + if( (i = vips_enum_from_nick( "im_vips2dz", + VIPS_TYPE_FOREIGN_DZ_LAYOUT, q )) < 0 ) + return( -1 ); + layout = i; + } + + if( (q = im_getnextoption( &p )) ) + suffix = g_strdup( q ); + if( (q = im_getnextoption( &p )) ) + overlap = atoi( q ); + if( (q = im_getnextoption( &p )) ) + tile_size = atoi( q ); + + if( (q = im_getnextoption( &p )) ) { + if( (i = vips_enum_from_nick( "im_vips2dz", + VIPS_TYPE_FOREIGN_DZ_DEPTH, q )) < 0 ) + return( -1 ); + depth = i; + } + + if( (q = im_getnextoption( &p )) ) { + if( im_isprefix( "cen", q ) ) + centre = TRUE; + } + + if( (q = im_getnextoption( &p )) ) { + if( (i = vips_enum_from_nick( "im_vips2dz", + VIPS_TYPE_ANGLE, q )) < 0 ) + return( -1 ); + angle = i; + } + + if( vips_dzsave( in, name, + "layout", layout, + "suffix", suffix, + "overlap", overlap, + "tile_size", tile_size, + "depth", depth, + "centre", centre, + "angle", angle, + NULL ) ) + return( -1 ); + + return( 0 ); +} diff --git a/libvips/foreign/dzsave.c b/libvips/foreign/dzsave.c index 9cc8ae12..fc4b6d42 100644 --- a/libvips/foreign/dzsave.c +++ b/libvips/foreign/dzsave.c @@ -1341,7 +1341,7 @@ vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class ) _( "Filename suffix for tiles" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignSaveDz, suffix ), - ".jpg" ); + ".jpeg" ); VIPS_ARG_INT( class, "overlap", 10, _( "Overlap" ), @@ -1392,7 +1392,7 @@ vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class ) VIPS_ARG_STRING( class, "dirname", 1, _( "Base name" ), _( "Base name to save to" ), - VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, G_STRUCT_OFFSET( VipsForeignSaveDz, basename ), NULL ); diff --git a/libvips/foreign/foreign.c b/libvips/foreign/foreign.c index b649defb..47f248ec 100644 --- a/libvips/foreign/foreign.c +++ b/libvips/foreign/foreign.c @@ -1668,6 +1668,10 @@ vips_foreign_operation_init( void ) * @out: decompressed image * @...: %NULL-terminated list of optional named arguments * + * Optional arguments: + * + * @all_frames: load all frames in sequence + * * Read in an image using libMagick, the ImageMagick library. This library can * read more than 80 file formats, including SVG, BMP, EPS, DICOM and many * others. @@ -1678,6 +1682,9 @@ vips_foreign_operation_init( void ) * The reader should also work with most versions of GraphicsMagick. See the * "--with-magickpackage" configure option. * + * Normally it will only load the first image in a many-image sequence (such + * as a GIF). Set @all_frames to true to read the whole image sequence. + * * See also: vips_image_new_from_file(). * * Returns: 0 on success, -1 on error. diff --git a/libvips/foreign/magick.h b/libvips/foreign/magick.h index 37a56bec..df67db0a 100644 --- a/libvips/foreign/magick.h +++ b/libvips/foreign/magick.h @@ -35,8 +35,10 @@ extern "C" { #endif /*__cplusplus*/ -int vips__magick_read( const char *filename, VipsImage *out ); -int vips__magick_read_header( const char *filename, VipsImage *out ); +int vips__magick_read( const char *filename, + VipsImage *out, gboolean all_frames ); +int vips__magick_read_header( const char *filename, + VipsImage *out, gboolean all_frames ); #ifdef __cplusplus } diff --git a/libvips/foreign/magick2vips.c b/libvips/foreign/magick2vips.c index 1ae4eeb5..75e0e27a 100644 --- a/libvips/foreign/magick2vips.c +++ b/libvips/foreign/magick2vips.c @@ -38,6 +38,8 @@ * - use new API stuff, argh * 17/12/11 * - turn into a set of read fns ready to be called from a class + * 11/6/13 + * - add @all_frames option, off by default */ /* @@ -106,6 +108,7 @@ typedef struct _Read { char *filename; VipsImage *im; + gboolean all_frames; Image *image; ImageInfo *image_info; @@ -138,7 +141,7 @@ read_destroy( VipsImage *im, Read *read ) } static Read * -read_new( const char *filename, VipsImage *im ) +read_new( const char *filename, VipsImage *im, gboolean all_frames ) { Read *read; static int inited = 0; @@ -155,6 +158,7 @@ read_new( const char *filename, VipsImage *im ) if( !(read = VIPS_NEW( im, Read )) ) return( NULL ); read->filename = g_strdup( filename ); + read->all_frames = all_frames; read->im = im; read->image = NULL; read->image_info = CloneImageInfo( NULL ); @@ -245,6 +249,8 @@ parse_header( Read *read ) IsMonochromeImage( image, &image->exception ) ); printf( "IsOpaqueImage() = %d\n", IsOpaqueImage( image, &image->exception ) ); + printf( "image->columns = %zd\n", image->columns ); + printf( "image->rows = %zd\n", image->rows ); #endif /*DEBUG*/ im->Xsize = image->columns; @@ -405,6 +411,15 @@ parse_header( Read *read ) */ read->n_frames = 1; +#ifdef DEBUG + printf( "image has %d frames\n", read->n_frames ); +#endif /*DEBUG*/ + + /* If all_frames is off, just get the first one. + */ + if( !read->all_frames ) + read->n_frames = 1; + /* Record frame pointers. */ im->Ysize *= read->n_frames; @@ -632,7 +647,7 @@ magick_fill_region( VipsRegion *out, } int -vips__magick_read( const char *filename, VipsImage *out ) +vips__magick_read( const char *filename, VipsImage *out, gboolean all_frames ) { Read *read; @@ -640,7 +655,7 @@ vips__magick_read( const char *filename, VipsImage *out ) printf( "magick2vips: vips__magick_read: %s\n", filename ); #endif /*DEBUG*/ - if( !(read = read_new( filename, out )) ) + if( !(read = read_new( filename, out, all_frames )) ) return( -1 ); #ifdef HAVE_SETIMAGEOPTION @@ -681,7 +696,8 @@ vips__magick_read( const char *filename, VipsImage *out ) * http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=20017 */ int -vips__magick_read_header( const char *filename, VipsImage *im ) +vips__magick_read_header( const char *filename, VipsImage *im, + gboolean all_frames ) { Read *read; @@ -689,7 +705,7 @@ vips__magick_read_header( const char *filename, VipsImage *im ) printf( "vips__magick_read_header: %s\n", filename ); #endif /*DEBUG*/ - if( !(read = read_new( filename, im )) ) + if( !(read = read_new( filename, im, all_frames )) ) return( -1 ); #ifdef DEBUG diff --git a/libvips/foreign/magickload.c b/libvips/foreign/magickload.c index 2ad1aca4..2f9bc3c0 100644 --- a/libvips/foreign/magickload.c +++ b/libvips/foreign/magickload.c @@ -4,6 +4,8 @@ * - from openslideload.c * 17/1/12 * - remove header-only loads + * 11/6/13 + * - add @all_frames option, off by default */ /* @@ -57,9 +59,8 @@ typedef struct _VipsForeignLoadMagick { VipsForeignLoad parent_object; - /* Filename for load. - */ char *filename; + gboolean all_frames; } VipsForeignLoadMagick; @@ -74,7 +75,7 @@ ismagick( const char *filename ) VipsImage *t; t = vips_image_new(); - if( vips__magick_read_header( filename, t ) ) { + if( vips__magick_read_header( filename, t, FALSE ) ) { g_object_unref( t ); return( FALSE ); } @@ -111,7 +112,8 @@ vips_foreign_load_magick_header( VipsForeignLoad *load ) { VipsForeignLoadMagick *magick = (VipsForeignLoadMagick *) load; - if( vips__magick_read( magick->filename, load->out ) ) + if( vips__magick_read( magick->filename, + load->out, magick->all_frames ) ) return( -1 ); return( 0 ); @@ -149,6 +151,13 @@ vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class ) VIPS_ARGUMENT_REQUIRED_INPUT, G_STRUCT_OFFSET( VipsForeignLoadMagick, filename ), NULL ); + + VIPS_ARG_BOOL( class, "all_frames", 3, + _( "all_frames" ), + _( "Read all frames from an image" ), + VIPS_ARGUMENT_OPTIONAL_INPUT, + G_STRUCT_OFFSET( VipsForeignLoadMagick, all_frames ), + FALSE ); } static void diff --git a/libvips/include/vips/format.h b/libvips/include/vips/format.h index 311df9b1..ffc1f7cb 100644 --- a/libvips/include/vips/format.h +++ b/libvips/include/vips/format.h @@ -165,6 +165,8 @@ int im_vips2rad( VipsImage *in, const char *filename ); int im_fits2vips( const char *filename, VipsImage *out ); int im_vips2fits( VipsImage *in, const char *filename ); +int im_vips2dz( VipsImage *in, const char *filename ); + #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/libvips/include/vips/util.h b/libvips/include/vips/util.h index 08671572..a1d55c20 100644 --- a/libvips/include/vips/util.h +++ b/libvips/include/vips/util.h @@ -159,6 +159,7 @@ G_STMT_START { \ const char *vips_enum_string( GType enm, int value ); const char *vips_enum_nick( GType enm, int value ); +int vips_enum_from_nick( const char *domain, GType type, const char *str ); gboolean vips_slist_equal( GSList *l1, GSList *l2 ); void *vips_slist_map2( GSList *list, VipsSListMap2Fn fn, void *a, void *b ); diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 26965dd6..4b74e740 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -192,9 +192,11 @@ vips_init( const char *argv0 ) return( 0 ); started = TRUE; - /* Need gobject etc. +#ifdef NEED_TYPE_INIT + /* Before glib 2.36 you have to call this on startup. */ g_type_init(); +#endif /*NEED_TYPE_INIT*/ /* Older glibs need this. */ diff --git a/libvips/iofuncs/object.c b/libvips/iofuncs/object.c index aca5f367..e051c00f 100644 --- a/libvips/iofuncs/object.c +++ b/libvips/iofuncs/object.c @@ -1439,29 +1439,6 @@ vips_object_class_install_argument( VipsObjectClass *object_class, #endif /*DEBUG*/ } -/* Make a bad-enum error. A common and fiddly case. - */ -static void -vips_enum_error( VipsObjectClass *class, GType otype, const char *value ) -{ - GEnumClass *genum = G_ENUM_CLASS( g_type_class_ref( otype ) ); - int i; - char str[1000]; - VipsBuf buf = VIPS_BUF_STATIC( str ); - - /* -1 since we always have a "last" member. - */ - for( i = 0; i < genum->n_values - 1; i++ ) { - if( i > 0 ) - vips_buf_appends( &buf, ", " ); - vips_buf_appends( &buf, genum->values[i].value_nick ); - } - - vips_error( class->nickname, _( "enum '%s' has no member '%s', " - "should be one of: %s" ), - g_type_name( otype ), value, vips_buf_all( &buf ) ); -} - static void vips_object_no_value( VipsObject *object, const char *name ) { @@ -1644,24 +1621,19 @@ vips_object_set_argument_from_string( VipsObject *object, g_value_set_double( &gvalue, d ); } else if( G_IS_PARAM_SPEC_ENUM( pspec ) ) { - GEnumValue *enum_value; + int i; if( !value ) { vips_object_no_value( object, name ); return( -1 ); } - if( !(enum_value = g_enum_get_value_by_name( - g_type_class_ref( otype ), value )) ) { - if( !(enum_value = g_enum_get_value_by_nick( - g_type_class_ref( otype ), value )) ) { - vips_enum_error( class, otype, value ); - return( -1 ); - } - } + if( (i = vips_enum_from_nick( class->nickname, + otype, value )) < 0 ) + return( -1 ); g_value_init( &gvalue, otype ); - g_value_set_enum( &gvalue, enum_value->value ); + g_value_set_enum( &gvalue, i ); } else if( G_IS_PARAM_SPEC_FLAGS( pspec ) ) { /* Hard to set from a symbolic name. Just take an int. diff --git a/libvips/iofuncs/operation.c b/libvips/iofuncs/operation.c index f1fcd2ed..6cf4350f 100644 --- a/libvips/iofuncs/operation.c +++ b/libvips/iofuncs/operation.c @@ -549,7 +549,7 @@ vips_call( const char *operation_name, ... ) #ifdef VIPS_DEBUG VIPS_DEBUG_MSG( "where:\n" ); - vips_object_print( VIPS_OBJECT( operation ) ); + vips_object_print_dump( VIPS_OBJECT( operation ) ); #endif /*VIPS_DEBUG*/ /* We have to break the va_list into separate required and optional diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c index 5b82145b..14846d55 100644 --- a/libvips/iofuncs/util.c +++ b/libvips/iofuncs/util.c @@ -1653,3 +1653,39 @@ vips_enum_nick( GType enm, int v ) return( value->value_nick ); } + +int +vips_enum_from_nick( const char *domain, GType type, const char *nick ) +{ + GTypeClass *class; + GEnumClass *genum; + GEnumValue *enum_value; + int i; + char str[1000]; + VipsBuf buf = VIPS_BUF_STATIC( str ); + + if( !(class = g_type_class_ref( type )) ) { + vips_error( domain, "%s", _( "no such enum type" ) ); + return( -1 ); + } + genum = G_ENUM_CLASS( class ); + + if( (enum_value = g_enum_get_value_by_name( genum, nick )) ) + return( enum_value->value ); + if( (enum_value = g_enum_get_value_by_nick( genum, nick )) ) + return( enum_value->value ); + + /* -1 since we always have a "last" member. + */ + for( i = 0; i < genum->n_values - 1; i++ ) { + if( i > 0 ) + vips_buf_appends( &buf, ", " ); + vips_buf_appends( &buf, genum->values[i].value_nick ); + } + + vips_error( domain, _( "enum '%s' has no member '%s', " + "should be one of: %s" ), + g_type_name( type ), nick, vips_buf_all( &buf ) ); + + return( -1 ); +} diff --git a/libvipsCC/include/vips/vipsc++.h b/libvipsCC/include/vips/vipsc++.h index 070c40e0..ea3be1e9 100644 --- a/libvipsCC/include/vips/vipsc++.h +++ b/libvipsCC/include/vips/vipsc++.h @@ -1,7 +1,7 @@ // headers for package arithmetic // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage abs() throw( VError ); VImage acos() throw( VError ); VImage add( VImage add_in2 ) throw( VError ); @@ -49,13 +49,13 @@ VImage tan() throw( VError ); // headers for package cimg // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage greyc( int greyc_iterations, double greyc_amplitude, double greyc_sharpness, double greyc_anisotropy, double greyc_alpha, double greyc_sigma, double greyc_dl, double greyc_da, double greyc_gauss_prec, int greyc_interpolation, int greyc_fast_approx ) throw( VError ); VImage greyc_mask( VImage greyc_mask_mask, int greyc_mask_iterations, double greyc_mask_amplitude, double greyc_mask_sharpness, double greyc_mask_anisotropy, double greyc_mask_alpha, double greyc_mask_sigma, double greyc_mask_dl, double greyc_mask_da, double greyc_mask_gauss_prec, int greyc_mask_interpolation, int greyc_mask_fast_approx ) throw( VError ); // headers for package colour // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage LCh2Lab() throw( VError ); VImage LCh2UCS() throw( VError ); VImage Lab2LCh() throw( VError ); @@ -101,7 +101,7 @@ VImage sRGB2XYZ() throw( VError ); // headers for package conversion // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 static VImage gaussnoise( int gaussnoise_xsize, int gaussnoise_ysize, double gaussnoise_mean, double gaussnoise_sigma ) throw( VError ); VImage bandjoin( VImage bandjoin_in2 ) throw( VError ); static VImage black( int black_x_size, int black_y_size, int black_bands ) throw( VError ); @@ -149,7 +149,7 @@ VImage zoom( int zoom_xfac, int zoom_yfac ) throw( VError ); // headers for package convolution // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage aconvsep( VDMask aconvsep_matrix, int aconvsep_n_layers ) throw( VError ); VImage aconv( VDMask aconv_matrix, int aconv_n_layers, int aconv_cluster ) throw( VError ); VImage addgnoise( double addgnoise_sigma ) throw( VError ); @@ -170,7 +170,7 @@ VImage spcor( VImage spcor_in2 ) throw( VError ); // headers for package deprecated // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage argb2rgba() throw( VError ); VImage flood_copy( int flood_copy_start_x, int flood_copy_start_y, std::vector flood_copy_ink ) throw( VError ); VImage flood_blob_copy( int flood_blob_copy_start_x, int flood_blob_copy_start_y, std::vector flood_blob_copy_ink ) throw( VError ); @@ -253,10 +253,11 @@ VImage moreeq( double moreeq_c ) throw( VError ); VImage notequal( VImage notequal_in2 ) throw( VError ); VImage notequal( std::vector notequal_vec ) throw( VError ); VImage notequal( double notequal_c ) throw( VError ); +VImage quadratic( VImage quadratic_coeff ) throw( VError ); // headers for package format // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 static VImage csv2vips( char* csv2vips_filename ) throw( VError ); static VImage fits2vips( char* fits2vips_in ) throw( VError ); static VImage jpeg2vips( char* jpeg2vips_in ) throw( VError ); @@ -267,6 +268,7 @@ static VImage ppm2vips( char* ppm2vips_filename ) throw( VError ); static VImage analyze2vips( char* analyze2vips_filename ) throw( VError ); static VImage tiff2vips( char* tiff2vips_in ) throw( VError ); void vips2csv( char* vips2csv_filename ) throw( VError ); +void vips2dz( char* vips2dz_out ) throw( VError ); void vips2jpeg( char* vips2jpeg_out ) throw( VError ); void vips2mimejpeg( int vips2mimejpeg_qfac ) throw( VError ); void vips2png( char* vips2png_out ) throw( VError ); @@ -275,7 +277,7 @@ void vips2tiff( char* vips2tiff_out ) throw( VError ); // headers for package freq_filt // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 static VImage create_fmask( int create_fmask_width, int create_fmask_height, int create_fmask_type, double create_fmask_p1, double create_fmask_p2, double create_fmask_p3, double create_fmask_p4, double create_fmask_p5 ) throw( VError ); VImage disp_ps() throw( VError ); VImage flt_image_freq( int flt_image_freq_type, double flt_image_freq_p1, double flt_image_freq_p2, double flt_image_freq_p3, double flt_image_freq_p4, double flt_image_freq_p5 ) throw( VError ); @@ -289,7 +291,7 @@ VImage invfftr() throw( VError ); // headers for package histograms_lut // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage gammacorrect( double gammacorrect_exponent ) throw( VError ); VImage heq( int heq_band_number ) throw( VError ); VImage hist( int hist_band_number ) throw( VError ); @@ -319,7 +321,7 @@ VImage tone_map( VImage tone_map_lut ) throw( VError ); // headers for package inplace // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 void draw_circle( int draw_circle_cx, int draw_circle_cy, int draw_circle_radius, int draw_circle_fill, std::vector draw_circle_ink ) throw( VError ); void draw_rect( int draw_rect_left, int draw_rect_top, int draw_rect_width, int draw_rect_height, int draw_rect_fill, std::vector draw_rect_ink ) throw( VError ); void draw_line( int draw_line_x1, int draw_line_y1, int draw_line_x2, int draw_line_y2, std::vector draw_line_ink ) throw( VError ); @@ -334,7 +336,7 @@ VImage line( VImage line_mask, VImage line_ink, std::vector line_x1, std::v // headers for package iofuncs // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 static VImage binfile( char* binfile_filename, int binfile_width, int binfile_height, int binfile_bands, int binfile_offset ) throw( VError ); VImage cache( int cache_tile_width, int cache_tile_height, int cache_max_tiles ) throw( VError ); char* getext() throw( VError ); @@ -347,11 +349,11 @@ void printdesc() throw( VError ); // headers for package mask // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // headers for package morphology // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 double cntlines( int cntlines_direction ) throw( VError ); VImage dilate( VIMask dilate_mask ) throw( VError ); VImage rank( int rank_xsize, int rank_ysize, int rank_n ) throw( VError ); @@ -364,7 +366,7 @@ VImage profile( int profile_direction ) throw( VError ); // headers for package mosaicing // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage align_bands() throw( VError ); double correl( VImage correl_sec, int correl_xref, int correl_yref, int correl_xsec, int correl_ysec, int correl_hwindowsize, int correl_hsearchsize, int& correl_x, int& correl_y ) throw( VError ); int _find_lroverlap( VImage _find_lroverlap_sec, int _find_lroverlap_bandno, int _find_lroverlap_xr, int _find_lroverlap_yr, int _find_lroverlap_xs, int _find_lroverlap_ys, int _find_lroverlap_halfcorrelation, int _find_lroverlap_halfarea, int& _find_lroverlap_dy0, double& _find_lroverlap_scale1, double& _find_lroverlap_angle1, double& _find_lroverlap_dx1, double& _find_lroverlap_dy1 ) throw( VError ); @@ -386,7 +388,7 @@ VImage tbmosaic1( VImage tbmosaic1_sec, int tbmosaic1_bandno, int tbmosaic1_xr1, // headers for package other // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage benchmark() throw( VError ); double benchmark2() throw( VError ); VImage benchmarkn( int benchmarkn_n ) throw( VError ); @@ -401,7 +403,7 @@ static VImage zone( int zone_size ) throw( VError ); // headers for package resample // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 VImage rightshift_size( int rightshift_size_xshift, int rightshift_size_yshift, int rightshift_size_band_fmt ) throw( VError ); VImage shrink( double shrink_xfac, double shrink_yfac ) throw( VError ); VImage stretch3( double stretch3_xdisp, double stretch3_ydisp ) throw( VError ); @@ -410,7 +412,7 @@ VImage affinei_all( char* affinei_all_interpolate, double affinei_all_a, double // headers for package video // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 static VImage video_test( int video_test_brightness, int video_test_error ) throw( VError ); static VImage video_v4l1( char* video_v4l1_device, int video_v4l1_channel, int video_v4l1_brightness, int video_v4l1_colour, int video_v4l1_contrast, int video_v4l1_hue, int video_v4l1_ngrabs ) throw( VError ); diff --git a/libvipsCC/vipsc++.cc b/libvipsCC/vipsc++.cc index ddea477e..3e4afa29 100644 --- a/libvipsCC/vipsc++.cc +++ b/libvipsCC/vipsc++.cc @@ -1,7 +1,7 @@ // bodies for package arithmetic // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_abs: absolute value VImage VImage::abs() throw( VError ) { @@ -761,7 +761,7 @@ VImage VImage::tan() throw( VError ) // bodies for package cimg // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_greyc: noise-removing filter VImage VImage::greyc( int iterations, double amplitude, double sharpness, double anisotropy, double alpha, double sigma, double dl, double da, double gauss_prec, int interpolation, int fast_approx ) throw( VError ) { @@ -821,7 +821,7 @@ VImage VImage::greyc_mask( VImage mask, int iterations, double amplitude, double // bodies for package colour // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_LCh2Lab: convert LCh to Lab VImage VImage::LCh2Lab() throw( VError ) { @@ -1537,7 +1537,7 @@ VImage VImage::sRGB2XYZ() throw( VError ) // bodies for package conversion // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_gaussnoise: generate image of gaussian noise with specified statistics VImage VImage::gaussnoise( int xsize, int ysize, double mean, double sigma ) throw( VError ) { @@ -2321,7 +2321,7 @@ VImage VImage::zoom( int xfac, int yfac ) throw( VError ) // bodies for package convolution // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_aconvsep: approximate separable convolution VImage VImage::aconvsep( VDMask matrix, int n_layers ) throw( VError ) { @@ -2624,7 +2624,7 @@ VImage VImage::spcor( VImage in2 ) throw( VError ) // bodies for package deprecated // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_argb2rgba: convert pre-multipled argb to png-style rgba VImage VImage::argb2rgba() throw( VError ) { @@ -4095,10 +4095,28 @@ VImage VImage::notequal( double c ) throw( VError ) return( out ); } +// im_quadratic: transform via quadratic +VImage VImage::quadratic( VImage coeff ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_quadratic" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.data(2) = coeff.image(); + _vec.call(); + out._ref->addref( in._ref ); + out._ref->addref( coeff._ref ); + + return( out ); +} + // bodies for package format // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_csv2vips: read a file in csv format VImage VImage::csv2vips( char* filename ) throw( VError ) { @@ -4236,6 +4254,17 @@ void VImage::vips2csv( char* filename ) throw( VError ) _vec.call(); } +// im_vips2dz: save as deepzoom +void VImage::vips2dz( char* out ) throw( VError ) +{ + VImage in = *this; + Vargv _vec( "im_vips2dz" ); + + _vec.data(0) = in.image(); + _vec.data(1) = (im_object) out; + _vec.call(); +} + // im_vips2jpeg: convert to jpeg void VImage::vips2jpeg( char* out ) throw( VError ) { @@ -4294,7 +4323,7 @@ void VImage::vips2tiff( char* out ) throw( VError ) // bodies for package freq_filt // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_create_fmask: create frequency domain filter mask VImage VImage::create_fmask( int width, int height, int type, double p1, double p2, double p3, double p4, double p5 ) throw( VError ) { @@ -4462,7 +4491,7 @@ VImage VImage::invfftr() throw( VError ) // bodies for package histograms_lut // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_gammacorrect: gamma-correct image VImage VImage::gammacorrect( double exponent ) throw( VError ) { @@ -4909,7 +4938,7 @@ VImage VImage::tone_map( VImage lut ) throw( VError ) // bodies for package inplace // this file automatically generated from -// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012 +// VIPS library 7.34.0-Tue Jun 11 11:18:24 BST 2013 // im_draw_circle: draw circle on image void VImage::draw_circle( int cx, int cy, int radius, int fill, std::vector ink ) throw( VError ) { @@ -5107,7 +5136,7 @@ VImage VImage::line( VImage mask, VImage ink, std::vector x1, std::vector