diff --git a/ChangeLog b/ChangeLog index 94af075f..181a2048 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ - added im_system_image() (thanks Roland) - added postclose callbacks - added vipsthumbnail +- oops, generate C++/Python wrappers for deprecated operations by default 26/11/09 started 7.20.3 - updated en_GB.po translation diff --git a/libvips/deprecated/deprecated_dispatch.c b/libvips/deprecated/deprecated_dispatch.c index 21c77a5c..3d84c45f 100644 --- a/libvips/deprecated/deprecated_dispatch.c +++ b/libvips/deprecated/deprecated_dispatch.c @@ -359,36 +359,6 @@ static im_function similarity_area_desc = { similarity_area_args /* Arg list */ }; -/* Call im_remainderconst_vec via arg vector. - */ -static int -remainderconst_vec_vec( im_object *argv ) -{ - im_doublevec_object *dv = (im_doublevec_object *) argv[2]; - - return( im_remainder_vec( argv[0], argv[1], dv->n, dv->vec ) ); -} - -/* Args for im_remainderconst_vec(). - */ -static im_arg_desc remainderconst_vec_args[] = { - IM_INPUT_IMAGE( "in" ), - IM_OUTPUT_IMAGE( "out" ), - IM_INPUT_DOUBLEVEC( "x" ) -}; - -/* Description of im_remainderconst_vec. - */ -static im_function remainderconst_vec_desc = { - "im_remainderconst_vec", /* Name */ - N_( "remainder after integer division by a vector of constants" ), - /* Description */ - IM_FN_PIO | IM_FN_PTOP, /* Flags */ - remainderconst_vec_vec, /* Dispatch function */ - IM_NUMBER( remainderconst_vec_args ),/* Size of arg list */ - remainderconst_vec_args /* Arg list */ -}; - static int icc_export_vec( im_object *argv ) { @@ -1215,7 +1185,6 @@ static im_function convf_desc = { static im_function *deprecated_list[] = { &resize_linear_desc, &cmulnorm_desc, - &remainderconst_vec_desc, &fav4_desc, &gadd_desc, &icc_export_desc, diff --git a/libvipsCC/Makefile.am b/libvipsCC/Makefile.am index 8a7bf1ae..816e663c 100644 --- a/libvipsCC/Makefile.am +++ b/libvipsCC/Makefile.am @@ -21,10 +21,13 @@ libvipsCC_la_LDFLAGS = \ libvipsCC_la_LIBADD = \ $(top_builddir)/libvips/libvips.la @VIPS_LIBS@ +# swap the 'awk' line for this: +# awk '{if($$1!="deprecated") print $$1}'` ; \ +# to not generate the wrappers for deprecated functions .PHONEY: vipsc++.cc: packages=`vips --list packages | \ - awk '{if($$1!="deprecated") print $$1}'` ; \ + awk '{print $$1}'` ; \ echo > vipsc++.cc ; \ for name in $$packages; do \ echo "// bodies for package $$name" >> vipsc++.cc ; \ diff --git a/libvipsCC/include/vips/Makefile.am b/libvipsCC/include/vips/Makefile.am index 2f2e2b52..531e2b64 100644 --- a/libvipsCC/include/vips/Makefile.am +++ b/libvipsCC/include/vips/Makefile.am @@ -7,10 +7,13 @@ pkginclude_HEADERS = \ vips \ vipsc++.h +# swap the 'awk' line for this: +# awk '{if($$1!="deprecated") print $$1}'` ; \ +# to not generate the wrappers for deprecated functions .PHONEY: vipsc++.h: packages=`vips --list packages | \ - awk '{if($$1!="deprecated") print $$1}'` ; \ + awk '{print $$1}'` ; \ echo > vipsc++.h ; \ for name in $$packages; do \ echo "// headers for package $$name" >> vipsc++.h ; \ diff --git a/libvipsCC/include/vips/vipsc++.h b/libvipsCC/include/vips/vipsc++.h index fd770769..46066d9b 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.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage abs() throw( VError ); VImage acos() throw( VError ); VImage add( VImage ) throw( VError ); @@ -11,6 +11,7 @@ double avg() throw( VError ); double point_bilinear( double, double, int ) throw( VError ); VImage bandmean() throw( VError ); VImage ceil() throw( VError ); +VImage cmulnorm( VImage ) throw( VError ); VImage cos() throw( VError ); VImage cross_phase( VImage ) throw( VError ); double deviate() throw( VError ); @@ -19,11 +20,14 @@ VImage exp10() throw( VError ); VImage expn( double ) throw( VError ); VImage expn( std::vector ) throw( VError ); VImage exp() throw( VError ); +VImage fav4( VImage, VImage, VImage ) throw( VError ); VImage floor() throw( VError ); +VImage gadd( double, double, VImage, double ) throw( VError ); VImage invert() throw( VError ); VImage lin( double, double ) throw( VError ); static VImage linreg( std::vector, std::vector ) throw( VError ); VImage lin( std::vector, std::vector ) throw( VError ); +VImage litecor( VImage, int, double ) throw( VError ); VImage log10() throw( VError ); VImage log() throw( VError ); double max() throw( VError ); @@ -35,7 +39,6 @@ std::complex minpos() throw( VError ); VImage multiply( VImage ) throw( VError ); VImage pow( double ) throw( VError ); VImage pow( std::vector ) throw( VError ); -VImage recomb( VDMask ) throw( VError ); VImage remainder( VImage ) throw( VError ); VImage remainder( double ) throw( VError ); VImage remainder( std::vector ) throw( VError ); @@ -48,7 +51,7 @@ VImage tan() throw( VError ); // headers for package boolean // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage andimage( VImage ) throw( VError ); VImage andimage( int ) throw( VError ); VImage andimage( std::vector ) throw( VError ); @@ -58,20 +61,18 @@ VImage orimage( std::vector ) throw( VError ); VImage eorimage( VImage ) throw( VError ); VImage eorimage( int ) throw( VError ); VImage eorimage( std::vector ) throw( VError ); -VImage shiftleft( std::vector ) throw( VError ); VImage shiftleft( int ) throw( VError ); -VImage shiftright( std::vector ) throw( VError ); VImage shiftright( int ) throw( VError ); // headers for package cimg // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage greyc( int, double, double, double, double, double, double, double, double, int, int ) throw( VError ); VImage greyc_mask( VImage, int, double, double, double, double, double, double, double, double, int, int ) throw( VError ); // headers for package colour // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage LCh2Lab() throw( VError ); VImage LCh2UCS() throw( VError ); VImage Lab2LCh() throw( VError ); @@ -107,6 +108,7 @@ VImage disp2Lab( VDisplay ) throw( VError ); VImage disp2XYZ( VDisplay ) throw( VError ); VImage float2rad() throw( VError ); VImage icc_ac2rc( char* ) throw( VError ); +VImage icc_export( char*, int ) throw( VError ); VImage icc_export_depth( int, char*, int ) throw( VError ); VImage icc_import( char*, int ) throw( VError ); VImage icc_import_embedded( int ) throw( VError ); @@ -117,9 +119,7 @@ VImage sRGB2XYZ() throw( VError ); // headers for package conversion // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 -VImage addgnoise( double ) throw( VError ); -static VImage gaussnoise( int, int, double, double ) throw( VError ); +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage bandjoin( VImage ) throw( VError ); static VImage black( int, int, int ) throw( VError ); VImage c2amph() throw( VError ); @@ -127,13 +127,21 @@ VImage c2imag() throw( VError ); VImage c2ps() throw( VError ); VImage c2real() throw( VError ); VImage c2rect() throw( VError ); -VImage clip() throw( VError ); +VImage clip2c() throw( VError ); +VImage clip2cm() throw( VError ); +VImage clip2d() throw( VError ); +VImage clip2dcm() throw( VError ); +VImage clip2f() throw( VError ); VImage clip2fmt( int ) throw( VError ); +VImage clip2i() throw( VError ); +VImage clip2s() throw( VError ); +VImage clip2ui() throw( VError ); +VImage clip2us() throw( VError ); +VImage clip() throw( VError ); VImage copy() throw( VError ); -VImage copy_file() throw( VError ); VImage copy_morph( int, int, int ) throw( VError ); VImage copy_swap() throw( VError ); -VImage copy_( int, double, double, int, int ) throw( VError ); +VImage copy_set( int, double, double, int, int ) throw( VError ); VImage extract_area( int, int, int, int ) throw( VError ); VImage extract_areabands( int, int, int, int, int, int ) throw( VError ); VImage extract_band( int ) throw( VError ); @@ -145,13 +153,12 @@ VImage flipver() throw( VError ); static VImage gbandjoin( std::vector ) throw( VError ); VImage grid( int, int, int ) throw( VError ); VImage insert( VImage, int, int ) throw( VError ); -VImage insert( VImage, std::vector, std::vector ) throw( VError ); VImage insert_noexpand( VImage, int, int ) throw( VError ); -VImage embed( int, int, int, int, int ) throw( VError ); VImage lrjoin( VImage ) throw( VError ); static VImage mask2vips( VDMask ) throw( VError ); VImage msb() throw( VError ); VImage msb_band( int ) throw( VError ); +VImage recomb( VDMask ) throw( VError ); VImage replicate( int, int ) throw( VError ); VImage ri2c( VImage ) throw( VError ); VImage rot180() throw( VError ); @@ -159,35 +166,60 @@ VImage rot270() throw( VError ); VImage rot90() throw( VError ); VImage scale() throw( VError ); VImage scaleps() throw( VError ); +VImage rightshift_size( int, int, int ) throw( VError ); +VImage slice( double, double ) throw( VError ); VImage subsample( int, int ) throw( VError ); char* system( char* ) throw( VError ); VImage tbjoin( VImage ) throw( VError ); static VImage text( char*, char*, int, int, int ) throw( VError ); +VImage thresh( double ) throw( VError ); VDMask vips2mask() throw( VError ); VImage wrap( int, int ) throw( VError ); VImage zoom( int, int ) throw( VError ); // headers for package convolution // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +VImage addgnoise( double ) throw( VError ); VImage compass( VIMask ) throw( VError ); VImage contrast_surface( int, int ) throw( VError ); +VImage contrast_surface_raw( int, int ) throw( VError ); VImage conv( VIMask ) throw( VError ); -VImage conv( VDMask ) throw( VError ); +VImage conv_raw( VIMask ) throw( VError ); +VImage convf( VDMask ) throw( VError ); +VImage convf_raw( VDMask ) throw( VError ); VImage convsep( VIMask ) throw( VError ); -VImage convsep( VDMask ) throw( VError ); +VImage convsep_raw( VIMask ) throw( VError ); +VImage convsepf( VDMask ) throw( VError ); +VImage convsepf_raw( VDMask ) throw( VError ); +VImage convsub( VIMask, int, int ) throw( VError ); +VImage embed( int, int, int, int, int ) throw( VError ); VImage fastcor( VImage ) throw( VError ); -VImage gradcor( VImage ) throw( VError ); -VImage gradient( VIMask ) throw( VError ); +VImage fastcor_raw( VImage ) throw( VError ); +static VImage gaussnoise( int, int, double, double ) throw( VError ); VImage grad_x() throw( VError ); VImage grad_y() throw( VError ); +VImage gradcor( VImage ) throw( VError ); +VImage gradcor_raw( VImage ) throw( VError ); +VImage gradient( VIMask ) throw( VError ); +static VImage rank_image( std::vector, int ) throw( VError ); VImage lindetect( VIMask ) throw( VError ); +static VImage maxvalue( std::vector ) throw( VError ); +int mpercent( double ) throw( VError ); +VImage phasecor_fft( VImage ) throw( VError ); +VImage rank( int, int, int ) throw( VError ); +VImage rank_raw( int, int, int ) throw( VError ); +VImage resize_linear( int, int ) throw( VError ); VImage sharpen( int, double, double, double, double, double ) throw( VError ); +VImage shrink( double, double ) throw( VError ); VImage spcor( VImage ) throw( VError ); +VImage spcor_raw( VImage ) throw( VError ); +VImage stretch3( double, double ) throw( VError ); +VImage zerox( int ) throw( VError ); // headers for package format // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 static VImage csv2vips( char* ) throw( VError ); static VImage jpeg2vips( char* ) throw( VError ); static VImage magick2vips( char* ) throw( VError ); @@ -205,7 +237,7 @@ void vips2tiff( char* ) throw( VError ); // headers for package freq_filt // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 static VImage create_fmask( int, int, int, double, double, double, double, double ) throw( VError ); VImage disp_ps() throw( VError ); VImage flt_image_freq( int, double, double, double, double, double ) throw( VError ); @@ -214,18 +246,16 @@ VImage freqflt( VImage ) throw( VError ); VImage fwfft() throw( VError ); VImage rotquad() throw( VError ); VImage invfft() throw( VError ); -VImage phasecor_fft( VImage ) throw( VError ); VImage invfftr() throw( VError ); // headers for package histograms_lut // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage gammacorrect( double ) throw( VError ); VImage heq( int ) throw( VError ); VImage hist( int ) throw( VError ); VImage histcum() throw( VError ); VImage histeq() throw( VError ); -VImage hist_indexed( VImage ) throw( VError ); VImage histgr( int ) throw( VError ); VImage histnD( int ) throw( VError ); VImage histnorm() throw( VError ); @@ -236,12 +266,13 @@ static VImage identity( int ) throw( VError ); static VImage identity_ushort( int, int ) throw( VError ); int ismonotonic() throw( VError ); VImage lhisteq( int, int ) throw( VError ); -int mpercent( double ) throw( VError ); +VImage lhisteq_raw( int, int ) throw( VError ); static VImage invertlut( VDMask, int ) throw( VError ); static VImage buildlut( VDMask ) throw( VError ); VImage maplut( VImage ) throw( VError ); VImage project( VImage& ) throw( VError ); VImage stdif( double, double, double, double, int, int ) throw( VError ); +VImage stdif_raw( double, double, double, double, int, int ) throw( VError ); VImage tone_analyse( double, double, double, double, double, double ) throw( VError ); static VImage tone_build( double, double, double, double, double, double, double, double ) throw( VError ); static VImage tone_build_range( int, int, double, double, double, double, double, double, double, double ) throw( VError ); @@ -249,46 +280,40 @@ VImage tone_map( VImage ) throw( VError ); // headers for package inplace // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 void circle( int, int, int, int ) throw( VError ); VImage flood_blob_copy( int, int, std::vector ) throw( VError ); -VImage flood_other_copy( VImage, int, int, int ) throw( VError ); void insertplace( VImage, int, int ) throw( VError ); -VImage line( VImage, VImage, std::vector, std::vector, std::vector, std::vector ) throw( VError ); +void line( int, int, int, int, int ) throw( VError ); +VImage lineset( VImage, VImage, std::vector, std::vector, std::vector, std::vector ) throw( VError ); // headers for package iofuncs // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 static VImage binfile( char*, int, int, int, int ) throw( VError ); VImage cache( int, int, int ) throw( VError ); -char* getext() throw( VError ); -int header_get_typeof( char* ) throw( VError ); +int header_get_type( char* ) throw( VError ); int header_int( char* ) throw( VError ); double header_double( char* ) throw( VError ); char* header_string( char* ) throw( VError ); -char* history_get() throw( VError ); -void printdesc() throw( VError ); -// headers for package mask +// headers for package matrix // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // headers for package morphology // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 double cntlines( int ) throw( VError ); VImage dilate( VIMask ) throw( VError ); -VImage rank( int, int, int ) throw( VError ); -static VImage rank_image( std::vector, int ) throw( VError ); -static VImage maxvalue( std::vector ) throw( VError ); -VImage label_regions( int& ) throw( VError ); -VImage zerox( int ) throw( VError ); +VImage dilate_raw( VIMask ) throw( VError ); VImage erode( VIMask ) throw( VError ); +VImage erode_raw( VIMask ) throw( VError ); VImage profile( int ) throw( VError ); // headers for package mosaicing // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage align_bands() throw( VError ); double correl( VImage, int, int, int, int, int, int, int&, int& ) throw( VError ); int _find_lroverlap( VImage, int, int, int, int, int, int, int, int&, double&, double&, double&, double& ) throw( VError ); @@ -310,7 +335,7 @@ VImage tbmosaic1( VImage, int, int, int, int, int, int, int, int, int, int, int, // headers for package other // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage benchmark() throw( VError ); double benchmark2() throw( VError ); VImage benchmarkn( int ) throw( VError ); @@ -324,7 +349,7 @@ static VImage zone( int ) throw( VError ); // headers for package relational // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 VImage blend( VImage, VImage ) throw( VError ); VImage equal( VImage ) throw( VError ); VImage equal( std::vector ) throw( VError ); @@ -348,14 +373,14 @@ VImage notequal( double ) throw( VError ); // headers for package resample // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 -VImage rightshift_size( int, int, int ) throw( VError ); -VImage shrink( double, double ) throw( VError ); -VImage stretch3( double, double ) throw( VError ); +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +VImage affine( double, double, double, double, double, double, int, int, int, int ) throw( VError ); +VImage similarity_area( double, double, double, double, int, int, int, int ) throw( VError ); +VImage similarity( double, double, double, double ) throw( VError ); // headers for package video // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 static VImage video_test( int, int ) throw( VError ); static VImage video_v4l1( char*, int, int, int, int, int, int ) throw( VError ); diff --git a/libvipsCC/vipsc++.cc b/libvipsCC/vipsc++.cc index a913b714..42cd95b1 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.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_abs: absolute value VImage VImage::abs() throw( VError ) { @@ -149,6 +149,24 @@ VImage VImage::ceil() throw( VError ) return( out ); } +// im_cmulnorm: multiply two complex images, normalising output +VImage VImage::cmulnorm( VImage in2 ) throw( VError ) +{ + VImage in1 = *this; + VImage out; + + Vargv _vec( "im_cmulnorm" ); + + _vec.data(0) = in1.image(); + _vec.data(1) = in2.image(); + _vec.data(2) = out.image(); + _vec.call(); + out._ref->addref( in1._ref ); + out._ref->addref( in2._ref ); + + return( out ); +} + // im_costra: cos of image (angles in degrees) VImage VImage::cos() throw( VError ) { @@ -285,6 +303,24 @@ VImage VImage::exp() throw( VError ) return( out ); } +// im_fav4: average of 4 images +VImage VImage::fav4( VImage in2, VImage in3, VImage in4 ) throw( VError ) +{ + VImage in1 = *this; + VImage out; + + Vargv _vec( "im_fav4" ); + + _vec.data(0) = in1.image(); + _vec.data(1) = in2.image(); + _vec.data(2) = in3.image(); + _vec.data(3) = in4.image(); + _vec.data(4) = out.image(); + _vec.call(); + + return( out ); +} + // im_floor: round to largest integal value not greater than VImage VImage::floor() throw( VError ) { @@ -301,6 +337,25 @@ VImage VImage::floor() throw( VError ) return( out ); } +// im_gadd: calculate a*in1 + b*in2 + c = outfile +VImage VImage::gadd( double a, double b, VImage in2, double c ) throw( VError ) +{ + VImage in1 = *this; + VImage out; + + Vargv _vec( "im_gadd" ); + + *((double*) _vec.data(0)) = a; + _vec.data(1) = in1.image(); + *((double*) _vec.data(2)) = b; + _vec.data(3) = in2.image(); + *((double*) _vec.data(4)) = c; + _vec.data(5) = out.image(); + _vec.call(); + + return( out ); +} + // im_invert: photographic negative VImage VImage::invert() throw( VError ) { @@ -382,6 +437,24 @@ VImage VImage::lin( std::vector a, std::vector b ) throw( VError return( out ); } +// im_litecor: calculate max(white)*factor*(in/white), if clip == 1 +VImage VImage::litecor( VImage white, int clip, double factor ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_litecor" ); + + _vec.data(0) = in.image(); + _vec.data(1) = white.image(); + _vec.data(2) = out.image(); + *((int*) _vec.data(3)) = clip; + *((double*) _vec.data(4)) = factor; + _vec.call(); + + return( out ); +} + // im_log10tra: log10 of image VImage VImage::log10() throw( VError ) { @@ -531,7 +604,7 @@ VImage VImage::multiply( VImage in2 ) throw( VError ) return( out ); } -// im_powtra: pel^x of image +// im_powtra: pel^x ofbuildimage VImage VImage::pow( double x ) throw( VError ) { VImage in = *this; @@ -568,23 +641,6 @@ VImage VImage::pow( std::vector v ) throw( VError ) return( out ); } -// im_recomb: linear recombination with mask -VImage VImage::recomb( VDMask matrix ) throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_recomb" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - ((im_mask_object*) _vec.data(2))->mask = matrix.mask().dptr; - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - // im_remainder: remainder after integer division VImage VImage::remainder( VImage in2 ) throw( VError ) { @@ -620,13 +676,13 @@ VImage VImage::remainder( double x ) throw( VError ) return( out ); } -// im_remainder_vec: remainder after integer division by a vector of constants +// im_remainderconst_vec: remainder after integer division by a vector of constants VImage VImage::remainder( std::vector x ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_remainder_vec" ); + Vargv _vec( "im_remainderconst_vec" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -741,7 +797,7 @@ VImage VImage::tan() throw( VError ) // bodies for package boolean // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_andimage: bitwise and of two images VImage VImage::andimage( VImage in2 ) throw( VError ) { @@ -907,27 +963,7 @@ VImage VImage::eorimage( std::vector vec ) throw( VError ) return( out ); } -// im_shiftleft_vec: shift image array bits to left -VImage VImage::shiftleft( std::vector vec ) throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_shiftleft_vec" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - ((im_doublevec_object*) _vec.data(2))->n = vec.size(); - ((im_doublevec_object*) _vec.data(2))->vec = new double[vec.size()]; - for( unsigned int i = 0; i < vec.size(); i++ ) - ((im_doublevec_object*) _vec.data(2))->vec[i] = vec[i]; - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - -// im_shiftleft: shift image n bits to left +// im_shiftleft: shift integer image n bits to left VImage VImage::shiftleft( int c ) throw( VError ) { VImage in1 = *this; @@ -944,26 +980,6 @@ VImage VImage::shiftleft( int c ) throw( VError ) return( out ); } -// im_shiftright_vec: shift image array bits to right -VImage VImage::shiftright( std::vector vec ) throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_shiftright_vec" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - ((im_doublevec_object*) _vec.data(2))->n = vec.size(); - ((im_doublevec_object*) _vec.data(2))->vec = new double[vec.size()]; - for( unsigned int i = 0; i < vec.size(); i++ ) - ((im_doublevec_object*) _vec.data(2))->vec[i] = vec[i]; - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - // im_shiftright: shift integer image n bits to right VImage VImage::shiftright( int c ) throw( VError ) { @@ -984,7 +1000,7 @@ VImage VImage::shiftright( int c ) throw( VError ) // bodies for package cimg // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // 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 ) { @@ -1044,7 +1060,7 @@ VImage VImage::greyc_mask( VImage mask, int iterations, double amplitude, double // bodies for package colour // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_LCh2Lab: convert LCh to Lab VImage VImage::LCh2Lab() throw( VError ) { @@ -1631,6 +1647,24 @@ VImage VImage::icc_ac2rc( char* profile ) throw( VError ) return( out ); } +// im_icc_export: convert a float LAB to an 8-bit device image with an ICC profile +VImage VImage::icc_export( char* output_profile, int intent ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_icc_export" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.data(2) = (im_object) output_profile; + *((int*) _vec.data(3)) = intent; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_icc_export_depth: convert a float LAB to device space with an ICC profile VImage VImage::icc_export_depth( int depth, char* output_profile, int intent ) throw( VError ) { @@ -1760,41 +1794,7 @@ VImage VImage::sRGB2XYZ() throw( VError ) // bodies for package conversion // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 -// im_addgnoise: add gaussian noise with mean 0 and std. dev. sigma -VImage VImage::addgnoise( double sigma ) throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_addgnoise" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - *((double*) _vec.data(2)) = sigma; - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - -// im_gaussnoise: generate image of gaussian noise with specified statistics -VImage VImage::gaussnoise( int xsize, int ysize, double mean, double sigma ) throw( VError ) -{ - VImage out; - - Vargv _vec( "im_gaussnoise" ); - - _vec.data(0) = out.image(); - *((int*) _vec.data(1)) = xsize; - *((int*) _vec.data(2)) = ysize; - *((double*) _vec.data(3)) = mean; - *((double*) _vec.data(4)) = sigma; - _vec.call(); - - return( out ); -} - +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_bandjoin: bandwise join of two images VImage VImage::bandjoin( VImage in2 ) throw( VError ) { @@ -1909,13 +1909,77 @@ VImage VImage::c2rect() throw( VError ) return( out ); } -// im_clip: convert to unsigned 8-bit integer -VImage VImage::clip() throw( VError ) +// im_clip2c: convert to signed 8-bit integer +VImage VImage::clip2c() throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_clip" ); + Vargv _vec( "im_clip2c" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2cm: convert to complex +VImage VImage::clip2cm() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip2cm" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2d: convert to double-precision float +VImage VImage::clip2d() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip2d" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2dcm: convert to double complex +VImage VImage::clip2dcm() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip2dcm" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2f: convert to single-precision float +VImage VImage::clip2f() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip2f" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -1942,13 +2006,13 @@ VImage VImage::clip2fmt( int ofmt ) throw( VError ) return( out ); } -// im_copy: copy image -VImage VImage::copy() throw( VError ) +// im_clip2i: convert to signed 32-bit integer +VImage VImage::clip2i() throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_copy" ); + Vargv _vec( "im_clip2i" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -1958,13 +2022,77 @@ VImage VImage::copy() throw( VError ) return( out ); } -// im_copy_file: copy image to a file and return that -VImage VImage::copy_file() throw( VError ) +// im_clip2s: convert to signed 16-bit integer +VImage VImage::clip2s() throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_copy_file" ); + Vargv _vec( "im_clip2s" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2ui: convert to unsigned 32-bit integer +VImage VImage::clip2ui() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip2ui" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2us: convert to unsigned 16-bit integer +VImage VImage::clip2us() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip2us" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip: convert to unsigned 8-bit integer +VImage VImage::clip() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_copy: copy image +VImage VImage::copy() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_copy" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -2010,7 +2138,7 @@ VImage VImage::copy_swap() throw( VError ) } // im_copy_set: copy image, setting informational fields -VImage VImage::copy_( int Type, double Xres, double Yres, int Xoffset, int Yoffset ) throw( VError ) +VImage VImage::copy_set( int Type, double Xres, double Yres, int Xoffset, int Yoffset ) throw( VError ) { VImage input = *this; VImage output; @@ -2234,30 +2362,6 @@ VImage VImage::insert( VImage sub, int x, int y ) throw( VError ) return( out ); } -// im_insertset: insert sub into main at every position in x, y -VImage VImage::insert( VImage sub, std::vector x, std::vector y ) throw( VError ) -{ - VImage main = *this; - VImage out; - - Vargv _vec( "im_insertset" ); - - _vec.data(0) = main.image(); - _vec.data(1) = sub.image(); - _vec.data(2) = out.image(); - ((im_intvec_object*) _vec.data(3))->n = x.size(); - ((im_intvec_object*) _vec.data(3))->vec = new int[x.size()]; - for( unsigned int i = 0; i < x.size(); i++ ) - ((im_intvec_object*) _vec.data(3))->vec[i] = x[i]; - ((im_intvec_object*) _vec.data(4))->n = y.size(); - ((im_intvec_object*) _vec.data(4))->vec = new int[y.size()]; - for( unsigned int i = 0; i < y.size(); i++ ) - ((im_intvec_object*) _vec.data(4))->vec[i] = y[i]; - _vec.call(); - - return( out ); -} - // im_insert_noexpand: insert sub-image into main image at position, no expansion VImage VImage::insert_noexpand( VImage sub, int x, int y ) throw( VError ) { @@ -2278,27 +2382,6 @@ VImage VImage::insert_noexpand( VImage sub, int x, int y ) throw( VError ) return( out ); } -// im_embed: embed in within a set of borders -VImage VImage::embed( int type, int x, int y, int w, int h ) throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_embed" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - *((int*) _vec.data(2)) = type; - *((int*) _vec.data(3)) = x; - *((int*) _vec.data(4)) = y; - *((int*) _vec.data(5)) = w; - *((int*) _vec.data(6)) = h; - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - // im_lrjoin: join two images left-right VImage VImage::lrjoin( VImage in2 ) throw( VError ) { @@ -2364,6 +2447,23 @@ VImage VImage::msb_band( int band ) throw( VError ) return( out ); } +// im_recomb: linear recombination with mask +VImage VImage::recomb( VDMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_recomb" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().dptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_replicate: replicate an image horizontally and vertically VImage VImage::replicate( int across, int down ) throw( VError ) { @@ -2479,6 +2579,42 @@ VImage VImage::scaleps() throw( VError ) return( out ); } +// im_rightshift_size: decrease size by a power-of-two factor +VImage VImage::rightshift_size( int xshift, int yshift, int band_fmt ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_rightshift_size" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = xshift; + *((int*) _vec.data(3)) = yshift; + *((int*) _vec.data(4)) = band_fmt; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_slice: slice an image using two thresholds +VImage VImage::slice( double thresh1, double thresh2 ) throw( VError ) +{ + VImage input = *this; + VImage output; + + Vargv _vec( "im_slice" ); + + _vec.data(0) = input.image(); + _vec.data(1) = output.image(); + *((double*) _vec.data(2)) = thresh1; + *((double*) _vec.data(3)) = thresh2; + _vec.call(); + + return( output ); +} + // im_subsample: subsample image by integer factors VImage VImage::subsample( int xshrink, int yshrink ) throw( VError ) { @@ -2549,6 +2685,22 @@ VImage VImage::text( char* text, char* font, int width, int alignment, int dpi ) return( out ); } +// im_thresh: slice an image at a threshold +VImage VImage::thresh( double threshold ) throw( VError ) +{ + VImage input = *this; + VImage output; + + Vargv _vec( "im_thresh" ); + + _vec.data(0) = input.image(); + _vec.data(1) = output.image(); + *((double*) _vec.data(2)) = threshold; + _vec.call(); + + return( output ); +} + // im_vips2mask: convert VIPS image to DOUBLEMASK VDMask VImage::vips2mask() throw( VError ) { @@ -2604,7 +2756,24 @@ VImage VImage::zoom( int xfac, int yfac ) throw( VError ) // bodies for package convolution // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// im_addgnoise: add gaussian noise with mean 0 and std. dev. sigma +VImage VImage::addgnoise( double sigma ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_addgnoise" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((double*) _vec.data(2)) = sigma; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_compass: convolve with 8-way rotating integer mask VImage VImage::compass( VIMask matrix ) throw( VError ) { @@ -2640,6 +2809,24 @@ VImage VImage::contrast_surface( int half_win_size, int spacing ) throw( VError return( out ); } +// im_contrast_surface_raw: find high-contrast points in an image +VImage VImage::contrast_surface_raw( int half_win_size, int spacing ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_contrast_surface_raw" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = half_win_size; + *((int*) _vec.data(3)) = spacing; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_conv: convolve VImage VImage::conv( VIMask matrix ) throw( VError ) { @@ -2657,13 +2844,47 @@ VImage VImage::conv( VIMask matrix ) throw( VError ) return( out ); } -// im_conv_f: convolve, with DOUBLEMASK -VImage VImage::conv( VDMask matrix ) throw( VError ) +// im_conv_raw: convolve, no border +VImage VImage::conv_raw( VIMask matrix ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_conv_f" ); + Vargv _vec( "im_conv_raw" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().iptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_convf: convolve, with DOUBLEMASK +VImage VImage::convf( VDMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_convf" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().dptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_convf_raw: convolve, with DOUBLEMASK, no border +VImage VImage::convf_raw( VDMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_convf_raw" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -2691,13 +2912,30 @@ VImage VImage::convsep( VIMask matrix ) throw( VError ) return( out ); } -// im_convsep_f: seperable convolution, with DOUBLEMASK -VImage VImage::convsep( VDMask matrix ) throw( VError ) +// im_convsep_raw: seperable convolution, no border +VImage VImage::convsep_raw( VIMask matrix ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_convsep_f" ); + Vargv _vec( "im_convsep_raw" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().iptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_convsepf: seperable convolution, with DOUBLEMASK +VImage VImage::convsepf( VDMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_convsepf" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -2708,6 +2946,62 @@ VImage VImage::convsep( VDMask matrix ) throw( VError ) return( out ); } +// im_convsepf_raw: seperable convolution, with DOUBLEMASK, no border +VImage VImage::convsepf_raw( VDMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_convsepf_raw" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().dptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_convsub: convolve uchar to uchar, sub-sampling by xskip, yskip +VImage VImage::convsub( VIMask matrix, int xskip, int yskip ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_convsub" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().iptr; + *((int*) _vec.data(3)) = xskip; + *((int*) _vec.data(4)) = yskip; + _vec.call(); + + return( out ); +} + +// im_embed: embed in within a set of borders +VImage VImage::embed( int type, int x, int y, int w, int h ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_embed" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = type; + *((int*) _vec.data(3)) = x; + *((int*) _vec.data(4)) = y; + *((int*) _vec.data(5)) = w; + *((int*) _vec.data(6)) = h; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_fastcor: fast correlate in2 within in1 VImage VImage::fastcor( VImage in2 ) throw( VError ) { @@ -2726,13 +3020,13 @@ VImage VImage::fastcor( VImage in2 ) throw( VError ) return( out ); } -// im_gradcor: non-normalised correlation of gradient of in2 within in1 -VImage VImage::gradcor( VImage in2 ) throw( VError ) +// im_fastcor_raw: fast correlate in2 within in1, no border +VImage VImage::fastcor_raw( VImage in2 ) throw( VError ) { VImage in1 = *this; VImage out; - Vargv _vec( "im_gradcor" ); + Vargv _vec( "im_fastcor_raw" ); _vec.data(0) = in1.image(); _vec.data(1) = in2.image(); @@ -2744,19 +3038,19 @@ VImage VImage::gradcor( VImage in2 ) throw( VError ) return( out ); } -// im_gradient: convolve with 2-way rotating mask -VImage VImage::gradient( VIMask matrix ) throw( VError ) +// im_gaussnoise: generate image of gaussian noise with specified statistics +VImage VImage::gaussnoise( int xsize, int ysize, double mean, double sigma ) throw( VError ) { - VImage in = *this; VImage out; - Vargv _vec( "im_gradient" ); + Vargv _vec( "im_gaussnoise" ); - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - ((im_mask_object*) _vec.data(2))->mask = matrix.mask().iptr; + _vec.data(0) = out.image(); + *((int*) _vec.data(1)) = xsize; + *((int*) _vec.data(2)) = ysize; + *((double*) _vec.data(3)) = mean; + *((double*) _vec.data(4)) = sigma; _vec.call(); - out._ref->addref( in._ref ); return( out ); } @@ -2793,6 +3087,79 @@ VImage VImage::grad_y() throw( VError ) return( out ); } +// im_gradcor: non-normalised correlation of gradient of in2 within in1 +VImage VImage::gradcor( VImage in2 ) throw( VError ) +{ + VImage in1 = *this; + VImage out; + + Vargv _vec( "im_gradcor" ); + + _vec.data(0) = in1.image(); + _vec.data(1) = in2.image(); + _vec.data(2) = out.image(); + _vec.call(); + out._ref->addref( in1._ref ); + out._ref->addref( in2._ref ); + + return( out ); +} + +// im_gradcor_raw: non-normalised correlation of gradient of in2 within in1, no padding +VImage VImage::gradcor_raw( VImage in2 ) throw( VError ) +{ + VImage in1 = *this; + VImage out; + + Vargv _vec( "im_gradcor_raw" ); + + _vec.data(0) = in1.image(); + _vec.data(1) = in2.image(); + _vec.data(2) = out.image(); + _vec.call(); + out._ref->addref( in1._ref ); + out._ref->addref( in2._ref ); + + return( out ); +} + +// im_gradient: convolve with 2-way rotating mask +VImage VImage::gradient( VIMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_gradient" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().iptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_rank_image: point-wise pixel rank +VImage VImage::rank_image( std::vector in, int index ) throw( VError ) +{ + VImage out; + + Vargv _vec( "im_rank_image" ); + + ((im_imagevec_object*) _vec.data(0))->n = in.size(); + ((im_imagevec_object*) _vec.data(0))->vec = new IMAGE *[in.size()]; + for( unsigned int i = 0; i < in.size(); i++ ) + ((im_imagevec_object*) _vec.data(0))->vec[i] = in[i].image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = index; + _vec.call(); + for( unsigned int i = 0; i < in.size(); i++ ) + out._ref->addref( in[i]._ref ); + + return( out ); +} + // im_lindetect: convolve with 4-way rotating mask VImage VImage::lindetect( VIMask matrix ) throw( VError ) { @@ -2810,6 +3177,112 @@ VImage VImage::lindetect( VIMask matrix ) throw( VError ) return( out ); } +// im_maxvalue: point-wise maximum value +VImage VImage::maxvalue( std::vector in ) throw( VError ) +{ + VImage out; + + Vargv _vec( "im_maxvalue" ); + + ((im_imagevec_object*) _vec.data(0))->n = in.size(); + ((im_imagevec_object*) _vec.data(0))->vec = new IMAGE *[in.size()]; + for( unsigned int i = 0; i < in.size(); i++ ) + ((im_imagevec_object*) _vec.data(0))->vec[i] = in[i].image(); + _vec.data(1) = out.image(); + _vec.call(); + for( unsigned int i = 0; i < in.size(); i++ ) + out._ref->addref( in[i]._ref ); + + return( out ); +} + +// im_mpercent: find threshold above which there are percent values +int VImage::mpercent( double percent ) throw( VError ) +{ + VImage in = *this; + int thresh; + + Vargv _vec( "im_mpercent" ); + + _vec.data(0) = in.image(); + *((double*) _vec.data(1)) = percent; + _vec.call(); + thresh = *((int*)_vec.data(2)); + + return( thresh ); +} + +// im_phasecor_fft: non-normalised correlation of gradient of in2 within in1 +VImage VImage::phasecor_fft( VImage in2 ) throw( VError ) +{ + VImage in1 = *this; + VImage out; + + Vargv _vec( "im_phasecor_fft" ); + + _vec.data(0) = in1.image(); + _vec.data(1) = in2.image(); + _vec.data(2) = out.image(); + _vec.call(); + + return( out ); +} + +// im_rank: rank filter nth element of xsize/ysize window +VImage VImage::rank( int xsize, int ysize, int n ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_rank" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = xsize; + *((int*) _vec.data(3)) = ysize; + *((int*) _vec.data(4)) = n; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_rank_raw: rank filter nth element of xsize/ysize window, no border +VImage VImage::rank_raw( int xsize, int ysize, int n ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_rank_raw" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = xsize; + *((int*) _vec.data(3)) = ysize; + *((int*) _vec.data(4)) = n; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_resize_linear: resize to X by Y pixels with linear interpolation +VImage VImage::resize_linear( int X, int Y ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_resize_linear" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = X; + *((int*) _vec.data(3)) = Y; + _vec.call(); + + return( out ); +} + // im_sharpen: sharpen high frequencies of L channel of LabQ VImage VImage::sharpen( int mask_size, double x1, double y2, double y3, double m1, double m2 ) throw( VError ) { @@ -2832,6 +3305,24 @@ VImage VImage::sharpen( int mask_size, double x1, double y2, double y3, double m return( out ); } +// im_shrink: shrink image by xfac, yfac times +VImage VImage::shrink( double xfac, double yfac ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_shrink" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((double*) _vec.data(2)) = xfac; + *((double*) _vec.data(3)) = yfac; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_spcor: normalised correlation of in2 within in1 VImage VImage::spcor( VImage in2 ) throw( VError ) { @@ -2850,10 +3341,63 @@ VImage VImage::spcor( VImage in2 ) throw( VError ) return( out ); } +// im_spcor_raw: normalised correlation of in2 within in1, no black padding +VImage VImage::spcor_raw( VImage in2 ) throw( VError ) +{ + VImage in1 = *this; + VImage out; + + Vargv _vec( "im_spcor_raw" ); + + _vec.data(0) = in1.image(); + _vec.data(1) = in2.image(); + _vec.data(2) = out.image(); + _vec.call(); + out._ref->addref( in1._ref ); + out._ref->addref( in2._ref ); + + return( out ); +} + +// im_stretch3: stretch 3%, sub-pixel displace by xdisp/ydisp +VImage VImage::stretch3( double xdisp, double ydisp ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_stretch3" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((double*) _vec.data(2)) = xdisp; + *((double*) _vec.data(3)) = ydisp; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_zerox: find +ve or -ve zero crossings in image +VImage VImage::zerox( int flag ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_zerox" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = flag; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // bodies for package format // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_csv2vips: read a file in csv format VImage VImage::csv2vips( char* filename ) throw( VError ) { @@ -3035,7 +3579,7 @@ void VImage::vips2tiff( char* out ) throw( VError ) // bodies for package freq_filt // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // 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 ) { @@ -3169,22 +3713,6 @@ VImage VImage::invfft() throw( VError ) return( out ); } -// im_phasecor_fft: non-normalised correlation of gradient of in2 within in1 -VImage VImage::phasecor_fft( VImage in2 ) throw( VError ) -{ - VImage in1 = *this; - VImage out; - - Vargv _vec( "im_phasecor_fft" ); - - _vec.data(0) = in1.image(); - _vec.data(1) = in2.image(); - _vec.data(2) = out.image(); - _vec.call(); - - return( out ); -} - // im_invfftr: real part of inverse fast-fourier transform VImage VImage::invfftr() throw( VError ) { @@ -3203,7 +3731,7 @@ VImage VImage::invfftr() throw( VError ) // bodies for package histograms_lut // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_gammacorrect: gamma-correct image VImage VImage::gammacorrect( double exponent ) throw( VError ) { @@ -3287,24 +3815,6 @@ VImage VImage::histeq() throw( VError ) return( out ); } -// im_hist_indexed: make a histogram with an index image -VImage VImage::hist_indexed( VImage value ) throw( VError ) -{ - VImage index = *this; - VImage out; - - Vargv _vec( "im_hist_indexed" ); - - _vec.data(0) = index.image(); - _vec.data(1) = value.image(); - _vec.data(2) = out.image(); - _vec.call(); - out._ref->addref( index._ref ); - out._ref->addref( value._ref ); - - return( out ); -} - // im_histgr: find histogram of image VImage VImage::histgr( int band_number ) throw( VError ) { @@ -3463,20 +3973,22 @@ VImage VImage::lhisteq( int width, int height ) throw( VError ) return( out ); } -// im_mpercent: find threshold above which there are percent values -int VImage::mpercent( double percent ) throw( VError ) +// im_lhisteq_raw: local histogram equalisation, no border +VImage VImage::lhisteq_raw( int width, int height ) throw( VError ) { VImage in = *this; - int thresh; + VImage out; - Vargv _vec( "im_mpercent" ); + Vargv _vec( "im_lhisteq_raw" ); _vec.data(0) = in.image(); - *((double*) _vec.data(1)) = percent; + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = width; + *((int*) _vec.data(3)) = height; _vec.call(); - thresh = *((int*)_vec.data(2)); + out._ref->addref( in._ref ); - return( thresh ); + return( out ); } // im_invertlut: generate correction table from set of measures @@ -3564,6 +4076,28 @@ VImage VImage::stdif( double a, double m0, double b, double s0, int xw, int yw ) return( out ); } +// im_stdif_raw: statistical differencing, no border +VImage VImage::stdif_raw( double a, double m0, double b, double s0, int xw, int yw ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_stdif_raw" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((double*) _vec.data(2)) = a; + *((double*) _vec.data(3)) = m0; + *((double*) _vec.data(4)) = b; + *((double*) _vec.data(5)) = s0; + *((int*) _vec.data(6)) = xw; + *((int*) _vec.data(7)) = yw; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_tone_analyse: analyse in and create LUT for tone adjustment VImage VImage::tone_analyse( double Ps, double Pm, double Ph, double S, double M, double H ) throw( VError ) { @@ -3650,7 +4184,7 @@ VImage VImage::tone_map( VImage lut ) throw( VError ) // bodies for package inplace // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_circle: plot circle on image void VImage::circle( int cx, int cy, int radius, int intensity ) throw( VError ) { @@ -3686,25 +4220,6 @@ VImage VImage::flood_blob_copy( int start_x, int start_y, std::vector in return( out ); } -// im_flood_other_copy: flood mask with serial number from start_x, start_y while pixel == start pixel -VImage VImage::flood_other_copy( VImage test, int start_x, int start_y, int serial ) throw( VError ) -{ - VImage mask = *this; - VImage out; - - Vargv _vec( "im_flood_other_copy" ); - - _vec.data(0) = mask.image(); - _vec.data(1) = test.image(); - _vec.data(2) = out.image(); - *((int*) _vec.data(3)) = start_x; - *((int*) _vec.data(4)) = start_y; - *((int*) _vec.data(5)) = serial; - _vec.call(); - - return( out ); -} - // im_insertplace: draw image sub inside image main at position (x,y) void VImage::insertplace( VImage sub, int x, int y ) throw( VError ) { @@ -3718,8 +4233,23 @@ void VImage::insertplace( VImage sub, int x, int y ) throw( VError ) _vec.call(); } +// im_line: draw line between points (x1,y1) and (x2,y2) +void VImage::line( int x1, int y1, int x2, int y2, int pelval ) throw( VError ) +{ + VImage im = *this; + Vargv _vec( "im_line" ); + + _vec.data(0) = im.image(); + *((int*) _vec.data(1)) = x1; + *((int*) _vec.data(2)) = y1; + *((int*) _vec.data(3)) = x2; + *((int*) _vec.data(4)) = y2; + *((int*) _vec.data(5)) = pelval; + _vec.call(); +} + // im_lineset: draw line between points (x1,y1) and (x2,y2) -VImage VImage::line( VImage mask, VImage ink, std::vector x1, std::vector y1, std::vector x2, std::vector y2 ) throw( VError ) +VImage VImage::lineset( VImage mask, VImage ink, std::vector x1, std::vector y1, std::vector x2, std::vector y2 ) throw( VError ) { VImage in = *this; VImage out; @@ -3754,7 +4284,7 @@ VImage VImage::line( VImage mask, VImage ink, std::vector x1, std::vectoraddref( in._ref ); - - return( out ); -} - -// im_rank_image: point-wise pixel rank -VImage VImage::rank_image( std::vector in, int index ) throw( VError ) -{ - VImage out; - - Vargv _vec( "im_rank_image" ); - - ((im_imagevec_object*) _vec.data(0))->n = in.size(); - ((im_imagevec_object*) _vec.data(0))->vec = new IMAGE *[in.size()]; - for( unsigned int i = 0; i < in.size(); i++ ) - ((im_imagevec_object*) _vec.data(0))->vec[i] = in[i].image(); - _vec.data(1) = out.image(); - *((int*) _vec.data(2)) = index; - _vec.call(); - for( unsigned int i = 0; i < in.size(); i++ ) - out._ref->addref( in[i]._ref ); - - return( out ); -} - -// im_maxvalue: point-wise maximum value -VImage VImage::maxvalue( std::vector in ) throw( VError ) -{ - VImage out; - - Vargv _vec( "im_maxvalue" ); - - ((im_imagevec_object*) _vec.data(0))->n = in.size(); - ((im_imagevec_object*) _vec.data(0))->vec = new IMAGE *[in.size()]; - for( unsigned int i = 0; i < in.size(); i++ ) - ((im_imagevec_object*) _vec.data(0))->vec[i] = in[i].image(); - _vec.data(1) = out.image(); - _vec.call(); - for( unsigned int i = 0; i < in.size(); i++ ) - out._ref->addref( in[i]._ref ); - - return( out ); -} - -// im_label_regions: number continuous regions in an image -VImage VImage::label_regions( int& segments ) throw( VError ) -{ - VImage test = *this; - VImage mask; - - Vargv _vec( "im_label_regions" ); - - _vec.data(0) = test.image(); - _vec.data(1) = mask.image(); - _vec.call(); - segments = *((int*)_vec.data(2)); - - return( mask ); -} - -// im_zerox: find +ve or -ve zero crossings in image -VImage VImage::zerox( int flag ) throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_zerox" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - *((int*) _vec.data(2)) = flag; + ((im_mask_object*) _vec.data(2))->mask = mask.mask().iptr; _vec.call(); out._ref->addref( in._ref ); @@ -4044,6 +4460,23 @@ VImage VImage::erode( VIMask mask ) throw( VError ) return( out ); } +// im_erode_raw: erode image with mask +VImage VImage::erode_raw( VIMask mask ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_erode_raw" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + ((im_mask_object*) _vec.data(2))->mask = mask.mask().iptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_profile: find first horizontal/vertical edge VImage VImage::profile( int direction ) throw( VError ) { @@ -4063,7 +4496,7 @@ VImage VImage::profile( int direction ) throw( VError ) // bodies for package mosaicing // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_align_bands: align the bands of an image VImage VImage::align_bands() throw( VError ) { @@ -4496,7 +4929,7 @@ VImage VImage::tbmosaic1( VImage sec, int bandno, int xr1, int yr1, int xs1, int // bodies for package other // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_benchmark: do something complicated for testing VImage VImage::benchmark() throw( VError ) { @@ -4653,7 +5086,7 @@ VImage VImage::zone( int size ) throw( VError ) // bodies for package relational // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_blend: use cond image to blend between images in1 and in2 VImage VImage::blend( VImage in1, VImage in2 ) throw( VError ) { @@ -5027,56 +5460,71 @@ VImage VImage::notequal( double c ) throw( VError ) // bodies for package resample // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 -// im_rightshift_size: decrease size by a power-of-two factor -VImage VImage::rightshift_size( int xshift, int yshift, int band_fmt ) throw( VError ) +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// im_affine: affine transform +VImage VImage::affine( double a, double b, double c, double d, double dx, double dy, int x, int y, int w, int h ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_rightshift_size" ); + Vargv _vec( "im_affine" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((int*) _vec.data(2)) = xshift; - *((int*) _vec.data(3)) = yshift; - *((int*) _vec.data(4)) = band_fmt; + *((double*) _vec.data(2)) = a; + *((double*) _vec.data(3)) = b; + *((double*) _vec.data(4)) = c; + *((double*) _vec.data(5)) = d; + *((double*) _vec.data(6)) = dx; + *((double*) _vec.data(7)) = dy; + *((int*) _vec.data(8)) = x; + *((int*) _vec.data(9)) = y; + *((int*) _vec.data(10)) = w; + *((int*) _vec.data(11)) = h; _vec.call(); out._ref->addref( in._ref ); return( out ); } -// im_shrink: shrink image by xfac, yfac times -VImage VImage::shrink( double xfac, double yfac ) throw( VError ) +// im_similarity_area: output area xywh of similarity transformation +VImage VImage::similarity_area( double a, double b, double dx, double dy, int x, int y, int w, int h ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_shrink" ); + Vargv _vec( "im_similarity_area" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((double*) _vec.data(2)) = xfac; - *((double*) _vec.data(3)) = yfac; + *((double*) _vec.data(2)) = a; + *((double*) _vec.data(3)) = b; + *((double*) _vec.data(4)) = dx; + *((double*) _vec.data(5)) = dy; + *((int*) _vec.data(6)) = x; + *((int*) _vec.data(7)) = y; + *((int*) _vec.data(8)) = w; + *((int*) _vec.data(9)) = h; _vec.call(); out._ref->addref( in._ref ); return( out ); } -// im_stretch3: stretch 3%, sub-pixel displace by xdisp/ydisp -VImage VImage::stretch3( double xdisp, double ydisp ) throw( VError ) +// im_similarity: similarity transformation +VImage VImage::similarity( double a, double b, double dx, double dy ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_stretch3" ); + Vargv _vec( "im_similarity" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((double*) _vec.data(2)) = xdisp; - *((double*) _vec.data(3)) = ydisp; + *((double*) _vec.data(2)) = a; + *((double*) _vec.data(3)) = b; + *((double*) _vec.data(4)) = dx; + *((double*) _vec.data(5)) = dy; _vec.call(); out._ref->addref( in._ref ); @@ -5086,7 +5534,7 @@ VImage VImage::stretch3( double xdisp, double ydisp ) throw( VError ) // bodies for package video // this file automatically generated from -// VIPS library 7.20.1-Fri Nov 13 11:00:09 GMT 2009 +// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 // im_video_test: test video grabber VImage VImage::video_test( int brightness, int error ) throw( VError ) {