From 2cbaf93b18f4db6b4bf55b4b38677bcc0b1e26da Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 24 Jun 2010 19:40:12 +0000 Subject: [PATCH] stuff --- TODO | 2 - libvipsCC/include/vips/vipsc++.h | 166 +-- libvipsCC/vipsc++.cc | 1859 +++++++++++++++++------------- 3 files changed, 1168 insertions(+), 859 deletions(-) diff --git a/TODO b/TODO index b751132d..5fe32b23 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -- regenerate c++ and python bindings, 7.22 branch needs copy_set fix - - lcms2 needs testing - tools subdirs are now pretty stupid :-( just have a single dir diff --git a/libvipsCC/include/vips/vipsc++.h b/libvipsCC/include/vips/vipsc++.h index 46066d9b..a07d6c4d 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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 VImage abs() throw( VError ); VImage acos() throw( VError ); VImage add( VImage ) throw( VError ); @@ -11,7 +11,6 @@ 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 ); @@ -20,14 +19,11 @@ 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 ); @@ -39,6 +35,7 @@ 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 ); @@ -51,7 +48,7 @@ VImage tan() throw( VError ); // headers for package boolean // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 VImage andimage( VImage ) throw( VError ); VImage andimage( int ) throw( VError ); VImage andimage( std::vector ) throw( VError ); @@ -61,18 +58,20 @@ 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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 VImage LCh2Lab() throw( VError ); VImage LCh2UCS() throw( VError ); VImage Lab2LCh() throw( VError ); @@ -108,7 +107,6 @@ 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 ); @@ -119,26 +117,17 @@ VImage sRGB2XYZ() throw( VError ); // headers for package conversion // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 +static VImage gaussnoise( int, int, double, double ) throw( VError ); VImage bandjoin( VImage ) throw( VError ); static VImage black( int, int, int ) throw( VError ); VImage c2amph() throw( VError ); VImage c2imag() throw( VError ); -VImage c2ps() throw( VError ); VImage c2real() throw( VError ); VImage c2rect() 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_set( int, double, double, int, int ) throw( VError ); @@ -153,12 +142,13 @@ 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 ); @@ -166,60 +156,82 @@ 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 system_image( char*, char*, char*, 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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 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_raw( VIMask ) throw( VError ); -VImage convf( VDMask ) throw( VError ); -VImage convf_raw( VDMask ) throw( VError ); +VImage conv( VDMask ) throw( VError ); VImage convsep( VIMask ) 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 convsep( VDMask ) throw( VError ); VImage fastcor( VImage ) throw( VError ); -VImage fastcor_raw( VImage ) throw( VError ); -static VImage gaussnoise( int, int, double, double ) throw( VError ); +VImage gradcor( VImage ) throw( VError ); +VImage gradient( VIMask ) 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 ); + +// headers for package deprecated +// this file automatically generated from +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 +VImage clip() throw( VError ); +VImage c2ps() throw( VError ); +VImage resize_linear( int, int ) throw( VError ); +VImage cmulnorm( VImage ) throw( VError ); +VImage fav4( VImage, VImage, VImage ) throw( VError ); +VImage gadd( double, double, VImage, double ) throw( VError ); +VImage icc_export( char*, int ) throw( VError ); +VImage litecor( VImage, int, double ) throw( VError ); +VImage affine( double, double, double, double, double, double, int, int, int, int ) throw( VError ); +VImage clip2c() throw( VError ); +VImage clip2cm() throw( VError ); +VImage clip2d() throw( VError ); +VImage clip2dcm() throw( VError ); +VImage clip2f() throw( VError ); +VImage clip2i() throw( VError ); +VImage convsub( VIMask, int, int ) throw( VError ); +VImage convf( VDMask ) throw( VError ); +VImage convsepf( VDMask ) throw( VError ); +VImage clip2s() throw( VError ); +VImage clip2ui() throw( VError ); +VImage insertplace( VImage, std::vector, std::vector ) throw( VError ); +VImage clip2us() throw( VError ); +VImage slice( double, double ) throw( VError ); +VImage segment( int& ) throw( VError ); +void line( int, int, int, int, int ) throw( VError ); +VImage thresh( double ) throw( VError ); +VImage convf_raw( VDMask ) throw( VError ); +VImage conv_raw( VIMask ) throw( VError ); +VImage contrast_surface_raw( int, int ) throw( VError ); +VImage convsepf_raw( VDMask ) throw( VError ); +VImage convsep_raw( VIMask ) throw( VError ); +VImage fastcor_raw( VImage ) throw( VError ); +VImage gradcor_raw( VImage ) throw( VError ); VImage spcor_raw( VImage ) throw( VError ); -VImage stretch3( double, double ) throw( VError ); -VImage zerox( int ) throw( VError ); +VImage lhisteq_raw( int, int ) throw( VError ); +VImage stdif_raw( double, double, double, double, int, int ) throw( VError ); +VImage rank_raw( int, int, int ) throw( VError ); +VImage dilate_raw( VIMask ) throw( VError ); +VImage erode_raw( VIMask ) 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 format // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 static VImage csv2vips( char* ) throw( VError ); static VImage jpeg2vips( char* ) throw( VError ); static VImage magick2vips( char* ) throw( VError ); @@ -237,7 +249,7 @@ void vips2tiff( char* ) throw( VError ); // headers for package freq_filt // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 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 ); @@ -246,16 +258,18 @@ 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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 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 ); @@ -266,13 +280,12 @@ static VImage identity( int ) throw( VError ); static VImage identity_ushort( int, int ) throw( VError ); int ismonotonic() throw( VError ); VImage lhisteq( int, int ) throw( VError ); -VImage lhisteq_raw( int, int ) throw( VError ); +int mpercent( double ) 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 ); @@ -280,40 +293,47 @@ VImage tone_map( VImage ) throw( VError ); // headers for package inplace // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 void circle( int, int, int, int ) throw( VError ); +VImage flood_copy( int, int, std::vector ) 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 ); -void line( int, int, int, int, int ) throw( VError ); -VImage lineset( VImage, VImage, std::vector, std::vector, std::vector, std::vector ) throw( VError ); +VImage line( VImage, VImage, std::vector, std::vector, std::vector, std::vector ) throw( VError ); // headers for package iofuncs // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 static VImage binfile( char*, int, int, int, int ) throw( VError ); VImage cache( int, int, int ) throw( VError ); -int header_get_type( char* ) throw( VError ); +char* getext() throw( VError ); +int header_get_typeof( 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 matrix +// headers for package mask // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // headers for package morphology // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 double cntlines( int ) throw( VError ); VImage dilate( VIMask ) throw( VError ); -VImage dilate_raw( 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 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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 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 ); @@ -335,7 +355,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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 VImage benchmark() throw( VError ); double benchmark2() throw( VError ); VImage benchmarkn( int ) throw( VError ); @@ -349,7 +369,7 @@ static VImage zone( int ) throw( VError ); // headers for package relational // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 VImage blend( VImage, VImage ) throw( VError ); VImage equal( VImage ) throw( VError ); VImage equal( std::vector ) throw( VError ); @@ -373,14 +393,14 @@ VImage notequal( double ) throw( VError ); // headers for package resample // this file automatically generated from -// 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 ); +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 +VImage rightshift_size( int, int, int ) throw( VError ); +VImage shrink( double, double ) throw( VError ); +VImage stretch3( double, double ) throw( VError ); // headers for package video // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 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 42cd95b1..ce381139 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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_abs: absolute value VImage VImage::abs() throw( VError ) { @@ -133,7 +133,7 @@ VImage VImage::bandmean() throw( VError ) return( out ); } -// im_ceil: round to smallest integal value not less than +// im_ceil: round to smallest integer value not less than VImage VImage::ceil() throw( VError ) { VImage in = *this; @@ -149,24 +149,6 @@ 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 ) { @@ -303,25 +285,7 @@ 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 +// im_floor: round to largest integer value not greater than VImage VImage::floor() throw( VError ) { VImage in = *this; @@ -337,25 +301,6 @@ 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 ) { @@ -437,24 +382,6 @@ 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 ) { @@ -604,7 +531,7 @@ VImage VImage::multiply( VImage in2 ) throw( VError ) return( out ); } -// im_powtra: pel^x ofbuildimage +// im_powtra: pel^x of image VImage VImage::pow( double x ) throw( VError ) { VImage in = *this; @@ -641,6 +568,23 @@ 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 ) { @@ -676,13 +620,13 @@ VImage VImage::remainder( double x ) throw( VError ) return( out ); } -// im_remainderconst_vec: remainder after integer division by a vector of constants +// im_remainder_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_remainderconst_vec" ); + Vargv _vec( "im_remainder_vec" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -696,7 +640,7 @@ VImage VImage::remainder( std::vector x ) throw( VError ) return( out ); } -// im_rint: round to nearest integal value +// im_rint: round to nearest integer value VImage VImage::rint() throw( VError ) { VImage in = *this; @@ -797,7 +741,7 @@ VImage VImage::tan() throw( VError ) // bodies for package boolean // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_andimage: bitwise and of two images VImage VImage::andimage( VImage in2 ) throw( VError ) { @@ -963,7 +907,27 @@ VImage VImage::eorimage( std::vector vec ) throw( VError ) return( out ); } -// im_shiftleft: shift integer image n bits to left +// 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 VImage VImage::shiftleft( int c ) throw( VError ) { VImage in1 = *this; @@ -980,6 +944,26 @@ 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 ) { @@ -1000,7 +984,7 @@ VImage VImage::shiftright( int c ) throw( VError ) // bodies for package cimg // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // 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 ) { @@ -1060,7 +1044,7 @@ VImage VImage::greyc_mask( VImage mask, int iterations, double amplitude, double // bodies for package colour // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_LCh2Lab: convert LCh to Lab VImage VImage::LCh2Lab() throw( VError ) { @@ -1647,24 +1631,6 @@ 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 ) { @@ -1794,7 +1760,24 @@ VImage VImage::sRGB2XYZ() throw( VError ) // bodies for package conversion // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 +// 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 ); +} + // im_bandjoin: bandwise join of two images VImage VImage::bandjoin( VImage in2 ) throw( VError ) { @@ -1861,22 +1844,6 @@ VImage VImage::c2imag() throw( VError ) return( out ); } -// im_c2ps: find power spectrum of complex image -VImage VImage::c2ps() throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_c2ps" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - // im_c2real: extract real part of complex image VImage VImage::c2real() throw( VError ) { @@ -1909,86 +1876,6 @@ VImage VImage::c2rect() throw( VError ) return( out ); } -// im_clip2c: convert to signed 8-bit integer -VImage VImage::clip2c() throw( VError ) -{ - VImage in = *this; - VImage out; - - 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(); - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - // im_clip2fmt: convert image format to ofmt VImage VImage::clip2fmt( int ofmt ) throw( VError ) { @@ -2006,86 +1893,6 @@ VImage VImage::clip2fmt( int ofmt ) throw( VError ) return( out ); } -// im_clip2i: convert to signed 32-bit integer -VImage VImage::clip2i() throw( VError ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_clip2i" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - _vec.call(); - out._ref->addref( in._ref ); - - return( out ); -} - -// im_clip2s: convert to signed 16-bit integer -VImage VImage::clip2s() throw( VError ) -{ - VImage in = *this; - VImage out; - - 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 ) { @@ -2102,6 +1909,22 @@ VImage VImage::copy() throw( VError ) return( out ); } +// im_copy_file: copy image to a file and return that +VImage VImage::copy_file() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_copy_file" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_copy_morph: copy image, setting pixel layout VImage VImage::copy_morph( int Bands, int BandFmt, int Coding ) throw( VError ) { @@ -2362,6 +2185,30 @@ 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 ) { @@ -2382,6 +2229,27 @@ 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 width, int height ) 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)) = width; + *((int*) _vec.data(6)) = height; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + // im_lrjoin: join two images left-right VImage VImage::lrjoin( VImage in2 ) throw( VError ) { @@ -2447,23 +2315,6 @@ 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 ) { @@ -2579,42 +2430,6 @@ 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 ) { @@ -2649,6 +2464,25 @@ char* VImage::system( char* command ) throw( VError ) return( output ); } +// im_system_image: run command on image, with image output +VImage VImage::system_image( char* in_format, char* out_format, char* command, char*& log ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_system_image" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _vec.data(2) = (im_object) in_format; + _vec.data(3) = (im_object) out_format; + _vec.data(4) = (im_object) command; + _vec.call(); + log = (char*) _vec.data(5); + + return( out ); +} + // im_tbjoin: join two images top-bottom VImage VImage::tbjoin( VImage in2 ) throw( VError ) { @@ -2685,22 +2519,6 @@ 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 ) { @@ -2756,7 +2574,7 @@ VImage VImage::zoom( int xfac, int yfac ) throw( VError ) // bodies for package convolution // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_addgnoise: add gaussian noise with mean 0 and std. dev. sigma VImage VImage::addgnoise( double sigma ) throw( VError ) { @@ -2809,24 +2627,6 @@ 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 ) { @@ -2844,47 +2644,13 @@ VImage VImage::conv( VIMask matrix ) throw( VError ) return( out ); } -// im_conv_raw: convolve, no border -VImage VImage::conv_raw( VIMask matrix ) throw( VError ) +// im_conv_f: convolve, with DOUBLEMASK +VImage VImage::conv( VDMask matrix ) throw( VError ) { VImage in = *this; VImage out; - 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" ); + Vargv _vec( "im_conv_f" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -2912,30 +2678,13 @@ VImage VImage::convsep( VIMask matrix ) throw( VError ) return( out ); } -// im_convsep_raw: seperable convolution, no border -VImage VImage::convsep_raw( VIMask matrix ) throw( VError ) +// im_convsep_f: seperable convolution, with DOUBLEMASK +VImage VImage::convsep( VDMask matrix ) throw( VError ) { VImage in = *this; VImage out; - 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" ); + Vargv _vec( "im_convsep_f" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); @@ -2946,62 +2695,6 @@ VImage VImage::convsepf( 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 ) { @@ -3020,13 +2713,13 @@ VImage VImage::fastcor( VImage in2 ) throw( VError ) return( out ); } -// im_fastcor_raw: fast correlate in2 within in1, no border -VImage VImage::fastcor_raw( VImage in2 ) throw( VError ) +// 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_fastcor_raw" ); + Vargv _vec( "im_gradcor" ); _vec.data(0) = in1.image(); _vec.data(1) = in2.image(); @@ -3038,19 +2731,19 @@ VImage VImage::fastcor_raw( VImage in2 ) throw( VError ) 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 ) +// im_gradient: convolve with 2-way rotating mask +VImage VImage::gradient( VIMask matrix ) throw( VError ) { + VImage in = *this; VImage out; - Vargv _vec( "im_gaussnoise" ); + Vargv _vec( "im_gradient" ); - _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.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 ); } @@ -3087,13 +2780,610 @@ 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 ) +// im_lindetect: convolve with 4-way rotating mask +VImage VImage::lindetect( VIMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_lindetect" ); + + _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_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 ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_sharpen" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = mask_size; + *((double*) _vec.data(3)) = x1; + *((double*) _vec.data(4)) = y2; + *((double*) _vec.data(5)) = y3; + *((double*) _vec.data(6)) = m1; + *((double*) _vec.data(7)) = m2; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_spcor: normalised correlation of in2 within in1 +VImage VImage::spcor( VImage in2 ) throw( VError ) { VImage in1 = *this; VImage out; - Vargv _vec( "im_gradcor" ); + Vargv _vec( "im_spcor" ); + + _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 ); +} + + +// bodies for package deprecated +// this file automatically generated from +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 +// 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_c2ps: find power spectrum of complex image +VImage VImage::c2ps() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_c2ps" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _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_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_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_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_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_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_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_affine" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((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_clip2c: convert to signed 8-bit integer +VImage VImage::clip2c() throw( VError ) +{ + VImage in = *this; + VImage out; + + 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(); + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2i: convert to signed 32-bit integer +VImage VImage::clip2i() throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_clip2i" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + _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_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_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(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().dptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_clip2s: convert to signed 16-bit integer +VImage VImage::clip2s() throw( VError ) +{ + VImage in = *this; + VImage out; + + 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_insertplaceset: insert sub into main at every position in x, y +VImage VImage::insertplace( VImage sub, std::vector x, std::vector y ) throw( VError ) +{ + VImage main = *this; + VImage out; + + Vargv _vec( "im_insertplaceset" ); + + _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_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_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_segment: number continuous regions in an image +VImage VImage::segment( int& segments ) throw( VError ) +{ + VImage test = *this; + VImage mask; + + Vargv _vec( "im_segment" ); + + _vec.data(0) = test.image(); + _vec.data(1) = mask.image(); + _vec.call(); + segments = *((int*)_vec.data(2)); + + return( mask ); +} + +// 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_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_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(); + ((im_mask_object*) _vec.data(2))->mask = matrix.mask().dptr; + _vec.call(); + out._ref->addref( in._ref ); + + return( out ); +} + +// im_conv_raw: convolve, no border +VImage VImage::conv_raw( VIMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + 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_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_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_convsep_raw: seperable convolution, no border +VImage VImage::convsep_raw( VIMask matrix ) throw( VError ) +{ + VImage in = *this; + VImage out; + + 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_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_fastcor_raw" ); _vec.data(0) = in1.image(); _vec.data(1) = in2.image(); @@ -3123,124 +3413,58 @@ VImage VImage::gradcor_raw( VImage in2 ) throw( VError ) 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 ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_lindetect" ); - - _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_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 ) +// 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_phasecor_fft" ); + 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_rank: rank filter nth element of xsize/ysize window -VImage VImage::rank( int xsize, int ysize, int n ) throw( VError ) +// im_lhisteq_raw: local histogram equalisation, no border +VImage VImage::lhisteq_raw( int width, int height ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_rank" ); + Vargv _vec( "im_lhisteq_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; + *((int*) _vec.data(2)) = width; + *((int*) _vec.data(3)) = height; + _vec.call(); + out._ref->addref( in._ref ); + + 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 ); @@ -3266,128 +3490,78 @@ VImage VImage::rank_raw( int xsize, int ysize, int n ) throw( VError ) return( out ); } -// im_resize_linear: resize to X by Y pixels with linear interpolation -VImage VImage::resize_linear( int X, int Y ) throw( VError ) +// im_dilate_raw: dilate image with mask +VImage VImage::dilate_raw( VIMask mask ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_resize_linear" ); + Vargv _vec( "im_dilate_raw" ); _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 ) -{ - VImage in = *this; - VImage out; - - Vargv _vec( "im_sharpen" ); - - _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - *((int*) _vec.data(2)) = mask_size; - *((double*) _vec.data(3)) = x1; - *((double*) _vec.data(4)) = y2; - *((double*) _vec.data(5)) = y3; - *((double*) _vec.data(6)) = m1; - *((double*) _vec.data(7)) = m2; + ((im_mask_object*) _vec.data(2))->mask = mask.mask().iptr; _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_erode_raw: erode image with mask +VImage VImage::erode_raw( VIMask mask ) throw( VError ) { VImage in = *this; VImage out; - Vargv _vec( "im_shrink" ); + Vargv _vec( "im_erode_raw" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((double*) _vec.data(2)) = xfac; - *((double*) _vec.data(3)) = yfac; + ((im_mask_object*) _vec.data(2))->mask = mask.mask().iptr; _vec.call(); out._ref->addref( in._ref ); return( out ); } -// im_spcor: normalised correlation of in2 within in1 -VImage VImage::spcor( VImage in2 ) throw( VError ) -{ - VImage in1 = *this; - VImage out; - - Vargv _vec( "im_spcor" ); - - _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_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 ) +// 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_stretch3" ); + Vargv _vec( "im_similarity_area" ); _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; + *((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_zerox: find +ve or -ve zero crossings in image -VImage VImage::zerox( int flag ) 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_zerox" ); + Vargv _vec( "im_similarity" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((int*) _vec.data(2)) = flag; + *((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 ); @@ -3397,7 +3571,7 @@ VImage VImage::zerox( int flag ) throw( VError ) // bodies for package format // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_csv2vips: read a file in csv format VImage VImage::csv2vips( char* filename ) throw( VError ) { @@ -3579,7 +3753,7 @@ void VImage::vips2tiff( char* out ) throw( VError ) // bodies for package freq_filt // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // 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 ) { @@ -3713,6 +3887,22 @@ 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 ) { @@ -3731,7 +3921,7 @@ VImage VImage::invfftr() throw( VError ) // bodies for package histograms_lut // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_gammacorrect: gamma-correct image VImage VImage::gammacorrect( double exponent ) throw( VError ) { @@ -3815,6 +4005,24 @@ 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 ) { @@ -3973,22 +4181,20 @@ VImage VImage::lhisteq( int width, int height ) throw( VError ) return( out ); } -// im_lhisteq_raw: local histogram equalisation, no border -VImage VImage::lhisteq_raw( int width, int height ) throw( VError ) +// im_mpercent: find threshold above which there are percent values +int VImage::mpercent( double percent ) throw( VError ) { VImage in = *this; - VImage out; + int thresh; - Vargv _vec( "im_lhisteq_raw" ); + Vargv _vec( "im_mpercent" ); _vec.data(0) = in.image(); - _vec.data(1) = out.image(); - *((int*) _vec.data(2)) = width; - *((int*) _vec.data(3)) = height; + *((double*) _vec.data(1)) = percent; _vec.call(); - out._ref->addref( in._ref ); + thresh = *((int*)_vec.data(2)); - return( out ); + return( thresh ); } // im_invertlut: generate correction table from set of measures @@ -4076,28 +4282,6 @@ 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 ) { @@ -4184,7 +4368,7 @@ VImage VImage::tone_map( VImage lut ) throw( VError ) // bodies for package inplace // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_circle: plot circle on image void VImage::circle( int cx, int cy, int radius, int intensity ) throw( VError ) { @@ -4199,6 +4383,27 @@ void VImage::circle( int cx, int cy, int radius, int intensity ) throw( VError ) _vec.call(); } +// im_flood_copy: flood with ink from start_x, start_y while pixel == start pixel +VImage VImage::flood_copy( int start_x, int start_y, std::vector ink ) throw( VError ) +{ + VImage in = *this; + VImage out; + + Vargv _vec( "im_flood_copy" ); + + _vec.data(0) = in.image(); + _vec.data(1) = out.image(); + *((int*) _vec.data(2)) = start_x; + *((int*) _vec.data(3)) = start_y; + ((im_doublevec_object*) _vec.data(4))->n = ink.size(); + ((im_doublevec_object*) _vec.data(4))->vec = new double[ink.size()]; + for( unsigned int i = 0; i < ink.size(); i++ ) + ((im_doublevec_object*) _vec.data(4))->vec[i] = ink[i]; + _vec.call(); + + return( out ); +} + // im_flood_blob_copy: flood with ink from start_x, start_y while pixel == start pixel VImage VImage::flood_blob_copy( int start_x, int start_y, std::vector ink ) throw( VError ) { @@ -4220,6 +4425,25 @@ VImage VImage::flood_blob_copy( int start_x, int start_y, std::vector in return( out ); } +// im_flood_other_copy: flood mark with serial from start_x, start_y while pixel == start pixel +VImage VImage::flood_other_copy( VImage mark, int start_x, int start_y, int serial ) throw( VError ) +{ + VImage test = *this; + VImage out; + + Vargv _vec( "im_flood_other_copy" ); + + _vec.data(0) = test.image(); + _vec.data(1) = mark.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 ) { @@ -4233,23 +4457,8 @@ 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::lineset( VImage mask, VImage ink, std::vector x1, std::vector y1, std::vector x2, std::vector y2 ) throw( VError ) +VImage VImage::line( VImage mask, VImage ink, std::vector x1, std::vector y1, std::vector x2, std::vector y2 ) throw( VError ) { VImage in = *this; VImage out; @@ -4284,7 +4493,7 @@ VImage VImage::lineset( VImage mask, VImage ink, std::vector x1, std::vecto // bodies for package iofuncs // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_binfile: open a headerless binary file VImage VImage::binfile( char* filename, int width, int height, int bands, int offset ) throw( VError ) { @@ -4321,13 +4530,28 @@ VImage VImage::cache( int tile_width, int tile_height, int max_tiles ) throw( VE return( out ); } -// im_header_get_type: return field type -int VImage::header_get_type( char* field ) throw( VError ) +// im_getext: return the image metadata XML as a string +char* VImage::getext() throw( VError ) +{ + VImage image = *this; + char* history; + + Vargv _vec( "im_getext" ); + + _vec.data(0) = image.image(); + _vec.call(); + history = (char*) _vec.data(1); + + return( history ); +} + +// im_header_get_typeof: return field type +int VImage::header_get_typeof( char* field ) throw( VError ) { VImage image = *this; int gtype; - Vargv _vec( "im_header_get_type" ); + Vargv _vec( "im_header_get_typeof" ); _vec.data(0) = (im_object) field; _vec.data(1) = image.image(); @@ -4369,7 +4593,7 @@ double VImage::header_double( char* field ) throw( VError ) return( value ); } -// im_header_string: extract string fields from header +// im_header_string: extract fields from headers as strings char* VImage::header_string( char* field ) throw( VError ) { VImage image = *this; @@ -4385,14 +4609,39 @@ char* VImage::header_string( char* field ) throw( VError ) return( value ); } +// im_history_get: return the image history as a string +char* VImage::history_get() throw( VError ) +{ + VImage image = *this; + char* history; -// bodies for package matrix + Vargv _vec( "im_history_get" ); + + _vec.data(0) = image.image(); + _vec.call(); + history = (char*) _vec.data(1); + + return( history ); +} + +// im_printdesc: print an image header to stdout +void VImage::printdesc() throw( VError ) +{ + VImage image = *this; + Vargv _vec( "im_printdesc" ); + + _vec.data(0) = image.image(); + _vec.call(); +} + + +// bodies for package mask // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // bodies for package morphology // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_cntlines: count horizontal or vertical lines double VImage::cntlines( int direction ) throw( VError ) { @@ -4426,17 +4675,91 @@ VImage VImage::dilate( VIMask mask ) throw( VError ) return( out ); } -// im_dilate_raw: dilate image with mask -VImage VImage::dilate_raw( VIMask mask ) throw( VError ) +// 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_dilate_raw" ); + Vargv _vec( "im_rank" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - ((im_mask_object*) _vec.data(2))->mask = mask.mask().iptr; + *((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_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; _vec.call(); out._ref->addref( in._ref ); @@ -4460,23 +4783,6 @@ 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 ) { @@ -4496,7 +4802,7 @@ VImage VImage::profile( int direction ) throw( VError ) // bodies for package mosaicing // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_align_bands: align the bands of an image VImage VImage::align_bands() throw( VError ) { @@ -4929,7 +5235,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.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_benchmark: do something complicated for testing VImage VImage::benchmark() throw( VError ) { @@ -5086,7 +5392,7 @@ VImage VImage::zone( int size ) throw( VError ) // bodies for package relational // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_blend: use cond image to blend between images in1 and in2 VImage VImage::blend( VImage in1, VImage in2 ) throw( VError ) { @@ -5460,71 +5766,56 @@ VImage VImage::notequal( double c ) throw( VError ) // bodies for package resample // this file automatically generated from -// 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 ) +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 +// 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_affine" ); + Vargv _vec( "im_rightshift_size" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((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; + *((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_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 ) +// 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_similarity_area" ); + Vargv _vec( "im_shrink" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((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; + *((double*) _vec.data(2)) = xfac; + *((double*) _vec.data(3)) = yfac; _vec.call(); out._ref->addref( in._ref ); return( out ); } -// im_similarity: similarity transformation -VImage VImage::similarity( double a, double b, double dx, double dy ) throw( VError ) +// 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_similarity" ); + Vargv _vec( "im_stretch3" ); _vec.data(0) = in.image(); _vec.data(1) = out.image(); - *((double*) _vec.data(2)) = a; - *((double*) _vec.data(3)) = b; - *((double*) _vec.data(4)) = dx; - *((double*) _vec.data(5)) = dy; + *((double*) _vec.data(2)) = xdisp; + *((double*) _vec.data(3)) = ydisp; _vec.call(); out._ref->addref( in._ref ); @@ -5534,7 +5825,7 @@ VImage VImage::similarity( double a, double b, double dx, double dy ) throw( VEr // bodies for package video // this file automatically generated from -// VIPS library 7.18.1-Tue Sep 8 04:54:03 UTC 2009 +// VIPS library 7.22.1-Tue Jun 22 10:26:51 BST 2010 // im_video_test: test video grabber VImage VImage::video_test( int brightness, int error ) throw( VError ) {