diff --git a/TODO b/TODO index b105eeef..ca213115 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,23 @@ -- remove VipsCollect +- output arrays need an extra * in + + body must be: + + std::vector *out_array; + + call( "thing", options->set( "out-array", &out_array ) ); + + and call will new() a vector and place the pointer in out_array + + alternative: + + std::vector out_array; + + call( "thing", options->set( "out-array", &out_array ) ); + + now the caller must pass in an empty vector (or not?) which we fill (or + empty?) ... seems odd, but makes lifetime management much simpler + + diff --git a/cplusplus/Makefile.am b/cplusplus/Makefile.am index 08fa22dd..f67b6504 100644 --- a/cplusplus/Makefile.am +++ b/cplusplus/Makefile.am @@ -19,17 +19,14 @@ libvips_cc_la_LDFLAGS = \ libvips_cc_la_LIBADD = \ $(top_builddir)/libvips/libvips.la @VIPS_LIBS@ -# swap the 'awk' line for this: -# awk '{if($$1!="deprecated") print $$1}'` ; \ -# to not generate the wrappers for deprecated functions vips-operators.cc: - packages=`vips list packages | \ - awk '{print $$1}'` ; \ - echo > vips-operators.cc ; \ - for name in $$packages; do \ - echo "// bodies for package $$name" >> vips-operators.cc ; \ - vips cppc $$name >> vips-operators.cc ; \ - echo >> vips-operators.cc ; \ - done + echo "// bodies for vips operations" > vips-operators.cc; \ + echo -n "// " >> vips-operators.cc; \ + date >> vips-operators.cc; \ + echo "// this file is generated automatically, do not edit!" >> vips-operators.cc; \ + echo "" >> vips-operators.cc; \ + ./gen-operators.py >> vips-operators.cc -EXTRA_DIST = vips-operators.cc +EXTRA_DIST = \ + vips-operators.cc \ + gen-operators.py diff --git a/cplusplus/VImage.cc b/cplusplus/VImage.cc index 8ef35d96..52795483 100644 --- a/cplusplus/VImage.cc +++ b/cplusplus/VImage.cc @@ -90,6 +90,52 @@ VOption *VOption::set( const char *name, VImage value ) return( this ); } +// input double array +VOption *VOption::set( const char *name, std::vector value ) +{ + Pair *pair = new Pair( name ); + + double *array; + unsigned int i; + + pair->input = true; + + vips_value_set_array_double( &pair->value, NULL, value.size() ); + array = vips_value_get_array_double( &pair->value, NULL ); + + for( i = 0; i < value.size(); i++ ) + array[i] = value[i]; + + options.push_back( pair ); + + return( this ); +} + +// input image array +VOption *VOption::set( const char *name, std::vector value ) +{ + Pair *pair = new Pair( name ); + + VipsImage **array; + unsigned int i; + + pair->input = true; + + vips_value_set_array_image( &pair->value, value.size() ); + array = vips_value_get_array_image( &pair->value, NULL ); + + for( i = 0; i < value.size(); i++ ) { + VipsImage *vips_image = value[i].get_image(); + + array[i] = vips_image; + g_object_ref( vips_image ); + } + + options.push_back( pair ); + + return( this ); +} + // output image VOption *VOption::set( const char *name, VImage *value ) { @@ -105,6 +151,50 @@ VOption *VOption::set( const char *name, VImage *value ) return( this ); } +// output double +VOption *VOption::set( const char *name, double *value ) +{ + Pair *pair = new Pair( name ); + + // note where we will write the VImage on success + pair->input = false; + pair->vdouble = value; + g_value_init( &pair->value, G_TYPE_DOUBLE ); + + options.push_back( pair ); + + return( this ); +} + +// output int +VOption *VOption::set( const char *name, int *value ) +{ + Pair *pair = new Pair( name ); + + // note where we will write the VImage on success + pair->input = false; + pair->vint = value; + g_value_init( &pair->value, G_TYPE_INT ); + + options.push_back( pair ); + + return( this ); +} + +// output doublearray +VOption *VOption::set( const char *name, std::vector **value ) +{ + Pair *pair = new Pair( name ); + + // note where we will write the VImage on success + pair->input = false; + pair->vdoublearray = value; + + options.push_back( pair ); + + return( this ); +} + // walk the options and set props on the operation void VOption::set_operation( VipsOperation *operation ) { @@ -133,23 +223,45 @@ void VOption::get_operation( VipsOperation *operation ) for( i = options.begin(); i != options.end(); i++ ) if( not (*i)->input ) { + const char *name = (*i)->name; + GValue *value = &(*i)->value; + g_object_get_property( G_OBJECT( operation ), - (*i)->name, &(*i)->value ); + name, value ); #ifdef DEBUG printf( "get_operation: " ); vips_object_print_name( VIPS_OBJECT( operation ) ); - char *str_value = - g_strdup_value_contents( &(*i)->value ); - printf( ".%s = %s\n", (*i)->name, str_value ); + char *str_value = g_strdup_value_contents( value ); + printf( ".%s = %s\n", name, str_value ); g_free( str_value ); #endif /*DEBUG*/ - // rebox object - VipsImage *image = VIPS_IMAGE( - g_value_get_object( &(*i)->value ) ); - if( (*i)->vimage ) + GType type = G_VALUE_TYPE( value ); + if( type == VIPS_TYPE_IMAGE ) { + // rebox object + VipsImage *image = VIPS_IMAGE( + g_value_get_object( value ) ); *((*i)->vimage) = VImage( image ); + } + else if( type == G_TYPE_INT ) + *((*i)->vint) = g_value_get_int( value ); + else if( type == G_TYPE_DOUBLE ) + *((*i)->vint) = g_value_get_double( value ); + else if( type == VIPS_TYPE_ARRAY_DOUBLE ) { + int length; + double *array = + vips_value_get_array_double( value, + &length ); + std::vector *vector = + new std::vector( length ); + int j; + + for( j = 0; j < length; j++ ) + (*vector)[j] = array[j]; + + *((*i)->vdoublearray) = vector; + } } } diff --git a/cplusplus/gen-operators.py b/cplusplus/gen-operators.py new file mode 100755 index 00000000..bcc2add1 --- /dev/null +++ b/cplusplus/gen-operators.py @@ -0,0 +1,193 @@ +#!/usr/bin/python + +# walk vips and generate member definitions for all operators + +# sample member definition: + +# VImage VImage::invert( VOption *options ) +# throw( VError ) +# { +# VImage out; +# +# call( "invert", +# (options ? options : VImage::option())-> +# set( "in", *this )-> +# set( "out", &out ) ); +# +# return( out ); +# } + +import sys +import re + +import logging +#logging.basicConfig(level = logging.DEBUG) + +from gi.repository import Vips, GObject + +vips_type_image = GObject.GType.from_name("VipsImage") +vips_type_operation = GObject.GType.from_name("VipsOperation") +param_enum = GObject.GType.from_name("GParamEnum") + +# turn a GType into a C++ type +gtype_to_cpp = { + "VipsImage" : "VImage", + "gint" : "int", + "gdouble" : "double", + "gboolean" : "bool", + "gchararray" : "char *", + "VipsArrayDouble" : "std::vector", + "VipsArrayImage" : "std::vector", + "VipsBlob" : "void *" +} + +def get_ctype(prop): + # enum params use the C name as their name + if GObject.type_is_a(param_enum, prop): + return prop.value_type.name + + return gtype_to_cpp[prop.value_type.name] + +def find_required(op): + required = [] + for prop in op.props: + flags = op.get_argument_flags(prop.name) + if not flags & Vips.ArgumentFlags.REQUIRED: + continue + + required.append(prop) + + return required + +# find the first input image ... this will be used as "this" +def find_first_input_image(op, required): + found = False + for prop in required: + flags = op.get_argument_flags(prop.name) + if not flags & Vips.ArgumentFlags.INPUT: + continue + if GObject.type_is_a(vips_type_image, prop.value_type): + found = True + break + + if not found: + return None + + return prop + +# find the first output arg ... this will be used as the result +def find_first_output(op, required): + found = False + for prop in required: + flags = op.get_argument_flags(prop.name) + if not flags & Vips.ArgumentFlags.OUTPUT: + continue + found = True + break + + if not found: + return None + + return prop + +# swap any "-" for "_" +def cppize(name): + return re.sub('-', '_', name) + +def gen_arg_list(required): + first = True + for prop in required: + if not first: + print ',', + else: + first = False + + print get_ctype(prop), + print cppize(prop.name), + + if not first: + print ',', + print 'VOption *options', + +def gen_operation(cls): + op = Vips.Operation.new(cls.name) + gtype = Vips.type_find("VipsOperation", cls.name) + nickname = Vips.nickname_find(gtype) + all_required = find_required(op) + + result = find_first_output(op, all_required) + this = find_first_input_image(op, all_required) + + # shallow copy + required = all_required[:] + if result != None: + required.remove(result) + if this != None: + required.remove(this) + + if result == None: + print 'void', + else: + print '%s' % gtype_to_cpp[result.value_type.name], + + print 'VImage::%s(' % nickname, + + gen_arg_list(required) + + print ')' + print ' throw( VError )' + print '{' + if result != None: + print ' %s %s;' % (get_ctype(result), cppize(result.name)) + print '' + + print ' call( "%s"' % nickname, + + first = True + for prop in all_required: + if first: + print ',' + print ' (options ? options : VImage::option())', + first = False + + print '->' + print ' ', + if prop == this: + print 'set( "%s", *this )' % prop.name, + else: + flags = op.get_argument_flags(prop.name) + arg = cppize(prop.name) + if flags & Vips.ArgumentFlags.OUTPUT: + arg = '&' + arg + + print 'set( "%s", %s )' % (prop.name, arg), + + print ');' + + if result != None: + print '' + print ' return( %s );' % cppize(result.name) + + print '}' + print '' + +# we have a few synonyms ... don't generate twice +generated = {} + +def find_class_methods(cls): + if not cls.is_abstract(): + gtype = Vips.type_find("VipsOperation", cls.name) + nickname = Vips.nickname_find(gtype) + if not nickname in generated: + gen_operation(cls) + generated[nickname] = True + + if len(cls.children) > 0: + for child in cls.children: + # not easy to get at the deprecated flag in an abtract type? + if cls.name != 'VipsWrap7': + find_class_methods(child) + +if __name__ == '__main__': + find_class_methods(vips_type_operation) + diff --git a/cplusplus/include/vips/Makefile.am b/cplusplus/include/vips/Makefile.am index c14ef992..dd9db403 100644 --- a/cplusplus/include/vips/Makefile.am +++ b/cplusplus/include/vips/Makefile.am @@ -4,15 +4,13 @@ pkginclude_HEADERS = \ vips8 \ vips-operators.h -# swap the 'awk' line for this: -# awk '{if($$1!="deprecated") print $$1}'` ; \ -# to not generate the wrappers for deprecated functions vips-operators.h: - packages=`vips list packages | \ - awk '{print $$1}'` ; \ - echo > vips-operators.h ; \ - for name in $$packages; do \ - echo "// headers for package $$name" >> vips-operators.h ; \ - vips cpph $$name >> vips-operators.h ; \ - echo >> vips-operators.h ; \ - done + echo "// headers for vips operations" > 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 + +EXTRA_DIST = \ + gen-operators-h.py diff --git a/cplusplus/include/vips/VImage8.h b/cplusplus/include/vips/VImage8.h index fd94213e..0b555323 100644 --- a/cplusplus/include/vips/VImage8.h +++ b/cplusplus/include/vips/VImage8.h @@ -167,9 +167,20 @@ private: // from the arg to set() bool input; - // we need to box and unbox VImage ... keep a pointer to the - // VImage from C++ here - VImage *vimage; + union { + // we need to box and unbox VImage ... keep a pointer + // to the VImage from C++ here + VImage *vimage; + + // output double + double *vdouble; + + // output int + int *vint; + + // output doublearray + std::vector **vdoublearray; + }; Pair( const char *name ) : name( name ), input( false ), vimage( 0 ) @@ -196,6 +207,12 @@ public: VOption *set( const char *name, int value ); VOption *set( const char *name, VImage value ); VOption *set( const char *name, VImage *value ); + VOption *set( const char *name, std::vector value ); + VOption *set( const char *name, std::vector value ); + + VOption *set( const char *name, int *value ); + VOption *set( const char *name, double *value ); + VOption *set( const char *name, std::vector **value ); void set_operation( VipsOperation *operation ); void get_operation( VipsOperation *operation ); diff --git a/cplusplus/include/vips/gen-operators-h.py b/cplusplus/include/vips/gen-operators-h.py new file mode 100755 index 00000000..7f4e3203 --- /dev/null +++ b/cplusplus/include/vips/gen-operators-h.py @@ -0,0 +1,153 @@ +#!/usr/bin/python + +# walk vips and generate headers for all operators + +# sample member declaration : + +# VImage invert( VOption *options = 0 ) +# throw( VError ); + +import sys +import re + +import logging +#logging.basicConfig(level = logging.DEBUG) + +from gi.repository import Vips, GObject + +vips_type_image = GObject.GType.from_name("VipsImage") +vips_type_operation = GObject.GType.from_name("VipsOperation") +param_enum = GObject.GType.from_name("GParamEnum") + +# turn a GType into a C++ type +gtype_to_cpp = { + "VipsImage" : "VImage", + "gint" : "int", + "gdouble" : "double", + "gboolean" : "bool", + "gchararray" : "char *", + "VipsArrayDouble" : "std::vector", + "VipsArrayImage" : "std::vector", + "VipsBlob" : "void *" +} + +def get_ctype(prop): + # enum params use the C name as their name + if GObject.type_is_a(param_enum, prop): + return prop.value_type.name + + return gtype_to_cpp[prop.value_type.name] + +def find_required(op): + required = [] + for prop in op.props: + flags = op.get_argument_flags(prop.name) + if not flags & Vips.ArgumentFlags.REQUIRED: + continue + + required.append(prop) + + return required + +# find the first input image ... this will be used as "this" +def find_first_input_image(op, required): + found = False + for prop in required: + flags = op.get_argument_flags(prop.name) + if not flags & Vips.ArgumentFlags.INPUT: + continue + if GObject.type_is_a(vips_type_image, prop.value_type): + found = True + break + + if not found: + return None + + return prop + +# find the first output arg ... this will be used as the result +def find_first_output(op, required): + found = False + for prop in required: + flags = op.get_argument_flags(prop.name) + if not flags & Vips.ArgumentFlags.OUTPUT: + continue + found = True + break + + if not found: + return None + + return prop + +# swap any "-" for "_" +def cppize(name): + return re.sub('-', '_', name) + +def gen_arg_list(required): + first = True + for prop in required: + if not first: + print ',', + else: + first = False + + print get_ctype(prop), + print cppize(prop.name), + + if not first: + print ',', + print 'VOption *options = 0', + +def gen_operation(cls): + op = Vips.Operation.new(cls.name) + gtype = Vips.type_find("VipsOperation", cls.name) + nickname = Vips.nickname_find(gtype) + all_required = find_required(op) + + result = find_first_output(op, all_required) + this = find_first_input_image(op, all_required) + + # shallow copy + required = all_required[:] + if result != None: + required.remove(result) + if this != None: + required.remove(this) + + # no "this" available, it's a class method + if this == None: + print 'static', + + if result == None: + print 'void', + else: + print '%s' % gtype_to_cpp[result.value_type.name], + + print '%s(' % nickname, + + gen_arg_list(required) + + print ')' + print ' throw( VError );' + +# we have a few synonyms ... don't generate twice +generated = {} + +def find_class_methods(cls): + if not cls.is_abstract(): + gtype = Vips.type_find("VipsOperation", cls.name) + nickname = Vips.nickname_find(gtype) + if not nickname in generated: + gen_operation(cls) + generated[nickname] = True + + if len(cls.children) > 0: + for child in cls.children: + # not easy to get at the deprecated flag in an abtract type? + if cls.name != 'VipsWrap7': + find_class_methods(child) + +if __name__ == '__main__': + find_class_methods(vips_type_operation) + diff --git a/cplusplus/include/vips/vips-operators.h b/cplusplus/include/vips/vips-operators.h index 6f75c822..a4f3ea83 100644 --- a/cplusplus/include/vips/vips-operators.h +++ b/cplusplus/include/vips/vips-operators.h @@ -1 +1,412 @@ -VImage invert( VOption *options = 0 ) throw( VError ); +// headers for vips operations +// Mon Oct 27 17:00:38 GMT 2014 +// this file is generated automatically, do not edit! + +static void system( char * cmd_format , VOption *options = 0 ) + throw( VError ); +VImage add( VImage right , VOption *options = 0 ) + throw( VError ); +VImage subtract( VImage right , VOption *options = 0 ) + throw( VError ); +VImage multiply( VImage right , VOption *options = 0 ) + throw( VError ); +VImage divide( VImage right , VOption *options = 0 ) + throw( VError ); +VImage relational( VImage right , VipsOperationRelational relational , VOption *options = 0 ) + throw( VError ); +VImage remainder( VImage right , VOption *options = 0 ) + throw( VError ); +VImage boolean( VImage right , VipsOperationBoolean boolean , VOption *options = 0 ) + throw( VError ); +VImage math2( VImage right , VipsOperationMath2 math2 , VOption *options = 0 ) + throw( VError ); +VImage complex2( VImage right , VipsOperationComplex2 cmplx , VOption *options = 0 ) + throw( VError ); +VImage complexform( VImage right , VOption *options = 0 ) + throw( VError ); +static VImage sum( std::vector in , VOption *options = 0 ) + throw( VError ); +VImage invert( VOption *options = 0 ) + throw( VError ); +VImage linear( std::vector a , std::vector b , VOption *options = 0 ) + throw( VError ); +VImage math( VipsOperationMath math , VOption *options = 0 ) + throw( VError ); +VImage abs( VOption *options = 0 ) + throw( VError ); +VImage sign( VOption *options = 0 ) + throw( VError ); +VImage round( VipsOperationRound round , VOption *options = 0 ) + throw( VError ); +VImage relational_const( std::vector c , VipsOperationRelational relational , VOption *options = 0 ) + throw( VError ); +VImage remainder_const( std::vector c , VOption *options = 0 ) + throw( VError ); +VImage boolean_const( std::vector c , VipsOperationBoolean boolean , VOption *options = 0 ) + throw( VError ); +VImage math2_const( std::vector c , VipsOperationMath2 math2 , VOption *options = 0 ) + throw( VError ); +VImage complex( VipsOperationComplex cmplx , VOption *options = 0 ) + throw( VError ); +VImage complexget( VipsOperationComplexget get , VOption *options = 0 ) + throw( VError ); +double avg( VOption *options = 0 ) + throw( VError ); +double min( VOption *options = 0 ) + throw( VError ); +double max( VOption *options = 0 ) + throw( VError ); +double deviate( VOption *options = 0 ) + throw( VError ); +VImage stats( VOption *options = 0 ) + throw( VError ); +VImage hist_find( VOption *options = 0 ) + throw( VError ); +VImage hist_find_ndim( VOption *options = 0 ) + throw( VError ); +VImage hist_find_indexed( VImage index , VOption *options = 0 ) + throw( VError ); +VImage hough_line( VOption *options = 0 ) + throw( VError ); +VImage hough_circle( VOption *options = 0 ) + throw( VError ); +VImage project( VImage rows , VOption *options = 0 ) + throw( VError ); +VImage profile( VImage rows , VOption *options = 0 ) + throw( VError ); +VImage measure( int h , int v , VOption *options = 0 ) + throw( VError ); +std::vector getpoint( int x , int y , VOption *options = 0 ) + throw( VError ); +VImage copy( VOption *options = 0 ) + throw( VError ); +VImage blockcache( VOption *options = 0 ) + throw( VError ); +VImage tilecache( VOption *options = 0 ) + throw( VError ); +VImage linecache( VOption *options = 0 ) + throw( VError ); +VImage sequential( VOption *options = 0 ) + throw( VError ); +VImage cache( VOption *options = 0 ) + throw( VError ); +VImage embed( int x , int y , int width , int height , VOption *options = 0 ) + throw( VError ); +VImage flip( VipsDirection direction , VOption *options = 0 ) + throw( VError ); +VImage insert( VImage sub , int x , int y , VOption *options = 0 ) + throw( VError ); +VImage join( VImage in2 , VipsDirection direction , VOption *options = 0 ) + throw( VError ); +VImage extract_area( int left , int top , int width , int height , VOption *options = 0 ) + throw( VError ); +VImage extract_band( int band , VOption *options = 0 ) + throw( VError ); +static VImage bandjoin( std::vector in , VOption *options = 0 ) + throw( VError ); +static VImage bandrank( std::vector in , VOption *options = 0 ) + throw( VError ); +VImage bandmean( VOption *options = 0 ) + throw( VError ); +VImage bandbool( VipsOperationBoolean boolean , VOption *options = 0 ) + throw( VError ); +VImage replicate( int across , int down , VOption *options = 0 ) + throw( VError ); +VImage cast( VipsBandFormat format , VOption *options = 0 ) + throw( VError ); +VImage rot( VipsAngle angle , VOption *options = 0 ) + throw( VError ); +VImage rot45( VOption *options = 0 ) + throw( VError ); +VImage autorot( VOption *options = 0 ) + throw( VError ); +VImage ifthenelse( VImage in1 , VImage in2 , VOption *options = 0 ) + throw( VError ); +VImage recomb( VImage m , VOption *options = 0 ) + throw( VError ); +VImage flatten( VOption *options = 0 ) + throw( VError ); +VImage grid( int tile_height , int across , int down , VOption *options = 0 ) + throw( VError ); +VImage scale( VOption *options = 0 ) + throw( VError ); +VImage wrap( VOption *options = 0 ) + throw( VError ); +VImage zoom( int xfac , int yfac , VOption *options = 0 ) + throw( VError ); +VImage subsample( int xfac , int yfac , VOption *options = 0 ) + throw( VError ); +VImage msb( VOption *options = 0 ) + throw( VError ); +VImage falsecolour( VOption *options = 0 ) + throw( VError ); +VImage gamma( VOption *options = 0 ) + throw( VError ); +static VImage black( int width , int height , VOption *options = 0 ) + throw( VError ); +static VImage gaussnoise( int width , int height , VOption *options = 0 ) + throw( VError ); +static VImage text( char * text , VOption *options = 0 ) + throw( VError ); +static VImage xyz( int width , int height , VOption *options = 0 ) + throw( VError ); +static VImage gaussmat( double sigma , double min_ampl , VOption *options = 0 ) + throw( VError ); +static VImage logmat( double sigma , double min_ampl , VOption *options = 0 ) + throw( VError ); +static VImage eye( int width , int height , VOption *options = 0 ) + throw( VError ); +static VImage grey( int width , int height , VOption *options = 0 ) + throw( VError ); +static VImage zone( int width , int height , VOption *options = 0 ) + throw( VError ); +static VImage sines( int width , int height , VOption *options = 0 ) + throw( VError ); +static VImage mask_ideal( int width , int height , double frequency_cutoff , VOption *options = 0 ) + throw( VError ); +static VImage mask_ideal_ring( int width , int height , double frequency_cutoff , double ringwidth , VOption *options = 0 ) + throw( VError ); +static VImage mask_ideal_band( int width , int height , double frequency_cutoff_x , double frequency_cutoff_y , double radius , VOption *options = 0 ) + throw( VError ); +static VImage mask_butterworth( int width , int height , double order , double frequency_cutoff , double amplitude_cutoff , VOption *options = 0 ) + throw( VError ); +static VImage mask_butterworth_ring( int width , int height , double order , double frequency_cutoff , double amplitude_cutoff , double ringwidth , VOption *options = 0 ) + throw( VError ); +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 ) + throw( VError ); +static VImage mask_gaussian( int width , int height , double frequency_cutoff , double amplitude_cutoff , VOption *options = 0 ) + throw( VError ); +static VImage mask_gaussian_ring( int width , int height , double frequency_cutoff , double amplitude_cutoff , double ringwidth , VOption *options = 0 ) + throw( VError ); +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 ) + throw( VError ); +static VImage mask_fractal( int width , int height , double fractal_dimension , VOption *options = 0 ) + throw( VError ); +VImage buildlut( VOption *options = 0 ) + throw( VError ); +VImage invertlut( VOption *options = 0 ) + throw( VError ); +static VImage tonelut( VOption *options = 0 ) + throw( VError ); +static VImage identity( VOption *options = 0 ) + throw( VError ); +static VImage fractsurf( int width , int height , double fractal_dimension , VOption *options = 0 ) + throw( VError ); +static VImage radload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage ppmload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage csvload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage matrixload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage analyzeload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage rawload( char * filename , int width , int height , int bands , VOption *options = 0 ) + throw( VError ); +static VImage vipsload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage pngload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage pngload_buffer( void * buffer , VOption *options = 0 ) + throw( VError ); +static VImage matload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage jpegload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage jpegload_buffer( void * buffer , VOption *options = 0 ) + throw( VError ); +static VImage webpload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage webpload_buffer( void * buffer , VOption *options = 0 ) + throw( VError ); +static VImage tiffload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage tiffload_buffer( void * buffer , VOption *options = 0 ) + throw( VError ); +static VImage openslideload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage magickload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage fitsload( char * filename , VOption *options = 0 ) + throw( VError ); +static VImage openexrload( char * filename , VOption *options = 0 ) + throw( VError ); +void radsave( char * filename , VOption *options = 0 ) + throw( VError ); +void ppmsave( char * filename , VOption *options = 0 ) + throw( VError ); +void csvsave( char * filename , VOption *options = 0 ) + throw( VError ); +void matrixsave( char * filename , VOption *options = 0 ) + throw( VError ); +void matrixprint( VOption *options = 0 ) + throw( VError ); +void rawsave( char * filename , VOption *options = 0 ) + throw( VError ); +void rawsave_fd( int fd , VOption *options = 0 ) + throw( VError ); +void vipssave( char * filename , VOption *options = 0 ) + throw( VError ); +void dzsave( char * filename , VOption *options = 0 ) + throw( VError ); +void pngsave( char * filename , VOption *options = 0 ) + throw( VError ); +void * pngsave_buffer( VOption *options = 0 ) + throw( VError ); +void jpegsave( char * filename , VOption *options = 0 ) + throw( VError ); +void * jpegsave_buffer( VOption *options = 0 ) + throw( VError ); +void jpegsave_mime( VOption *options = 0 ) + throw( VError ); +void webpsave( char * filename , VOption *options = 0 ) + throw( VError ); +void * webpsave_buffer( VOption *options = 0 ) + throw( VError ); +void tiffsave( char * filename , VOption *options = 0 ) + throw( VError ); +void fitssave( char * filename , VOption *options = 0 ) + throw( VError ); +VImage shrink( double xshrink , double yshrink , VOption *options = 0 ) + throw( VError ); +VImage quadratic( VImage coeff , VOption *options = 0 ) + throw( VError ); +VImage affine( std::vector matrix , VOption *options = 0 ) + throw( VError ); +VImage similarity( VOption *options = 0 ) + throw( VError ); +VImage resize( double h_scale , double v_scale , VOption *options = 0 ) + throw( VError ); +VImage colourspace( VipsInterpretation space , VOption *options = 0 ) + throw( VError ); +VImage Lab2XYZ( VOption *options = 0 ) + throw( VError ); +VImage XYZ2Lab( VOption *options = 0 ) + throw( VError ); +VImage Lab2LCh( VOption *options = 0 ) + throw( VError ); +VImage LCh2Lab( VOption *options = 0 ) + throw( VError ); +VImage LCh2CMC( VOption *options = 0 ) + throw( VError ); +VImage CMC2LCh( VOption *options = 0 ) + throw( VError ); +VImage XYZ2Yxy( VOption *options = 0 ) + throw( VError ); +VImage Yxy2XYZ( VOption *options = 0 ) + throw( VError ); +VImage scRGB2XYZ( VOption *options = 0 ) + throw( VError ); +VImage XYZ2scRGB( VOption *options = 0 ) + throw( VError ); +VImage LabQ2Lab( VOption *options = 0 ) + throw( VError ); +VImage Lab2LabQ( VOption *options = 0 ) + throw( VError ); +VImage LabQ2LabS( VOption *options = 0 ) + throw( VError ); +VImage LabS2LabQ( VOption *options = 0 ) + throw( VError ); +VImage LabS2Lab( VOption *options = 0 ) + throw( VError ); +VImage Lab2LabS( VOption *options = 0 ) + throw( VError ); +VImage rad2float( VOption *options = 0 ) + throw( VError ); +VImage float2rad( VOption *options = 0 ) + throw( VError ); +VImage LabQ2sRGB( VOption *options = 0 ) + throw( VError ); +VImage sRGB2scRGB( VOption *options = 0 ) + throw( VError ); +VImage scRGB2sRGB( VOption *options = 0 ) + throw( VError ); +VImage icc_import( VOption *options = 0 ) + throw( VError ); +VImage icc_export( VOption *options = 0 ) + throw( VError ); +VImage icc_transform( char * output_profile , VOption *options = 0 ) + throw( VError ); +VImage dE76( VImage right , VOption *options = 0 ) + throw( VError ); +VImage dE00( VImage right , VOption *options = 0 ) + throw( VError ); +VImage dECMC( VImage right , VOption *options = 0 ) + throw( VError ); +VImage maplut( VImage lut , VOption *options = 0 ) + throw( VError ); +int percent( double percent , VOption *options = 0 ) + throw( VError ); +VImage stdif( int width , int height , VOption *options = 0 ) + throw( VError ); +VImage hist_cum( VOption *options = 0 ) + throw( VError ); +VImage hist_match( VImage ref , VOption *options = 0 ) + throw( VError ); +VImage hist_norm( VOption *options = 0 ) + throw( VError ); +VImage hist_equal( VOption *options = 0 ) + throw( VError ); +VImage hist_plot( VOption *options = 0 ) + throw( VError ); +VImage hist_local( int width , int height , VOption *options = 0 ) + throw( VError ); +bool hist_ismonotonic( VOption *options = 0 ) + throw( VError ); +VImage conv( VImage mask , VOption *options = 0 ) + throw( VError ); +VImage compass( VImage mask , VOption *options = 0 ) + throw( VError ); +VImage convsep( VImage mask , VOption *options = 0 ) + throw( VError ); +VImage fastcor( VImage ref , VOption *options = 0 ) + throw( VError ); +VImage spcor( VImage ref , VOption *options = 0 ) + throw( VError ); +VImage sharpen( VOption *options = 0 ) + throw( VError ); +VImage gaussblur( int radius , VOption *options = 0 ) + throw( VError ); +VImage fwfft( VOption *options = 0 ) + throw( VError ); +VImage invfft( VOption *options = 0 ) + throw( VError ); +VImage freqmult( VImage mask , VOption *options = 0 ) + throw( VError ); +VImage spectrum( VOption *options = 0 ) + throw( VError ); +VImage phasecor( VImage in2 , VOption *options = 0 ) + throw( VError ); +VImage morph( VImage mask , VipsOperationMorphology morph , VOption *options = 0 ) + throw( VError ); +VImage rank( int width , int height , int index , VOption *options = 0 ) + throw( VError ); +double countlines( VipsDirection direction , VOption *options = 0 ) + throw( VError ); +VImage labelregions( VOption *options = 0 ) + throw( VError ); +void draw_rect( std::vector ink , int left , int top , int width , int height , VOption *options = 0 ) + throw( VError ); +void draw_mask( std::vector ink , VImage mask , int x , int y , VOption *options = 0 ) + throw( VError ); +void draw_line( std::vector ink , int x1 , int y1 , int x2 , int y2 , VOption *options = 0 ) + throw( VError ); +void draw_circle( std::vector ink , int cx , int cy , int radius , VOption *options = 0 ) + throw( VError ); +void draw_flood( std::vector ink , int x , int y , VOption *options = 0 ) + throw( VError ); +void draw_image( VImage sub , int x , int y , VOption *options = 0 ) + throw( VError ); +void draw_smudge( int left , int top , int width , int height , VOption *options = 0 ) + throw( VError ); +VImage merge( VImage sec , VipsDirection direction , int dx , int dy , VOption *options = 0 ) + throw( VError ); +VImage mosaic( VImage sec , VipsDirection direction , int xref , int yref , int xsec , int ysec , VOption *options = 0 ) + throw( VError ); +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 ) + throw( VError ); +VImage match( VImage sec , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options = 0 ) + throw( VError ); +VImage globalbalance( VOption *options = 0 ) + throw( VError ); diff --git a/cplusplus/vips-operators.cc b/cplusplus/vips-operators.cc index 0a644743..848e8e2b 100644 --- a/cplusplus/vips-operators.cc +++ b/cplusplus/vips-operators.cc @@ -1,14 +1,2757 @@ +// bodies for vips operations +// Mon Oct 27 17:08:34 GMT 2014 +// this file is generated automatically, do not edit! -VImage VImage::invert( VOption *options ) - throw( VError ) +void VImage::system( char * cmd_format , VOption *options ) + throw( VError ) { - VImage out; - - call( "invert", - (options ? options : VImage::option())-> - set( "in", *this )-> - set( "out", &out ) ); - - return( out ); + call( "system" , + (options ? options : VImage::option()) -> + set( "cmd-format", cmd_format ) ); +} + +VImage VImage::add( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "add" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::subtract( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "subtract" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::multiply( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "multiply" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::divide( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "divide" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::relational( VImage right , VipsOperationRelational relational , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "relational" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) -> + set( "relational", relational ) ); + + return( out ); +} + +VImage VImage::remainder( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "remainder" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::boolean( VImage right , VipsOperationBoolean boolean , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "boolean" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) -> + set( "boolean", boolean ) ); + + return( out ); +} + +VImage VImage::math2( VImage right , VipsOperationMath2 math2 , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "math2" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) -> + set( "math2", math2 ) ); + + return( out ); +} + +VImage VImage::complex2( VImage right , VipsOperationComplex2 cmplx , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "complex2" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) -> + set( "cmplx", cmplx ) ); + + return( out ); +} + +VImage VImage::complexform( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "complexform" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::sum( std::vector in , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "sum" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::invert( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "invert" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::linear( std::vector a , std::vector b , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "linear" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "a", a ) -> + set( "b", b ) ); + + return( out ); +} + +VImage VImage::math( VipsOperationMath math , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "math" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "math", math ) ); + + return( out ); +} + +VImage VImage::abs( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "abs" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::sign( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "sign" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::round( VipsOperationRound round , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "round" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "round", round ) ); + + return( out ); +} + +VImage VImage::relational_const( std::vector c , VipsOperationRelational relational , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "relational_const" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "c", c ) -> + set( "relational", relational ) ); + + return( out ); +} + +VImage VImage::remainder_const( std::vector c , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "remainder_const" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::boolean_const( std::vector c , VipsOperationBoolean boolean , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "boolean_const" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "c", c ) -> + set( "boolean", boolean ) ); + + return( out ); +} + +VImage VImage::math2_const( std::vector c , VipsOperationMath2 math2 , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "math2_const" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "c", c ) -> + set( "math2", math2 ) ); + + return( out ); +} + +VImage VImage::complex( VipsOperationComplex cmplx , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "complex" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "cmplx", cmplx ) ); + + return( out ); +} + +VImage VImage::complexget( VipsOperationComplexget get , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "complexget" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "get", get ) ); + + return( out ); +} + +double VImage::avg( VOption *options ) + throw( VError ) +{ + double out; + + call( "avg" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +double VImage::min( VOption *options ) + throw( VError ) +{ + double out; + + call( "min" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +double VImage::max( VOption *options ) + throw( VError ) +{ + double out; + + call( "max" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +double VImage::deviate( VOption *options ) + throw( VError ) +{ + double out; + + call( "deviate" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::stats( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "stats" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_find( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "hist_find" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_find_ndim( VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + VImage out; + + call( "hist_find_indexed" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "index", index ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hough_line( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "hough_line" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hough_circle( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "hough_circle" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::project( VImage rows , VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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::copy( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "copy" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::blockcache( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "blockcache" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::tilecache( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "tilecache" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::linecache( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "linecache" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::sequential( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "sequential" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::cache( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "cache" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::embed( int x , int y , int width , int height , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "embed" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "x", x ) -> + set( "y", y ) -> + set( "width", width ) -> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::flip( VipsDirection direction , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "flip" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "direction", direction ) ); + + return( out ); +} + +VImage VImage::insert( VImage sub , int x , int y , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "insert" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "main", *this ) -> + set( "sub", sub ) -> + set( "x", x ) -> + set( "y", y ) ); + + return( out ); +} + +VImage VImage::join( VImage in2 , VipsDirection direction , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "join" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in1", *this ) -> + set( "in2", in2 ) -> + set( "direction", direction ) ); + + return( out ); +} + +VImage VImage::extract_area( int left , int top , int width , int height , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "extract_area" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "input", *this ) -> + set( "left", left ) -> + set( "top", top ) -> + set( "width", width ) -> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::extract_band( int band , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "extract_band" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "band", band ) ); + + return( out ); +} + +VImage VImage::bandjoin( std::vector in , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "bandjoin" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::bandrank( std::vector in , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "bandrank" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::bandmean( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "bandmean" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::bandbool( VipsOperationBoolean boolean , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "bandbool" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "boolean", boolean ) ); + + return( out ); +} + +VImage VImage::replicate( int across , int down , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "replicate" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "across", across ) -> + set( "down", down ) ); + + return( out ); +} + +VImage VImage::cast( VipsBandFormat format , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "cast" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "format", format ) ); + + return( out ); +} + +VImage VImage::rot( VipsAngle angle , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "rot" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "angle", angle ) ); + + return( out ); +} + +VImage VImage::rot45( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "rot45" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::autorot( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "autorot" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::ifthenelse( VImage in1 , VImage in2 , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "ifthenelse" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "cond", *this ) -> + set( "in1", in1 ) -> + set( "in2", in2 ) ); + + return( out ); +} + +VImage VImage::recomb( VImage m , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "recomb" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "m", m ) ); + + return( out ); +} + +VImage VImage::flatten( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "flatten" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::grid( int tile_height , int across , int down , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "grid" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "tile-height", tile_height ) -> + set( "across", across ) -> + set( "down", down ) ); + + return( out ); +} + +VImage VImage::scale( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "scale" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::wrap( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "wrap" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::zoom( int xfac , int yfac , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "zoom" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "input", *this ) -> + set( "xfac", xfac ) -> + set( "yfac", yfac ) ); + + return( out ); +} + +VImage VImage::subsample( int xfac , int yfac , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "subsample" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "input", *this ) -> + set( "xfac", xfac ) -> + set( "yfac", yfac ) ); + + return( out ); +} + +VImage VImage::msb( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "msb" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::falsecolour( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "falsecolour" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::gamma( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "gamma" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::black( int width , int height , VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + VImage out; + + call( "buildlut" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::invertlut( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "invertlut" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::tonelut( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "tonelut" , + (options ? options : VImage::option()) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::identity( VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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::radload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "radload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::ppmload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "ppmload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::csvload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "csvload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::matrixload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "matrixload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::analyzeload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "analyzeload" , + (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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + VImage out; + + call( "vipsload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pngload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "pngload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pngload_buffer( void * buffer , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "pngload_buffer" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "buffer", buffer ) ); + + return( out ); +} + +VImage VImage::matload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "matload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::jpegload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "jpegload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::jpegload_buffer( void * buffer , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "jpegload_buffer" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "buffer", buffer ) ); + + return( out ); +} + +VImage VImage::webpload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "webpload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::webpload_buffer( void * buffer , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "webpload_buffer" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "buffer", buffer ) ); + + return( out ); +} + +VImage VImage::tiffload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "tiffload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::tiffload_buffer( void * buffer , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "tiffload_buffer" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "buffer", buffer ) ); + + return( out ); +} + +VImage VImage::openslideload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "openslideload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::magickload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "magickload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::fitsload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "fitsload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::openexrload( char * filename , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "openexrload" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::radsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "radsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::ppmsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "ppmsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::csvsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "csvsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::matrixsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "matrixsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::matrixprint( VOption *options ) + throw( VError ) +{ + call( "matrixprint" , + (options ? options : VImage::option()) -> + set( "in", *this ) ); +} + +void VImage::rawsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "rawsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::rawsave_fd( int fd , VOption *options ) + throw( VError ) +{ + call( "rawsave_fd" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "fd", fd ) ); +} + +void VImage::vipssave( char * filename , VOption *options ) + throw( VError ) +{ + call( "vipssave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::dzsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "dzsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::pngsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "pngsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void * VImage::pngsave_buffer( VOption *options ) + throw( VError ) +{ + void * buffer; + + call( "pngsave_buffer" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +void VImage::jpegsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "jpegsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void * VImage::jpegsave_buffer( VOption *options ) + throw( VError ) +{ + void * buffer; + + call( "jpegsave_buffer" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +void VImage::jpegsave_mime( VOption *options ) + throw( VError ) +{ + call( "jpegsave_mime" , + (options ? options : VImage::option()) -> + set( "in", *this ) ); +} + +void VImage::webpsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "webpsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void * VImage::webpsave_buffer( VOption *options ) + throw( VError ) +{ + void * buffer; + + call( "webpsave_buffer" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +void VImage::tiffsave( char * filename , VOption *options ) + throw( VError ) +{ + call( "tiffsave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +void VImage::fitssave( char * filename , VOption *options ) + throw( VError ) +{ + call( "fitssave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +VImage VImage::shrink( double xshrink , double yshrink , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "shrink" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "xshrink", xshrink ) -> + set( "yshrink", yshrink ) ); + + return( out ); +} + +VImage VImage::quadratic( VImage coeff , VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + VImage out; + + call( "affine" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "matrix", matrix ) ); + + return( out ); +} + +VImage VImage::similarity( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "similarity" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::resize( double h_scale , double v_scale , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "resize" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "h-scale", h_scale ) -> + set( "v-scale", v_scale ) ); + + return( out ); +} + +VImage VImage::colourspace( VipsInterpretation space , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "colourspace" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "space", space ) ); + + return( out ); +} + +VImage VImage::Lab2XYZ( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "Lab2XYZ" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::XYZ2Lab( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "XYZ2Lab" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::Lab2LCh( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "Lab2LCh" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::LCh2Lab( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "LCh2Lab" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::LCh2CMC( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "LCh2CMC" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::CMC2LCh( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "CMC2LCh" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::XYZ2Yxy( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "XYZ2Yxy" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::Yxy2XYZ( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "Yxy2XYZ" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::scRGB2XYZ( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "scRGB2XYZ" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::XYZ2scRGB( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "XYZ2scRGB" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::LabQ2Lab( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "LabQ2Lab" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::Lab2LabQ( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "Lab2LabQ" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::LabQ2LabS( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "LabQ2LabS" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::LabS2LabQ( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "LabS2LabQ" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::LabS2Lab( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "LabS2Lab" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::Lab2LabS( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "Lab2LabS" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::rad2float( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "rad2float" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::float2rad( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "float2rad" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::LabQ2sRGB( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "LabQ2sRGB" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::sRGB2scRGB( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "sRGB2scRGB" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::scRGB2sRGB( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "scRGB2sRGB" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::icc_import( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "icc_import" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::icc_export( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "icc_export" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::icc_transform( char * output_profile , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "icc_transform" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "output-profile", output_profile ) ); + + return( out ); +} + +VImage VImage::dE76( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "dE76" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::dE00( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "dE00" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::dECMC( VImage right , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "dECMC" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "left", *this ) -> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::maplut( VImage lut , VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + int threshold; + + call( "percent" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "percent", percent ) -> + set( "threshold", &threshold ) ); + + return( threshold ); +} + +VImage VImage::stdif( int width , int height , VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + VImage out; + + call( "hist_cum" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) ); + + return( out ); +} + +VImage VImage::hist_match( VImage ref , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "hist_match" , + (options ? options : VImage::option()) -> + set( "out", &out ) -> + set( "in", *this ) -> + set( "ref", ref ) ); + + return( out ); +} + +VImage VImage::hist_norm( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "hist_norm" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_equal( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "hist_equal" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_plot( VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + bool monotonic; + + call( "hist_ismonotonic" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "monotonic", &monotonic ) ); + + return( monotonic ); +} + +VImage VImage::conv( VImage mask , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "conv" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::compass( VImage mask , VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + VImage out; + + call( "convsep" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::fastcor( VImage ref , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "fastcor" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "ref", ref ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::spcor( VImage ref , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "spcor" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "ref", ref ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sharpen( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "sharpen" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::gaussblur( int radius , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "gaussblur" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "radius", radius ) ); + + return( out ); +} + +VImage VImage::fwfft( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "fwfft" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::invfft( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "invfft" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::freqmult( VImage mask , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "freqmult" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::spectrum( VOption *options ) + throw( VError ) +{ + VImage out; + + call( "spectrum" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::phasecor( VImage in2 , VOption *options ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + 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 ) + throw( VError ) +{ + double nolines; + + call( "countlines" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "nolines", &nolines ) -> + set( "direction", direction ) ); + + return( nolines ); +} + +VImage VImage::labelregions( VOption *options ) + throw( VError ) +{ + VImage mask; + + call( "labelregions" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "mask", &mask ) ); + + return( mask ); +} + +void VImage::draw_rect( std::vector ink , int left , int top , int width , int height , VOption *options ) + throw( VError ) +{ + 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_mask( std::vector ink , VImage mask , int x , int y , VOption *options ) + throw( VError ) +{ + 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_line( std::vector ink , int x1 , int y1 , int x2 , int y2 , VOption *options ) + throw( VError ) +{ + 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_circle( std::vector ink , int cx , int cy , int radius , VOption *options ) + throw( VError ) +{ + call( "draw_circle" , + (options ? options : VImage::option()) -> + set( "image", *this ) -> + set( "ink", ink ) -> + set( "cx", cx ) -> + set( "cy", cy ) -> + set( "radius", radius ) ); +} + +void VImage::draw_flood( std::vector ink , int x , int y , VOption *options ) + throw( VError ) +{ + call( "draw_flood" , + (options ? options : VImage::option()) -> + set( "image", *this ) -> + set( "ink", ink ) -> + set( "x", x ) -> + set( "y", y ) ); +} + +void VImage::draw_image( VImage sub , int x , int y , VOption *options ) + throw( VError ) +{ + call( "draw_image" , + (options ? options : VImage::option()) -> + set( "image", *this ) -> + set( "sub", sub ) -> + set( "x", x ) -> + set( "y", y ) ); +} + +void VImage::draw_smudge( int left , int top , int width , int height , VOption *options ) + throw( VError ) +{ + call( "draw_smudge" , + (options ? options : VImage::option()) -> + set( "image", *this ) -> + set( "left", left ) -> + set( "top", top ) -> + set( "width", width ) -> + set( "height", height ) ); +} + +VImage VImage::merge( VImage sec , VipsDirection direction , int dx , int dy , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "merge" , + (options ? options : VImage::option()) -> + set( "ref", *this ) -> + set( "sec", sec ) -> + set( "out", &out ) -> + set( "direction", direction ) -> + set( "dx", dx ) -> + set( "dy", dy ) ); + + return( out ); +} + +VImage VImage::mosaic( VImage sec , VipsDirection direction , int xref , int yref , int xsec , int ysec , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "mosaic" , + (options ? options : VImage::option()) -> + set( "ref", *this ) -> + set( "sec", sec ) -> + set( "out", &out ) -> + set( "direction", direction ) -> + set( "xref", xref ) -> + set( "yref", yref ) -> + set( "xsec", xsec ) -> + set( "ysec", ysec ) ); + + return( out ); +} + +VImage VImage::mosaic1( VImage sec , VipsDirection direction , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "mosaic1" , + (options ? options : VImage::option()) -> + set( "ref", *this ) -> + set( "sec", sec ) -> + set( "out", &out ) -> + set( "direction", direction ) -> + 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::match( VImage sec , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options ) + throw( VError ) +{ + VImage out; + + call( "match" , + (options ? options : VImage::option()) -> + set( "ref", *this ) -> + set( "sec", sec ) -> + set( "out", &out ) -> + 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 ) + throw( VError ) +{ + VImage out; + + call( "globalbalance" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); } diff --git a/libvips/iofuncs/type.c b/libvips/iofuncs/type.c index 2babfd34..6600572f 100644 --- a/libvips/iofuncs/type.c +++ b/libvips/iofuncs/type.c @@ -1458,7 +1458,7 @@ vips_value_get_array_image( const GValue *value, int *n ) * @value: (out): %GValue to get from * @n: the number of elements * - * Set @value to hold a copy of @array. Pass in the array length in @n. + * Set @value to hold an array of images. Pass in the array length in @n. * * See also: vips_array_image_get(). */ @@ -1479,7 +1479,7 @@ vips_value_set_array_image( GValue *value, int n ) * @n: (allow-none): return the number of elements here, optionally * * Return the start of the array of %GObject held by @value. - * optionally return the number of elements in @n. + * Optionally return the number of elements in @n. * * See also: vips_array_object_set(). *