diff --git a/cplusplus/VImage.cpp b/cplusplus/VImage.cpp index 3143d857..1e4b1e99 100644 --- a/cplusplus/VImage.cpp +++ b/cplusplus/VImage.cpp @@ -596,20 +596,20 @@ VImage::new_from_buffer( const std::string &buf, const char *option_string, } VImage -VImage::new_from_stream( const VStreamI &input, const char *option_string, +VImage::new_from_stream( VStreamI streami, const char *option_string, VOption *options ) { const char *operation_name; VImage out; if( !(operation_name = vips_foreign_find_load_stream( - input.get_stream() )) ) { + streami.get_stream() )) ) { delete options; throw( VError() ); } options = (options ? options : VImage::option())-> - set( "input", input )-> + set( "streami", streami )-> set( "out", &out ); call_option_string( operation_name, option_string, options ); @@ -702,7 +702,7 @@ VImage::write_to_buffer( const char *suffix, void **buf, size_t *size, } void -VImage::write_to_stream( const char *suffix, const VStreamO &output, +VImage::write_to_stream( const char *suffix, VStreamO streamo, VOption *options ) const { char filename[VIPS_PATH_MAX]; @@ -718,7 +718,7 @@ VImage::write_to_stream( const char *suffix, const VStreamO &output, call_option_string( operation_name, option_string, (options ? options : VImage::option())-> set( "in", *this )-> - set( "output", output ) ); + set( "streamo", streamo ) ); } #include "vips-operators.cpp" diff --git a/cplusplus/gen-operators.py b/cplusplus/gen-operators.py index 97c9f5e1..dd44e2d8 100755 --- a/cplusplus/gen-operators.py +++ b/cplusplus/gen-operators.py @@ -25,7 +25,7 @@ import argparse -from pyvips import Operation, GValue, Error, \ +from pyvips import Introspect, Operation, GValue, Error, \ ffi, gobject_lib, type_map, type_from_name, nickname_find, type_name # TODO Move to pyvips.GValue @@ -41,8 +41,8 @@ gtype_to_cpp = { GValue.refstr_type: 'char *', GValue.gflags_type: 'int', GValue.image_type: 'VImage', - stream_input_type: 'const VStreamI &', - stream_output_type: 'const VStreamO &', + stream_input_type: 'VStreamI', + stream_output_type: 'VStreamO', GValue.array_int_type: 'std::vector', GValue.array_double_type: 'std::vector', GValue.array_image_type: 'std::vector', @@ -87,66 +87,42 @@ def cppize(name): def generate_operation(operation_name, declaration_only=False): - op = Operation.new_from_name(operation_name) + intro = Introspect.get(operation_name) - # we are only interested in non-deprecated args - args = [[name, flags] for name, flags in op.get_args() - if not flags & _DEPRECATED] - - # find the first required input image arg, if any ... that will be self - member_x = None - for name, flags in args: - if ((flags & _INPUT) != 0 and - (flags & _REQUIRED) != 0 and - op.get_typeof(name) == GValue.image_type): - member_x = name - break - - required_input = [name for name, flags in args - if (flags & _INPUT) != 0 and - (flags & _REQUIRED) != 0 and - name != member_x] - - required_output = [name for name, flags in args - if ((flags & _OUTPUT) != 0 and - (flags & _REQUIRED) != 0) or - ((flags & _INPUT) != 0 and - (flags & _REQUIRED) != 0 and - (flags & _MODIFY) != 0) and - name != member_x] + required_output = [name for name in intro.required_output if name != intro.member_x] has_output = len(required_output) >= 1 - # Add a C++ style comment block with some additional markings (@param, + # Add a C++ style comment block with some additional markings (@param, # @return) if declaration_only: - result = '\n/**\n * {}.'.format(op.get_description().capitalize()) + result = '\n/**\n * {}.'.format(intro.description.capitalize()) - for name in required_input: + for name in intro.method_args: result += '\n * @param {} {}.' \ - .format(cppize(name), op.get_blurb(name)) + .format(cppize(name), intro.details[name]['blurb']) if has_output: # skip the first element for name in required_output[1:]: result += '\n * @param {} {}.' \ - .format(cppize(name), op.get_blurb(name)) + .format(cppize(name), intro.details[name]['blurb']) result += '\n * @param options Optional options.' if has_output: result += '\n * @return {}.' \ - .format(op.get_blurb(required_output[0])) + .format(intro.details[required_output[0]]['blurb']) result += '\n */\n' else: result = '\n' - if member_x is None and declaration_only: + if intro.member_x is None and declaration_only: result += 'static ' if has_output: # the first output arg will be used as the result - cpp_type = get_cpp_type(op.get_typeof(required_output[0])) + cpp_type = get_cpp_type(intro.details[required_output[0]]['type']) spacing = '' if cpp_type.endswith(cplusplus_suffixes) else ' ' result += '{0}{1}'.format(cpp_type, spacing) else: @@ -160,8 +136,9 @@ def generate_operation(operation_name, declaration_only=False): cplusplus_operation += '_image' result += '{0}( '.format(cplusplus_operation) - for name in required_input: - gtype = op.get_typeof(name) + for name in intro.method_args: + details = intro.details[name] + gtype = details['type'] cpp_type = get_cpp_type(gtype) spacing = '' if cpp_type.endswith(cplusplus_suffixes) else ' ' result += '{0}{1}{2}, '.format(cpp_type, spacing, cppize(name)) @@ -170,7 +147,8 @@ def generate_operation(operation_name, declaration_only=False): if has_output: # skip the first element for name in required_output[1:]: - gtype = op.get_typeof(name) + details = intro.details[name] + gtype = details['type'] cpp_type = get_cpp_type(gtype) spacing = '' if cpp_type.endswith(cplusplus_suffixes) else ' ' result += '{0}{1}*{2}, '.format(cpp_type, spacing, cppize(name)) @@ -178,7 +156,7 @@ def generate_operation(operation_name, declaration_only=False): result += 'VOption *options {0})'.format('= 0 ' if declaration_only else '') # if no 'this' available, it's a class method and they are all const - if member_x is not None: + if intro.member_x is not None: result += ' const' if declaration_only: @@ -191,17 +169,17 @@ def generate_operation(operation_name, declaration_only=False): if has_output: # the first output arg will be used as the result name = required_output[0] - cpp_type = get_cpp_type(op.get_typeof(name)) + cpp_type = get_cpp_type(intro.details[name]['type']) spacing = '' if cpp_type.endswith(cplusplus_suffixes) else ' ' result += ' {0}{1}{2};\n\n'.format(cpp_type, spacing, cppize(name)) result += ' call( "{0}",\n'.format(operation_name) result += ' (options ? options : VImage::option())' - if member_x is not None: + if intro.member_x is not None: result += '->\n' - result += ' set( "{0}", *this )'.format(member_x) + result += ' set( "{0}", *this )'.format(intro.member_x) - all_required = required_input + all_required = intro.method_args if has_output: # first element needs to be passed by reference @@ -236,10 +214,10 @@ def generate_operators(declarations_only=False): nickname = nickname_find(gtype) try: # can fail for abstract types - op = Operation.new_from_name(nickname) + intro = Introspect.get(nickname) # we are only interested in non-deprecated operations - if (op.get_flags() & _OPERATION_DEPRECATED) == 0: + if (intro.flags & _OPERATION_DEPRECATED) == 0: all_nicknames.append(nickname) except Error: pass diff --git a/cplusplus/include/vips/VImage8.h b/cplusplus/include/vips/VImage8.h index e9d85931..0819d8cd 100644 --- a/cplusplus/include/vips/VImage8.h +++ b/cplusplus/include/vips/VImage8.h @@ -514,7 +514,7 @@ public: static VImage new_from_buffer( const std::string &buf, const char *option_string, VOption *options = 0 ); - static VImage new_from_stream( const VStreamI &input, + static VImage new_from_stream( VStreamI streami, const char *option_string, VOption *options = 0 ); static VImage new_matrix( int width, int height ); @@ -569,8 +569,8 @@ public: void write_to_buffer( const char *suffix, void **buf, size_t *size, VOption *options = 0 ) const; - void write_to_stream( const char *suffix, - const VStreamO &output, VOption *options = 0 ) const; + void write_to_stream( const char *suffix, VStreamO streamo, + VOption *options = 0 ) const; void * write_to_memory( size_t *size ) const diff --git a/cplusplus/include/vips/vips-operators.h b/cplusplus/include/vips/vips-operators.h index 8d8e0618..dbc2804b 100644 --- a/cplusplus/include/vips/vips-operators.h +++ b/cplusplus/include/vips/vips-operators.h @@ -1,5 +1,5 @@ // headers for vips operations -// Mon 11 Nov 09:21:14 GMT 2019 +// Fri 29 Nov 2019 02:46:41 PM CET // this file is generated automatically, do not edit! /** @@ -1039,11 +1039,11 @@ static VImage jpegload_buffer( VipsBlob *buffer, VOption *options = 0 ); /** * Load image from jpeg stream. - * @param input Stream to load from. + * @param streami Stream to load from. * @param options Optional options. * @return Output image. */ -static VImage jpegload_stream( const VStreamI &input, VOption *options = 0 ); +static VImage jpegload_stream( VStreamI streami, VOption *options = 0 ); /** * Save image to jpeg file. @@ -1070,7 +1070,7 @@ void jpegsave_mime( VOption *options = 0 ) const; * @param streamo Stream to save to. * @param options Optional options. */ -void jpegsave_stream( const VStreamO &streamo, VOption *options = 0 ) const; +void jpegsave_stream( VStreamO streamo, VOption *options = 0 ) const; /** * Label regions in an image. @@ -1521,7 +1521,7 @@ static VImage pngload_buffer( VipsBlob *buffer, VOption *options = 0 ); * @param options Optional options. * @return Output image. */ -static VImage pngload_stream( const VStreamI &streami, VOption *options = 0 ); +static VImage pngload_stream( VStreamI streami, VOption *options = 0 ); /** * Save image to png file. @@ -1542,7 +1542,7 @@ VipsBlob *pngsave_buffer( VOption *options = 0 ) const; * @param streamo Stream to save to. * @param options Optional options. */ -void pngsave_stream( const VStreamO &streamo, VOption *options = 0 ) const; +void pngsave_stream( VStreamO streamo, VOption *options = 0 ) const; /** * Load ppm from file. @@ -1627,7 +1627,7 @@ static VImage radload_buffer( VipsBlob *buffer, VOption *options = 0 ); * @param options Optional options. * @return Output image. */ -static VImage radload_stream( const VStreamI &streami, VOption *options = 0 ); +static VImage radload_stream( VStreamI streami, VOption *options = 0 ); /** * Save image to radiance file. @@ -1648,7 +1648,7 @@ VipsBlob *radsave_buffer( VOption *options = 0 ) const; * @param streamo Stream to save to. * @param options Optional options. */ -void radsave_stream( const VStreamO &streamo, VOption *options = 0 ) const; +void radsave_stream( VStreamO streamo, VOption *options = 0 ) const; /** * Rank filter. @@ -1998,7 +1998,7 @@ static VImage svgload_buffer( VipsBlob *buffer, VOption *options = 0 ); * @param options Optional options. * @return Output image. */ -static VImage svgload_stream( const VStreamI &streami, VOption *options = 0 ); +static VImage svgload_stream( VStreamI streami, VOption *options = 0 ); /** * Find the index of the first non-zero pixel in tests. @@ -2056,7 +2056,7 @@ VImage thumbnail_image( int width, VOption *options = 0 ) const; * @param options Optional options. * @return Output image. */ -static VImage thumbnail_stream( const VStreamI &streami, int width, VOption *options = 0 ); +static VImage thumbnail_stream( VStreamI streami, int width, VOption *options = 0 ); /** * Load tiff from file. @@ -2080,7 +2080,7 @@ static VImage tiffload_buffer( VipsBlob *buffer, VOption *options = 0 ); * @param options Optional options. * @return Output image. */ -static VImage tiffload_stream( const VStreamI &streami, VOption *options = 0 ); +static VImage tiffload_stream( VStreamI streami, VOption *options = 0 ); /** * Save image to tiff file. @@ -2161,7 +2161,7 @@ static VImage webpload_buffer( VipsBlob *buffer, VOption *options = 0 ); * @param options Optional options. * @return Output image. */ -static VImage webpload_stream( const VStreamI &streami, VOption *options = 0 ); +static VImage webpload_stream( VStreamI streami, VOption *options = 0 ); /** * Save image to webp file. @@ -2182,7 +2182,7 @@ VipsBlob *webpsave_buffer( VOption *options = 0 ) const; * @param streamo Stream to save to. * @param options Optional options. */ -void webpsave_stream( const VStreamO &streamo, VOption *options = 0 ) const; +void webpsave_stream( VStreamO streamo, VOption *options = 0 ) const; /** * Make a worley noise image. diff --git a/cplusplus/vips-operators.cpp b/cplusplus/vips-operators.cpp index b20e8eeb..d6726514 100644 --- a/cplusplus/vips-operators.cpp +++ b/cplusplus/vips-operators.cpp @@ -1,5 +1,5 @@ // bodies for vips operations -// Mon 11 Nov 09:21:02 GMT 2019 +// Fri 29 Nov 2019 02:46:41 PM CET // this file is generated automatically, do not edit! VImage VImage::CMC2LCh( VOption *options ) const @@ -1628,14 +1628,14 @@ VImage VImage::jpegload_buffer( VipsBlob *buffer, VOption *options ) return( out ); } -VImage VImage::jpegload_stream( const VStreamI &input, VOption *options ) +VImage VImage::jpegload_stream( VStreamI streami, VOption *options ) { VImage out; call( "jpegload_stream", (options ? options : VImage::option())-> set( "out", &out )-> - set( "input", input ) ); + set( "streami", streami ) ); return( out ); } @@ -1667,7 +1667,7 @@ void VImage::jpegsave_mime( VOption *options ) const set( "in", *this ) ); } -void VImage::jpegsave_stream( const VStreamO &streamo, VOption *options ) const +void VImage::jpegsave_stream( VStreamO streamo, VOption *options ) const { call( "jpegsave_stream", (options ? options : VImage::option())-> @@ -2319,7 +2319,7 @@ VImage VImage::pngload_buffer( VipsBlob *buffer, VOption *options ) return( out ); } -VImage VImage::pngload_stream( const VStreamI &streami, VOption *options ) +VImage VImage::pngload_stream( VStreamI streami, VOption *options ) { VImage out; @@ -2351,7 +2351,7 @@ VipsBlob *VImage::pngsave_buffer( VOption *options ) const return( buffer ); } -void VImage::pngsave_stream( const VStreamO &streamo, VOption *options ) const +void VImage::pngsave_stream( VStreamO streamo, VOption *options ) const { call( "pngsave_stream", (options ? options : VImage::option())-> @@ -2478,7 +2478,7 @@ VImage VImage::radload_buffer( VipsBlob *buffer, VOption *options ) return( out ); } -VImage VImage::radload_stream( const VStreamI &streami, VOption *options ) +VImage VImage::radload_stream( VStreamI streami, VOption *options ) { VImage out; @@ -2510,7 +2510,7 @@ VipsBlob *VImage::radsave_buffer( VOption *options ) const return( buffer ); } -void VImage::radsave_stream( const VStreamO &streamo, VOption *options ) const +void VImage::radsave_stream( VStreamO streamo, VOption *options ) const { call( "radsave_stream", (options ? options : VImage::option())-> @@ -3062,7 +3062,7 @@ VImage VImage::svgload_buffer( VipsBlob *buffer, VOption *options ) return( out ); } -VImage VImage::svgload_stream( const VStreamI &streami, VOption *options ) +VImage VImage::svgload_stream( VStreamI streami, VOption *options ) { VImage out; @@ -3144,7 +3144,7 @@ VImage VImage::thumbnail_image( int width, VOption *options ) const return( out ); } -VImage VImage::thumbnail_stream( const VStreamI &streami, int width, VOption *options ) +VImage VImage::thumbnail_stream( VStreamI streami, int width, VOption *options ) { VImage out; @@ -3181,7 +3181,7 @@ VImage VImage::tiffload_buffer( VipsBlob *buffer, VOption *options ) return( out ); } -VImage VImage::tiffload_stream( const VStreamI &streami, VOption *options ) +VImage VImage::tiffload_stream( VStreamI streami, VOption *options ) { VImage out; @@ -3304,7 +3304,7 @@ VImage VImage::webpload_buffer( VipsBlob *buffer, VOption *options ) return( out ); } -VImage VImage::webpload_stream( const VStreamI &streami, VOption *options ) +VImage VImage::webpload_stream( VStreamI streami, VOption *options ) { VImage out; @@ -3336,7 +3336,7 @@ VipsBlob *VImage::webpsave_buffer( VOption *options ) const return( buffer ); } -void VImage::webpsave_stream( const VStreamO &streamo, VOption *options ) const +void VImage::webpsave_stream( VStreamO streamo, VOption *options ) const { call( "webpsave_stream", (options ? options : VImage::option())-> diff --git a/doc/function-list.xml b/doc/function-list.xml index 6529d16c..6a93b7a4 100644 --- a/doc/function-list.xml +++ b/doc/function-list.xml @@ -72,1119 +72,199 @@ - system - run an external command - vips_system() + CMC2LCh + Transform lch to cmc + vips_CMC2LCh() - add - add two images - vips_add() + CMYK2XYZ + Transform cmyk to xyz + vips_CMYK2XYZ() - subtract - subtract two images - vips_subtract() + HSV2sRGB + Transform hsv to srgb + vips_HSV2sRGB() - multiply - multiply two images - vips_multiply() + LCh2CMC + Transform lch to cmc + vips_LCh2CMC() - divide - divide two images - vips_divide() + LCh2Lab + Transform lch to lab + vips_LCh2Lab() - relational - relational operation on two images - vips_relational(), vips_equal(), vips_notequal(), vips_less(), - vips_lesseq(), vips_more(), vips_moreeq() + Lab2LCh + Transform lab to lch + vips_Lab2LCh() - remainder - remainder after integer division of two images - vips_remainder() + Lab2LabQ + Transform float lab to labq coding + vips_Lab2LabQ() - boolean - boolean operation on two images - vips_boolean(), vips_andimage(), vips_orimage(), vips_eorimage(), - vips_lshift(), vips_rshift() + Lab2LabS + Transform float lab to signed short + vips_Lab2LabS() - math2 - binary math operations - vips_math2(), vips_pow(), vips_wop() + Lab2XYZ + Transform cielab to xyz + vips_Lab2XYZ() - complex2 - complex binary operations on two images - vips_complex2(), vips_cross_phase() + LabQ2Lab + Unpack a labq image to float lab + vips_LabQ2Lab() - complexform - form a complex image from two real images - vips_complexform() + LabQ2LabS + Unpack a labq image to short lab + vips_LabQ2LabS() - sum - sum an array of images - vips_sum() + LabQ2sRGB + Convert a labq image to srgb + vips_LabQ2sRGB() - invert - invert an image - vips_invert() + LabS2Lab + Transform signed short lab to float + vips_LabS2Lab() - linear - calculate (a * in + b) - vips_linear(), vips_linear1() + LabS2LabQ + Transform short lab to labq coding + vips_LabS2LabQ() - math - apply a math operation to an image - vips_math(), vips_sin(), vips_cos(), vips_tan(), vips_asin(), - vips_acos(), vips_atan(), vips_exp(), vips_exp10(), vips_log(), - vips_log10() + XYZ2CMYK + Transform xyz to cmyk + vips_XYZ2CMYK() + + + XYZ2Lab + Transform xyz to lab + vips_XYZ2Lab() + + + XYZ2Yxy + Transform xyz to yxy + vips_XYZ2Yxy() + + + XYZ2scRGB + Transform xyz to scrgb + vips_XYZ2scRGB() + + + Yxy2XYZ + Transform yxy to xyz + vips_Yxy2XYZ() abs - absolute value of an image + Absolute value of an image vips_abs() - sign - unit vector of pixel - vips_sign() + add + Add two images + vips_add() - round - perform a round function on an image - vips_round(), vips_floor(), vips_ceil(), vips_rint() + affine + Affine transform of an image + vips_affine() - relational_const - relational operations against a constant - vips_relational_const(), vips_equal_const(), vips_notequal_const(), - vips_less_const(), vips_lesseq_const(), vips_more_const(), - vips_moreeq_const(), vips_relational_const1(), vips_equal_const1(), - vips_notequal_const1(), vips_less_const1(), vips_lesseq_const1(), - vips_more_const1(), vips_moreeq_const1() - - - remainder_const - remainder after integer division of an image and a constant - vips_remainder_const(), vips_remainder_const1() - - - boolean_const - boolean operations against a constant - vips_boolean_const(), vips_andimage_const(), vips_orimage_const(), - vips_eorimage_const(), vips_lshift_const(), vips_rshift_const(), - vips_boolean_const1(), vips_andimage_const1(), vips_orimage_const1(), - vips_eorimage_const1(), vips_lshift_const1(), vips_rshift_const1() - - - math2_const - pow( @in, @c ) - vips_math2_const(), vips_pow_const(), vips_wop_const(), - vips_math2_const1(), vips_pow_const1(), vips_wop_const1() - - - complex - perform a complex operation on an image - vips_complex(), vips_polar(), vips_rect(), vips_conj() - - - complexget - get a component from a complex image - vips_complexget(), vips_real(), vips_imag() - - - avg - find image average - vips_avg() - - - min - find image minimum - vips_min() - - - max - find image maximum - vips_max() - - - deviate - find image standard deviation - vips_deviate() - - - stats - find image average - vips_stats() - - - hist_find - find image histogram - vips_hist_find() - - - hist_find_ndim - find n-dimensional image histogram - vips_hist_find_ndim() - - - hist_find_indexed - find indexed image histogram - vips_hist_find_indexed() - - - hough_line - find hough line transform - vips_hough_line() - - - hough_circle - find hough circle transform - vips_hough_circle() - - - project - find image projections - vips_project() - - - profile - find image profiles - vips_profile() - - - measure - measure a set of patches on a color chart - vips_measure() - - - getpoint - read a point from an image - vips_getpoint() - - - copy - copy an image - vips_copy() - - - tilecache - cache an image as a set of tiles - vips_tilecache() - - - linecache - cache an image as a set of lines - vips_linecache() - - - sequential - check sequential access - vips_sequential() - - - cache - cache an image - vips_cache() - - - embed - embed an image in a larger image - vips_embed() - - - gravity - expand an image with a specified gravity - vips_gravity() - - - flip - flip an image - vips_flip() - - - transpose3d - transpose a volumetric image - vips_transpose3d() - - - insert - insert image @sub into @main at @x, @y - vips_insert() - - - join - join a pair of images - vips_join() + analyzeload + Load an analyze6 image + vips_analyzeload() arrayjoin - join an array of images + Join an array of images vips_arrayjoin() - extract_area - extract an area from an image - vips_extract_area(), vips_crop() + autorot + Autorotate image by exif tag + vips_autorot() - smartcrop - extract an area from an image - vips_smartcrop() + avg + Find image average + vips_avg() - find_trim - search an image for non-background pixels - vips_find_trim() + bandbool + Boolean operation across image bands + vips_bandbool(), vips_bandand(), vips_bandor(), vips_bandeor(), vips_bandmean() - extract_band - extract band from an image - vips_extract_band() + bandfold + Fold up x axis into bands + vips_bandfold() bandjoin - bandwise join a set of images + Bandwise join a set of images vips_bandjoin(), vips_bandjoin2() bandjoin_const - append a constant band to an image + Append a constant band to an image vips_bandjoin_const(), vips_bandjoin_const1() - - bandrank - band-wise rank of a set of images - vips_bandrank() - bandmean - band-wise average + Band-wise average vips_bandmean() - bandbool - boolean operation across image bands - vips_bandbool(), vips_bandand(), vips_bandor(), vips_bandeor(), - vips_bandmean() - - - replicate - replicate an image - vips_replicate() - - - cast - cast an image - vips_cast(), vips_cast_uchar(), vips_cast_char(), vips_cast_ushort(), - vips_cast_short(), vips_cast_uint(), vips_cast_int(), vips_cast_float(), - vips_cast_double(), vips_cast_complex(), vips_cast_dpcomplex() - - - rot - rotate an image - vips_rot() - - - rot45 - rotate an image - vips_rot45() - - - autorot - autorotate image by exif tag - vips_autorot() - - - ifthenelse - ifthenelse an image - vips_ifthenelse() - - - recomb - linear recombination with matrix - vips_recomb() - - - bandfold - fold up x axis into bands - vips_bandfold() - - - composite - composite a set of images with a PDF blend mode - vips_composite() + bandrank + Band-wise rank of a set of images + vips_bandrank() bandunfold - unfold image bands into x axis + Unfold image bands into x axis vips_bandunfold() - - flatten - flatten alpha out of an image - vips_flatten() - - - premultiply - premultiply image alpha - vips_premultiply() - - - unpremultiply - unpremultiply image alpha - vips_unpremultiply() - - - grid - grid an image - vips_grid() - - - scale - scale an image to uchar - vips_scale() - - - wrap - wrap image origin - vips_wrap() - - - zoom - zoom an image - vips_zoom() - - - subsample - subsample an image - vips_subsample() - - - msb - pick most-significant byte from an image - vips_msb() - - - byteswap - byteswap an image - vips_byteswap() - - - falsecolour - false colour an image - vips_falsecolour() - - - gamma - gamma an image - vips_gamma() - black - make a black image + Make a black image vips_black() - gaussnoise - make a gaussnoise image - vips_gaussnoise() + boolean + Boolean operation on two images + vips_boolean(), vips_andimage(), vips_orimage(), vips_eorimage(), vips_lshift(), vips_rshift() - text - make a text image - vips_text() - - - xyz - make an image where pixel values are coordinates - vips_xyz() - - - gaussmat - make a gaussian image - vips_gaussmat() - - - logmat - make a laplacian of gaussian image - vips_logmat() - - - eye - make an image showing the eye's spatial response - vips_eye() - - - grey - make a grey ramp image - vips_grey() - - - zone - make a zone plate - vips_zone() - - - sines - make a 2D sine wave - vips_sines() - - - mask_ideal - make an ideal filter - vips_mask_ideal() - - - mask_ideal_ring - make an ideal ring filter - vips_mask_ideal_ring() - - - mask_ideal_band - make an ideal band filter - vips_mask_ideal_band() - - - mask_butterworth - make a butterworth filter - vips_mask_butterworth() - - - mask_butterworth_ring - make a butterworth ring filter - vips_mask_butterworth_ring() - - - mask_butterworth_band - make a butterworth_band filter - vips_mask_butterworth_band() - - - mask_gaussian - make a gaussian filter - vips_mask_gaussian() - - - mask_gaussian_ring - make a gaussian ring filter - vips_mask_gaussian_ring() - - - mask_gaussian_band - make a gaussian filter - vips_mask_gaussian_band() - - - mask_fractal - make fractal filter - vips_mask_fractal() + boolean_const + Boolean operations against a constant + vips_boolean_const(), vips_andimage_const(), vips_orimage_const(), vips_eorimage_const(), vips_lshift_const(), vips_rshift_const(), vips_boolean_const1(), vips_andimage_const1(), vips_orimage_const1(), vips_eorimage_const1(), vips_lshift_const1(), vips_rshift_const1() buildlut - build a look-up table + Build a look-up table vips_buildlut() - invertlut - build an inverted look-up table - vips_invertlut() + byteswap + Byteswap an image + vips_byteswap() - tonelut - build a look-up table - vips_tonelut() - - - identity - make a 1D image where pixel values are indexes - vips_identity() - - - fractsurf - make a fractal surface - vips_fractsurf() - - - worley - make a worley noise image - vips_worley() - - - perlin - make a perlin noise image - vips_perlin() - - - radload - load a Radiance image from a file - vips_radload() - - - pdfload - load PDF with libpoppler - vips_pdfload() - - - pdfload_buffer - load PDF with libpoppler - vips_pdfload_buffer() - - - svgload - load SVG with rsvg - vips_svgload() - - - svgload_buffer - load SVG with rsvg - vips_svgload_buffer() - - - gifload - load GIF with giflib - vips_gifload() - - - gifload_buffer - load GIF with giflib - vips_gifload_buffer() - - - ppmload - load ppm from file - vips_ppmload() - - - csvload - load csv from file - vips_csvload() - - - matrixload - load matrix from file - vips_matrixload() - - - analyzeload - load an Analyze6 image - vips_analyzeload() - - - rawload - load raw data from a file - vips_rawload() - - - pngload - load png from file - vips_pngload() - - - pngload_buffer - load png from buffer - vips_pngload_buffer() - - - matload - load mat from file - vips_matload() - - - jpegload - load jpeg from file - vips_jpegload() - - - jpegload_buffer - load jpeg from buffer - vips_jpegload_buffer() - - - webpload - load webp from file - vips_webpload() - - - webpload_buffer - load webp from buffer - vips_webpload_buffer() - - - tiffload - load tiff from file - vips_tiffload() - - - tiffload_buffer - load tiff from buffer - vips_tiffload_buffer() - - - openslideload - load file with OpenSlide - vips_openslideload() - - - magickload - load file with ImageMagick - vips_magickload() - - - magickload_buffer - load image from buffer with ImageMagick - vips_magickload_buffer() - - - magicksave - save file with ImageMagick - vips_magicksave() - - - niftiload - load a NIfTI image - vips_niftiload() - - - niftisave - save image in NIfTI format - vips_niftisave() - - - fitsload - load a FITS image - vips_fitsload() - - - openexrload - load an OpenEXR image - vips_openexrload() - - - radsave - save image to Radiance file - vips_radsave() - - - ppmsave - save image to ppm file - vips_ppmsave() - - - csvsave - save image to csv file - vips_csvsave() - - - matrixsave - save image to matrix file - vips_matrixsave() - - - matrixprint - print matrix - vips_matrixprint() - - - rawsave - save image to raw file - vips_rawsave() - - - rawsave_fd - write raw image to file descriptor - vips_rawsave_fd() - - - dzsave - save image to deep zoom format - vips_dzsave() - - - dzsave_buffer - save image to dz buffer - vips_dzsave_buffer() - - - pngsave - save image to png file - vips_pngsave() - - - pngsave_buffer - save image to png buffer - vips_pngsave_buffer() - - - jpegsave - save image to jpeg file - vips_jpegsave() - - - jpegsave_buffer - save image to jpeg buffer - vips_jpegsave_buffer() - - - jpegsave_mime - save image to jpeg mime - vips_jpegsave_mime() - - - webpsave - save image to webp file - vips_webpsave() - - - webpsave_buffer - save image to webp buffer - vips_webpsave_buffer() - - - tiffsave - save image to tiff file - vips_tiffsave() - - - tiffsave_buffer - save image to tiff buffer - vips_tiffsave_buffer() - - - fitssave - save image to fits file - vips_fitssave() - - - shrink - shrink an image - vips_shrink() - - - shrinkh - shrink an image horizontally - vips_shrinkh() - - - shrinkv - shrink an image vertically - vips_shrinkv() - - - reduceh - shrink an image horizontally - vips_reduceh() - - - reducev - shrink an image vertically - vips_reducev() - - - reduce - reduce an image - vips_reduce() - - - thumbnail - generate thumbnail from file - vips_thumbnail() - - - thumbnail_buffer - generate thumbnail from buffer - vips_thumbnail_buffer() - - - thumbnail_image - generate thumbnail from image - vips_thumbnail_image() - - - mapim - resample an image with an arbitrary warp - vips_mapim() - - - affine - affine transform of an image - vips_affine() - - - similarity - similarity transform of an image - vips_similarity() - - - rotate - rotate an image by a number of degrees - vips_rotate() - - - resize - resize an image - vips_resize() - - - colourspace - convert to a new colourspace - vips_colourspace() - - - Lab2XYZ - transform CIELAB to XYZ - vips_Lab2XYZ() - - - XYZ2Lab - transform XYZ to Lab - vips_XYZ2Lab() - - - Lab2LCh - transform Lab to LCh - vips_Lab2LCh() - - - LCh2Lab - transform LCh to Lab - vips_LCh2Lab() - - - LCh2CMC - transform LCh to CMC - vips_LCh2CMC() - - - CMC2LCh - transform LCh to CMC - vips_CMC2LCh() - - - XYZ2Yxy - transform XYZ to Yxy - vips_XYZ2Yxy() - - - Yxy2XYZ - transform Yxy to XYZ - vips_Yxy2XYZ() - - - scRGB2XYZ - transform scRGB to XYZ - vips_scRGB2XYZ() - - - XYZ2scRGB - transform XYZ to scRGB - vips_XYZ2scRGB() - - - LabQ2Lab - unpack a LabQ image to float Lab - vips_LabQ2Lab() - - - Lab2LabQ - transform float Lab to LabQ coding - vips_Lab2LabQ() - - - LabQ2LabS - unpack a LabQ image to short Lab - vips_LabQ2LabS() - - - LabS2LabQ - transform short Lab to LabQ coding - vips_LabS2LabQ() - - - LabS2Lab - transform signed short Lab to float - vips_LabS2Lab() - - - Lab2LabS - transform float Lab to signed short - vips_Lab2LabS() - - - rad2float - unpack Radiance coding to float RGB - vips_rad2float() - - - float2rad - transform float RGB to Radiance coding - vips_float2rad() - - - LabQ2sRGB - unpack a LabQ image to short Lab - vips_LabQ2sRGB() - - - sRGB2HSV - transform sRGB to HSV - vips_sRGB2HSV() - - - HSV2sRGB - transform HSV to sRGB - vips_HSV2sRGB() - - - sRGB2scRGB - convert an sRGB image to scRGB - vips_sRGB2scRGB() - - - scRGB2BW - convert scRGB to BW - vips_scRGB2BW() - - - scRGB2sRGB - convert an scRGB image to sRGB - vips_scRGB2sRGB() - - - icc_import - import from device with ICC profile - vips_icc_import() - - - icc_export - output to device with ICC profile - vips_icc_export() - - - icc_transform - transform between devices with ICC profiles - vips_icc_transform() - - - dE76 - calculate dE76 - vips_dE76() - - - dE00 - calculate dE00 - vips_dE00() - - - dECMC - calculate dECMC - vips_dECMC() - - - maplut - map an image though a lut - vips_maplut() - - - percent - find threshold for percent of pixels - vips_percent() - - - stdif - statistical difference - vips_stdif() - - - hist_cum - form cumulative histogram - vips_hist_cum() - - - hist_match - match two histograms - vips_hist_match() - - - hist_norm - normalise histogram - vips_hist_norm() - - - hist_equal - histogram equalisation - vips_hist_equal() - - - hist_plot - plot histogram - vips_hist_plot() - - - hist_local - local histogram equalisation - vips_hist_local() - - - hist_ismonotonic - test for monotonicity - vips_hist_ismonotonic() - - - hist_entropy - estimate image entropy - vips_hist_entropy() - - - conv - convolution operation - vips_conv() - - - conva - approximate integer convolution - vips_conva() - - - convf - float convolution operation - vips_convf() - - - convi - int convolution operation - vips_convi() - - - compass - convolve with rotating mask - vips_compass() - - - convsep - seperable convolution operation - vips_convsep() - - - convasep - approximate separable integer convolution - vips_convasep() - - - sobel - Sobel edge detector - vips_sobel() + cache + Cache an image + vips_cache() canny @@ -1192,135 +272,1174 @@ vips_canny() - fastcor - fast correlation - vips_fastcor() + case + Use pixel values to pick cases from an array of images + vips_case() - spcor - spatial correlation - vips_spcor() + cast + Cast an image + vips_cast(), vips_cast_uchar(), vips_cast_char(), vips_cast_ushort(), vips_cast_shortcast_uint(), vips_cast_int(), vips_cast_float(), vips_cast_double(), vips_cast_complex(), vips_cast_dpcomplex() - sharpen - unsharp masking for print - vips_sharpen() + colourspace + Convert to a new colorspace + vips_colourspace() - gaussblur - gaussian blur - vips_gaussblur() + compass + Convolve with rotating mask + vips_compass() - fwfft - forward FFT - vips_fwfft() + complex + Perform a complex operation on an image + vips_complex(), vips_polar(), vips_rect(), vips_conj() - invfft - inverse FFT - vips_invfft() + complex2 + Complex binary operations on two images + vips_complex2(), vips_cross_phase() - freqmult - frequency-domain filtering - vips_freqmult() + complexform + Form a complex image from two real images + vips_complexform() - spectrum - make displayable power spectrum - vips_spectrum() + complexget + Get a component from a complex image + vips_complexget(), vips_real(), vips_imag() - phasecor - calculate phase correlation - vips_phasecor() + composite + Blend an array of images with an array of blend modes + vips_composite() - morph - morphology operation: dilate, erode, hitmiss - vips_morph() + composite2 + Blend a pair of images with a blend mode + vips_composite2() - rank - rank filter - vips_rank(), vips_median() + conv + Convolution operation + vips_conv() + + + conva + Approximate integer convolution + vips_conva() + + + convasep + Approximate separable integer convolution + vips_convasep() + + + convf + Float convolution operation + vips_convf() + + + convi + Int convolution operation + vips_convi() + + + convsep + Seperable convolution operation + vips_convsep() + + + copy + Copy an image + vips_copy() countlines - count lines in an image + Count lines in an image vips_countlines() - labelregions - label regions in an image - vips_labelregions() + csvload + Load csv from file + vips_csvload() - fill_nearest - replace each zero pixel with the nearest non-zero pixel - vips_fill_nearest() + csvsave + Save image to csv file + vips_csvsave() - draw_rect - paint a rectangle on an image - vips_draw_rect(), vips_draw_rect1(), vips_draw_point(), - vips_draw_point1() + dE00 + Calculate de00 + vips_dE00() - draw_mask - draw a mask on an image - vips_draw_mask(), vips_draw_mask1() + dE76 + Calculate de76 + vips_dE76() - draw_line - draw a line on an image - vips_draw_line(), vips_draw_line1() + dECMC + Calculate decmc + vips_dECMC() + + + deviate + Find image standard deviation + vips_deviate() + + + divide + Divide two images + vips_divide() draw_circle - draw a circle on an image + Draw a circle on an image vips_draw_circle(), vips_draw_circle1() draw_flood - flood-fill an area - vips_draw_flood(), vips_draw_flood1() + Flood-fill an area + vips_draw_flood(), vips_draw_flood() draw_image - paint an image into another image + Paint an image into another image vips_draw_image() + + draw_line + Draw a line on an image + vips_draw_line(), vips_draw_line1() + + + draw_mask + Draw a mask on an image + vips_draw_mask(), vips_draw_mask1() + + + draw_rect + Paint a rectangle on an image + vips_draw_rect(), vips_rect(), vips_draw_rect1(), vips_draw_point(), vips_draw_point1() + draw_smudge - blur a rectangle on an image + Blur a rectangle on an image vips_draw_smudge() + + dzsave + Save image to deepzoom file + vips_dzsave() + + + dzsave_buffer + Save image to dz buffer + vips_dzsave_buffer() + + + embed + Embed an image in a larger image + vips_embed() + + + extract_area + Extract an area from an image + vips_extract_area(), vips_crop() + + + extract_band + Extract band from an image + vips_extract_band() + + + eye + Make an image showing the eye's spatial response + vips_eye() + + + falsecolour + False-color an image + vips_falsecolour() + + + fastcor + Fast correlation + vips_fastcor() + + + fill_nearest + Fill image zeros with nearest non-zero pixel + vips_fill_nearest() + + + find_trim + Search an image for non-edge areas + vips_find_trim() + + + fitsload + Load a fits image + vips_fitsload() + + + fitssave + Save image to fits file + vips_fitssave() + + + flatten + Flatten alpha out of an image + vips_flatten() + + + flip + Flip an image + vips_flip() + + + float2rad + Transform float rgb to radiance coding + vips_float2rad() + + + fractsurf + Make a fractal surface + vips_fractsurf() + + + freqmult + Frequency-domain filtering + vips_freqmult() + + + fwfft + Forward fft + vips_fwfft() + + + gamma + Gamma an image + vips_gamma() + + + gaussblur + Gaussian blur + vips_gaussblur() + + + gaussmat + Make a gaussian image + vips_gaussmat() + + + gaussnoise + Make a gaussnoise image + vips_gaussnoise() + + + getpoint + Read a point from an image + vips_getpoint() + + + gifload + Load gif with giflib + vips_gifload() + + + gifload_buffer + Load gif with giflib + vips_gifload_buffer() + + + globalbalance + Global balance an image mosaic + vips_globalbalance() + + + gravity + Place an image within a larger image with a certain gravity + vips_gravity() + + + grey + Make a grey ramp image + vips_grey() + + + grid + Grid an image + vips_grid() + + + heifload + Load a heif image + vips_heifload() + + + heifload_buffer + Load a heif image + vips_heifload_buffer() + + + heifsave + Save image in heif format + vips_heifsave() + + + heifsave_buffer + Save image in heif format + vips_heifsave_buffer() + + + hist_cum + Form cumulative histogram + vips_hist_cum() + + + hist_entropy + Estimate image entropy + vips_hist_entropy() + + + hist_equal + Histogram equalisation + vips_hist_equal() + + + hist_find + Find image histogram + vips_hist_find() + + + hist_find_indexed + Find indexed image histogram + vips_hist_find_indexed() + + + hist_find_ndim + Find n-dimensional image histogram + vips_hist_find_ndim() + + + hist_ismonotonic + Test for monotonicity + vips_hist_ismonotonic() + + + hist_local + Local histogram equalisation + vips_hist_local() + + + hist_match + Match two histograms + vips_hist_match() + + + hist_norm + Normalise histogram + vips_hist_norm() + + + hist_plot + Plot histogram + vips_hist_plot() + + + hough_circle + Find hough circle transform + vips_hough_circle() + + + hough_line + Find hough line transform + vips_hough_line() + + + icc_export + Output to device with icc profile + vips_icc_export() + + + icc_import + Import from device with icc profile + vips_icc_import() + + + icc_transform + Transform between devices with icc profiles + vips_icc_transform() + + + identity + Make a 1d image where pixel values are indexes + vips_identity() + + + ifthenelse + Ifthenelse an image + vips_ifthenelse() + + + insert + Insert image @sub into @main at @x, @y + vips_insert() + + + invert + Invert an image + vips_invert() + + + invertlut + Build an inverted look-up table + vips_invertlut() + + + invfft + Inverse fft + vips_invfft() + + + join + Join a pair of images + vips_join() + + + jpegload + Load jpeg from file + vips_jpegload() + + + jpegload_buffer + Load jpeg from buffer + vips_jpegload_buffer() + + + jpegload_stream + Load image from jpeg stream + vips_jpegload_stream() + + + jpegsave + Save image to jpeg file + vips_jpegsave() + + + jpegsave_buffer + Save image to jpeg buffer + vips_jpegsave_buffer() + + + jpegsave_mime + Save image to jpeg mime + vips_jpegsave_mime() + + + jpegsave_stream + Save image to jpeg stream + vips_jpegsave_stream() + + + labelregions + Label regions in an image + vips_labelregions() + + + linear + Calculate (a * in + b) + vips_linear(), vips_linear1() + + + linecache + Cache an image as a set of lines + vips_linecache() + + + logmat + Make a laplacian of gaussian image + vips_logmat() + + + magickload + Load file with imagemagick + vips_magickload() + + + magickload_buffer + Load buffer with imagemagick + vips_magickload_buffer() + + + magicksave + Save file with imagemagick + vips_magicksave() + + + magicksave_buffer + Save image to magick buffer + vips_magicksave_buffer() + + + mapim + Resample with a map image + vips_mapim() + + + maplut + Map an image though a lut + vips_maplut() + + + mask_butterworth + Make a butterworth filter + vips_mask_butterworth() + + + mask_butterworth_band + Make a butterworth_band filter + vips_mask_butterworth_band() + + + mask_butterworth_ring + Make a butterworth ring filter + vips_mask_butterworth_ring() + + + mask_fractal + Make fractal filter + vips_mask_fractal() + + + mask_gaussian + Make a gaussian filter + vips_mask_gaussian() + + + mask_gaussian_band + Make a gaussian filter + vips_mask_gaussian_band() + + + mask_gaussian_ring + Make a gaussian ring filter + vips_mask_gaussian_ring() + + + mask_ideal + Make an ideal filter + vips_mask_ideal() + + + mask_ideal_band + Make an ideal band filter + vips_mask_ideal_band() + + + mask_ideal_ring + Make an ideal ring filter + vips_mask_ideal_ring() + + + match + First-order match of two images + vips_match() + + + math + Apply a math operation to an image + vips_math(), vips_sin(), vips_cos(), vips_tan(), vips_asin(), vips_acos(), vips_atan(), vips_exp(), vips_exp10(), vips_log(), vips_log10() + + + math2 + Binary math operations + vips_math2(), vips_pow(), vips_wop() + + + math2_const + Binary math operations with a constant + vips_math2_const(), vips_andimage_const(), vips_orimage_const(), vips_eorimage_const(), vips_lshift_const(), vips_rshift_const(), vips_math2_const1(), vips_andimage_const1(), vips_orimage_const1(), vips_eorimage_const1(), vips_lshift_const1(), vips_rshift_const1() + + + matload + Load mat from file + vips_matload() + + + matrixload + Load matrix from file + vips_matrixload() + + + matrixprint + Print matrix + vips_matrixprint() + + + matrixsave + Save image to matrix file + vips_matrixsave() + + + max + Find image maximum + vips_max() + + + measure + Measure a set of patches on a color chart + vips_measure() + merge - merge two images + Merge two images vips_merge() + + min + Find image minimum + vips_min() + + + morph + Morphology operation + vips_morph() + mosaic - mosaic two images + Mosaic two images vips_mosaic() mosaic1 - first-order mosaic of two images + First-order mosaic of two images vips_mosaic1() - match - first-order match of two images - vips_match() + msb + Pick most-significant byte from an image + vips_msb() - globalbalance - global balance an image mosaic - vips_globalbalance() + multiply + Multiply two images + vips_multiply() + + + niftiload + Load a nifti image + vips_niftiload() + + + niftisave + Save image to nifti file + vips_niftisave() + + + openexrload + Load an openexr image + vips_openexrload() + + + openslideload + Load file with openslide + vips_openslideload() + + + pdfload + Load pdf with libpoppler + vips_pdfload() + + + pdfload_buffer + Load pdf with libpoppler + vips_pdfload_buffer() + + + percent + Find threshold for percent of pixels + vips_percent() + + + perlin + Make a perlin noise image + vips_perlin() + + + phasecor + Calculate phase correlation + vips_phasecor() + + + pngload + Load png from file + vips_pngload() + + + pngload_buffer + Load png from buffer + vips_pngload_buffer() + + + pngload_stream + Load png from stream + vips_pngload_stream() + + + pngsave + Save image to png file + vips_pngsave() + + + pngsave_buffer + Save image to png buffer + vips_pngsave_buffer() + + + pngsave_stream + Save image to png stream + vips_pngsave_stream() + + + ppmload + Load ppm from file + vips_ppmload() + + + ppmsave + Save image to ppm file + vips_ppmsave() + + + premultiply + Premultiply image alpha + vips_premultiply() + + + profile + Find image profiles + vips_profile() + + + profile_load + Load named icc profile + vips_profile_load() + + + project + Find image projections + vips_project() + + + quadratic + Resample an image with a quadratic transform + vips_quadratic() + + + rad2float + Unpack radiance coding to float rgb + vips_rad2float() + + + radload + Load a radiance image from a file + vips_radload() + + + radload_buffer + Load rad from buffer + vips_radload_buffer() + + + radload_stream + Load rad from stream + vips_radload_stream() + + + radsave + Save image to radiance file + vips_radsave() + + + radsave_buffer + Save image to radiance buffer + vips_radsave_buffer() + + + radsave_stream + Save image to radiance stream + vips_radsave_stream() + + + rank + Rank filter + vips_rank(), vips_median() + + + rawload + Load raw data from a file + vips_rawload() + + + rawsave + Save image to raw file + vips_rawsave() + + + rawsave_fd + Write raw image to file descriptor + vips_rawsave_fd() + + + recomb + Linear recombination with matrix + vips_recomb() + + + reduce + Reduce an image + vips_reduce() + + + reduceh + Shrink an image horizontally + vips_reduceh() + + + reducev + Shrink an image vertically + vips_reducev() + + + relational + Relational operation on two images + vips_relational(), vips_equal(), vips_notequal(), vips_less(), vips_lesseq(), vips_more(), vips_moreeq() + + + relational_const + Relational operations against a constant + vips_relational_const(), vips_equal_const(), vips_notequal_const(), vips_less_const(), vips_lesseq_const(), vips_more_const(), vips_moreeq_const(), vips_relational_const1(), vips_equal_const1(), vips_notequal_const1(), vips_less_const1(), vips_lesseq_const1(), vips_more_const1(), vips_moreeq_const1() + + + remainder + Remainder after integer division of two images + vips_remainder() + + + remainder_const + Remainder after integer division of an image and a constant + vips_remainder_const(), vips_remainder_const1() + + + replicate + Replicate an image + vips_replicate() + + + resize + Resize an image + vips_resize() + + + rot + Rotate an image + vips_rot() + + + rot45 + Rotate an image + vips_rot45() + + + rotate + Rotate an image by a number of degrees + vips_rotate() + + + round + Perform a round function on an image + vips_round(), vips_floor(), vips_ceil(), vips_rint() + + + sRGB2HSV + Transform srgb to hsv + vips_sRGB2HSV() + + + sRGB2scRGB + Convert an srgb image to scrgb + vips_sRGB2scRGB() + + + scRGB2BW + Convert scrgb to bw + vips_scRGB2BW() + + + scRGB2XYZ + Transform scrgb to xyz + vips_scRGB2XYZ() + + + scRGB2sRGB + Convert an scrgb image to srgb + vips_scRGB2sRGB() + + + scale + Scale an image to uchar + vips_scale() + + + sequential + Check sequential access + vips_sequential() + + + sharpen + Unsharp masking for print + vips_sharpen() + + + shrink + Shrink an image + vips_shrink() + + + shrinkh + Shrink an image horizontally + vips_shrinkh() + + + shrinkv + Shrink an image vertically + vips_shrinkv() + + + sign + Unit vector of pixel + vips_sign() + + + similarity + Similarity transform of an image + vips_similarity() + + + sines + Make a 2d sine wave + vips_sines() + + + smartcrop + Extract an area from an image + vips_smartcrop() + + + sobel + Sobel edge detector + vips_sobel() + + + spcor + Spatial correlation + vips_spcor() + + + spectrum + Make displayable power spectrum + vips_spectrum() + + + stats + Find many image stats + vips_stats() + + + stdif + Statistical difference + vips_stdif() + + + subsample + Subsample an image + vips_subsample() + + + subtract + Subtract two images + vips_subtract() + + + sum + Sum an array of images + vips_sum() + + + svgload + Load svg with rsvg + vips_svgload() + + + svgload_buffer + Load svg with rsvg + vips_svgload_buffer() + + + svgload_stream + Load svg from stream + vips_svgload_stream() + + + switch + Find the index of the first non-zero pixel in tests + vips_switch() + + + system + Run an external command + vips_system() + + + text + Make a text image + vips_text() + + + thumbnail + Generate thumbnail from file + vips_thumbnail() + + + thumbnail_buffer + Generate thumbnail from buffer + vips_thumbnail_buffer() + + + thumbnail_image + Generate thumbnail from image + vips_thumbnail_image() + + + thumbnail_stream + Generate thumbnail from stream + vips_thumbnail_stream() + + + tiffload + Load tiff from file + vips_tiffload() + + + tiffload_buffer + Load tiff from buffer + vips_tiffload_buffer() + + + tiffload_stream + Load tiff from stream + vips_tiffload_stream() + + + tiffsave + Save image to tiff file + vips_tiffsave() + + + tiffsave_buffer + Save image to tiff buffer + vips_tiffsave_buffer() + + + tilecache + Cache an image as a set of tiles + vips_tilecache() + + + tonelut + Build a look-up table + vips_tonelut() + + + transpose3d + Transpose3d an image + vips_transpose3d() + + + unpremultiply + Unpremultiply image alpha + vips_unpremultiply() + + + vipsload + Load vips from file + vips_vipsload() + + + vipssave + Save image to vips file + vips_vipssave() + + + webpload + Load webp from file + vips_webpload() + + + webpload_buffer + Load webp from buffer + vips_webpload_buffer() + + + webpload_stream + Load webp from stream + vips_webpload_stream() + + + webpsave + Save image to webp file + vips_webpsave() + + + webpsave_buffer + Save image to webp buffer + vips_webpsave_buffer() + + + webpsave_stream + Save image to webp stream + vips_webpsave_stream() + + + worley + Make a worley noise image + vips_worley() + + + wrap + Wrap image origin + vips_wrap() + + + xyz + Make an image where pixel values are coordinates + vips_xyz() + + + zone + Make a zone plate + vips_zone() + + + zoom + Zoom an image + vips_zoom() diff --git a/doc/gen-function-list.py b/doc/gen-function-list.py index d1394b32..4d91eed9 100755 --- a/doc/gen-function-list.py +++ b/doc/gen-function-list.py @@ -15,7 +15,7 @@ # vips_gamma() # -from pyvips import Operation, Error, \ +from pyvips import Introspect, Operation, Error, \ ffi, type_map, type_from_name, nickname_find # for VipsOperationFlags @@ -23,13 +23,15 @@ _OPERATION_DEPRECATED = 8 def gen_function(operation_name): - op = Operation.new_from_name(operation_name) + intro = Introspect.get(operation_name) - print('') - print(' {}'.format(operation_name)) - print(' {}'.format(op.get_description().capitalize())) - print(' vips_{}()'.format(operation_name)) - print('') + result = '\n' + result += ' {}\n'.format(operation_name) + result += ' {}\n'.format(intro.description.capitalize()) + result += ' vips_{}()\n'.format(operation_name) + result += '' + + return result def gen_function_list(): @@ -39,10 +41,10 @@ def gen_function_list(): nickname = nickname_find(gtype) try: # can fail for abstract types - op = Operation.new_from_name(nickname) + intro = Introspect.get(nickname) # we are only interested in non-deprecated operations - if (op.get_flags() & _OPERATION_DEPRECATED) == 0: + if (intro.flags & _OPERATION_DEPRECATED) == 0: all_nicknames.append(nickname) except Error: pass @@ -53,15 +55,50 @@ def gen_function_list(): type_map(type_from_name('VipsOperation'), add_nickname) - # add 'missing' synonyms by hand - all_nicknames.append('crop') - # make list unique and sort all_nicknames = list(set(all_nicknames)) all_nicknames.sort() + # make dict with overloads + overloads = { + 'bandbool': ['bandand', 'bandor', 'bandeor', 'bandmean'], + 'bandjoin': ['bandjoin2'], + 'bandjoin_const': ['bandjoin_const1'], + 'boolean': ['andimage', 'orimage', 'eorimage', 'lshift', 'rshift'], + 'cast': ['cast_uchar', 'cast_char', 'cast_ushort', 'cast_short' 'cast_uint', 'cast_int', 'cast_float', + 'cast_double', 'cast_complex', 'cast_dpcomplex'], + 'complex': ['polar', 'rect', 'conj'], + 'complex2': ['cross_phase'], + 'complexget': ['real', 'imag'], + 'draw_circle': ['draw_circle1'], + 'draw_flood': ['draw_flood'], + 'draw_line': ['draw_line1'], + 'draw_mask': ['draw_mask1'], + 'draw_rect': ['rect', 'draw_rect1', 'draw_point', 'draw_point1'], + 'extract_area': ['crop'], + 'linear': ['linear1'], + 'math': ['sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'exp', 'exp10', 'log', 'log10'], + 'math2': ['pow', 'wop'], + 'rank': ['median'], + 'relational': ['equal', 'notequal', 'less', 'lesseq', 'more', 'moreeq'], + 'remainder_const': ['remainder_const1'], + 'round': ['floor', 'ceil', 'rint'], + } + + overloads['boolean_const'] = [o + '_const' for o in overloads['boolean']] + ['boolean_const1'] + \ + [o + '_const1' for o in overloads['boolean']] + + overloads['math2_const'] = [o + '_const' for o in overloads['boolean']] + ['math2_const1'] + \ + [o + '_const1' for o in overloads['boolean']] + + overloads['relational_const'] = [o + '_const' for o in overloads['relational']] + ['relational_const1'] + \ + [o + '_const1' for o in overloads['relational']] + for nickname in all_nicknames: - gen_function(nickname) + result = gen_function(nickname) + if nickname in overloads: + result = result.replace('()', '(), ' + (', '.join('vips_{}()'.format(n) for n in overloads[nickname]))) + print(result) if __name__ == '__main__': diff --git a/test/.gitignore b/test/.gitignore index 3b5549c9..4463a396 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1 +1,2 @@ test_descriptors +test_streams diff --git a/test/test_streams b/test/test_streams deleted file mode 100755 index b7e8f017..00000000 --- a/test/test_streams +++ /dev/null @@ -1,210 +0,0 @@ -#! /bin/bash - -# test_streams - temporary wrapper script for .libs/test_streams -# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-11 -# -# The test_streams program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' ../libvips/libvips.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "test_streams:test_streams:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-11" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "test_streams:test_streams:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "test_streams:test_streams:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='test_streams' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/john/GIT/libvips/libvips/.libs:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi