From 241f52fb54fa32ecc1f36238badcd255d69d5283 Mon Sep 17 00:00:00 2001 From: kleisauke Date: Sun, 3 Feb 2019 12:13:04 +0100 Subject: [PATCH] Fix compatibility with Makefile + all operations are now provided with a C++ style comment block. --- cplusplus/Makefile.am | 3 +- cplusplus/gen-operators.py | 74 +- cplusplus/include/vips/Makefile.am | 3 +- cplusplus/include/vips/vips-operators.h | 2319 +++++++++- cplusplus/vips-operators.cpp | 5618 ++++++++++++----------- 5 files changed, 4928 insertions(+), 3089 deletions(-) diff --git a/cplusplus/Makefile.am b/cplusplus/Makefile.am index 8cf58984..cdaf8921 100644 --- a/cplusplus/Makefile.am +++ b/cplusplus/Makefile.am @@ -25,8 +25,7 @@ vips-operators.cpp: echo -n "// " >> vips-operators.cpp; \ date >> vips-operators.cpp; \ echo "// this file is generated automatically, do not edit!" >> vips-operators.cpp; \ - echo "" >> vips-operators.cpp; \ - ./gen-operators.py >> vips-operators.cpp + ./gen-operators.py -g cpp >> vips-operators.cpp EXTRA_DIST = \ README \ diff --git a/cplusplus/gen-operators.py b/cplusplus/gen-operators.py index 46133f9c..d748a12a 100755 --- a/cplusplus/gen-operators.py +++ b/cplusplus/gen-operators.py @@ -28,7 +28,7 @@ # return( out ); # } -import datetime +import argparse from pyvips import Image, Operation, GValue, Error, \ ffi, gobject_lib, type_map, type_from_name, nickname_find, type_name @@ -41,7 +41,6 @@ gtype_to_cpp = { GValue.gstr_type: 'char *', GValue.refstr_type: 'char *', GValue.gflags_type: 'int', - GValue.gobject_type: 'char *', GValue.image_type: 'VImage', GValue.array_int_type: 'std::vector', GValue.array_double_type: 'std::vector', @@ -114,16 +113,30 @@ def generate_operation(operation_name, declaration_only=False): has_output = len(required_output) >= 1 - # TODO: Should we output the operation description as comment? - # if declaration_only: - # description = op.get_description() - # - # result = '\n\n/*\n' - # result += ' ' + description[0].upper() + description[1:] + '.\n' - # result += '*/\n' - # else: + # Add a C++ style comment block with some additional markings (@param, @return) + if declaration_only: + description = op.get_description() + + result = '\n/**\n' + result += ' * ' + description[0].upper() + description[1:] + '.' + + for name in required_input: + result += '\n * @param ' + cppize(name) + ' ' + op.get_blurb(name) + '.' + + if has_output: + # skip the first element + for name in required_output[1:]: + result += '\n * @param ' + cppize(name) + ' ' + op.get_blurb(name) + '.' + + result += '\n * @param options Optional options.' + + if has_output: + result += '\n * @return ' + op.get_blurb(required_output[0]) + '.' + + result += '\n */\n' + else: + result = '\n' - result = '\n' if member_x is None and declaration_only: result += 'static ' if has_output: @@ -201,20 +214,12 @@ def generate_operation(operation_name, declaration_only=False): result += '\n' result += ' return( {0} );\n'.format(required_output[0]) - result += '}\n' + result += '}' return result -preamble = """// {0} for vips operations -// {1} -// this file is generated automatically, do not edit! -""" - -now = datetime.datetime.now().strftime('%a %d %b %H:%M:%S %Y') - - -def generate_operators(filename, declarations_only=False): +def generate_operators(declarations_only=False): all_nicknames = [] def add_nickname(gtype, a, b): @@ -235,23 +240,24 @@ def generate_operators(filename, declarations_only=False): type_map(type_from_name('VipsOperation'), add_nickname) - # TODO: Should we add the 'missing' extract_area synonym by hand? - # all_nicknames.append('crop') + # add 'missing' synonyms by hand + all_nicknames.append('crop') # make list unique and sort all_nicknames = list(set(all_nicknames)) all_nicknames.sort() - print('Generating {0} ...'.format(filename)) - - with open(filename, 'w') as f: - f.write(preamble.format('headers' if declarations_only else "bodies", now)) - - for nickname in all_nicknames: - f.write(generate_operation(nickname, declarations_only)) - - f.write('\n') + for nickname in all_nicknames: + print(generate_operation(nickname, declarations_only)) -generate_operators('vips-operators.cpp') -generate_operators('include/vips/vips-operators.h', True) +parser = argparse.ArgumentParser(description='C++ binding generator') +parser.add_argument('--gen', '-g', + default='cpp', + choices=['h', 'cpp'], + help='File to generate: h (headers) or cpp (implementations) (default: %(default)s)') + +if __name__ == '__main__': + args = parser.parse_args() + + generate_operators(args.gen == 'h') diff --git a/cplusplus/include/vips/Makefile.am b/cplusplus/include/vips/Makefile.am index 020aa10d..dcb3d8fd 100644 --- a/cplusplus/include/vips/Makefile.am +++ b/cplusplus/include/vips/Makefile.am @@ -10,8 +10,7 @@ vips-operators.h: echo -n "// " >> vips-operators.h; \ date >> vips-operators.h; \ echo "// this file is generated automatically, do not edit!" >> vips-operators.h; \ - echo "" >> vips-operators.h; \ - ./gen-operators-h.py >> vips-operators.h + ./../../gen-operators.py -g h >> vips-operators.h EXTRA_DIST = \ gen-operators-h.py diff --git a/cplusplus/include/vips/vips-operators.h b/cplusplus/include/vips/vips-operators.h index 41163712..0a14b54d 100644 --- a/cplusplus/include/vips/vips-operators.h +++ b/cplusplus/include/vips/vips-operators.h @@ -1,262 +1,2089 @@ // headers for vips operations -// Fri 01 Feb 21:18:25 2019 +// Sun Feb 3 11:54:51 CET 2019 // this file is generated automatically, do not edit! -static void system( char *cmd_format, VOption *options = 0 ); -VImage add( VImage right, VOption *options = 0 ) const; -VImage subtract( VImage right, VOption *options = 0 ) const; -VImage multiply( VImage right, VOption *options = 0 ) const; -VImage divide( VImage right, VOption *options = 0 ) const; -VImage relational( VImage right, VipsOperationRelational relational, VOption *options = 0 ) const; -VImage remainder( VImage right, VOption *options = 0 ) const; -VImage boolean( VImage right, VipsOperationBoolean boolean, VOption *options = 0 ) const; -VImage math2( VImage right, VipsOperationMath2 math2, VOption *options = 0 ) const; -VImage complex2( VImage right, VipsOperationComplex2 cmplx, VOption *options = 0 ) const; -VImage complexform( VImage right, VOption *options = 0 ) const; -static VImage sum( std::vector in, VOption *options = 0 ); -VImage invert( VOption *options = 0 ) const; -VImage linear( std::vector a, std::vector b, VOption *options = 0 ) const; -VImage math( VipsOperationMath math, VOption *options = 0 ) const; -VImage abs( VOption *options = 0 ) const; -VImage sign( VOption *options = 0 ) const; -VImage round( VipsOperationRound round, VOption *options = 0 ) const; -VImage relational_const( VipsOperationRelational relational, std::vector c, VOption *options = 0 ) const; -VImage remainder_const( std::vector c, VOption *options = 0 ) const; -VImage boolean_const( VipsOperationBoolean boolean, std::vector c, VOption *options = 0 ) const; -VImage math2_const( VipsOperationMath2 math2, std::vector c, VOption *options = 0 ) const; -VImage complex( VipsOperationComplex cmplx, VOption *options = 0 ) const; -VImage complexget( VipsOperationComplexget get, VOption *options = 0 ) const; -double avg( VOption *options = 0 ) const; -double min( VOption *options = 0 ) const; -double max( VOption *options = 0 ) const; -double deviate( VOption *options = 0 ) const; -VImage stats( VOption *options = 0 ) const; -VImage hist_find( VOption *options = 0 ) const; -VImage hist_find_ndim( VOption *options = 0 ) const; -VImage hist_find_indexed( VImage index, VOption *options = 0 ) const; -VImage hough_line( VOption *options = 0 ) const; -VImage hough_circle( VOption *options = 0 ) const; -VImage project( VImage *rows, VOption *options = 0 ) const; -VImage profile( VImage *rows, VOption *options = 0 ) const; -VImage measure( int h, int v, VOption *options = 0 ) const; -std::vector getpoint( int x, int y, VOption *options = 0 ) const; -int find_trim( int *top, int *width, int *height, VOption *options = 0 ) const; -VImage copy( VOption *options = 0 ) const; -VImage tilecache( VOption *options = 0 ) const; -VImage linecache( VOption *options = 0 ) const; -VImage sequential( VOption *options = 0 ) const; -VImage cache( VOption *options = 0 ) const; -VImage embed( int x, int y, int width, int height, VOption *options = 0 ) const; -VImage gravity( VipsCompassDirection direction, int width, int height, VOption *options = 0 ) const; -VImage flip( VipsDirection direction, VOption *options = 0 ) const; -VImage insert( VImage sub, int x, int y, VOption *options = 0 ) const; -VImage join( VImage in2, VipsDirection direction, VOption *options = 0 ) const; -static VImage arrayjoin( std::vector in, VOption *options = 0 ); -VImage extract_area( int left, int top, int width, int height, VOption *options = 0 ) const; -VImage smartcrop( int width, int height, VOption *options = 0 ) const; -VImage extract_band( int band, VOption *options = 0 ) const; -static VImage bandjoin( std::vector in, VOption *options = 0 ); -VImage bandjoin_const( std::vector c, VOption *options = 0 ) const; -static VImage bandrank( std::vector in, VOption *options = 0 ); -VImage bandmean( VOption *options = 0 ) const; -VImage bandbool( VipsOperationBoolean boolean, VOption *options = 0 ) const; -VImage replicate( int across, int down, VOption *options = 0 ) const; -VImage cast( VipsBandFormat format, VOption *options = 0 ) const; -VImage rot( VipsAngle angle, VOption *options = 0 ) const; -VImage rot45( VOption *options = 0 ) const; -VImage autorot( VOption *options = 0 ) const; -VImage ifthenelse( VImage in1, VImage in2, VOption *options = 0 ) const; -VImage recomb( VImage m, VOption *options = 0 ) const; -VImage bandfold( VOption *options = 0 ) const; -VImage bandunfold( VOption *options = 0 ) const; -VImage flatten( VOption *options = 0 ) const; -VImage premultiply( VOption *options = 0 ) const; -VImage unpremultiply( VOption *options = 0 ) const; -VImage grid( int tile_height, int across, int down, VOption *options = 0 ) const; -VImage transpose3d( VOption *options = 0 ) const; -VImage scale( VOption *options = 0 ) const; -VImage wrap( VOption *options = 0 ) const; -VImage zoom( int xfac, int yfac, VOption *options = 0 ) const; -VImage subsample( int xfac, int yfac, VOption *options = 0 ) const; -VImage msb( VOption *options = 0 ) const; -VImage byteswap( VOption *options = 0 ) const; -VImage falsecolour( VOption *options = 0 ) const; -VImage gamma( VOption *options = 0 ) const; -static VImage composite( std::vector in, std::vector mode, VOption *options = 0 ); -VImage composite2( VImage overlay, VipsBlendMode mode, VOption *options = 0 ) const; -static VImage black( int width, int height, VOption *options = 0 ); -static VImage gaussnoise( int width, int height, VOption *options = 0 ); -static VImage text( char *text, VOption *options = 0 ); -static VImage xyz( int width, int height, VOption *options = 0 ); -static VImage gaussmat( double sigma, double min_ampl, VOption *options = 0 ); -static VImage logmat( double sigma, double min_ampl, VOption *options = 0 ); -static VImage eye( int width, int height, VOption *options = 0 ); -static VImage grey( int width, int height, VOption *options = 0 ); -static VImage zone( int width, int height, VOption *options = 0 ); -static VImage sines( int width, int height, VOption *options = 0 ); -static VImage mask_ideal( int width, int height, double frequency_cutoff, VOption *options = 0 ); -static VImage mask_ideal_ring( int width, int height, double frequency_cutoff, double ringwidth, VOption *options = 0 ); -static VImage mask_ideal_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, VOption *options = 0 ); -static VImage mask_butterworth( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0 ); -static VImage mask_butterworth_ring( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0 ); -static VImage mask_butterworth_band( int width, int height, double order, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0 ); -static VImage mask_gaussian( int width, int height, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0 ); -static VImage mask_gaussian_ring( int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0 ); -static VImage mask_gaussian_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0 ); -static VImage mask_fractal( int width, int height, double fractal_dimension, VOption *options = 0 ); -VImage buildlut( VOption *options = 0 ) const; -VImage invertlut( VOption *options = 0 ) const; -static VImage tonelut( VOption *options = 0 ); -static VImage identity( VOption *options = 0 ); -static VImage fractsurf( int width, int height, double fractal_dimension, VOption *options = 0 ); -static VImage worley( int width, int height, VOption *options = 0 ); -static VImage perlin( int width, int height, VOption *options = 0 ); -static VImage csvload( char *filename, VOption *options = 0 ); -static VImage matrixload( char *filename, VOption *options = 0 ); -static VImage rawload( char *filename, int width, int height, int bands, VOption *options = 0 ); -static VImage vipsload( char *filename, VOption *options = 0 ); -static VImage analyzeload( char *filename, VOption *options = 0 ); -static VImage ppmload( char *filename, VOption *options = 0 ); -static VImage radload( char *filename, VOption *options = 0 ); -static VImage pdfload( char *filename, VOption *options = 0 ); -static VImage pdfload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage svgload( char *filename, VOption *options = 0 ); -static VImage svgload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage gifload( char *filename, VOption *options = 0 ); -static VImage gifload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage pngload( char *filename, VOption *options = 0 ); -static VImage pngload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage matload( char *filename, VOption *options = 0 ); -static VImage jpegload( char *filename, VOption *options = 0 ); -static VImage jpegload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage webpload( char *filename, VOption *options = 0 ); -static VImage webpload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage tiffload( char *filename, VOption *options = 0 ); -static VImage tiffload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage openslideload( char *filename, VOption *options = 0 ); -static VImage magickload( char *filename, VOption *options = 0 ); -static VImage magickload_buffer( VipsBlob *buffer, VOption *options = 0 ); -static VImage fitsload( char *filename, VOption *options = 0 ); -static VImage openexrload( char *filename, VOption *options = 0 ); -void csvsave( char *filename, VOption *options = 0 ) const; -void matrixsave( char *filename, VOption *options = 0 ) const; -void matrixprint( VOption *options = 0 ) const; -void rawsave( char *filename, VOption *options = 0 ) const; -void rawsave_fd( int fd, VOption *options = 0 ) const; -void vipssave( char *filename, VOption *options = 0 ) const; -void ppmsave( char *filename, VOption *options = 0 ) const; -void radsave( char *filename, VOption *options = 0 ) const; -VipsBlob *radsave_buffer( VOption *options = 0 ) const; -void dzsave( char *filename, VOption *options = 0 ) const; -VipsBlob *dzsave_buffer( VOption *options = 0 ) const; -void pngsave( char *filename, VOption *options = 0 ) const; -VipsBlob *pngsave_buffer( VOption *options = 0 ) const; -void jpegsave( char *filename, VOption *options = 0 ) const; -VipsBlob *jpegsave_buffer( VOption *options = 0 ) const; -void jpegsave_mime( VOption *options = 0 ) const; -void webpsave( char *filename, VOption *options = 0 ) const; -VipsBlob *webpsave_buffer( VOption *options = 0 ) const; -void tiffsave( char *filename, VOption *options = 0 ) const; -VipsBlob *tiffsave_buffer( VOption *options = 0 ) const; -void magicksave( char *filename, VOption *options = 0 ) const; -VipsBlob *magicksave_buffer( VOption *options = 0 ) const; -void fitssave( char *filename, VOption *options = 0 ) const; -static VImage thumbnail( char *filename, int width, VOption *options = 0 ); -static VImage thumbnail_buffer( VipsBlob *buffer, int width, VOption *options = 0 ); -VImage thumbnail_image( int width, VOption *options = 0 ) const; -VImage mapim( VImage index, VOption *options = 0 ) const; -VImage shrink( double hshrink, double vshrink, VOption *options = 0 ) const; -VImage shrinkh( int hshrink, VOption *options = 0 ) const; -VImage shrinkv( int vshrink, VOption *options = 0 ) const; -VImage reduceh( double hshrink, VOption *options = 0 ) const; -VImage reducev( double vshrink, VOption *options = 0 ) const; -VImage reduce( double hshrink, double vshrink, VOption *options = 0 ) const; -VImage quadratic( VImage coeff, VOption *options = 0 ) const; -VImage affine( std::vector matrix, VOption *options = 0 ) const; -VImage similarity( VOption *options = 0 ) const; -VImage rotate( double angle, VOption *options = 0 ) const; -VImage resize( double scale, VOption *options = 0 ) const; -VImage colourspace( VipsInterpretation space, VOption *options = 0 ) const; -VImage Lab2XYZ( VOption *options = 0 ) const; -VImage XYZ2Lab( VOption *options = 0 ) const; -VImage Lab2LCh( VOption *options = 0 ) const; -VImage LCh2Lab( VOption *options = 0 ) const; -VImage LCh2CMC( VOption *options = 0 ) const; +/** + * Transform LCh to CMC. + * @param options Optional options. + * @return Output image. + */ VImage CMC2LCh( VOption *options = 0 ) const; -VImage XYZ2Yxy( VOption *options = 0 ) const; -VImage Yxy2XYZ( VOption *options = 0 ) const; -VImage scRGB2XYZ( VOption *options = 0 ) const; -VImage XYZ2scRGB( VOption *options = 0 ) const; -VImage LabQ2Lab( VOption *options = 0 ) const; -VImage Lab2LabQ( VOption *options = 0 ) const; -VImage LabQ2LabS( VOption *options = 0 ) const; -VImage LabS2LabQ( VOption *options = 0 ) const; -VImage LabS2Lab( VOption *options = 0 ) const; -VImage Lab2LabS( VOption *options = 0 ) const; -VImage rad2float( VOption *options = 0 ) const; -VImage float2rad( VOption *options = 0 ) const; -VImage LabQ2sRGB( VOption *options = 0 ) const; -VImage sRGB2HSV( VOption *options = 0 ) const; + +/** + * Transform CMYK to XYZ. + * @param options Optional options. + * @return Output image. + */ +VImage CMYK2XYZ( VOption *options = 0 ) const; + +/** + * Transform HSV to sRGB. + * @param options Optional options. + * @return Output image. + */ VImage HSV2sRGB( VOption *options = 0 ) const; -VImage icc_import( VOption *options = 0 ) const; -VImage icc_export( VOption *options = 0 ) const; -VImage icc_transform( char *output_profile, VOption *options = 0 ) const; -VImage dE76( VImage right, VOption *options = 0 ) const; -VImage dE00( VImage right, VOption *options = 0 ) const; -VImage dECMC( VImage right, VOption *options = 0 ) const; -VImage sRGB2scRGB( VOption *options = 0 ) const; -VImage scRGB2BW( VOption *options = 0 ) const; -VImage scRGB2sRGB( VOption *options = 0 ) const; -VImage maplut( VImage lut, VOption *options = 0 ) const; -int percent( double percent, VOption *options = 0 ) const; -VImage stdif( int width, int height, VOption *options = 0 ) const; -VImage hist_cum( VOption *options = 0 ) const; -VImage hist_match( VImage ref, VOption *options = 0 ) const; -VImage hist_norm( VOption *options = 0 ) const; -VImage hist_equal( VOption *options = 0 ) const; -VImage hist_plot( VOption *options = 0 ) const; -VImage hist_local( int width, int height, VOption *options = 0 ) const; -bool hist_ismonotonic( VOption *options = 0 ) const; -double hist_entropy( VOption *options = 0 ) const; -VImage conv( VImage mask, VOption *options = 0 ) const; -VImage conva( VImage mask, VOption *options = 0 ) const; -VImage convf( VImage mask, VOption *options = 0 ) const; -VImage convi( VImage mask, VOption *options = 0 ) const; -VImage compass( VImage mask, VOption *options = 0 ) const; -VImage convsep( VImage mask, VOption *options = 0 ) const; -VImage convasep( VImage mask, VOption *options = 0 ) const; -VImage fastcor( VImage ref, VOption *options = 0 ) const; -VImage spcor( VImage ref, VOption *options = 0 ) const; -VImage sharpen( VOption *options = 0 ) const; -VImage gaussblur( double sigma, VOption *options = 0 ) const; + +/** + * Transform LCh to CMC. + * @param options Optional options. + * @return Output image. + */ +VImage LCh2CMC( VOption *options = 0 ) const; + +/** + * Transform LCh to Lab. + * @param options Optional options. + * @return Output image. + */ +VImage LCh2Lab( VOption *options = 0 ) const; + +/** + * Transform Lab to LCh. + * @param options Optional options. + * @return Output image. + */ +VImage Lab2LCh( VOption *options = 0 ) const; + +/** + * Transform float Lab to LabQ coding. + * @param options Optional options. + * @return Output image. + */ +VImage Lab2LabQ( VOption *options = 0 ) const; + +/** + * Transform float Lab to signed short. + * @param options Optional options. + * @return Output image. + */ +VImage Lab2LabS( VOption *options = 0 ) const; + +/** + * Transform CIELAB to XYZ. + * @param options Optional options. + * @return Output image. + */ +VImage Lab2XYZ( VOption *options = 0 ) const; + +/** + * Unpack a LabQ image to float Lab. + * @param options Optional options. + * @return Output image. + */ +VImage LabQ2Lab( VOption *options = 0 ) const; + +/** + * Unpack a LabQ image to short Lab. + * @param options Optional options. + * @return Output image. + */ +VImage LabQ2LabS( VOption *options = 0 ) const; + +/** + * Convert a LabQ image to sRGB. + * @param options Optional options. + * @return Output image. + */ +VImage LabQ2sRGB( VOption *options = 0 ) const; + +/** + * Transform signed short Lab to float. + * @param options Optional options. + * @return Output image. + */ +VImage LabS2Lab( VOption *options = 0 ) const; + +/** + * Transform short Lab to LabQ coding. + * @param options Optional options. + * @return Output image. + */ +VImage LabS2LabQ( VOption *options = 0 ) const; + +/** + * Transform XYZ to CMYK. + * @param options Optional options. + * @return Output image. + */ +VImage XYZ2CMYK( VOption *options = 0 ) const; + +/** + * Transform XYZ to Lab. + * @param options Optional options. + * @return Output image. + */ +VImage XYZ2Lab( VOption *options = 0 ) const; + +/** + * Transform XYZ to Yxy. + * @param options Optional options. + * @return Output image. + */ +VImage XYZ2Yxy( VOption *options = 0 ) const; + +/** + * Transform XYZ to scRGB. + * @param options Optional options. + * @return Output image. + */ +VImage XYZ2scRGB( VOption *options = 0 ) const; + +/** + * Transform Yxy to XYZ. + * @param options Optional options. + * @return Output image. + */ +VImage Yxy2XYZ( VOption *options = 0 ) const; + +/** + * Absolute value of an image. + * @param options Optional options. + * @return Output image. + */ +VImage abs( VOption *options = 0 ) const; + +/** + * Add two images. + * @param right Right-hand image argument. + * @param options Optional options. + * @return Output image. + */ +VImage add( VImage right, VOption *options = 0 ) const; + +/** + * Affine transform of an image. + * @param matrix Transformation matrix. + * @param options Optional options. + * @return Output image. + */ +VImage affine( std::vector matrix, VOption *options = 0 ) const; + +/** + * Load an Analyze6 image. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage analyzeload( char *filename, VOption *options = 0 ); + +/** + * Join an array of images. + * @param in Array of input images. + * @param options Optional options. + * @return Output image. + */ +static VImage arrayjoin( std::vector in, VOption *options = 0 ); + +/** + * Autorotate image by exif tag. + * @param options Optional options. + * @return Output image. + */ +VImage autorot( VOption *options = 0 ) const; + +/** + * Find image average. + * @param options Optional options. + * @return Output value. + */ +double avg( VOption *options = 0 ) const; + +/** + * Boolean operation across image bands. + * @param boolean boolean to perform. + * @param options Optional options. + * @return Output image. + */ +VImage bandbool( VipsOperationBoolean boolean, VOption *options = 0 ) const; + +/** + * Fold up x axis into bands. + * @param options Optional options. + * @return Output image. + */ +VImage bandfold( VOption *options = 0 ) const; + +/** + * Bandwise join a set of images. + * @param in Array of input images. + * @param options Optional options. + * @return Output image. + */ +static VImage bandjoin( std::vector in, VOption *options = 0 ); + +/** + * Append a constant band to an image. + * @param c Array of constants to add. + * @param options Optional options. + * @return Output image. + */ +VImage bandjoin_const( std::vector c, VOption *options = 0 ) const; + +/** + * Band-wise average. + * @param options Optional options. + * @return Output image. + */ +VImage bandmean( VOption *options = 0 ) const; + +/** + * Band-wise rank of a set of images. + * @param in Array of input images. + * @param options Optional options. + * @return Output image. + */ +static VImage bandrank( std::vector in, VOption *options = 0 ); + +/** + * Unfold image bands into x axis. + * @param options Optional options. + * @return Output image. + */ +VImage bandunfold( VOption *options = 0 ) const; + +/** + * Make a black image. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage black( int width, int height, VOption *options = 0 ); + +/** + * Boolean operation on two images. + * @param right Right-hand image argument. + * @param boolean boolean to perform. + * @param options Optional options. + * @return Output image. + */ +VImage boolean( VImage right, VipsOperationBoolean boolean, VOption *options = 0 ) const; + +/** + * Boolean operations against a constant. + * @param boolean boolean to perform. + * @param c Array of constants. + * @param options Optional options. + * @return Output image. + */ +VImage boolean_const( VipsOperationBoolean boolean, std::vector c, VOption *options = 0 ) const; + +/** + * Build a look-up table. + * @param options Optional options. + * @return Output image. + */ +VImage buildlut( VOption *options = 0 ) const; + +/** + * Byteswap an image. + * @param options Optional options. + * @return Output image. + */ +VImage byteswap( VOption *options = 0 ) const; + +/** + * Cache an image. + * @param options Optional options. + * @return Output image. + */ +VImage cache( VOption *options = 0 ) const; + +/** + * Canny edge detector. + * @param options Optional options. + * @return Output image. + */ VImage canny( VOption *options = 0 ) const; -VImage sobel( VOption *options = 0 ) const; -VImage fwfft( VOption *options = 0 ) const; -VImage invfft( VOption *options = 0 ) const; -VImage freqmult( VImage mask, VOption *options = 0 ) const; -VImage spectrum( VOption *options = 0 ) const; -VImage phasecor( VImage in2, VOption *options = 0 ) const; -VImage morph( VImage mask, VipsOperationMorphology morph, VOption *options = 0 ) const; -VImage rank( int width, int height, int index, VOption *options = 0 ) const; + +/** + * Cast an image. + * @param format Format to cast to. + * @param options Optional options. + * @return Output image. + */ +VImage cast( VipsBandFormat format, VOption *options = 0 ) const; + +/** + * Convert to a new colorspace. + * @param space Destination color space. + * @param options Optional options. + * @return Output image. + */ +VImage colourspace( VipsInterpretation space, VOption *options = 0 ) const; + +/** + * Convolve with rotating mask. + * @param mask Input matrix image. + * @param options Optional options. + * @return Output image. + */ +VImage compass( VImage mask, VOption *options = 0 ) const; + +/** + * Perform a complex operation on an image. + * @param cmplx complex to perform. + * @param options Optional options. + * @return Output image. + */ +VImage complex( VipsOperationComplex cmplx, VOption *options = 0 ) const; + +/** + * Complex binary operations on two images. + * @param right Right-hand image argument. + * @param cmplx binary complex operation to perform. + * @param options Optional options. + * @return Output image. + */ +VImage complex2( VImage right, VipsOperationComplex2 cmplx, VOption *options = 0 ) const; + +/** + * Form a complex image from two real images. + * @param right Right-hand image argument. + * @param options Optional options. + * @return Output image. + */ +VImage complexform( VImage right, VOption *options = 0 ) const; + +/** + * Get a component from a complex image. + * @param get complex to perform. + * @param options Optional options. + * @return Output image. + */ +VImage complexget( VipsOperationComplexget get, VOption *options = 0 ) const; + +/** + * Blend an array of images with an array of blend modes. + * @param in Array of input images. + * @param mode Array of VipsBlendMode to join with. + * @param options Optional options. + * @return Output image. + */ +static VImage composite( std::vector in, std::vector mode, VOption *options = 0 ); + +/** + * Blend a pair of images with a blend mode. + * @param overlay Overlay image. + * @param mode VipsBlendMode to join with. + * @param options Optional options. + * @return Output image. + */ +VImage composite2( VImage overlay, VipsBlendMode mode, VOption *options = 0 ) const; + +/** + * Convolution operation. + * @param mask Input matrix image. + * @param options Optional options. + * @return Output image. + */ +VImage conv( VImage mask, VOption *options = 0 ) const; + +/** + * Approximate integer convolution. + * @param mask Input matrix image. + * @param options Optional options. + * @return Output image. + */ +VImage conva( VImage mask, VOption *options = 0 ) const; + +/** + * Approximate separable integer convolution. + * @param mask Input matrix image. + * @param options Optional options. + * @return Output image. + */ +VImage convasep( VImage mask, VOption *options = 0 ) const; + +/** + * Float convolution operation. + * @param mask Input matrix image. + * @param options Optional options. + * @return Output image. + */ +VImage convf( VImage mask, VOption *options = 0 ) const; + +/** + * Int convolution operation. + * @param mask Input matrix image. + * @param options Optional options. + * @return Output image. + */ +VImage convi( VImage mask, VOption *options = 0 ) const; + +/** + * Seperable convolution operation. + * @param mask Input matrix image. + * @param options Optional options. + * @return Output image. + */ +VImage convsep( VImage mask, VOption *options = 0 ) const; + +/** + * Copy an image. + * @param options Optional options. + * @return Output image. + */ +VImage copy( VOption *options = 0 ) const; + +/** + * Count lines in an image. + * @param direction Countlines left-right or up-down. + * @param options Optional options. + * @return Number of lines. + */ double countlines( VipsDirection direction, VOption *options = 0 ) const; -VImage labelregions( VOption *options = 0 ) const; -VImage fill_nearest( VOption *options = 0 ) const; -void draw_rect( std::vector ink, int left, int top, int width, int height, VOption *options = 0 ) const; -void draw_mask( std::vector ink, VImage mask, int x, int y, VOption *options = 0 ) const; -void draw_line( std::vector ink, int x1, int y1, int x2, int y2, VOption *options = 0 ) const; + +/** + * Extract an area from an image. + * @param left Left edge of extract area. + * @param top Top edge of extract area. + * @param width Width of extract area. + * @param height Height of extract area. + * @param options Optional options. + * @return Output image. + */ +VImage crop( int left, int top, int width, int height, VOption *options = 0 ) const; + +/** + * Load csv from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage csvload( char *filename, VOption *options = 0 ); + +/** + * Save image to csv file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void csvsave( char *filename, VOption *options = 0 ) const; + +/** + * Calculate dE00. + * @param right Right-hand input image. + * @param options Optional options. + * @return Output image. + */ +VImage dE00( VImage right, VOption *options = 0 ) const; + +/** + * Calculate dE76. + * @param right Right-hand input image. + * @param options Optional options. + * @return Output image. + */ +VImage dE76( VImage right, VOption *options = 0 ) const; + +/** + * Calculate dECMC. + * @param right Right-hand input image. + * @param options Optional options. + * @return Output image. + */ +VImage dECMC( VImage right, VOption *options = 0 ) const; + +/** + * Find image standard deviation. + * @param options Optional options. + * @return Output value. + */ +double deviate( VOption *options = 0 ) const; + +/** + * Divide two images. + * @param right Right-hand image argument. + * @param options Optional options. + * @return Output image. + */ +VImage divide( VImage right, VOption *options = 0 ) const; + +/** + * Draw a circle on an image. + * @param ink Color for pixels. + * @param cx Centre of draw_circle. + * @param cy Centre of draw_circle. + * @param radius Radius in pixels. + * @param options Optional options. + */ void draw_circle( std::vector ink, int cx, int cy, int radius, VOption *options = 0 ) const; + +/** + * Flood-fill an area. + * @param ink Color for pixels. + * @param x DrawFlood start point. + * @param y DrawFlood start point. + * @param options Optional options. + */ void draw_flood( std::vector ink, int x, int y, VOption *options = 0 ) const; + +/** + * Paint an image into another image. + * @param sub Sub-image to insert into main image. + * @param x Draw image here. + * @param y Draw image here. + * @param options Optional options. + */ void draw_image( VImage sub, int x, int y, VOption *options = 0 ) const; + +/** + * Draw a line on an image. + * @param ink Color for pixels. + * @param x1 Start of draw_line. + * @param y1 Start of draw_line. + * @param x2 End of draw_line. + * @param y2 End of draw_line. + * @param options Optional options. + */ +void draw_line( std::vector ink, int x1, int y1, int x2, int y2, VOption *options = 0 ) const; + +/** + * Draw a mask on an image. + * @param ink Color for pixels. + * @param mask Mask of pixels to draw. + * @param x Draw mask here. + * @param y Draw mask here. + * @param options Optional options. + */ +void draw_mask( std::vector ink, VImage mask, int x, int y, VOption *options = 0 ) const; + +/** + * Paint a rectangle on an image. + * @param ink Color for pixels. + * @param left Rect to fill. + * @param top Rect to fill. + * @param width Rect to fill. + * @param height Rect to fill. + * @param options Optional options. + */ +void draw_rect( std::vector ink, int left, int top, int width, int height, VOption *options = 0 ) const; + +/** + * Blur a rectangle on an image. + * @param left Rect to fill. + * @param top Rect to fill. + * @param width Rect to fill. + * @param height Rect to fill. + * @param options Optional options. + */ void draw_smudge( int left, int top, int width, int height, VOption *options = 0 ) const; -VImage merge( VImage sec, VipsDirection direction, int dx, int dy, VOption *options = 0 ) const; -VImage mosaic( VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VOption *options = 0 ) const; -VImage mosaic1( VImage sec, VipsDirection direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0 ) const; -VImage match( VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0 ) const; + +/** + * Save image to deepzoom file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void dzsave( char *filename, VOption *options = 0 ) const; + +/** + * Save image to dz buffer. + * @param options Optional options. + * @return Buffer to save to. + */ +VipsBlob *dzsave_buffer( VOption *options = 0 ) const; + +/** + * Embed an image in a larger image. + * @param x Left edge of input in output. + * @param y Top edge of input in output. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +VImage embed( int x, int y, int width, int height, VOption *options = 0 ) const; + +/** + * Extract an area from an image. + * @param left Left edge of extract area. + * @param top Top edge of extract area. + * @param width Width of extract area. + * @param height Height of extract area. + * @param options Optional options. + * @return Output image. + */ +VImage extract_area( int left, int top, int width, int height, VOption *options = 0 ) const; + +/** + * Extract band from an image. + * @param band Band to extract. + * @param options Optional options. + * @return Output image. + */ +VImage extract_band( int band, VOption *options = 0 ) const; + +/** + * Make an image showing the eye's spatial response. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage eye( int width, int height, VOption *options = 0 ); + +/** + * False-color an image. + * @param options Optional options. + * @return Output image. + */ +VImage falsecolour( VOption *options = 0 ) const; + +/** + * Fast correlation. + * @param ref Input reference image. + * @param options Optional options. + * @return Output image. + */ +VImage fastcor( VImage ref, VOption *options = 0 ) const; + +/** + * Fill image zeros with nearest non-zero pixel. + * @param options Optional options. + * @return Value of nearest non-zero pixel. + */ +VImage fill_nearest( VOption *options = 0 ) const; + +/** + * Search an image for non-edge areas. + * @param top Top edge of extract area. + * @param width Width of extract area. + * @param height Height of extract area. + * @param options Optional options. + * @return Left edge of image. + */ +int find_trim( int *top, int *width, int *height, VOption *options = 0 ) const; + +/** + * Load a FITS image. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage fitsload( char *filename, VOption *options = 0 ); + +/** + * Save image to fits file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void fitssave( char *filename, VOption *options = 0 ) const; + +/** + * Flatten alpha out of an image. + * @param options Optional options. + * @return Output image. + */ +VImage flatten( VOption *options = 0 ) const; + +/** + * Flip an image. + * @param direction Direction to flip image. + * @param options Optional options. + * @return Output image. + */ +VImage flip( VipsDirection direction, VOption *options = 0 ) const; + +/** + * Transform float RGB to Radiance coding. + * @param options Optional options. + * @return Output image. + */ +VImage float2rad( VOption *options = 0 ) const; + +/** + * Make a fractal surface. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param fractal_dimension Fractal dimension. + * @param options Optional options. + * @return Output image. + */ +static VImage fractsurf( int width, int height, double fractal_dimension, VOption *options = 0 ); + +/** + * Frequency-domain filtering. + * @param mask Input mask image. + * @param options Optional options. + * @return Output image. + */ +VImage freqmult( VImage mask, VOption *options = 0 ) const; + +/** + * Forward FFT. + * @param options Optional options. + * @return Output image. + */ +VImage fwfft( VOption *options = 0 ) const; + +/** + * Gamma an image. + * @param options Optional options. + * @return Output image. + */ +VImage gamma( VOption *options = 0 ) const; + +/** + * Gaussian blur. + * @param sigma Sigma of Gaussian. + * @param options Optional options. + * @return Output image. + */ +VImage gaussblur( double sigma, VOption *options = 0 ) const; + +/** + * Make a gaussian image. + * @param sigma Sigma of Gaussian. + * @param min_ampl Minimum amplitude of Gaussian. + * @param options Optional options. + * @return Output image. + */ +static VImage gaussmat( double sigma, double min_ampl, VOption *options = 0 ); + +/** + * Make a gaussnoise image. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage gaussnoise( int width, int height, VOption *options = 0 ); + +/** + * Read a point from an image. + * @param x Point to read. + * @param y Point to read. + * @param options Optional options. + * @return Array of output values. + */ +std::vector getpoint( int x, int y, VOption *options = 0 ) const; + +/** + * Load GIF with giflib. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage gifload( char *filename, VOption *options = 0 ); + +/** + * Load GIF with giflib. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage gifload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Global balance an image mosaic. + * @param options Optional options. + * @return Output image. + */ VImage globalbalance( VOption *options = 0 ) const; -// These operators have been added recently: -VImage CMYK2XYZ( VOption *options = 0 ) const; -VImage XYZ2CMYK( VOption *options = 0 ) const; +/** + * Place an image within a larger image with a certain gravity. + * @param direction direction to place image within width/height. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +VImage gravity( VipsCompassDirection direction, int width, int height, VOption *options = 0 ) const; + +/** + * Make a grey ramp image. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage grey( int width, int height, VOption *options = 0 ); + +/** + * Grid an image. + * @param tile_height chop into tiles this high. + * @param across number of tiles across. + * @param down number of tiles down. + * @param options Optional options. + * @return Output image. + */ +VImage grid( int tile_height, int across, int down, VOption *options = 0 ) const; + +/** + * Form cumulative histogram. + * @param options Optional options. + * @return Output image. + */ +VImage hist_cum( VOption *options = 0 ) const; + +/** + * Estimate image entropy. + * @param options Optional options. + * @return Output value. + */ +double hist_entropy( VOption *options = 0 ) const; + +/** + * Histogram equalisation. + * @param options Optional options. + * @return Output image. + */ +VImage hist_equal( VOption *options = 0 ) const; + +/** + * Find image histogram. + * @param options Optional options. + * @return Output histogram. + */ +VImage hist_find( VOption *options = 0 ) const; + +/** + * Find indexed image histogram. + * @param index Index image. + * @param options Optional options. + * @return Output histogram. + */ +VImage hist_find_indexed( VImage index, VOption *options = 0 ) const; + +/** + * Find n-dimensional image histogram. + * @param options Optional options. + * @return Output histogram. + */ +VImage hist_find_ndim( VOption *options = 0 ) const; + +/** + * Test for monotonicity. + * @param options Optional options. + * @return true if in is monotonic. + */ +bool hist_ismonotonic( VOption *options = 0 ) const; + +/** + * Local histogram equalisation. + * @param width Window width in pixels. + * @param height Window height in pixels. + * @param options Optional options. + * @return Output image. + */ +VImage hist_local( int width, int height, VOption *options = 0 ) const; + +/** + * Match two histograms. + * @param ref Reference histogram. + * @param options Optional options. + * @return Output image. + */ +VImage hist_match( VImage ref, VOption *options = 0 ) const; + +/** + * Normalise histogram. + * @param options Optional options. + * @return Output image. + */ +VImage hist_norm( VOption *options = 0 ) const; + +/** + * Plot histogram. + * @param options Optional options. + * @return Output image. + */ +VImage hist_plot( VOption *options = 0 ) const; + +/** + * Find hough circle transform. + * @param options Optional options. + * @return Output image. + */ +VImage hough_circle( VOption *options = 0 ) const; + +/** + * Find hough line transform. + * @param options Optional options. + * @return Output image. + */ +VImage hough_line( VOption *options = 0 ) const; + +/** + * Output to device with ICC profile. + * @param options Optional options. + * @return Output image. + */ +VImage icc_export( VOption *options = 0 ) const; + +/** + * Import from device with ICC profile. + * @param options Optional options. + * @return Output image. + */ +VImage icc_import( VOption *options = 0 ) const; + +/** + * Transform between devices with ICC profiles. + * @param output_profile Filename to load output profile from. + * @param options Optional options. + * @return Output image. + */ +VImage icc_transform( char *output_profile, VOption *options = 0 ) const; + +/** + * Make a 1D image where pixel values are indexes. + * @param options Optional options. + * @return Output image. + */ +static VImage identity( VOption *options = 0 ); + +/** + * Ifthenelse an image. + * @param in1 Source for TRUE pixels. + * @param in2 Source for FALSE pixels. + * @param options Optional options. + * @return Output image. + */ +VImage ifthenelse( VImage in1, VImage in2, VOption *options = 0 ) const; + +/** + * Insert image @sub into @main at @x, @y. + * @param sub Sub-image to insert into main image. + * @param x Left edge of sub in main. + * @param y Top edge of sub in main. + * @param options Optional options. + * @return Output image. + */ +VImage insert( VImage sub, int x, int y, VOption *options = 0 ) const; + +/** + * Invert an image. + * @param options Optional options. + * @return Output image. + */ +VImage invert( VOption *options = 0 ) const; + +/** + * Build an inverted look-up table. + * @param options Optional options. + * @return Output image. + */ +VImage invertlut( VOption *options = 0 ) const; + +/** + * Inverse FFT. + * @param options Optional options. + * @return Output image. + */ +VImage invfft( VOption *options = 0 ) const; + +/** + * Join a pair of images. + * @param in2 Second input image. + * @param direction Join left-right or up-down. + * @param options Optional options. + * @return Output image. + */ +VImage join( VImage in2, VipsDirection direction, VOption *options = 0 ) const; + +/** + * Load jpeg from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage jpegload( char *filename, VOption *options = 0 ); + +/** + * Load jpeg from buffer. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage jpegload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Save image to jpeg file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void jpegsave( char *filename, VOption *options = 0 ) const; + +/** + * Save image to jpeg buffer. + * @param options Optional options. + * @return Buffer to save to. + */ +VipsBlob *jpegsave_buffer( VOption *options = 0 ) const; + +/** + * Save image to jpeg mime. + * @param options Optional options. + */ +void jpegsave_mime( VOption *options = 0 ) const; + +/** + * Label regions in an image. + * @param options Optional options. + * @return Mask of region labels. + */ +VImage labelregions( VOption *options = 0 ) const; + +/** + * Calculate (a * in + b). + * @param a Multiply by this. + * @param b Add this. + * @param options Optional options. + * @return Output image. + */ +VImage linear( std::vector a, std::vector b, VOption *options = 0 ) const; + +/** + * Cache an image as a set of lines. + * @param options Optional options. + * @return Output image. + */ +VImage linecache( VOption *options = 0 ) const; + +/** + * Make a laplacian of gaussian image. + * @param sigma Radius of Logmatian. + * @param min_ampl Minimum amplitude of Logmatian. + * @param options Optional options. + * @return Output image. + */ +static VImage logmat( double sigma, double min_ampl, VOption *options = 0 ); + +/** + * Load file with ImageMagick. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage magickload( char *filename, VOption *options = 0 ); + +/** + * Load buffer with ImageMagick. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage magickload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Save file with ImageMagick. + * @param filename Filename to save to. + * @param options Optional options. + */ +void magicksave( char *filename, VOption *options = 0 ) const; + +/** + * Save image to magick buffer. + * @param options Optional options. + * @return Buffer to save to. + */ +VipsBlob *magicksave_buffer( VOption *options = 0 ) const; + +/** + * Resample with an mapim image. + * @param index Index pixels with this. + * @param options Optional options. + * @return Output image. + */ +VImage mapim( VImage index, VOption *options = 0 ) const; + +/** + * Map an image though a lut. + * @param lut Look-up table image. + * @param options Optional options. + * @return Output image. + */ +VImage maplut( VImage lut, VOption *options = 0 ) const; + +/** + * Make a butterworth filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param order Filter order. + * @param frequency_cutoff Frequency cutoff. + * @param amplitude_cutoff Amplitude cutoff. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_butterworth( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0 ); + +/** + * Make a butterworth_band filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param order Filter order. + * @param frequency_cutoff_x Frequency cutoff x. + * @param frequency_cutoff_y Frequency cutoff y. + * @param radius radius of circle. + * @param amplitude_cutoff Amplitude cutoff. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_butterworth_band( int width, int height, double order, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0 ); + +/** + * Make a butterworth ring filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param order Filter order. + * @param frequency_cutoff Frequency cutoff. + * @param amplitude_cutoff Amplitude cutoff. + * @param ringwidth Ringwidth. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_butterworth_ring( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0 ); + +/** + * Make fractal filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param fractal_dimension Fractal dimension. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_fractal( int width, int height, double fractal_dimension, VOption *options = 0 ); + +/** + * Make a gaussian filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param frequency_cutoff Frequency cutoff. + * @param amplitude_cutoff Amplitude cutoff. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_gaussian( int width, int height, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0 ); + +/** + * Make a gaussian filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param frequency_cutoff_x Frequency cutoff x. + * @param frequency_cutoff_y Frequency cutoff y. + * @param radius radius of circle. + * @param amplitude_cutoff Amplitude cutoff. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_gaussian_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0 ); + +/** + * Make a gaussian ring filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param frequency_cutoff Frequency cutoff. + * @param amplitude_cutoff Amplitude cutoff. + * @param ringwidth Ringwidth. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_gaussian_ring( int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0 ); + +/** + * Make an ideal filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param frequency_cutoff Frequency cutoff. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_ideal( int width, int height, double frequency_cutoff, VOption *options = 0 ); + +/** + * Make an ideal band filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param frequency_cutoff_x Frequency cutoff x. + * @param frequency_cutoff_y Frequency cutoff y. + * @param radius radius of circle. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_ideal_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, VOption *options = 0 ); + +/** + * Make an ideal ring filter. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param frequency_cutoff Frequency cutoff. + * @param ringwidth Ringwidth. + * @param options Optional options. + * @return Output image. + */ +static VImage mask_ideal_ring( int width, int height, double frequency_cutoff, double ringwidth, VOption *options = 0 ); + +/** + * First-order match of two images. + * @param sec Secondary image. + * @param xr1 Position of first reference tie-point. + * @param yr1 Position of first reference tie-point. + * @param xs1 Position of first secondary tie-point. + * @param ys1 Position of first secondary tie-point. + * @param xr2 Position of second reference tie-point. + * @param yr2 Position of second reference tie-point. + * @param xs2 Position of second secondary tie-point. + * @param ys2 Position of second secondary tie-point. + * @param options Optional options. + * @return Output image. + */ +VImage match( VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0 ) const; + +/** + * Apply a math operation to an image. + * @param math math to perform. + * @param options Optional options. + * @return Output image. + */ +VImage math( VipsOperationMath math, VOption *options = 0 ) const; + +/** + * Binary math operations. + * @param right Right-hand image argument. + * @param math2 math to perform. + * @param options Optional options. + * @return Output image. + */ +VImage math2( VImage right, VipsOperationMath2 math2, VOption *options = 0 ) const; + +/** + * Binary math operations with a constant. + * @param math2 math to perform. + * @param c Array of constants. + * @param options Optional options. + * @return Output image. + */ +VImage math2_const( VipsOperationMath2 math2, std::vector c, VOption *options = 0 ) const; + +/** + * Load mat from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage matload( char *filename, VOption *options = 0 ); + +/** + * Load matrix from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage matrixload( char *filename, VOption *options = 0 ); + +/** + * Print matrix. + * @param options Optional options. + */ +void matrixprint( VOption *options = 0 ) const; + +/** + * Save image to matrix file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void matrixsave( char *filename, VOption *options = 0 ) const; + +/** + * Find image maximum. + * @param options Optional options. + * @return Output value. + */ +double max( VOption *options = 0 ) const; + +/** + * Measure a set of patches on a color chart. + * @param h Number of patches across chart. + * @param v Number of patches down chart. + * @param options Optional options. + * @return Output array of statistics. + */ +VImage measure( int h, int v, VOption *options = 0 ) const; + +/** + * Merge two images. + * @param sec Secondary image. + * @param direction Horizontal or vertcial merge. + * @param dx Horizontal displacement from sec to ref. + * @param dy Vertical displacement from sec to ref. + * @param options Optional options. + * @return Output image. + */ +VImage merge( VImage sec, VipsDirection direction, int dx, int dy, VOption *options = 0 ) const; + +/** + * Find image minimum. + * @param options Optional options. + * @return Output value. + */ +double min( VOption *options = 0 ) const; + +/** + * Morphology operation. + * @param mask Input matrix image. + * @param morph Morphological operation to perform. + * @param options Optional options. + * @return Output image. + */ +VImage morph( VImage mask, VipsOperationMorphology morph, VOption *options = 0 ) const; + +/** + * Mosaic two images. + * @param sec Secondary image. + * @param direction Horizontal or vertcial mosaic. + * @param xref Position of reference tie-point. + * @param yref Position of reference tie-point. + * @param xsec Position of secondary tie-point. + * @param ysec Position of secondary tie-point. + * @param options Optional options. + * @return Output image. + */ +VImage mosaic( VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VOption *options = 0 ) const; + +/** + * First-order mosaic of two images. + * @param sec Secondary image. + * @param direction Horizontal or vertcial mosaic. + * @param xr1 Position of first reference tie-point. + * @param yr1 Position of first reference tie-point. + * @param xs1 Position of first secondary tie-point. + * @param ys1 Position of first secondary tie-point. + * @param xr2 Position of second reference tie-point. + * @param yr2 Position of second reference tie-point. + * @param xs2 Position of second secondary tie-point. + * @param ys2 Position of second secondary tie-point. + * @param options Optional options. + * @return Output image. + */ +VImage mosaic1( VImage sec, VipsDirection direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0 ) const; + +/** + * Pick most-significant byte from an image. + * @param options Optional options. + * @return Output image. + */ +VImage msb( VOption *options = 0 ) const; + +/** + * Multiply two images. + * @param right Right-hand image argument. + * @param options Optional options. + * @return Output image. + */ +VImage multiply( VImage right, VOption *options = 0 ) const; + +/** + * Load a NIFTI image. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ static VImage niftiload( char *filename, VOption *options = 0 ); + +/** + * Save image to nifti file. + * @param filename Filename to save to. + * @param options Optional options. + */ void niftisave( char *filename, VOption *options = 0 ) const; + +/** + * Load an OpenEXR image. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage openexrload( char *filename, VOption *options = 0 ); + +/** + * Load file with OpenSlide. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage openslideload( char *filename, VOption *options = 0 ); + +/** + * Load PDF with libpoppler. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage pdfload( char *filename, VOption *options = 0 ); + +/** + * Load PDF with libpoppler. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage pdfload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Find threshold for percent of pixels. + * @param percent Percent of pixels. + * @param options Optional options. + * @return Threshold above which lie percent of pixels. + */ +int percent( double percent, VOption *options = 0 ) const; + +/** + * Make a perlin noise image. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage perlin( int width, int height, VOption *options = 0 ); + +/** + * Calculate phase correlation. + * @param in2 Second input image. + * @param options Optional options. + * @return Output image. + */ +VImage phasecor( VImage in2, VOption *options = 0 ) const; + +/** + * Load png from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage pngload( char *filename, VOption *options = 0 ); + +/** + * Load png from buffer. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage pngload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Save image to png file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void pngsave( char *filename, VOption *options = 0 ) const; + +/** + * Save image to png buffer. + * @param options Optional options. + * @return Buffer to save to. + */ +VipsBlob *pngsave_buffer( VOption *options = 0 ) const; + +/** + * Load ppm from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage ppmload( char *filename, VOption *options = 0 ); + +/** + * Save image to ppm file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void ppmsave( char *filename, VOption *options = 0 ) const; + +/** + * Premultiply image alpha. + * @param options Optional options. + * @return Output image. + */ +VImage premultiply( VOption *options = 0 ) const; + +/** + * Find image profiles. + * @param rows First non-zero pixel in row. + * @param options Optional options. + * @return First non-zero pixel in column. + */ +VImage profile( VImage *rows, VOption *options = 0 ) const; + +/** + * Load named ICC profile. + * @param name Profile name. + * @param options Optional options. + * @return Loaded profile. + */ static VipsBlob *profile_load( char *name, VOption *options = 0 ); + +/** + * Find image projections. + * @param rows Sums of rows. + * @param options Optional options. + * @return Sums of columns. + */ +VImage project( VImage *rows, VOption *options = 0 ) const; + +/** + * Resample an image with a quadratic transform. + * @param coeff Coefficient matrix. + * @param options Optional options. + * @return Output image. + */ +VImage quadratic( VImage coeff, VOption *options = 0 ) const; + +/** + * Unpack Radiance coding to float RGB. + * @param options Optional options. + * @return Output image. + */ +VImage rad2float( VOption *options = 0 ) const; + +/** + * Load a Radiance image from a file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage radload( char *filename, VOption *options = 0 ); + +/** + * Save image to Radiance file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void radsave( char *filename, VOption *options = 0 ) const; + +/** + * Save image to Radiance buffer. + * @param options Optional options. + * @return Buffer to save to. + */ +VipsBlob *radsave_buffer( VOption *options = 0 ) const; + +/** + * Rank filter. + * @param width Window width in pixels. + * @param height Window height in pixels. + * @param index Select pixel at index. + * @param options Optional options. + * @return Output image. + */ +VImage rank( int width, int height, int index, VOption *options = 0 ) const; + +/** + * Load raw data from a file. + * @param filename Filename to load from. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param bands Number of bands in image. + * @param options Optional options. + * @return Output image. + */ +static VImage rawload( char *filename, int width, int height, int bands, VOption *options = 0 ); + +/** + * Save image to raw file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void rawsave( char *filename, VOption *options = 0 ) const; + +/** + * Write raw image to file descriptor. + * @param fd File descriptor to write to. + * @param options Optional options. + */ +void rawsave_fd( int fd, VOption *options = 0 ) const; + +/** + * Linear recombination with matrix. + * @param m matrix of coefficients. + * @param options Optional options. + * @return Output image. + */ +VImage recomb( VImage m, VOption *options = 0 ) const; + +/** + * Reduce an image. + * @param hshrink Horizontal shrink factor. + * @param vshrink Vertical shrink factor. + * @param options Optional options. + * @return Output image. + */ +VImage reduce( double hshrink, double vshrink, VOption *options = 0 ) const; + +/** + * Shrink an image horizontally. + * @param hshrink Horizontal shrink factor. + * @param options Optional options. + * @return Output image. + */ +VImage reduceh( double hshrink, VOption *options = 0 ) const; + +/** + * Shrink an image vertically. + * @param vshrink Vertical shrink factor. + * @param options Optional options. + * @return Output image. + */ +VImage reducev( double vshrink, VOption *options = 0 ) const; + +/** + * Relational operation on two images. + * @param right Right-hand image argument. + * @param relational relational to perform. + * @param options Optional options. + * @return Output image. + */ +VImage relational( VImage right, VipsOperationRelational relational, VOption *options = 0 ) const; + +/** + * Relational operations against a constant. + * @param relational relational to perform. + * @param c Array of constants. + * @param options Optional options. + * @return Output image. + */ +VImage relational_const( VipsOperationRelational relational, std::vector c, VOption *options = 0 ) const; + +/** + * Remainder after integer division of two images. + * @param right Right-hand image argument. + * @param options Optional options. + * @return Output image. + */ +VImage remainder( VImage right, VOption *options = 0 ) const; + +/** + * Remainder after integer division of an image and a constant. + * @param c Array of constants. + * @param options Optional options. + * @return Output image. + */ +VImage remainder_const( std::vector c, VOption *options = 0 ) const; + +/** + * Replicate an image. + * @param across Repeat this many times horizontally. + * @param down Repeat this many times vertically. + * @param options Optional options. + * @return Output image. + */ +VImage replicate( int across, int down, VOption *options = 0 ) const; + +/** + * Resize an image. + * @param scale Scale image by this factor. + * @param options Optional options. + * @return Output image. + */ +VImage resize( double scale, VOption *options = 0 ) const; + +/** + * Rotate an image. + * @param angle Angle to rotate image. + * @param options Optional options. + * @return Output image. + */ +VImage rot( VipsAngle angle, VOption *options = 0 ) const; + +/** + * Rotate an image. + * @param options Optional options. + * @return Output image. + */ +VImage rot45( VOption *options = 0 ) const; + +/** + * Rotate an image by a number of degrees. + * @param angle Rotate anticlockwise by this many degrees. + * @param options Optional options. + * @return Output image. + */ +VImage rotate( double angle, VOption *options = 0 ) const; + +/** + * Perform a round function on an image. + * @param round rounding operation to perform. + * @param options Optional options. + * @return Output image. + */ +VImage round( VipsOperationRound round, VOption *options = 0 ) const; + +/** + * Transform sRGB to HSV. + * @param options Optional options. + * @return Output image. + */ +VImage sRGB2HSV( VOption *options = 0 ) const; + +/** + * Convert an sRGB image to scRGB. + * @param options Optional options. + * @return Output image. + */ +VImage sRGB2scRGB( VOption *options = 0 ) const; + +/** + * Convert scRGB to BW. + * @param options Optional options. + * @return Output image. + */ +VImage scRGB2BW( VOption *options = 0 ) const; + +/** + * Transform scRGB to XYZ. + * @param options Optional options. + * @return Output image. + */ +VImage scRGB2XYZ( VOption *options = 0 ) const; + +/** + * Convert an scRGB image to sRGB. + * @param options Optional options. + * @return Output image. + */ +VImage scRGB2sRGB( VOption *options = 0 ) const; + +/** + * Scale an image to uchar. + * @param options Optional options. + * @return Output image. + */ +VImage scale( VOption *options = 0 ) const; + +/** + * Check sequential access. + * @param options Optional options. + * @return Output image. + */ +VImage sequential( VOption *options = 0 ) const; + +/** + * Unsharp masking for print. + * @param options Optional options. + * @return Output image. + */ +VImage sharpen( VOption *options = 0 ) const; + +/** + * Shrink an image. + * @param hshrink Horizontal shrink factor. + * @param vshrink Vertical shrink factor. + * @param options Optional options. + * @return Output image. + */ +VImage shrink( double hshrink, double vshrink, VOption *options = 0 ) const; + +/** + * Shrink an image horizontally. + * @param hshrink Horizontal shrink factor. + * @param options Optional options. + * @return Output image. + */ +VImage shrinkh( int hshrink, VOption *options = 0 ) const; + +/** + * Shrink an image vertically. + * @param vshrink Vertical shrink factor. + * @param options Optional options. + * @return Output image. + */ +VImage shrinkv( int vshrink, VOption *options = 0 ) const; + +/** + * Unit vector of pixel. + * @param options Optional options. + * @return Output image. + */ +VImage sign( VOption *options = 0 ) const; + +/** + * Similarity transform of an image. + * @param options Optional options. + * @return Output image. + */ +VImage similarity( VOption *options = 0 ) const; + +/** + * Make a 2D sine wave. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage sines( int width, int height, VOption *options = 0 ); + +/** + * Extract an area from an image. + * @param width Width of extract area. + * @param height Height of extract area. + * @param options Optional options. + * @return Output image. + */ +VImage smartcrop( int width, int height, VOption *options = 0 ) const; + +/** + * Sobel edge detector. + * @param options Optional options. + * @return Output image. + */ +VImage sobel( VOption *options = 0 ) const; + +/** + * Spatial correlation. + * @param ref Input reference image. + * @param options Optional options. + * @return Output image. + */ +VImage spcor( VImage ref, VOption *options = 0 ) const; + +/** + * Make displayable power spectrum. + * @param options Optional options. + * @return Output image. + */ +VImage spectrum( VOption *options = 0 ) const; + +/** + * Find many image stats. + * @param options Optional options. + * @return Output array of statistics. + */ +VImage stats( VOption *options = 0 ) const; + +/** + * Statistical difference. + * @param width Window width in pixels. + * @param height Window height in pixels. + * @param options Optional options. + * @return Output image. + */ +VImage stdif( int width, int height, VOption *options = 0 ) const; + +/** + * Subsample an image. + * @param xfac Horizontal subsample factor. + * @param yfac Vertical subsample factor. + * @param options Optional options. + * @return Output image. + */ +VImage subsample( int xfac, int yfac, VOption *options = 0 ) const; + +/** + * Subtract two images. + * @param right Right-hand image argument. + * @param options Optional options. + * @return Output image. + */ +VImage subtract( VImage right, VOption *options = 0 ) const; + +/** + * Sum an array of images. + * @param in Array of input images. + * @param options Optional options. + * @return Output image. + */ +static VImage sum( std::vector in, VOption *options = 0 ); + +/** + * Load SVG with rsvg. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage svgload( char *filename, VOption *options = 0 ); + +/** + * Load SVG with rsvg. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage svgload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Run an external command. + * @param cmd_format Command to run. + * @param options Optional options. + */ +static void system( char *cmd_format, VOption *options = 0 ); + +/** + * Make a text image. + * @param text Text to render. + * @param options Optional options. + * @return Output image. + */ +static VImage text( char *text, VOption *options = 0 ); + +/** + * Generate thumbnail from file. + * @param filename Filename to read from. + * @param width Size to this width. + * @param options Optional options. + * @return Output image. + */ +static VImage thumbnail( char *filename, int width, VOption *options = 0 ); + +/** + * Generate thumbnail from buffer. + * @param buffer Buffer to load from. + * @param width Size to this width. + * @param options Optional options. + * @return Output image. + */ +static VImage thumbnail_buffer( VipsBlob *buffer, int width, VOption *options = 0 ); + +/** + * Generate thumbnail from image. + * @param width Size to this width. + * @param options Optional options. + * @return Output image. + */ +VImage thumbnail_image( int width, VOption *options = 0 ) const; + +/** + * Load tiff from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage tiffload( char *filename, VOption *options = 0 ); + +/** + * Load tiff from buffer. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage tiffload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Save image to tiff file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void tiffsave( char *filename, VOption *options = 0 ) const; + +/** + * Save image to tiff buffer. + * @param options Optional options. + * @return Buffer to save to. + */ +VipsBlob *tiffsave_buffer( VOption *options = 0 ) const; + +/** + * Cache an image as a set of tiles. + * @param options Optional options. + * @return Output image. + */ +VImage tilecache( VOption *options = 0 ) const; + +/** + * Build a look-up table. + * @param options Optional options. + * @return Output image. + */ +static VImage tonelut( VOption *options = 0 ); + +/** + * Transpose3d an image. + * @param options Optional options. + * @return Output image. + */ +VImage transpose3d( VOption *options = 0 ) const; + +/** + * Unpremultiply image alpha. + * @param options Optional options. + * @return Output image. + */ +VImage unpremultiply( VOption *options = 0 ) const; + +/** + * Load vips from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage vipsload( char *filename, VOption *options = 0 ); + +/** + * Save image to vips file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void vipssave( char *filename, VOption *options = 0 ) const; + +/** + * Load webp from file. + * @param filename Filename to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage webpload( char *filename, VOption *options = 0 ); + +/** + * Load webp from buffer. + * @param buffer Buffer to load from. + * @param options Optional options. + * @return Output image. + */ +static VImage webpload_buffer( VipsBlob *buffer, VOption *options = 0 ); + +/** + * Save image to webp file. + * @param filename Filename to save to. + * @param options Optional options. + */ +void webpsave( char *filename, VOption *options = 0 ) const; + +/** + * Save image to webp buffer. + * @param options Optional options. + * @return Buffer to save to. + */ +VipsBlob *webpsave_buffer( VOption *options = 0 ) const; + +/** + * Make a worley noise image. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage worley( int width, int height, VOption *options = 0 ); + +/** + * Wrap image origin. + * @param options Optional options. + * @return Output image. + */ +VImage wrap( VOption *options = 0 ) const; + +/** + * Make an image where pixel values are coordinates. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage xyz( int width, int height, VOption *options = 0 ); + +/** + * Make a zone plate. + * @param width Image width in pixels. + * @param height Image height in pixels. + * @param options Optional options. + * @return Output image. + */ +static VImage zone( int width, int height, VOption *options = 0 ); + +/** + * Zoom an image. + * @param xfac Horizontal zoom factor. + * @param yfac Vertical zoom factor. + * @param options Optional options. + * @return Output image. + */ +VImage zoom( int xfac, int yfac, VOption *options = 0 ) const; diff --git a/cplusplus/vips-operators.cpp b/cplusplus/vips-operators.cpp index 84efe8cd..9319b6e0 100644 --- a/cplusplus/vips-operators.cpp +++ b/cplusplus/vips-operators.cpp @@ -1,12 +1,245 @@ // bodies for vips operations -// Fri 01 Feb 21:18:25 2019 +// Sun Feb 3 11:54:34 CET 2019 // this file is generated automatically, do not edit! -void VImage::system( char *cmd_format, VOption *options ) +VImage VImage::CMC2LCh( VOption *options ) const { - call( "system", + VImage out; + + call( "CMC2LCh", (options ? options : VImage::option())-> - set( "cmd_format", cmd_format ) ); + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::CMYK2XYZ( VOption *options ) const +{ + VImage out; + + call( "CMYK2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::HSV2sRGB( VOption *options ) const +{ + VImage out; + + call( "HSV2sRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LCh2CMC( VOption *options ) const +{ + VImage out; + + call( "LCh2CMC", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LCh2Lab( VOption *options ) const +{ + VImage out; + + call( "LCh2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::Lab2LCh( VOption *options ) const +{ + VImage out; + + call( "Lab2LCh", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::Lab2LabQ( VOption *options ) const +{ + VImage out; + + call( "Lab2LabQ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::Lab2LabS( VOption *options ) const +{ + VImage out; + + call( "Lab2LabS", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::Lab2XYZ( VOption *options ) const +{ + VImage out; + + call( "Lab2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LabQ2Lab( VOption *options ) const +{ + VImage out; + + call( "LabQ2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LabQ2LabS( VOption *options ) const +{ + VImage out; + + call( "LabQ2LabS", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LabQ2sRGB( VOption *options ) const +{ + VImage out; + + call( "LabQ2sRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LabS2Lab( VOption *options ) const +{ + VImage out; + + call( "LabS2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LabS2LabQ( VOption *options ) const +{ + VImage out; + + call( "LabS2LabQ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2CMYK( VOption *options ) const +{ + VImage out; + + call( "XYZ2CMYK", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2Lab( VOption *options ) const +{ + VImage out; + + call( "XYZ2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2Yxy( VOption *options ) const +{ + VImage out; + + call( "XYZ2Yxy", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2scRGB( VOption *options ) const +{ + VImage out; + + call( "XYZ2scRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::Yxy2XYZ( VOption *options ) const +{ + VImage out; + + call( "Yxy2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::abs( VOption *options ) const +{ + VImage out; + + call( "abs", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); } VImage VImage::add( VImage right, VOption *options ) const @@ -22,68 +255,162 @@ VImage VImage::add( VImage right, VOption *options ) const return( out ); } -VImage VImage::subtract( VImage right, VOption *options ) const +VImage VImage::affine( std::vector matrix, VOption *options ) const { VImage out; - call( "subtract", + call( "affine", (options ? options : VImage::option())-> - set( "left", *this )-> + set( "in", *this )-> set( "out", &out )-> - set( "right", right ) ); + set( "matrix", matrix ) ); return( out ); } -VImage VImage::multiply( VImage right, VOption *options ) const +VImage VImage::analyzeload( char *filename, VOption *options ) { VImage out; - call( "multiply", + call( "analyzeload", (options ? options : VImage::option())-> - set( "left", *this )-> set( "out", &out )-> - set( "right", right ) ); + set( "filename", filename ) ); return( out ); } -VImage VImage::divide( VImage right, VOption *options ) const +VImage VImage::arrayjoin( std::vector in, VOption *options ) { VImage out; - call( "divide", + call( "arrayjoin", (options ? options : VImage::option())-> - set( "left", *this )-> set( "out", &out )-> - set( "right", right ) ); + set( "in", in ) ); return( out ); } -VImage VImage::relational( VImage right, VipsOperationRelational relational, VOption *options ) const +VImage VImage::autorot( VOption *options ) const { VImage out; - call( "relational", + call( "autorot", (options ? options : VImage::option())-> - set( "left", *this )-> - set( "out", &out )-> - set( "right", right )-> - set( "relational", relational ) ); + set( "in", *this )-> + set( "out", &out ) ); return( out ); } -VImage VImage::remainder( VImage right, VOption *options ) const +double VImage::avg( VOption *options ) const +{ + double out; + + call( "avg", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::bandbool( VipsOperationBoolean boolean, VOption *options ) const { VImage out; - call( "remainder", + call( "bandbool", (options ? options : VImage::option())-> - set( "left", *this )-> + set( "in", *this )-> set( "out", &out )-> - set( "right", right ) ); + set( "boolean", boolean ) ); + + return( out ); +} + +VImage VImage::bandfold( VOption *options ) const +{ + VImage out; + + call( "bandfold", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::bandjoin( std::vector in, VOption *options ) +{ + VImage out; + + call( "bandjoin", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::bandjoin_const( std::vector c, VOption *options ) const +{ + VImage out; + + call( "bandjoin_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::bandmean( VOption *options ) const +{ + VImage out; + + call( "bandmean", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::bandrank( std::vector in, VOption *options ) +{ + VImage out; + + call( "bandrank", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::bandunfold( VOption *options ) const +{ + VImage out; + + call( "bandunfold", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::black( int width, int height, VOption *options ) +{ + VImage out; + + call( "black", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); return( out ); } @@ -102,16 +429,116 @@ VImage VImage::boolean( VImage right, VipsOperationBoolean boolean, VOption *opt return( out ); } -VImage VImage::math2( VImage right, VipsOperationMath2 math2, VOption *options ) const +VImage VImage::boolean_const( VipsOperationBoolean boolean, std::vector c, VOption *options ) const { VImage out; - call( "math2", + call( "boolean_const", (options ? options : VImage::option())-> - set( "left", *this )-> + set( "in", *this )-> set( "out", &out )-> - set( "right", right )-> - set( "math2", math2 ) ); + set( "boolean", boolean )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::buildlut( VOption *options ) const +{ + VImage out; + + call( "buildlut", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::byteswap( VOption *options ) const +{ + VImage out; + + call( "byteswap", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::cache( VOption *options ) const +{ + VImage out; + + call( "cache", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::canny( VOption *options ) const +{ + VImage out; + + call( "canny", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::cast( VipsBandFormat format, VOption *options ) const +{ + VImage out; + + call( "cast", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "format", format ) ); + + return( out ); +} + +VImage VImage::colourspace( VipsInterpretation space, VOption *options ) const +{ + VImage out; + + call( "colourspace", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "space", space ) ); + + return( out ); +} + +VImage VImage::compass( VImage mask, VOption *options ) const +{ + VImage out; + + call( "compass", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::complex( VipsOperationComplex cmplx, VOption *options ) const +{ + VImage out; + + call( "complex", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "cmplx", cmplx ) ); return( out ); } @@ -143,162 +570,6 @@ VImage VImage::complexform( VImage right, VOption *options ) const return( out ); } -VImage VImage::sum( std::vector in, VOption *options ) -{ - VImage out; - - call( "sum", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "in", in ) ); - - return( out ); -} - -VImage VImage::invert( VOption *options ) const -{ - VImage out; - - call( "invert", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::linear( std::vector a, std::vector b, VOption *options ) const -{ - VImage out; - - call( "linear", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "a", a )-> - set( "b", b ) ); - - return( out ); -} - -VImage VImage::math( VipsOperationMath math, VOption *options ) const -{ - VImage out; - - call( "math", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "math", math ) ); - - return( out ); -} - -VImage VImage::abs( VOption *options ) const -{ - VImage out; - - call( "abs", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sign( VOption *options ) const -{ - VImage out; - - call( "sign", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::round( VipsOperationRound round, VOption *options ) const -{ - VImage out; - - call( "round", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "round", round ) ); - - return( out ); -} - -VImage VImage::relational_const( VipsOperationRelational relational, std::vector c, VOption *options ) const -{ - VImage out; - - call( "relational_const", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "relational", relational )-> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::remainder_const( std::vector c, VOption *options ) const -{ - VImage out; - - call( "remainder_const", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::boolean_const( VipsOperationBoolean boolean, std::vector c, VOption *options ) const -{ - VImage out; - - call( "boolean_const", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "boolean", boolean )-> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::math2_const( VipsOperationMath2 math2, std::vector c, VOption *options ) const -{ - VImage out; - - call( "math2_const", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "math2", math2 )-> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::complex( VipsOperationComplex cmplx, VOption *options ) const -{ - VImage out; - - call( "complex", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "cmplx", cmplx ) ); - - return( out ); -} - VImage VImage::complexget( VipsOperationComplexget get, VOption *options ) const { VImage out; @@ -312,724 +583,6 @@ VImage VImage::complexget( VipsOperationComplexget get, VOption *options ) const return( out ); } -double VImage::avg( VOption *options ) const -{ - double out; - - call( "avg", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -double VImage::min( VOption *options ) const -{ - double out; - - call( "min", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -double VImage::max( VOption *options ) const -{ - double out; - - call( "max", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -double VImage::deviate( VOption *options ) const -{ - double out; - - call( "deviate", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::stats( VOption *options ) const -{ - VImage out; - - call( "stats", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_find( VOption *options ) const -{ - VImage out; - - call( "hist_find", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_find_ndim( VOption *options ) const -{ - VImage out; - - call( "hist_find_ndim", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_find_indexed( VImage index, VOption *options ) const -{ - VImage out; - - call( "hist_find_indexed", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "index", index ) ); - - return( out ); -} - -VImage VImage::hough_line( VOption *options ) const -{ - VImage out; - - call( "hough_line", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hough_circle( VOption *options ) const -{ - VImage out; - - call( "hough_circle", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::project( VImage *rows, VOption *options ) const -{ - VImage columns; - - call( "project", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "columns", &columns )-> - set( "rows", rows ) ); - - return( columns ); -} - -VImage VImage::profile( VImage *rows, VOption *options ) const -{ - VImage columns; - - call( "profile", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "columns", &columns )-> - set( "rows", rows ) ); - - return( columns ); -} - -VImage VImage::measure( int h, int v, VOption *options ) const -{ - VImage out; - - call( "measure", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "h", h )-> - set( "v", v ) ); - - return( out ); -} - -std::vector VImage::getpoint( int x, int y, VOption *options ) const -{ - std::vector out_array; - - call( "getpoint", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out_array", &out_array )-> - set( "x", x )-> - set( "y", y ) ); - - return( out_array ); -} - -int VImage::find_trim( int *top, int *width, int *height, VOption *options ) const -{ - int left; - - call( "find_trim", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "left", &left )-> - set( "top", top )-> - set( "width", width )-> - set( "height", height ) ); - - return( left ); -} - -VImage VImage::copy( VOption *options ) const -{ - VImage out; - - call( "copy", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::tilecache( VOption *options ) const -{ - VImage out; - - call( "tilecache", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::linecache( VOption *options ) const -{ - VImage out; - - call( "linecache", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sequential( VOption *options ) const -{ - VImage out; - - call( "sequential", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::cache( VOption *options ) const -{ - VImage out; - - call( "cache", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::embed( int x, int y, int width, int height, VOption *options ) const -{ - VImage out; - - call( "embed", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "x", x )-> - set( "y", y )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::gravity( VipsCompassDirection direction, int width, int height, VOption *options ) const -{ - VImage out; - - call( "gravity", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "direction", direction )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::flip( VipsDirection direction, VOption *options ) const -{ - VImage out; - - call( "flip", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "direction", direction ) ); - - return( out ); -} - -VImage VImage::insert( VImage sub, int x, int y, VOption *options ) const -{ - VImage out; - - call( "insert", - (options ? options : VImage::option())-> - set( "main", *this )-> - set( "out", &out )-> - set( "sub", sub )-> - set( "x", x )-> - set( "y", y ) ); - - return( out ); -} - -VImage VImage::join( VImage in2, VipsDirection direction, VOption *options ) const -{ - VImage out; - - call( "join", - (options ? options : VImage::option())-> - set( "in1", *this )-> - set( "out", &out )-> - set( "in2", in2 )-> - set( "direction", direction ) ); - - return( out ); -} - -VImage VImage::arrayjoin( std::vector in, VOption *options ) -{ - VImage out; - - call( "arrayjoin", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "in", in ) ); - - return( out ); -} - -VImage VImage::extract_area( int left, int top, int width, int height, VOption *options ) const -{ - VImage out; - - call( "extract_area", - (options ? options : VImage::option())-> - set( "input", *this )-> - set( "out", &out )-> - set( "left", left )-> - set( "top", top )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::smartcrop( int width, int height, VOption *options ) const -{ - VImage out; - - call( "smartcrop", - (options ? options : VImage::option())-> - set( "input", *this )-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::extract_band( int band, VOption *options ) const -{ - VImage out; - - call( "extract_band", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "band", band ) ); - - return( out ); -} - -VImage VImage::bandjoin( std::vector in, VOption *options ) -{ - VImage out; - - call( "bandjoin", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "in", in ) ); - - return( out ); -} - -VImage VImage::bandjoin_const( std::vector c, VOption *options ) const -{ - VImage out; - - call( "bandjoin_const", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::bandrank( std::vector in, VOption *options ) -{ - VImage out; - - call( "bandrank", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "in", in ) ); - - return( out ); -} - -VImage VImage::bandmean( VOption *options ) const -{ - VImage out; - - call( "bandmean", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::bandbool( VipsOperationBoolean boolean, VOption *options ) const -{ - VImage out; - - call( "bandbool", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "boolean", boolean ) ); - - return( out ); -} - -VImage VImage::replicate( int across, int down, VOption *options ) const -{ - VImage out; - - call( "replicate", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "across", across )-> - set( "down", down ) ); - - return( out ); -} - -VImage VImage::cast( VipsBandFormat format, VOption *options ) const -{ - VImage out; - - call( "cast", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "format", format ) ); - - return( out ); -} - -VImage VImage::rot( VipsAngle angle, VOption *options ) const -{ - VImage out; - - call( "rot", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "angle", angle ) ); - - return( out ); -} - -VImage VImage::rot45( VOption *options ) const -{ - VImage out; - - call( "rot45", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::autorot( VOption *options ) const -{ - VImage out; - - call( "autorot", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::ifthenelse( VImage in1, VImage in2, VOption *options ) const -{ - VImage out; - - call( "ifthenelse", - (options ? options : VImage::option())-> - set( "cond", *this )-> - set( "out", &out )-> - set( "in1", in1 )-> - set( "in2", in2 ) ); - - return( out ); -} - -VImage VImage::recomb( VImage m, VOption *options ) const -{ - VImage out; - - call( "recomb", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "m", m ) ); - - return( out ); -} - -VImage VImage::bandfold( VOption *options ) const -{ - VImage out; - - call( "bandfold", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::bandunfold( VOption *options ) const -{ - VImage out; - - call( "bandunfold", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::flatten( VOption *options ) const -{ - VImage out; - - call( "flatten", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::premultiply( VOption *options ) const -{ - VImage out; - - call( "premultiply", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::unpremultiply( VOption *options ) const -{ - VImage out; - - call( "unpremultiply", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::grid( int tile_height, int across, int down, VOption *options ) const -{ - VImage out; - - call( "grid", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "tile_height", tile_height )-> - set( "across", across )-> - set( "down", down ) ); - - return( out ); -} - -VImage VImage::transpose3d( VOption *options ) const -{ - VImage out; - - call( "transpose3d", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::scale( VOption *options ) const -{ - VImage out; - - call( "scale", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::wrap( VOption *options ) const -{ - VImage out; - - call( "wrap", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::zoom( int xfac, int yfac, VOption *options ) const -{ - VImage out; - - call( "zoom", - (options ? options : VImage::option())-> - set( "input", *this )-> - set( "out", &out )-> - set( "xfac", xfac )-> - set( "yfac", yfac ) ); - - return( out ); -} - -VImage VImage::subsample( int xfac, int yfac, VOption *options ) const -{ - VImage out; - - call( "subsample", - (options ? options : VImage::option())-> - set( "input", *this )-> - set( "out", &out )-> - set( "xfac", xfac )-> - set( "yfac", yfac ) ); - - return( out ); -} - -VImage VImage::msb( VOption *options ) const -{ - VImage out; - - call( "msb", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::byteswap( VOption *options ) const -{ - VImage out; - - call( "byteswap", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::falsecolour( VOption *options ) const -{ - VImage out; - - call( "falsecolour", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::gamma( VOption *options ) const -{ - VImage out; - - call( "gamma", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - VImage VImage::composite( std::vector in, std::vector mode, VOption *options ) { VImage out; @@ -1057,1631 +610,6 @@ VImage VImage::composite2( VImage overlay, VipsBlendMode mode, VOption *options return( out ); } -VImage VImage::black( int width, int height, VOption *options ) -{ - VImage out; - - call( "black", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::gaussnoise( int width, int height, VOption *options ) -{ - VImage out; - - call( "gaussnoise", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::text( char *text, VOption *options ) -{ - VImage out; - - call( "text", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "text", text ) ); - - return( out ); -} - -VImage VImage::xyz( int width, int height, VOption *options ) -{ - VImage out; - - call( "xyz", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::gaussmat( double sigma, double min_ampl, VOption *options ) -{ - VImage out; - - call( "gaussmat", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "sigma", sigma )-> - set( "min_ampl", min_ampl ) ); - - return( out ); -} - -VImage VImage::logmat( double sigma, double min_ampl, VOption *options ) -{ - VImage out; - - call( "logmat", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "sigma", sigma )-> - set( "min_ampl", min_ampl ) ); - - return( out ); -} - -VImage VImage::eye( int width, int height, VOption *options ) -{ - VImage out; - - call( "eye", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::grey( int width, int height, VOption *options ) -{ - VImage out; - - call( "grey", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::zone( int width, int height, VOption *options ) -{ - VImage out; - - call( "zone", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::sines( int width, int height, VOption *options ) -{ - VImage out; - - call( "sines", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::mask_ideal( int width, int height, double frequency_cutoff, VOption *options ) -{ - VImage out; - - call( "mask_ideal", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "frequency_cutoff", frequency_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_ideal_ring( int width, int height, double frequency_cutoff, double ringwidth, VOption *options ) -{ - VImage out; - - call( "mask_ideal_ring", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "frequency_cutoff", frequency_cutoff )-> - set( "ringwidth", ringwidth ) ); - - return( out ); -} - -VImage VImage::mask_ideal_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, VOption *options ) -{ - VImage out; - - call( "mask_ideal_band", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "frequency_cutoff_x", frequency_cutoff_x )-> - set( "frequency_cutoff_y", frequency_cutoff_y )-> - set( "radius", radius ) ); - - return( out ); -} - -VImage VImage::mask_butterworth( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, VOption *options ) -{ - VImage out; - - call( "mask_butterworth", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "order", order )-> - set( "frequency_cutoff", frequency_cutoff )-> - set( "amplitude_cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_butterworth_ring( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options ) -{ - VImage out; - - call( "mask_butterworth_ring", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "order", order )-> - set( "frequency_cutoff", frequency_cutoff )-> - set( "amplitude_cutoff", amplitude_cutoff )-> - set( "ringwidth", ringwidth ) ); - - return( out ); -} - -VImage VImage::mask_butterworth_band( int width, int height, double order, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options ) -{ - VImage out; - - call( "mask_butterworth_band", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "order", order )-> - set( "frequency_cutoff_x", frequency_cutoff_x )-> - set( "frequency_cutoff_y", frequency_cutoff_y )-> - set( "radius", radius )-> - set( "amplitude_cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_gaussian( int width, int height, double frequency_cutoff, double amplitude_cutoff, VOption *options ) -{ - VImage out; - - call( "mask_gaussian", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "frequency_cutoff", frequency_cutoff )-> - set( "amplitude_cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_gaussian_ring( int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options ) -{ - VImage out; - - call( "mask_gaussian_ring", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "frequency_cutoff", frequency_cutoff )-> - set( "amplitude_cutoff", amplitude_cutoff )-> - set( "ringwidth", ringwidth ) ); - - return( out ); -} - -VImage VImage::mask_gaussian_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options ) -{ - VImage out; - - call( "mask_gaussian_band", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "frequency_cutoff_x", frequency_cutoff_x )-> - set( "frequency_cutoff_y", frequency_cutoff_y )-> - set( "radius", radius )-> - set( "amplitude_cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_fractal( int width, int height, double fractal_dimension, VOption *options ) -{ - VImage out; - - call( "mask_fractal", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "fractal_dimension", fractal_dimension ) ); - - return( out ); -} - -VImage VImage::buildlut( VOption *options ) const -{ - VImage out; - - call( "buildlut", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::invertlut( VOption *options ) const -{ - VImage out; - - call( "invertlut", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::tonelut( VOption *options ) -{ - VImage out; - - call( "tonelut", - (options ? options : VImage::option())-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::identity( VOption *options ) -{ - VImage out; - - call( "identity", - (options ? options : VImage::option())-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::fractsurf( int width, int height, double fractal_dimension, VOption *options ) -{ - VImage out; - - call( "fractsurf", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "fractal_dimension", fractal_dimension ) ); - - return( out ); -} - -VImage VImage::worley( int width, int height, VOption *options ) -{ - VImage out; - - call( "worley", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::perlin( int width, int height, VOption *options ) -{ - VImage out; - - call( "perlin", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::csvload( char *filename, VOption *options ) -{ - VImage out; - - call( "csvload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::matrixload( char *filename, VOption *options ) -{ - VImage out; - - call( "matrixload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - - -VImage VImage::rawload( char *filename, int width, int height, int bands, VOption *options ) -{ - VImage out; - - call( "rawload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename )-> - set( "width", width )-> - set( "height", height )-> - set( "bands", bands ) ); - - return( out ); -} - -VImage VImage::vipsload( char *filename, VOption *options ) -{ - VImage out; - - call( "vipsload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::analyzeload( char *filename, VOption *options ) -{ - VImage out; - - call( "analyzeload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::ppmload( char *filename, VOption *options ) -{ - VImage out; - - call( "ppmload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::radload( char *filename, VOption *options ) -{ - VImage out; - - call( "radload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::pdfload( char *filename, VOption *options ) -{ - VImage out; - - call( "pdfload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::pdfload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "pdfload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::svgload( char *filename, VOption *options ) -{ - VImage out; - - call( "svgload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::svgload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "svgload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::gifload( char *filename, VOption *options ) -{ - VImage out; - - call( "gifload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::gifload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "gifload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::pngload( char *filename, VOption *options ) -{ - VImage out; - - call( "pngload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::pngload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "pngload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::matload( char *filename, VOption *options ) -{ - VImage out; - - call( "matload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::jpegload( char *filename, VOption *options ) -{ - VImage out; - - call( "jpegload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::jpegload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "jpegload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::webpload( char *filename, VOption *options ) -{ - VImage out; - - call( "webpload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::webpload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "webpload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::tiffload( char *filename, VOption *options ) -{ - VImage out; - - call( "tiffload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::tiffload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "tiffload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::openslideload( char *filename, VOption *options ) -{ - VImage out; - - call( "openslideload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::magickload( char *filename, VOption *options ) -{ - VImage out; - - call( "magickload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::magickload_buffer( VipsBlob *buffer, VOption *options ) -{ - VImage out; - - call( "magickload_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer ) ); - - return( out ); -} - -VImage VImage::fitsload( char *filename, VOption *options ) -{ - VImage out; - - call( "fitsload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -VImage VImage::openexrload( char *filename, VOption *options ) -{ - VImage out; - - call( "openexrload", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename ) ); - - return( out ); -} - -void VImage::csvsave( char *filename, VOption *options ) const -{ - call( "csvsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -void VImage::matrixsave( char *filename, VOption *options ) const -{ - call( "matrixsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -void VImage::matrixprint( VOption *options ) const -{ - call( "matrixprint", - (options ? options : VImage::option())-> - set( "in", *this ) ); -} - -void VImage::rawsave( char *filename, VOption *options ) const -{ - call( "rawsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -void VImage::rawsave_fd( int fd, VOption *options ) const -{ - call( "rawsave_fd", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "fd", fd ) ); -} - -void VImage::vipssave( char *filename, VOption *options ) const -{ - call( "vipssave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -void VImage::ppmsave( char *filename, VOption *options ) const -{ - call( "ppmsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -void VImage::radsave( char *filename, VOption *options ) const -{ - call( "radsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VipsBlob *VImage::radsave_buffer( VOption *options ) const -{ - VipsBlob *buffer; - - call( "radsave_buffer", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::dzsave( char *filename, VOption *options ) const -{ - call( "dzsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VipsBlob *VImage::dzsave_buffer( VOption *options ) const -{ - VipsBlob *buffer; - - call( "dzsave_buffer", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::pngsave( char *filename, VOption *options ) const -{ - call( "pngsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VipsBlob *VImage::pngsave_buffer( VOption *options ) const -{ - VipsBlob *buffer; - - call( "pngsave_buffer", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::jpegsave( char *filename, VOption *options ) const -{ - call( "jpegsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VipsBlob *VImage::jpegsave_buffer( VOption *options ) const -{ - VipsBlob *buffer; - - call( "jpegsave_buffer", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::jpegsave_mime( VOption *options ) const -{ - call( "jpegsave_mime", - (options ? options : VImage::option())-> - set( "in", *this ) ); -} - -void VImage::webpsave( char *filename, VOption *options ) const -{ - call( "webpsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VipsBlob *VImage::webpsave_buffer( VOption *options ) const -{ - VipsBlob *buffer; - - call( "webpsave_buffer", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::tiffsave( char *filename, VOption *options ) const -{ - call( "tiffsave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VipsBlob *VImage::tiffsave_buffer( VOption *options ) const -{ - VipsBlob *buffer; - - call( "tiffsave_buffer", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::magicksave( char *filename, VOption *options ) const -{ - call( "magicksave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VipsBlob *VImage::magicksave_buffer( VOption *options ) const -{ - VipsBlob *buffer; - - call( "magicksave_buffer", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::fitssave( char *filename, VOption *options ) const -{ - call( "fitssave", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "filename", filename ) ); -} - -VImage VImage::thumbnail( char *filename, int width, VOption *options ) -{ - VImage out; - - call( "thumbnail", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "filename", filename )-> - set( "width", width ) ); - - return( out ); -} - -VImage VImage::thumbnail_buffer( VipsBlob *buffer, int width, VOption *options ) -{ - VImage out; - - call( "thumbnail_buffer", - (options ? options : VImage::option())-> - set( "out", &out )-> - set( "buffer", buffer )-> - set( "width", width ) ); - - return( out ); -} - -VImage VImage::thumbnail_image( int width, VOption *options ) const -{ - VImage out; - - call( "thumbnail_image", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "width", width ) ); - - return( out ); -} - -VImage VImage::mapim( VImage index, VOption *options ) const -{ - VImage out; - - call( "mapim", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "index", index ) ); - - return( out ); -} - -VImage VImage::shrink( double hshrink, double vshrink, VOption *options ) const -{ - VImage out; - - call( "shrink", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "hshrink", hshrink )-> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::shrinkh( int hshrink, VOption *options ) const -{ - VImage out; - - call( "shrinkh", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "hshrink", hshrink ) ); - - return( out ); -} - -VImage VImage::shrinkv( int vshrink, VOption *options ) const -{ - VImage out; - - call( "shrinkv", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::reduceh( double hshrink, VOption *options ) const -{ - VImage out; - - call( "reduceh", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "hshrink", hshrink ) ); - - return( out ); -} - -VImage VImage::reducev( double vshrink, VOption *options ) const -{ - VImage out; - - call( "reducev", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::reduce( double hshrink, double vshrink, VOption *options ) const -{ - VImage out; - - call( "reduce", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "hshrink", hshrink )-> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::quadratic( VImage coeff, VOption *options ) const -{ - VImage out; - - call( "quadratic", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "coeff", coeff ) ); - - return( out ); -} - -VImage VImage::affine( std::vector matrix, VOption *options ) const -{ - VImage out; - - call( "affine", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "matrix", matrix ) ); - - return( out ); -} - -VImage VImage::similarity( VOption *options ) const -{ - VImage out; - - call( "similarity", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::rotate( double angle, VOption *options ) const -{ - VImage out; - - call( "rotate", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "angle", angle ) ); - - return( out ); -} - -VImage VImage::resize( double scale, VOption *options ) const -{ - VImage out; - - call( "resize", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "scale", scale ) ); - - return( out ); -} - -VImage VImage::colourspace( VipsInterpretation space, VOption *options ) const -{ - VImage out; - - call( "colourspace", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "space", space ) ); - - return( out ); -} - -VImage VImage::Lab2XYZ( VOption *options ) const -{ - VImage out; - - call( "Lab2XYZ", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::XYZ2Lab( VOption *options ) const -{ - VImage out; - - call( "XYZ2Lab", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Lab2LCh( VOption *options ) const -{ - VImage out; - - call( "Lab2LCh", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LCh2Lab( VOption *options ) const -{ - VImage out; - - call( "LCh2Lab", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LCh2CMC( VOption *options ) const -{ - VImage out; - - call( "LCh2CMC", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::CMC2LCh( VOption *options ) const -{ - VImage out; - - call( "CMC2LCh", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::XYZ2Yxy( VOption *options ) const -{ - VImage out; - - call( "XYZ2Yxy", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Yxy2XYZ( VOption *options ) const -{ - VImage out; - - call( "Yxy2XYZ", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::scRGB2XYZ( VOption *options ) const -{ - VImage out; - - call( "scRGB2XYZ", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::XYZ2scRGB( VOption *options ) const -{ - VImage out; - - call( "XYZ2scRGB", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - - -VImage VImage::LabQ2Lab( VOption *options ) const -{ - VImage out; - - call( "LabQ2Lab", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Lab2LabQ( VOption *options ) const -{ - VImage out; - - call( "Lab2LabQ", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabQ2LabS( VOption *options ) const -{ - VImage out; - - call( "LabQ2LabS", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabS2LabQ( VOption *options ) const -{ - VImage out; - - call( "LabS2LabQ", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabS2Lab( VOption *options ) const -{ - VImage out; - - call( "LabS2Lab", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Lab2LabS( VOption *options ) const -{ - VImage out; - - call( "Lab2LabS", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::rad2float( VOption *options ) const -{ - VImage out; - - call( "rad2float", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::float2rad( VOption *options ) const -{ - VImage out; - - call( "float2rad", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabQ2sRGB( VOption *options ) const -{ - VImage out; - - call( "LabQ2sRGB", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sRGB2HSV( VOption *options ) const -{ - VImage out; - - call( "sRGB2HSV", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::HSV2sRGB( VOption *options ) const -{ - VImage out; - - call( "HSV2sRGB", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::icc_import( VOption *options ) const -{ - VImage out; - - call( "icc_import", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::icc_export( VOption *options ) const -{ - VImage out; - - call( "icc_export", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::icc_transform( char *output_profile, VOption *options ) const -{ - VImage out; - - call( "icc_transform", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "output_profile", output_profile ) ); - - return( out ); -} - -VImage VImage::dE76( VImage right, VOption *options ) const -{ - VImage out; - - call( "dE76", - (options ? options : VImage::option())-> - set( "left", *this )-> - set( "out", &out )-> - set( "right", right ) ); - - return( out ); -} - -VImage VImage::dE00( VImage right, VOption *options ) const -{ - VImage out; - - call( "dE00", - (options ? options : VImage::option())-> - set( "left", *this )-> - set( "out", &out )-> - set( "right", right ) ); - - return( out ); -} - -VImage VImage::dECMC( VImage right, VOption *options ) const -{ - VImage out; - - call( "dECMC", - (options ? options : VImage::option())-> - set( "left", *this )-> - set( "out", &out )-> - set( "right", right ) ); - - return( out ); -} - -VImage VImage::sRGB2scRGB( VOption *options ) const -{ - VImage out; - - call( "sRGB2scRGB", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::scRGB2BW( VOption *options ) const -{ - VImage out; - - call( "scRGB2BW", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::scRGB2sRGB( VOption *options ) const -{ - VImage out; - - call( "scRGB2sRGB", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::maplut( VImage lut, VOption *options ) const -{ - VImage out; - - call( "maplut", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "lut", lut ) ); - - return( out ); -} - -int VImage::percent( double percent, VOption *options ) const -{ - int threshold; - - call( "percent", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "threshold", &threshold )-> - set( "percent", percent ) ); - - return( threshold ); -} - -VImage VImage::stdif( int width, int height, VOption *options ) const -{ - VImage out; - - call( "stdif", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::hist_cum( VOption *options ) const -{ - VImage out; - - call( "hist_cum", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_match( VImage ref, VOption *options ) const -{ - VImage out; - - call( "hist_match", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "ref", ref ) ); - - return( out ); -} - -VImage VImage::hist_norm( VOption *options ) const -{ - VImage out; - - call( "hist_norm", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_equal( VOption *options ) const -{ - VImage out; - - call( "hist_equal", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_plot( VOption *options ) const -{ - VImage out; - - call( "hist_plot", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_local( int width, int height, VOption *options ) const -{ - VImage out; - - call( "hist_local", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height ) ); - - return( out ); -} - -bool VImage::hist_ismonotonic( VOption *options ) const -{ - bool monotonic; - - call( "hist_ismonotonic", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "monotonic", &monotonic ) ); - - return( monotonic ); -} - -double VImage::hist_entropy( VOption *options ) const -{ - double out; - - call( "hist_entropy", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - - VImage VImage::conv( VImage mask, VOption *options ) const { VImage out; @@ -2708,6 +636,18 @@ VImage VImage::conva( VImage mask, VOption *options ) const return( out ); } +VImage VImage::convasep( VImage mask, VOption *options ) const +{ + VImage out; + + call( "convasep", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} VImage VImage::convf( VImage mask, VOption *options ) const { @@ -2735,19 +675,6 @@ VImage VImage::convi( VImage mask, VOption *options ) const return( out ); } -VImage VImage::compass( VImage mask, VOption *options ) const -{ - VImage out; - - call( "compass", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "mask", mask ) ); - - return( out ); -} - VImage VImage::convsep( VImage mask, VOption *options ) const { VImage out; @@ -2761,50 +688,11 @@ VImage VImage::convsep( VImage mask, VOption *options ) const return( out ); } -VImage VImage::convasep( VImage mask, VOption *options ) const +VImage VImage::copy( VOption *options ) const { VImage out; - call( "convasep", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::fastcor( VImage ref, VOption *options ) const -{ - VImage out; - - call( "fastcor", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "ref", ref ) ); - - return( out ); -} - -VImage VImage::spcor( VImage ref, VOption *options ) const -{ - VImage out; - - call( "spcor", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "ref", ref ) ); - - return( out ); -} - -VImage VImage::sharpen( VOption *options ) const -{ - VImage out; - - call( "sharpen", + call( "copy", (options ? options : VImage::option())-> set( "in", *this )-> set( "out", &out ) ); @@ -2812,134 +700,6 @@ VImage VImage::sharpen( VOption *options ) const return( out ); } -VImage VImage::gaussblur( double sigma, VOption *options ) const -{ - VImage out; - - call( "gaussblur", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "sigma", sigma ) ); - - return( out ); -} - -VImage VImage::canny( VOption *options ) const -{ - VImage out; - - call( "canny", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sobel( VOption *options ) const -{ - VImage out; - - call( "sobel", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::fwfft( VOption *options ) const -{ - VImage out; - - call( "fwfft", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::invfft( VOption *options ) const -{ - VImage out; - - call( "invfft", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::freqmult( VImage mask, VOption *options ) const -{ - VImage out; - - call( "freqmult", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::spectrum( VOption *options ) const -{ - VImage out; - - call( "spectrum", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::phasecor( VImage in2, VOption *options ) const -{ - VImage out; - - call( "phasecor", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "in2", in2 ) ); - - return( out ); -} - -VImage VImage::morph( VImage mask, VipsOperationMorphology morph, VOption *options ) const -{ - VImage out; - - call( "morph", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "mask", mask )-> - set( "morph", morph ) ); - - return( out ); -} - -VImage VImage::rank( int width, int height, int index, VOption *options ) const -{ - VImage out; - - call( "rank", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out )-> - set( "width", width )-> - set( "height", height )-> - set( "index", index ) ); - - return( out ); -} - double VImage::countlines( VipsDirection direction, VOption *options ) const { double nolines; @@ -2953,23 +713,86 @@ double VImage::countlines( VipsDirection direction, VOption *options ) const return( nolines ); } -VImage VImage::labelregions( VOption *options ) const -{ - VImage mask; - - call( "labelregions", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "mask", &mask ) ); - - return( mask ); -} - -VImage VImage::fill_nearest( VOption *options ) const +VImage VImage::crop( int left, int top, int width, int height, VOption *options ) const { VImage out; - call( "fill_nearest", + call( "crop", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "left", left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::csvload( char *filename, VOption *options ) +{ + VImage out; + + call( "csvload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::csvsave( char *filename, VOption *options ) const +{ + call( "csvsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::dE00( VImage right, VOption *options ) const +{ + VImage out; + + call( "dE00", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::dE76( VImage right, VOption *options ) const +{ + VImage out; + + call( "dE76", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::dECMC( VImage right, VOption *options ) const +{ + VImage out; + + call( "dECMC", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +double VImage::deviate( VOption *options ) const +{ + double out; + + call( "deviate", (options ? options : VImage::option())-> set( "in", *this )-> set( "out", &out ) ); @@ -2977,39 +800,17 @@ VImage VImage::fill_nearest( VOption *options ) const return( out ); } -void VImage::draw_rect( std::vector ink, int left, int top, int width, int height, VOption *options ) const +VImage VImage::divide( VImage right, VOption *options ) const { - call( "draw_rect", - (options ? options : VImage::option())-> - set( "image", *this )-> - set( "ink", ink )-> - set( "left", left )-> - set( "top", top )-> - set( "width", width )-> - set( "height", height ) ); -} + VImage out; -void VImage::draw_mask( std::vector ink, VImage mask, int x, int y, VOption *options ) const -{ - call( "draw_mask", + call( "divide", (options ? options : VImage::option())-> - set( "image", *this )-> - set( "ink", ink )-> - set( "mask", mask )-> - set( "x", x )-> - set( "y", y ) ); -} + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); -void VImage::draw_line( std::vector ink, int x1, int y1, int x2, int y2, VOption *options ) const -{ - call( "draw_line", - (options ? options : VImage::option())-> - set( "image", *this )-> - set( "ink", ink )-> - set( "x1", x1 )-> - set( "y1", y1 )-> - set( "x2", x2 )-> - set( "y2", y2 ) ); + return( out ); } void VImage::draw_circle( std::vector ink, int cx, int cy, int radius, VOption *options ) const @@ -3043,6 +844,41 @@ void VImage::draw_image( VImage sub, int x, int y, VOption *options ) const set( "y", y ) ); } +void VImage::draw_line( std::vector ink, int x1, int y1, int x2, int y2, VOption *options ) const +{ + call( "draw_line", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "ink", ink )-> + set( "x1", x1 )-> + set( "y1", y1 )-> + set( "x2", x2 )-> + set( "y2", y2 ) ); +} + +void VImage::draw_mask( std::vector ink, VImage mask, int x, int y, VOption *options ) const +{ + call( "draw_mask", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "ink", ink )-> + set( "mask", mask )-> + set( "x", x )-> + set( "y", y ) ); +} + +void VImage::draw_rect( std::vector ink, int left, int top, int width, int height, VOption *options ) const +{ + call( "draw_rect", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "ink", ink )-> + set( "left", left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); +} + void VImage::draw_smudge( int left, int top, int width, int height, VOption *options ) const { call( "draw_smudge", @@ -3054,6 +890,1119 @@ void VImage::draw_smudge( int left, int top, int width, int height, VOption *opt set( "height", height ) ); } +void VImage::dzsave( char *filename, VOption *options ) const +{ + call( "dzsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::dzsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "dzsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::embed( int x, int y, int width, int height, VOption *options ) const +{ + VImage out; + + call( "embed", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "x", x )-> + set( "y", y )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::extract_area( int left, int top, int width, int height, VOption *options ) const +{ + VImage out; + + call( "extract_area", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "left", left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::extract_band( int band, VOption *options ) const +{ + VImage out; + + call( "extract_band", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "band", band ) ); + + return( out ); +} + +VImage VImage::eye( int width, int height, VOption *options ) +{ + VImage out; + + call( "eye", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::falsecolour( VOption *options ) const +{ + VImage out; + + call( "falsecolour", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::fastcor( VImage ref, VOption *options ) const +{ + VImage out; + + call( "fastcor", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "ref", ref ) ); + + return( out ); +} + +VImage VImage::fill_nearest( VOption *options ) const +{ + VImage out; + + call( "fill_nearest", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +int VImage::find_trim( int *top, int *width, int *height, VOption *options ) const +{ + int left; + + call( "find_trim", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "left", &left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); + + return( left ); +} + +VImage VImage::fitsload( char *filename, VOption *options ) +{ + VImage out; + + call( "fitsload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::fitssave( char *filename, VOption *options ) const +{ + call( "fitssave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::flatten( VOption *options ) const +{ + VImage out; + + call( "flatten", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::flip( VipsDirection direction, VOption *options ) const +{ + VImage out; + + call( "flip", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "direction", direction ) ); + + return( out ); +} + +VImage VImage::float2rad( VOption *options ) const +{ + VImage out; + + call( "float2rad", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::fractsurf( int width, int height, double fractal_dimension, VOption *options ) +{ + VImage out; + + call( "fractsurf", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "fractal_dimension", fractal_dimension ) ); + + return( out ); +} + +VImage VImage::freqmult( VImage mask, VOption *options ) const +{ + VImage out; + + call( "freqmult", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::fwfft( VOption *options ) const +{ + VImage out; + + call( "fwfft", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::gamma( VOption *options ) const +{ + VImage out; + + call( "gamma", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::gaussblur( double sigma, VOption *options ) const +{ + VImage out; + + call( "gaussblur", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "sigma", sigma ) ); + + return( out ); +} + +VImage VImage::gaussmat( double sigma, double min_ampl, VOption *options ) +{ + VImage out; + + call( "gaussmat", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "sigma", sigma )-> + set( "min_ampl", min_ampl ) ); + + return( out ); +} + +VImage VImage::gaussnoise( int width, int height, VOption *options ) +{ + VImage out; + + call( "gaussnoise", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +std::vector VImage::getpoint( int x, int y, VOption *options ) const +{ + std::vector out_array; + + call( "getpoint", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out_array", &out_array )-> + set( "x", x )-> + set( "y", y ) ); + + return( out_array ); +} + +VImage VImage::gifload( char *filename, VOption *options ) +{ + VImage out; + + call( "gifload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::gifload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "gifload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +VImage VImage::globalbalance( VOption *options ) const +{ + VImage out; + + call( "globalbalance", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::gravity( VipsCompassDirection direction, int width, int height, VOption *options ) const +{ + VImage out; + + call( "gravity", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "direction", direction )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::grey( int width, int height, VOption *options ) +{ + VImage out; + + call( "grey", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::grid( int tile_height, int across, int down, VOption *options ) const +{ + VImage out; + + call( "grid", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "tile_height", tile_height )-> + set( "across", across )-> + set( "down", down ) ); + + return( out ); +} + +VImage VImage::hist_cum( VOption *options ) const +{ + VImage out; + + call( "hist_cum", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +double VImage::hist_entropy( VOption *options ) const +{ + double out; + + call( "hist_entropy", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_equal( VOption *options ) const +{ + VImage out; + + call( "hist_equal", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_find( VOption *options ) const +{ + VImage out; + + call( "hist_find", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_find_indexed( VImage index, VOption *options ) const +{ + VImage out; + + call( "hist_find_indexed", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "index", index ) ); + + return( out ); +} + +VImage VImage::hist_find_ndim( VOption *options ) const +{ + VImage out; + + call( "hist_find_ndim", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +bool VImage::hist_ismonotonic( VOption *options ) const +{ + bool monotonic; + + call( "hist_ismonotonic", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "monotonic", &monotonic ) ); + + return( monotonic ); +} + +VImage VImage::hist_local( int width, int height, VOption *options ) const +{ + VImage out; + + call( "hist_local", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::hist_match( VImage ref, VOption *options ) const +{ + VImage out; + + call( "hist_match", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "ref", ref ) ); + + return( out ); +} + +VImage VImage::hist_norm( VOption *options ) const +{ + VImage out; + + call( "hist_norm", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_plot( VOption *options ) const +{ + VImage out; + + call( "hist_plot", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hough_circle( VOption *options ) const +{ + VImage out; + + call( "hough_circle", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hough_line( VOption *options ) const +{ + VImage out; + + call( "hough_line", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::icc_export( VOption *options ) const +{ + VImage out; + + call( "icc_export", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::icc_import( VOption *options ) const +{ + VImage out; + + call( "icc_import", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::icc_transform( char *output_profile, VOption *options ) const +{ + VImage out; + + call( "icc_transform", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "output_profile", output_profile ) ); + + return( out ); +} + +VImage VImage::identity( VOption *options ) +{ + VImage out; + + call( "identity", + (options ? options : VImage::option())-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::ifthenelse( VImage in1, VImage in2, VOption *options ) const +{ + VImage out; + + call( "ifthenelse", + (options ? options : VImage::option())-> + set( "cond", *this )-> + set( "out", &out )-> + set( "in1", in1 )-> + set( "in2", in2 ) ); + + return( out ); +} + +VImage VImage::insert( VImage sub, int x, int y, VOption *options ) const +{ + VImage out; + + call( "insert", + (options ? options : VImage::option())-> + set( "main", *this )-> + set( "out", &out )-> + set( "sub", sub )-> + set( "x", x )-> + set( "y", y ) ); + + return( out ); +} + +VImage VImage::invert( VOption *options ) const +{ + VImage out; + + call( "invert", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::invertlut( VOption *options ) const +{ + VImage out; + + call( "invertlut", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::invfft( VOption *options ) const +{ + VImage out; + + call( "invfft", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::join( VImage in2, VipsDirection direction, VOption *options ) const +{ + VImage out; + + call( "join", + (options ? options : VImage::option())-> + set( "in1", *this )-> + set( "out", &out )-> + set( "in2", in2 )-> + set( "direction", direction ) ); + + return( out ); +} + +VImage VImage::jpegload( char *filename, VOption *options ) +{ + VImage out; + + call( "jpegload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::jpegload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "jpegload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::jpegsave( char *filename, VOption *options ) const +{ + call( "jpegsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::jpegsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "jpegsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +void VImage::jpegsave_mime( VOption *options ) const +{ + call( "jpegsave_mime", + (options ? options : VImage::option())-> + set( "in", *this ) ); +} + +VImage VImage::labelregions( VOption *options ) const +{ + VImage mask; + + call( "labelregions", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "mask", &mask ) ); + + return( mask ); +} + +VImage VImage::linear( std::vector a, std::vector b, VOption *options ) const +{ + VImage out; + + call( "linear", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "a", a )-> + set( "b", b ) ); + + return( out ); +} + +VImage VImage::linecache( VOption *options ) const +{ + VImage out; + + call( "linecache", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::logmat( double sigma, double min_ampl, VOption *options ) +{ + VImage out; + + call( "logmat", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "sigma", sigma )-> + set( "min_ampl", min_ampl ) ); + + return( out ); +} + +VImage VImage::magickload( char *filename, VOption *options ) +{ + VImage out; + + call( "magickload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::magickload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "magickload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::magicksave( char *filename, VOption *options ) const +{ + call( "magicksave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::magicksave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "magicksave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::mapim( VImage index, VOption *options ) const +{ + VImage out; + + call( "mapim", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "index", index ) ); + + return( out ); +} + +VImage VImage::maplut( VImage lut, VOption *options ) const +{ + VImage out; + + call( "maplut", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "lut", lut ) ); + + return( out ); +} + +VImage VImage::mask_butterworth( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_butterworth", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "order", order )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_butterworth_band( int width, int height, double order, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_butterworth_band", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "order", order )-> + set( "frequency_cutoff_x", frequency_cutoff_x )-> + set( "frequency_cutoff_y", frequency_cutoff_y )-> + set( "radius", radius )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_butterworth_ring( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options ) +{ + VImage out; + + call( "mask_butterworth_ring", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "order", order )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff )-> + set( "ringwidth", ringwidth ) ); + + return( out ); +} + +VImage VImage::mask_fractal( int width, int height, double fractal_dimension, VOption *options ) +{ + VImage out; + + call( "mask_fractal", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "fractal_dimension", fractal_dimension ) ); + + return( out ); +} + +VImage VImage::mask_gaussian( int width, int height, double frequency_cutoff, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_gaussian", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_gaussian_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_gaussian_band", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff_x", frequency_cutoff_x )-> + set( "frequency_cutoff_y", frequency_cutoff_y )-> + set( "radius", radius )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_gaussian_ring( int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options ) +{ + VImage out; + + call( "mask_gaussian_ring", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff )-> + set( "ringwidth", ringwidth ) ); + + return( out ); +} + +VImage VImage::mask_ideal( int width, int height, double frequency_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_ideal", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_ideal_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, VOption *options ) +{ + VImage out; + + call( "mask_ideal_band", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff_x", frequency_cutoff_x )-> + set( "frequency_cutoff_y", frequency_cutoff_y )-> + set( "radius", radius ) ); + + return( out ); +} + +VImage VImage::mask_ideal_ring( int width, int height, double frequency_cutoff, double ringwidth, VOption *options ) +{ + VImage out; + + call( "mask_ideal_ring", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "ringwidth", ringwidth ) ); + + return( out ); +} + +VImage VImage::match( VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options ) const +{ + VImage out; + + call( "match", + (options ? options : VImage::option())-> + set( "ref", *this )-> + set( "out", &out )-> + set( "sec", sec )-> + set( "xr1", xr1 )-> + set( "yr1", yr1 )-> + set( "xs1", xs1 )-> + set( "ys1", ys1 )-> + set( "xr2", xr2 )-> + set( "yr2", yr2 )-> + set( "xs2", xs2 )-> + set( "ys2", ys2 ) ); + + return( out ); +} + +VImage VImage::math( VipsOperationMath math, VOption *options ) const +{ + VImage out; + + call( "math", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "math", math ) ); + + return( out ); +} + +VImage VImage::math2( VImage right, VipsOperationMath2 math2, VOption *options ) const +{ + VImage out; + + call( "math2", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right )-> + set( "math2", math2 ) ); + + return( out ); +} + +VImage VImage::math2_const( VipsOperationMath2 math2, std::vector c, VOption *options ) const +{ + VImage out; + + call( "math2_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "math2", math2 )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::matload( char *filename, VOption *options ) +{ + VImage out; + + call( "matload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::matrixload( char *filename, VOption *options ) +{ + VImage out; + + call( "matrixload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::matrixprint( VOption *options ) const +{ + call( "matrixprint", + (options ? options : VImage::option())-> + set( "in", *this ) ); +} + +void VImage::matrixsave( char *filename, VOption *options ) const +{ + call( "matrixsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +double VImage::max( VOption *options ) const +{ + double out; + + call( "max", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::measure( int h, int v, VOption *options ) const +{ + VImage out; + + call( "measure", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "h", h )-> + set( "v", v ) ); + + return( out ); +} VImage VImage::merge( VImage sec, VipsDirection direction, int dx, int dy, VOption *options ) const { @@ -3071,6 +2020,32 @@ VImage VImage::merge( VImage sec, VipsDirection direction, int dx, int dy, VOpti return( out ); } +double VImage::min( VOption *options ) const +{ + double out; + + call( "min", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::morph( VImage mask, VipsOperationMorphology morph, VOption *options ) const +{ + VImage out; + + call( "morph", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask )-> + set( "morph", morph ) ); + + return( out ); +} + VImage VImage::mosaic( VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VOption *options ) const { VImage out; @@ -3111,61 +2086,27 @@ VImage VImage::mosaic1( VImage sec, VipsDirection direction, int xr1, int yr1, i return( out ); } -VImage VImage::match( VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options ) const +VImage VImage::msb( VOption *options ) const { VImage out; - call( "match", + call( "msb", (options ? options : VImage::option())-> - set( "ref", *this )-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::multiply( VImage right, VOption *options ) const +{ + VImage out; + + call( "multiply", + (options ? options : VImage::option())-> + set( "left", *this )-> set( "out", &out )-> - set( "sec", sec )-> - set( "xr1", xr1 )-> - set( "yr1", yr1 )-> - set( "xs1", xs1 )-> - set( "ys1", ys1 )-> - set( "xr2", xr2 )-> - set( "yr2", yr2 )-> - set( "xs2", xs2 )-> - set( "ys2", ys2 ) ); - - return( out ); -} - -VImage VImage::globalbalance( VOption *options ) const -{ - VImage out; - - call( "globalbalance", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -// These operators have been added recently: - -VImage VImage::CMYK2XYZ( VOption *options ) const -{ - VImage out; - - call( "CMYK2XYZ", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::XYZ2CMYK( VOption *options ) const -{ - VImage out; - - call( "XYZ2CMYK", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); + set( "right", right ) ); return( out ); } @@ -3190,6 +2131,182 @@ void VImage::niftisave( char *filename, VOption *options ) const set( "filename", filename ) ); } +VImage VImage::openexrload( char *filename, VOption *options ) +{ + VImage out; + + call( "openexrload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::openslideload( char *filename, VOption *options ) +{ + VImage out; + + call( "openslideload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pdfload( char *filename, VOption *options ) +{ + VImage out; + + call( "pdfload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pdfload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "pdfload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +int VImage::percent( double percent, VOption *options ) const +{ + int threshold; + + call( "percent", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "threshold", &threshold )-> + set( "percent", percent ) ); + + return( threshold ); +} + +VImage VImage::perlin( int width, int height, VOption *options ) +{ + VImage out; + + call( "perlin", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::phasecor( VImage in2, VOption *options ) const +{ + VImage out; + + call( "phasecor", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "in2", in2 ) ); + + return( out ); +} + +VImage VImage::pngload( char *filename, VOption *options ) +{ + VImage out; + + call( "pngload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pngload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "pngload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::pngsave( char *filename, VOption *options ) const +{ + call( "pngsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::pngsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "pngsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::ppmload( char *filename, VOption *options ) +{ + VImage out; + + call( "ppmload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::ppmsave( char *filename, VOption *options ) const +{ + call( "ppmsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::premultiply( VOption *options ) const +{ + VImage out; + + call( "premultiply", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::profile( VImage *rows, VOption *options ) const +{ + VImage columns; + + call( "profile", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "columns", &columns )-> + set( "rows", rows ) ); + + return( columns ); +} + VipsBlob *VImage::profile_load( char *name, VOption *options ) { VipsBlob *profile; @@ -3202,3 +2319,894 @@ VipsBlob *VImage::profile_load( char *name, VOption *options ) return( profile ); } +VImage VImage::project( VImage *rows, VOption *options ) const +{ + VImage columns; + + call( "project", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "columns", &columns )-> + set( "rows", rows ) ); + + return( columns ); +} + +VImage VImage::quadratic( VImage coeff, VOption *options ) const +{ + VImage out; + + call( "quadratic", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "coeff", coeff ) ); + + return( out ); +} + +VImage VImage::rad2float( VOption *options ) const +{ + VImage out; + + call( "rad2float", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::radload( char *filename, VOption *options ) +{ + VImage out; + + call( "radload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::radsave( char *filename, VOption *options ) const +{ + call( "radsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::radsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "radsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::rank( int width, int height, int index, VOption *options ) const +{ + VImage out; + + call( "rank", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "index", index ) ); + + return( out ); +} + +VImage VImage::rawload( char *filename, int width, int height, int bands, VOption *options ) +{ + VImage out; + + call( "rawload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename )-> + set( "width", width )-> + set( "height", height )-> + set( "bands", bands ) ); + + return( out ); +} + +void VImage::rawsave( char *filename, VOption *options ) const +{ + call( "rawsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +void VImage::rawsave_fd( int fd, VOption *options ) const +{ + call( "rawsave_fd", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "fd", fd ) ); +} + +VImage VImage::recomb( VImage m, VOption *options ) const +{ + VImage out; + + call( "recomb", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "m", m ) ); + + return( out ); +} + +VImage VImage::reduce( double hshrink, double vshrink, VOption *options ) const +{ + VImage out; + + call( "reduce", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::reduceh( double hshrink, VOption *options ) const +{ + VImage out; + + call( "reduceh", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink ) ); + + return( out ); +} + +VImage VImage::reducev( double vshrink, VOption *options ) const +{ + VImage out; + + call( "reducev", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::relational( VImage right, VipsOperationRelational relational, VOption *options ) const +{ + VImage out; + + call( "relational", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right )-> + set( "relational", relational ) ); + + return( out ); +} + +VImage VImage::relational_const( VipsOperationRelational relational, std::vector c, VOption *options ) const +{ + VImage out; + + call( "relational_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "relational", relational )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::remainder( VImage right, VOption *options ) const +{ + VImage out; + + call( "remainder", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::remainder_const( std::vector c, VOption *options ) const +{ + VImage out; + + call( "remainder_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::replicate( int across, int down, VOption *options ) const +{ + VImage out; + + call( "replicate", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "across", across )-> + set( "down", down ) ); + + return( out ); +} + +VImage VImage::resize( double scale, VOption *options ) const +{ + VImage out; + + call( "resize", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "scale", scale ) ); + + return( out ); +} + +VImage VImage::rot( VipsAngle angle, VOption *options ) const +{ + VImage out; + + call( "rot", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "angle", angle ) ); + + return( out ); +} + +VImage VImage::rot45( VOption *options ) const +{ + VImage out; + + call( "rot45", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::rotate( double angle, VOption *options ) const +{ + VImage out; + + call( "rotate", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "angle", angle ) ); + + return( out ); +} + +VImage VImage::round( VipsOperationRound round, VOption *options ) const +{ + VImage out; + + call( "round", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "round", round ) ); + + return( out ); +} + +VImage VImage::sRGB2HSV( VOption *options ) const +{ + VImage out; + + call( "sRGB2HSV", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sRGB2scRGB( VOption *options ) const +{ + VImage out; + + call( "sRGB2scRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scRGB2BW( VOption *options ) const +{ + VImage out; + + call( "scRGB2BW", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scRGB2XYZ( VOption *options ) const +{ + VImage out; + + call( "scRGB2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scRGB2sRGB( VOption *options ) const +{ + VImage out; + + call( "scRGB2sRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scale( VOption *options ) const +{ + VImage out; + + call( "scale", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sequential( VOption *options ) const +{ + VImage out; + + call( "sequential", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sharpen( VOption *options ) const +{ + VImage out; + + call( "sharpen", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::shrink( double hshrink, double vshrink, VOption *options ) const +{ + VImage out; + + call( "shrink", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::shrinkh( int hshrink, VOption *options ) const +{ + VImage out; + + call( "shrinkh", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink ) ); + + return( out ); +} + +VImage VImage::shrinkv( int vshrink, VOption *options ) const +{ + VImage out; + + call( "shrinkv", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::sign( VOption *options ) const +{ + VImage out; + + call( "sign", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::similarity( VOption *options ) const +{ + VImage out; + + call( "similarity", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sines( int width, int height, VOption *options ) +{ + VImage out; + + call( "sines", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::smartcrop( int width, int height, VOption *options ) const +{ + VImage out; + + call( "smartcrop", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::sobel( VOption *options ) const +{ + VImage out; + + call( "sobel", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::spcor( VImage ref, VOption *options ) const +{ + VImage out; + + call( "spcor", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "ref", ref ) ); + + return( out ); +} + +VImage VImage::spectrum( VOption *options ) const +{ + VImage out; + + call( "spectrum", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::stats( VOption *options ) const +{ + VImage out; + + call( "stats", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::stdif( int width, int height, VOption *options ) const +{ + VImage out; + + call( "stdif", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::subsample( int xfac, int yfac, VOption *options ) const +{ + VImage out; + + call( "subsample", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "xfac", xfac )-> + set( "yfac", yfac ) ); + + return( out ); +} + +VImage VImage::subtract( VImage right, VOption *options ) const +{ + VImage out; + + call( "subtract", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::sum( std::vector in, VOption *options ) +{ + VImage out; + + call( "sum", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::svgload( char *filename, VOption *options ) +{ + VImage out; + + call( "svgload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::svgload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "svgload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::system( char *cmd_format, VOption *options ) +{ + call( "system", + (options ? options : VImage::option())-> + set( "cmd_format", cmd_format ) ); +} + +VImage VImage::text( char *text, VOption *options ) +{ + VImage out; + + call( "text", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "text", text ) ); + + return( out ); +} + +VImage VImage::thumbnail( char *filename, int width, VOption *options ) +{ + VImage out; + + call( "thumbnail", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename )-> + set( "width", width ) ); + + return( out ); +} + +VImage VImage::thumbnail_buffer( VipsBlob *buffer, int width, VOption *options ) +{ + VImage out; + + call( "thumbnail_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer )-> + set( "width", width ) ); + + return( out ); +} + +VImage VImage::thumbnail_image( int width, VOption *options ) const +{ + VImage out; + + call( "thumbnail_image", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width ) ); + + return( out ); +} + +VImage VImage::tiffload( char *filename, VOption *options ) +{ + VImage out; + + call( "tiffload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::tiffload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "tiffload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::tiffsave( char *filename, VOption *options ) const +{ + call( "tiffsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::tiffsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "tiffsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::tilecache( VOption *options ) const +{ + VImage out; + + call( "tilecache", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::tonelut( VOption *options ) +{ + VImage out; + + call( "tonelut", + (options ? options : VImage::option())-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::transpose3d( VOption *options ) const +{ + VImage out; + + call( "transpose3d", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::unpremultiply( VOption *options ) const +{ + VImage out; + + call( "unpremultiply", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::vipsload( char *filename, VOption *options ) +{ + VImage out; + + call( "vipsload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::vipssave( char *filename, VOption *options ) const +{ + call( "vipssave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::webpload( char *filename, VOption *options ) +{ + VImage out; + + call( "webpload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::webpload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "webpload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::webpsave( char *filename, VOption *options ) const +{ + call( "webpsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::webpsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "webpsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::worley( int width, int height, VOption *options ) +{ + VImage out; + + call( "worley", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::wrap( VOption *options ) const +{ + VImage out; + + call( "wrap", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::xyz( int width, int height, VOption *options ) +{ + VImage out; + + call( "xyz", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::zone( int width, int height, VOption *options ) +{ + VImage out; + + call( "zone", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::zoom( int xfac, int yfac, VOption *options ) const +{ + VImage out; + + call( "zoom", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "xfac", xfac )-> + set( "yfac", yfac ) ); + + return( out ); +}