update the C++ binding

and the Python one
This commit is contained in:
John Cupitt 2012-08-06 22:02:34 +01:00
parent 3276c636f7
commit 4cb63cf1ba
4 changed files with 131 additions and 57 deletions

View File

@ -1,4 +1,9 @@
6/8/12 started 7.30.1
- fixes to dzsave: shrink down to a 1x1 pixel tile, round image size up on
shrink, write a .dzi file with the pyramid params, default tile size and
overlap now matches the openslide writer
- wrap VipsInterpolate for C++
- so affinei and affinei_all appear in Python
20/7/12 started 7.30.0
- support "rs" mode in vips7

6
TODO
View File

@ -1,9 +1,3 @@
- C++/Python need an im_affinei_all, perhaps with a char* for the
interpolator?
test new affinei C++ stuff, esp freeing
blocking bugs
=============

View File

@ -1,13 +1,14 @@
// headers for package arithmetic
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage abs() throw( VError );
VImage acos() throw( VError );
VImage add( VImage add_in2 ) throw( VError );
VImage asin() throw( VError );
VImage atan() throw( VError );
double avg() throw( VError );
double point( char* point_interpolate, double point_x, double point_y, int point_band ) throw( VError );
double point_bilinear( double point_bilinear_x, double point_bilinear_y, int point_bilinear_band ) throw( VError );
VImage bandmean() throw( VError );
VImage ceil() throw( VError );
@ -48,13 +49,13 @@ VImage tan() throw( VError );
// headers for package cimg
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage greyc( int greyc_iterations, double greyc_amplitude, double greyc_sharpness, double greyc_anisotropy, double greyc_alpha, double greyc_sigma, double greyc_dl, double greyc_da, double greyc_gauss_prec, int greyc_interpolation, int greyc_fast_approx ) throw( VError );
VImage greyc_mask( VImage greyc_mask_mask, int greyc_mask_iterations, double greyc_mask_amplitude, double greyc_mask_sharpness, double greyc_mask_anisotropy, double greyc_mask_alpha, double greyc_mask_sigma, double greyc_mask_dl, double greyc_mask_da, double greyc_mask_gauss_prec, int greyc_mask_interpolation, int greyc_mask_fast_approx ) throw( VError );
// headers for package colour
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage LCh2Lab() throw( VError );
VImage LCh2UCS() throw( VError );
VImage Lab2LCh() throw( VError );
@ -89,7 +90,6 @@ VImage dE_fromdisp( VImage dE_fromdisp_in2, VDisplay dE_fromdisp_disp ) throw( V
VImage disp2Lab( VDisplay disp2Lab_disp ) throw( VError );
VImage disp2XYZ( VDisplay disp2XYZ_disp ) throw( VError );
VImage float2rad() throw( VError );
VImage argb2rgba() throw( VError );
VImage icc_ac2rc( char* icc_ac2rc_profile ) throw( VError );
VImage icc_export_depth( int icc_export_depth_depth, char* icc_export_depth_output_profile, int icc_export_depth_intent ) throw( VError );
VImage icc_import( char* icc_import_input_profile, int icc_import_intent ) throw( VError );
@ -101,7 +101,7 @@ VImage sRGB2XYZ() throw( VError );
// headers for package conversion
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
static VImage gaussnoise( int gaussnoise_xsize, int gaussnoise_ysize, double gaussnoise_mean, double gaussnoise_sigma ) throw( VError );
VImage bandjoin( VImage bandjoin_in2 ) throw( VError );
static VImage black( int black_x_size, int black_y_size, int black_bands ) throw( VError );
@ -149,7 +149,7 @@ VImage zoom( int zoom_xfac, int zoom_yfac ) throw( VError );
// headers for package convolution
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage aconvsep( VDMask aconvsep_matrix, int aconvsep_n_layers ) throw( VError );
VImage aconv( VDMask aconv_matrix, int aconv_n_layers, int aconv_cluster ) throw( VError );
VImage addgnoise( double addgnoise_sigma ) throw( VError );
@ -170,7 +170,8 @@ VImage spcor( VImage spcor_in2 ) throw( VError );
// headers for package deprecated
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage argb2rgba() throw( VError );
VImage flood_copy( int flood_copy_start_x, int flood_copy_start_y, std::vector<double> flood_copy_ink ) throw( VError );
VImage flood_blob_copy( int flood_blob_copy_start_x, int flood_blob_copy_start_y, std::vector<double> flood_blob_copy_ink ) throw( VError );
VImage flood_other_copy( VImage flood_other_copy_mark, int flood_other_copy_start_x, int flood_other_copy_start_y, int flood_other_copy_serial ) throw( VError );
@ -255,7 +256,7 @@ VImage notequal( double notequal_c ) throw( VError );
// headers for package format
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
static VImage csv2vips( char* csv2vips_filename ) throw( VError );
static VImage fits2vips( char* fits2vips_in ) throw( VError );
static VImage jpeg2vips( char* jpeg2vips_in ) throw( VError );
@ -274,7 +275,7 @@ void vips2tiff( char* vips2tiff_out ) throw( VError );
// headers for package freq_filt
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
static VImage create_fmask( int create_fmask_width, int create_fmask_height, int create_fmask_type, double create_fmask_p1, double create_fmask_p2, double create_fmask_p3, double create_fmask_p4, double create_fmask_p5 ) throw( VError );
VImage disp_ps() throw( VError );
VImage flt_image_freq( int flt_image_freq_type, double flt_image_freq_p1, double flt_image_freq_p2, double flt_image_freq_p3, double flt_image_freq_p4, double flt_image_freq_p5 ) throw( VError );
@ -288,7 +289,7 @@ VImage invfftr() throw( VError );
// headers for package histograms_lut
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage gammacorrect( double gammacorrect_exponent ) throw( VError );
VImage heq( int heq_band_number ) throw( VError );
VImage hist( int hist_band_number ) throw( VError );
@ -318,7 +319,7 @@ VImage tone_map( VImage tone_map_lut ) throw( VError );
// headers for package inplace
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
void draw_circle( int draw_circle_cx, int draw_circle_cy, int draw_circle_radius, int draw_circle_fill, std::vector<double> draw_circle_ink ) throw( VError );
void draw_rect( int draw_rect_left, int draw_rect_top, int draw_rect_width, int draw_rect_height, int draw_rect_fill, std::vector<double> draw_rect_ink ) throw( VError );
void draw_line( int draw_line_x1, int draw_line_y1, int draw_line_x2, int draw_line_y2, std::vector<double> draw_line_ink ) throw( VError );
@ -333,7 +334,7 @@ VImage line( VImage line_mask, VImage line_ink, std::vector<int> line_x1, std::v
// headers for package iofuncs
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
static VImage binfile( char* binfile_filename, int binfile_width, int binfile_height, int binfile_bands, int binfile_offset ) throw( VError );
VImage cache( int cache_tile_width, int cache_tile_height, int cache_max_tiles ) throw( VError );
char* getext() throw( VError );
@ -346,11 +347,11 @@ void printdesc() throw( VError );
// headers for package mask
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// headers for package morphology
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
double cntlines( int cntlines_direction ) throw( VError );
VImage dilate( VIMask dilate_mask ) throw( VError );
VImage rank( int rank_xsize, int rank_ysize, int rank_n ) throw( VError );
@ -363,7 +364,7 @@ VImage profile( int profile_direction ) throw( VError );
// headers for package mosaicing
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage align_bands() throw( VError );
double correl( VImage correl_sec, int correl_xref, int correl_yref, int correl_xsec, int correl_ysec, int correl_hwindowsize, int correl_hsearchsize, int& correl_x, int& correl_y ) throw( VError );
int _find_lroverlap( VImage _find_lroverlap_sec, int _find_lroverlap_bandno, int _find_lroverlap_xr, int _find_lroverlap_yr, int _find_lroverlap_xs, int _find_lroverlap_ys, int _find_lroverlap_halfcorrelation, int _find_lroverlap_halfarea, int& _find_lroverlap_dy0, double& _find_lroverlap_scale1, double& _find_lroverlap_angle1, double& _find_lroverlap_dx1, double& _find_lroverlap_dy1 ) throw( VError );
@ -385,7 +386,7 @@ VImage tbmosaic1( VImage tbmosaic1_sec, int tbmosaic1_bandno, int tbmosaic1_xr1,
// headers for package other
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage benchmark() throw( VError );
double benchmark2() throw( VError );
VImage benchmarkn( int benchmarkn_n ) throw( VError );
@ -400,14 +401,16 @@ static VImage zone( int zone_size ) throw( VError );
// headers for package resample
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
VImage rightshift_size( int rightshift_size_xshift, int rightshift_size_yshift, int rightshift_size_band_fmt ) throw( VError );
VImage shrink( double shrink_xfac, double shrink_yfac ) throw( VError );
VImage stretch3( double stretch3_xdisp, double stretch3_ydisp ) throw( VError );
VImage affinei( char* affinei_interpolate, double affinei_a, double affinei_b, double affinei_c, double affinei_d, double affinei_dx, double affinei_dy, int affinei_x, int affinei_y, int affinei_w, int affinei_h ) throw( VError );
VImage affinei_all( char* affinei_all_interpolate, double affinei_all_a, double affinei_all_b, double affinei_all_c, double affinei_all_d, double affinei_all_dx, double affinei_all_dy ) throw( VError );
// headers for package video
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
static VImage video_test( int video_test_brightness, int video_test_error ) throw( VError );
static VImage video_v4l1( char* video_v4l1_device, int video_v4l1_channel, int video_v4l1_brightness, int video_v4l1_colour, int video_v4l1_contrast, int video_v4l1_hue, int video_v4l1_ngrabs ) throw( VError );

View File

@ -1,7 +1,7 @@
// bodies for package arithmetic
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_abs: absolute value
VImage VImage::abs() throw( VError )
{
@ -99,6 +99,26 @@ double VImage::avg() throw( VError )
return( value );
}
// im_point: interpolate value at single point
double VImage::point( char* interpolate, double x, double y, int band ) throw( VError )
{
VImage in = *this;
double out;
Vargv _vec( "im_point" );
_vec.data(0) = in.image();
if( vips__input_interpolate_init( &_vec.data(1), interpolate ) )
verror();
*((double*) _vec.data(2)) = x;
*((double*) _vec.data(3)) = y;
*((int*) _vec.data(4)) = band;
_vec.call();
out = *((double*)_vec.data(5));
return( out );
}
// im_point_bilinear: interpolate value at single point, linearly
double VImage::point_bilinear( double x, double y, int band ) throw( VError )
{
@ -741,7 +761,7 @@ VImage VImage::tan() throw( VError )
// bodies for package cimg
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// 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 )
{
@ -801,7 +821,7 @@ VImage VImage::greyc_mask( VImage mask, int iterations, double amplitude, double
// bodies for package colour
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_LCh2Lab: convert LCh to Lab
VImage VImage::LCh2Lab() throw( VError )
{
@ -1371,22 +1391,6 @@ VImage VImage::float2rad() throw( VError )
return( out );
}
// im_argb2rgba: convert pre-multipled argb to png-style rgba
VImage VImage::argb2rgba() throw( VError )
{
VImage in = *this;
VImage out;
Vargv _vec( "im_argb2rgba" );
_vec.data(0) = in.image();
_vec.data(1) = out.image();
_vec.call();
out._ref->addref( in._ref );
return( out );
}
// im_icc_ac2rc: convert LAB from AC to RC using an ICC profile
VImage VImage::icc_ac2rc( char* profile ) throw( VError )
{
@ -1533,7 +1537,7 @@ VImage VImage::sRGB2XYZ() throw( VError )
// bodies for package conversion
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_gaussnoise: generate image of gaussian noise with specified statistics
VImage VImage::gaussnoise( int xsize, int ysize, double mean, double sigma ) throw( VError )
{
@ -2317,7 +2321,7 @@ VImage VImage::zoom( int xfac, int yfac ) throw( VError )
// bodies for package convolution
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_aconvsep: approximate separable convolution
VImage VImage::aconvsep( VDMask matrix, int n_layers ) throw( VError )
{
@ -2620,7 +2624,23 @@ VImage VImage::spcor( VImage in2 ) throw( VError )
// bodies for package deprecated
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_argb2rgba: convert pre-multipled argb to png-style rgba
VImage VImage::argb2rgba() throw( VError )
{
VImage in = *this;
VImage out;
Vargv _vec( "im_argb2rgba" );
_vec.data(0) = in.image();
_vec.data(1) = out.image();
_vec.call();
out._ref->addref( in._ref );
return( out );
}
// 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<double> ink ) throw( VError )
{
@ -4078,7 +4098,7 @@ VImage VImage::notequal( double c ) throw( VError )
// bodies for package format
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_csv2vips: read a file in csv format
VImage VImage::csv2vips( char* filename ) throw( VError )
{
@ -4274,7 +4294,7 @@ void VImage::vips2tiff( char* out ) throw( VError )
// bodies for package freq_filt
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// 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 )
{
@ -4442,7 +4462,7 @@ VImage VImage::invfftr() throw( VError )
// bodies for package histograms_lut
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_gammacorrect: gamma-correct image
VImage VImage::gammacorrect( double exponent ) throw( VError )
{
@ -4889,7 +4909,7 @@ VImage VImage::tone_map( VImage lut ) throw( VError )
// bodies for package inplace
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_draw_circle: draw circle on image
void VImage::draw_circle( int cx, int cy, int radius, int fill, std::vector<double> ink ) throw( VError )
{
@ -5087,7 +5107,7 @@ VImage VImage::line( VImage mask, VImage ink, std::vector<int> x1, std::vector<i
// bodies for package iofuncs
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_binfile: open a headerless binary file
VImage VImage::binfile( char* filename, int width, int height, int bands, int offset ) throw( VError )
{
@ -5231,11 +5251,11 @@ void VImage::printdesc() throw( VError )
// bodies for package mask
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// bodies for package morphology
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_cntlines: count horizontal or vertical lines
double VImage::cntlines( int direction ) throw( VError )
{
@ -5396,7 +5416,7 @@ VImage VImage::profile( int direction ) throw( VError )
// bodies for package mosaicing
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_align_bands: align the bands of an image
VImage VImage::align_bands() throw( VError )
{
@ -5829,7 +5849,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.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_benchmark: do something complicated for testing
VImage VImage::benchmark() throw( VError )
{
@ -6003,7 +6023,7 @@ VImage VImage::zone( int size ) throw( VError )
// bodies for package resample
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_rightshift_size: decrease size by a power-of-two factor
VImage VImage::rightshift_size( int xshift, int yshift, int band_fmt ) throw( VError )
{
@ -6059,10 +6079,62 @@ VImage VImage::stretch3( double xdisp, double ydisp ) throw( VError )
return( out );
}
// im_affinei: affine transform
VImage VImage::affinei( char* interpolate, 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_affinei" );
_vec.data(0) = in.image();
_vec.data(1) = out.image();
if( vips__input_interpolate_init( &_vec.data(2), interpolate ) )
verror();
*((double*) _vec.data(3)) = a;
*((double*) _vec.data(4)) = b;
*((double*) _vec.data(5)) = c;
*((double*) _vec.data(6)) = d;
*((double*) _vec.data(7)) = dx;
*((double*) _vec.data(8)) = dy;
*((int*) _vec.data(9)) = x;
*((int*) _vec.data(10)) = y;
*((int*) _vec.data(11)) = w;
*((int*) _vec.data(12)) = h;
_vec.call();
out._ref->addref( in._ref );
return( out );
}
// im_affinei_all: affine transform of whole image
VImage VImage::affinei_all( char* interpolate, double a, double b, double c, double d, double dx, double dy ) throw( VError )
{
VImage in = *this;
VImage out;
Vargv _vec( "im_affinei_all" );
_vec.data(0) = in.image();
_vec.data(1) = out.image();
if( vips__input_interpolate_init( &_vec.data(2), interpolate ) )
verror();
*((double*) _vec.data(3)) = a;
*((double*) _vec.data(4)) = b;
*((double*) _vec.data(5)) = c;
*((double*) _vec.data(6)) = d;
*((double*) _vec.data(7)) = dx;
*((double*) _vec.data(8)) = dy;
_vec.call();
out._ref->addref( in._ref );
return( out );
}
// bodies for package video
// this file automatically generated from
// VIPS library 7.28.0-Tue Jan 31 10:51:45 GMT 2012
// VIPS library 7.30.1-Mon Aug 6 21:21:06 BST 2012
// im_video_test: test video grabber
VImage VImage::video_test( int brightness, int error ) throw( VError )
{