diff --git a/.gitignore b/.gitignore index d12977b5..837f8325 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ vendor .gitattributes .DS_Store .nyc_output +.vscode/ package-lock.json diff --git a/.npmignore b/.npmignore index aab1aa52..6bcd27ba 100644 --- a/.npmignore +++ b/.npmignore @@ -13,3 +13,4 @@ vendor .prebuildrc .nyc_output .github/ +.vscode/ diff --git a/.travis.yml b/.travis.yml index 3295ebcd..620ceb7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,5 @@ matrix: include: - - name: "Linux (glibc) - Node 6" - os: linux - dist: trusty - sudo: false - language: node_js - node_js: "6" - name: "Linux (glibc) - Node 8" os: linux dist: trusty @@ -27,12 +21,6 @@ matrix: after_success: - npm install coveralls - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - - name: "Linux (glibc) - Node 11" - os: linux - dist: trusty - sudo: false - language: node_js - node_js: "11" - name: "Linux (musl) - Node 8" os: linux dist: trusty @@ -53,16 +41,6 @@ matrix: - sudo docker exec sharp apk add build-base git python2 --update-cache install: sudo docker exec sharp sh -c "npm install --unsafe-perm" script: sudo docker exec sharp sh -c "npm test" - - name: "Linux (musl) - Node 11" - os: linux - dist: trusty - sudo: true - language: minimal - before_install: - - sudo docker run -dit --name sharp --env CI --env PREBUILD_TOKEN --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:11-alpine - - sudo docker exec sharp apk add build-base git python2 --update-cache - install: sudo docker exec sharp sh -c "npm install --unsafe-perm" - script: sudo docker exec sharp sh -c "npm test" - name: "Linux (musl) - Node 12" os: linux dist: trusty @@ -73,11 +51,6 @@ matrix: - sudo docker exec sharp apk add build-base git python2 --update-cache install: sudo docker exec sharp sh -c "npm install --unsafe-perm" script: sudo docker exec sharp sh -c "npm test" - - name: "OS X - Node 6" - os: osx - osx_image: xcode9.2 - language: node_js - node_js: "6" - name: "OS X - Node 8" os: osx osx_image: xcode9.2 @@ -88,11 +61,6 @@ matrix: osx_image: xcode9.2 language: node_js node_js: "10" - - name: "OS X - Node 11" - os: osx - osx_image: xcode9.2 - language: node_js - node_js: "11" - name: "OS X - Node 12" os: osx osx_image: xcode9.2 diff --git a/README.md b/README.md index 0113222a..2ddfc38a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available. Most modern 64-bit OS X, Windows and Linux systems running -Node versions 6, 8, 10, 11 and 12 +Node versions 8, 10 and 12 do not require any additional install or runtime dependencies. ## Examples diff --git a/appveyor.yml b/appveyor.yml index a79c95ff..de6e8803 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,10 +4,8 @@ build: off platform: x64 environment: matrix: - - nodejs_version: "6" - nodejs_version: "8" - nodejs_version: "10" - - nodejs_version: "11" - nodejs_version: "12" install: - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) x64 diff --git a/binding.gyp b/binding.gyp index 7a64e6ca..a20c3f41 100644 --- a/binding.gyp +++ b/binding.gyp @@ -97,7 +97,8 @@ 'conditions': [ ['OS == "win"', { 'defines': [ - '_ALLOW_KEYWORD_MACROS' + '_ALLOW_KEYWORD_MACROS', + '_FILE_OFFSET_BITS=64' ], 'libraries': [ '../vendor/lib/libvips.lib', @@ -183,22 +184,15 @@ 'configurations': { 'Release': { 'cflags_cc': [ - '-Wno-cast-function-type', - '-Wno-deprecated-declarations' + '-Wno-cast-function-type' ], - 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': [ - '-Wno-deprecated-declarations' - ] - }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 } }, 'msvs_disabled_warnings': [ - 4275, - 4996 + 4275 ] } }, diff --git a/docs/changelog.md b/docs/changelog.md index 1987f836..3e9f41db 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,16 @@ # Changelog +### v0.23 - "*vision*" + +Requires libvips v8.8.0. + +#### v0.23.0 - TBD + +* Remove `overlayWith` previously deprecated in v0.22.0. + +* Drop support for Node.js versions 6 and 11. + [#1212](https://github.com/lovell/sharp/issues/1674) + ### v0.22 - "*uptake*" Requires libvips v8.7.4. diff --git a/docs/index.md b/docs/index.md index f6f5f9a0..1190f605 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,7 @@ As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available. Most modern 64-bit OS X, Windows and Linux systems running -Node versions 6, 8, 10, 11 and 12 +Node versions 8, 10 and 12 do not require any additional install or runtime dependencies. [![Test Coverage](https://coveralls.io/repos/lovell/sharp/badge.png?branch=master)](https://coveralls.io/r/lovell/sharp?branch=master) diff --git a/docs/install.md b/docs/install.md index 296b47bc..21439a37 100644 --- a/docs/install.md +++ b/docs/install.md @@ -10,12 +10,12 @@ yarn add sharp ## Prerequisites -* Node.js v6+ +* Node.js v8.5.0+ ### Building from source Pre-compiled binaries for sharp are provided for use with -Node versions 6, 8, 10, 11 and 12 on +Node versions 8, 10 and 12 on 64-bit Windows, OS X and Linux platforms. Sharp will be built from source at install time when: @@ -36,19 +36,20 @@ Building from source requires: [![Ubuntu 16.04 Build Status](https://travis-ci.org/lovell/sharp.png?branch=master)](https://travis-ci.org/lovell/sharp) libvips and its dependencies are fetched and stored within `node_modules/sharp/vendor` during `npm install`. -This involves an automated HTTPS download of approximately 9MB. +This involves an automated HTTPS download of approximately 10MB. Most Linux-based (glibc, musl) operating systems running on x64 and ARMv6+ CPUs should "just work", e.g.: -* Debian 7+ +* Debian 8+ * Ubuntu 14.04+ -* Centos 7+ -* Alpine 3.8+ (Node 8+) +* Red Hat Enterprise 8 +* CentOS 8 +* Alpine 3.8+ * Fedora * openSUSE 13.2+ * Archlinux * Raspbian Jessie -* Amazon Linux +* Amazon Linux 2 * Solus To use a globally-installed version of libvips instead of the provided binaries, @@ -61,7 +62,8 @@ and `LD_LIBRARY_PATH` at runtime. This allows the use of newer versions of libvips with older versions of sharp. -For 32-bit Intel CPUs and older Linux-based operating systems such as Centos 6, +For 32-bit Intel CPUs and older Linux-based operating systems such as +those based on Red Hat Enterprise Linux 7 (e.g. CentOS 7, Amazon Linux 1) compiling libvips from source is recommended. [https://libvips.github.io/libvips/install.html#building-libvips-from-a-source-tarball](https://libvips.github.io/libvips/install.html#building-libvips-from-a-source-tarball) @@ -97,7 +99,7 @@ that it can be located using `pkg-config --modversion vips-cpp`. [![Windows x64 Build Status](https://ci.appveyor.com/api/projects/status/pgtul704nkhhg6sg)](https://ci.appveyor.com/project/lovell/sharp) libvips and its dependencies are fetched and stored within `node_modules\sharp\vendor` during `npm install`. -This involves an automated HTTPS download of approximately 14MB. +This involves an automated HTTPS download of approximately 10MB. If you are having issues during installation consider removing the directory `C:\Users\[user]\AppData\Roaming\npm-cache\_libvips`. @@ -150,7 +152,7 @@ docker pull tailor/docker-libvips ### AWS Lambda -Set the Lambda runtime to Node.js 8.10. +Set the Lambda runtime to `nodejs10.x`. The binaries in the `node_modules` directory of the [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html) @@ -160,14 +162,14 @@ On non-Linux machines such as OS X and Windows run the following: ```sh rm -rf node_modules/sharp -npm install --arch=x64 --platform=linux --target=8.10.0 sharp +npm install --arch=x64 --platform=linux --target=10.15.0 sharp ``` Alternatively a Docker container closely matching the Lambda runtime can be used: ```sh rm -rf node_modules/sharp -docker run -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 npm install sharp +docker run -v "$PWD":/var/task lambci/lambda:build-nodejs10.x npm install sharp ``` To get the best performance select the largest memory available. diff --git a/install/dll-copy.js b/install/dll-copy.js index c88ea2f0..eac3cfcc 100644 --- a/install/dll-copy.js +++ b/install/dll-copy.js @@ -3,7 +3,6 @@ const fs = require('fs'); const path = require('path'); -const copyFileSync = require('fs-copy-file-sync'); const libvips = require('../lib/libvips'); const npmLog = require('npmlog'); @@ -24,7 +23,7 @@ if (process.platform === 'win32') { return /\.dll$/.test(filename); }) .forEach(function (filename) { - copyFileSync( + fs.copyFileSync( path.join(vendorLibDir, filename), path.join(buildReleaseDir, filename) ); diff --git a/install/libvips.js b/install/libvips.js index da2e4ab2..39fd4cfa 100644 --- a/install/libvips.js +++ b/install/libvips.js @@ -9,7 +9,6 @@ const npmLog = require('npmlog'); const semver = require('semver'); const simpleGet = require('simple-get'); const tar = require('tar'); -const copyFileSync = require('fs-copy-file-sync'); const agent = require('../lib/agent'); const libvips = require('../lib/libvips'); @@ -64,7 +63,7 @@ try { if (platformAndArch === 'freebsd-x64' || platformAndArch === 'openbsd-x64' || platformAndArch === 'sunos-x64') { throw new Error(`BSD/SunOS systems require manual installation of libvips >= ${minimumLibvipsVersion}`); } - if (detectLibc.family === detectLibc.GLIBC && detectLibc.version && semver.lt(`${detectLibc.version}.0`, '2.13.0')) { + if (detectLibc.family === detectLibc.GLIBC && detectLibc.version && semver.lt(`${detectLibc.version}.0`, '2.19.0')) { throw new Error(`Use with glibc version ${detectLibc.version} requires manual installation of libvips >= ${minimumLibvipsVersion}`); } // Download to per-process temporary file @@ -97,7 +96,7 @@ try { fs.renameSync(tarPathTemp, tarPathCache); } catch (err) { // Fall back to copy and unlink - copyFileSync(tarPathTemp, tarPathCache); + fs.copyFileSync(tarPathTemp, tarPathCache); fs.unlinkSync(tarPathTemp); } extractTarball(tarPathCache); diff --git a/lib/composite.js b/lib/composite.js index 44f170f8..d934bb80 100644 --- a/lib/composite.js +++ b/lib/composite.js @@ -1,7 +1,5 @@ 'use strict'; -const deprecate = require('util').deprecate; - const is = require('./is'); /** @@ -154,21 +152,11 @@ function composite (images) { return this; } -/** - * @deprecated - * @private - */ -function overlayWith (input, options) { - const blend = (is.object(options) && options.cutout) ? 'dest-in' : 'over'; - return this.composite([Object.assign({ input, blend }, options)]); -} - /** * Decorate the Sharp prototype with composite-related functions. * @private */ module.exports = function (Sharp) { Sharp.prototype.composite = composite; - Sharp.prototype.overlayWith = deprecate(overlayWith, 'overlayWith(input, options) is deprecated, use composite([{ input, ...options }]) instead'); Sharp.blend = blend; }; diff --git a/package.json b/package.json index 153046a7..7ae62af8 100644 --- a/package.json +++ b/package.json @@ -93,39 +93,38 @@ "vips" ], "dependencies": { - "color": "^3.1.1", + "color": "^3.1.2", "detect-libc": "^1.0.3", - "fs-copy-file-sync": "^1.1.1", - "nan": "^2.13.2", + "nan": "^2.14.0", "npmlog": "^4.1.2", "prebuild-install": "^5.3.0", - "semver": "^6.0.0", + "semver": "^6.1.2", "simple-get": "^3.0.3", - "tar": "^4.4.8", + "tar": "^4.4.10", "tunnel-agent": "^0.6.0" }, "devDependencies": { - "async": "^2.6.2", + "async": "^3.1.0", "cc": "^1.0.2", "decompress-zip": "^0.3.2", - "documentation": "^10.0.0", + "documentation": "^11.0.1", "exif-reader": "^1.0.2", "icc": "^1.0.0", "license-checker": "^25.0.1", "mocha": "^6.1.4", - "mock-fs": "^4.9.0", - "nyc": "^14.0.0", - "prebuild": "^8.2.1", + "mock-fs": "^4.10.1", + "nyc": "^14.1.1", + "prebuild": "^9.0.0", "prebuild-ci": "^3.0.0", "rimraf": "^2.6.3", "semistandard": "^13.0.1" }, "license": "Apache-2.0", "config": { - "libvips": "8.7.4" + "libvips": "8.8.0" }, "engines": { - "node": ">=6" + "node": ">=8.5.0" }, "semistandard": { "env": [ diff --git a/src/common.h b/src/common.h index cf55b689..ed04ea02 100644 --- a/src/common.h +++ b/src/common.h @@ -25,8 +25,8 @@ // Verify platform and compiler compatibility -#if (VIPS_MAJOR_VERSION < 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 7)) -#error libvips version 8.7.0+ is required - see sharp.pixelplumbing.com/page/install +#if (VIPS_MAJOR_VERSION < 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 8)) +#error libvips version 8.8.0+ is required - see sharp.pixelplumbing.com/page/install #endif #if ((!defined(__clang__)) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6))) diff --git a/src/libvips/cplusplus/VError.cpp b/src/libvips/cplusplus/VError.cpp index 67e67348..a3d82188 100644 --- a/src/libvips/cplusplus/VError.cpp +++ b/src/libvips/cplusplus/VError.cpp @@ -32,8 +32,6 @@ #endif /*HAVE_CONFIG_H*/ #include -#include - #include VIPS_NAMESPACE_START diff --git a/src/libvips/cplusplus/VImage.cpp b/src/libvips/cplusplus/VImage.cpp index 3c1acd98..205b46cb 100644 --- a/src/libvips/cplusplus/VImage.cpp +++ b/src/libvips/cplusplus/VImage.cpp @@ -563,7 +563,7 @@ VImage::new_from_file( const char *name, VOption *options ) } VImage -VImage::new_from_buffer( void *buf, size_t len, const char *option_string, +VImage::new_from_buffer( const void *buf, size_t len, const char *option_string, VOption *options ) { const char *operation_name; @@ -588,6 +588,13 @@ VImage::new_from_buffer( void *buf, size_t len, const char *option_string, return( out ); } +VImage +VImage::new_from_buffer( const std::string &buf, const char *option_string, + VOption *options ) +{ + return( new_from_buffer( buf.c_str(), buf.size(), option_string, options ) ); +} + VImage VImage::new_matrix( int width, int height ) { diff --git a/src/libvips/cplusplus/vips-operators.cpp b/src/libvips/cplusplus/vips-operators.cpp index 9f22ffe4..beae5057 100644 --- a/src/libvips/cplusplus/vips-operators.cpp +++ b/src/libvips/cplusplus/vips-operators.cpp @@ -1,2416 +1,26 @@ // bodies for vips operations -// Mon 11 Jun 14:28:56 BST 2018 +// Wed Apr 24 15:50:21 CEST 2019 // this file is generated automatically, do not edit! -void VImage::system( char * cmd_format , VOption *options ) -{ - call( "system" , - (options ? options : VImage::option()) -> - set( "cmd-format", cmd_format ) ); -} - -VImage VImage::add( VImage right , VOption *options ) const -{ - VImage out; - - call( "add" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::subtract( VImage right , VOption *options ) const -{ - VImage out; - - call( "subtract" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::multiply( VImage right , VOption *options ) const -{ - VImage out; - - call( "multiply" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::divide( VImage right , VOption *options ) const -{ - VImage out; - - call( "divide" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::relational( VImage right , VipsOperationRelational relational , VOption *options ) const -{ - VImage out; - - call( "relational" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) -> - set( "relational", relational ) ); - - return( out ); -} - -VImage VImage::remainder( VImage right , VOption *options ) const -{ - VImage out; - - call( "remainder" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::boolean( VImage right , VipsOperationBoolean boolean , VOption *options ) const -{ - VImage out; - - call( "boolean" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) -> - set( "boolean", boolean ) ); - - return( out ); -} - -VImage VImage::math2( VImage right , VipsOperationMath2 math2 , VOption *options ) const -{ - VImage out; - - call( "math2" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) -> - set( "math2", math2 ) ); - - return( out ); -} - -VImage VImage::complex2( VImage right , VipsOperationComplex2 cmplx , VOption *options ) const -{ - VImage out; - - call( "complex2" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) -> - set( "cmplx", cmplx ) ); - - return( out ); -} - -VImage VImage::complexform( VImage right , VOption *options ) const -{ - VImage out; - - call( "complexform" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sum( std::vector in , VOption *options ) -{ - VImage out; - - call( "sum" , - (options ? options : VImage::option()) -> - set( "in", in ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::invert( VOption *options ) const -{ - VImage out; - - call( "invert" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::linear( std::vector a , std::vector b , VOption *options ) const -{ - VImage out; - - call( "linear" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "a", a ) -> - set( "b", b ) ); - - return( out ); -} - -VImage VImage::math( VipsOperationMath math , VOption *options ) const -{ - VImage out; - - call( "math" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "math", math ) ); - - return( out ); -} - -VImage VImage::abs( VOption *options ) const -{ - VImage out; - - call( "abs" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sign( VOption *options ) const -{ - VImage out; - - call( "sign" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::round( VipsOperationRound round , VOption *options ) const -{ - VImage out; - - call( "round" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "round", round ) ); - - return( out ); -} - -VImage VImage::relational_const( VipsOperationRelational relational , std::vector c , VOption *options ) const -{ - VImage out; - - call( "relational_const" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "relational", relational ) -> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::remainder_const( std::vector c , VOption *options ) const -{ - VImage out; - - call( "remainder_const" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::boolean_const( VipsOperationBoolean boolean , std::vector c , VOption *options ) const -{ - VImage out; - - call( "boolean_const" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "boolean", boolean ) -> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::math2_const( VipsOperationMath2 math2 , std::vector c , VOption *options ) const -{ - VImage out; - - call( "math2_const" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "math2", math2 ) -> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::complex( VipsOperationComplex cmplx , VOption *options ) const -{ - VImage out; - - call( "complex" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "cmplx", cmplx ) ); - - return( out ); -} - -VImage VImage::complexget( VipsOperationComplexget get , VOption *options ) const -{ - VImage out; - - call( "complexget" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "get", get ) ); - - return( out ); -} - -double VImage::avg( VOption *options ) const -{ - double out; - - call( "avg" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -double VImage::min( VOption *options ) const -{ - double out; - - call( "min" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -double VImage::max( VOption *options ) const -{ - double out; - - call( "max" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -double VImage::deviate( VOption *options ) const -{ - double out; - - call( "deviate" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::stats( VOption *options ) const -{ - VImage out; - - call( "stats" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_find( VOption *options ) const -{ - VImage out; - - call( "hist_find" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_find_ndim( VOption *options ) const -{ - VImage out; - - call( "hist_find_ndim" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_find_indexed( VImage index , VOption *options ) const -{ - VImage out; - - call( "hist_find_indexed" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "index", index ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hough_line( VOption *options ) const -{ - VImage out; - - call( "hough_line" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hough_circle( VOption *options ) const -{ - VImage out; - - call( "hough_circle" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::project( VImage * rows , VOption *options ) const -{ - VImage columns; - - call( "project" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "columns", &columns ) -> - set( "rows", rows ) ); - - return( columns ); -} - -VImage VImage::profile( VImage * rows , VOption *options ) const -{ - VImage columns; - - call( "profile" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "columns", &columns ) -> - set( "rows", rows ) ); - - return( columns ); -} - -VImage VImage::measure( int h , int v , VOption *options ) const -{ - VImage out; - - call( "measure" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "h", h ) -> - set( "v", v ) ); - - return( out ); -} - -std::vector VImage::getpoint( int x , int y , VOption *options ) const -{ - std::vector out_array; - - call( "getpoint" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out-array", &out_array ) -> - set( "x", x ) -> - set( "y", y ) ); - - return( out_array ); -} - -int VImage::find_trim( int * top , int * width , int * height , VOption *options ) const -{ - int left; - - call( "find_trim" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "left", &left ) -> - set( "top", top ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( left ); -} - -VImage VImage::copy( VOption *options ) const -{ - VImage out; - - call( "copy" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::tilecache( VOption *options ) const -{ - VImage out; - - call( "tilecache" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::linecache( VOption *options ) const -{ - VImage out; - - call( "linecache" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sequential( VOption *options ) const -{ - VImage out; - - call( "sequential" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::cache( VOption *options ) const -{ - VImage out; - - call( "cache" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::embed( int x , int y , int width , int height , VOption *options ) const -{ - VImage out; - - call( "embed" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "x", x ) -> - set( "y", y ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::gravity( VipsCompassDirection direction , int width , int height , VOption *options ) const -{ - VImage out; - - call( "gravity" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "direction", direction ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::flip( VipsDirection direction , VOption *options ) const -{ - VImage out; - - call( "flip" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "direction", direction ) ); - - return( out ); -} - -VImage VImage::insert( VImage sub , int x , int y , VOption *options ) const -{ - VImage out; - - call( "insert" , - (options ? options : VImage::option()) -> - set( "main", *this ) -> - set( "sub", sub ) -> - set( "out", &out ) -> - set( "x", x ) -> - set( "y", y ) ); - - return( out ); -} - -VImage VImage::join( VImage in2 , VipsDirection direction , VOption *options ) const -{ - VImage out; - - call( "join" , - (options ? options : VImage::option()) -> - set( "in1", *this ) -> - set( "in2", in2 ) -> - set( "out", &out ) -> - set( "direction", direction ) ); - - return( out ); -} - -VImage VImage::arrayjoin( std::vector in , VOption *options ) -{ - VImage out; - - call( "arrayjoin" , - (options ? options : VImage::option()) -> - set( "in", in ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::extract_area( int left , int top , int width , int height , VOption *options ) const -{ - VImage out; - - call( "extract_area" , - (options ? options : VImage::option()) -> - set( "input", *this ) -> - set( "out", &out ) -> - set( "left", left ) -> - set( "top", top ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::smartcrop( int width , int height , VOption *options ) const -{ - VImage out; - - call( "smartcrop" , - (options ? options : VImage::option()) -> - set( "input", *this ) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::extract_band( int band , VOption *options ) const -{ - VImage out; - - call( "extract_band" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "band", band ) ); - - return( out ); -} - -VImage VImage::bandjoin( std::vector in , VOption *options ) -{ - VImage out; - - call( "bandjoin" , - (options ? options : VImage::option()) -> - set( "in", in ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::bandjoin_const( std::vector c , VOption *options ) const -{ - VImage out; - - call( "bandjoin_const" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "c", c ) ); - - return( out ); -} - -VImage VImage::bandrank( std::vector in , VOption *options ) -{ - VImage out; - - call( "bandrank" , - (options ? options : VImage::option()) -> - set( "in", in ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::bandmean( VOption *options ) const -{ - VImage out; - - call( "bandmean" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::bandbool( VipsOperationBoolean boolean , VOption *options ) const -{ - VImage out; - - call( "bandbool" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "boolean", boolean ) ); - - return( out ); -} - -VImage VImage::replicate( int across , int down , VOption *options ) const -{ - VImage out; - - call( "replicate" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "across", across ) -> - set( "down", down ) ); - - return( out ); -} - -VImage VImage::cast( VipsBandFormat format , VOption *options ) const -{ - VImage out; - - call( "cast" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "format", format ) ); - - return( out ); -} - -VImage VImage::rot( VipsAngle angle , VOption *options ) const -{ - VImage out; - - call( "rot" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "angle", angle ) ); - - return( out ); -} - -VImage VImage::rot45( VOption *options ) const -{ - VImage out; - - call( "rot45" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::autorot( VOption *options ) const -{ - VImage out; - - call( "autorot" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::ifthenelse( VImage in1 , VImage in2 , VOption *options ) const -{ - VImage out; - - call( "ifthenelse" , - (options ? options : VImage::option()) -> - set( "cond", *this ) -> - set( "in1", in1 ) -> - set( "in2", in2 ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::recomb( VImage m , VOption *options ) const -{ - VImage out; - - call( "recomb" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "m", m ) ); - - return( out ); -} - -VImage VImage::bandfold( VOption *options ) const -{ - VImage out; - - call( "bandfold" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::bandunfold( VOption *options ) const -{ - VImage out; - - call( "bandunfold" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::flatten( VOption *options ) const -{ - VImage out; - - call( "flatten" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::premultiply( VOption *options ) const -{ - VImage out; - - call( "premultiply" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::unpremultiply( VOption *options ) const -{ - VImage out; - - call( "unpremultiply" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::grid( int tile_height , int across , int down , VOption *options ) const -{ - VImage out; - - call( "grid" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "tile-height", tile_height ) -> - set( "across", across ) -> - set( "down", down ) ); - - return( out ); -} - -VImage VImage::transpose3d( VOption *options ) const -{ - VImage out; - - call( "transpose3d" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::scale( VOption *options ) const -{ - VImage out; - - call( "scale" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::wrap( VOption *options ) const -{ - VImage out; - - call( "wrap" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::zoom( int xfac , int yfac , VOption *options ) const -{ - VImage out; - - call( "zoom" , - (options ? options : VImage::option()) -> - set( "input", *this ) -> - set( "out", &out ) -> - set( "xfac", xfac ) -> - set( "yfac", yfac ) ); - - return( out ); -} - -VImage VImage::subsample( int xfac , int yfac , VOption *options ) const -{ - VImage out; - - call( "subsample" , - (options ? options : VImage::option()) -> - set( "input", *this ) -> - set( "out", &out ) -> - set( "xfac", xfac ) -> - set( "yfac", yfac ) ); - - return( out ); -} - -VImage VImage::msb( VOption *options ) const -{ - VImage out; - - call( "msb" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::byteswap( VOption *options ) const -{ - VImage out; - - call( "byteswap" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::falsecolour( VOption *options ) const -{ - VImage out; - - call( "falsecolour" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::gamma( VOption *options ) const -{ - VImage out; - - call( "gamma" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::composite( std::vector in , std::vector mode , VOption *options ) -{ - VImage out; - - call( "composite" , - (options ? options : VImage::option()) -> - set( "in", in ) -> - set( "out", &out ) -> - set( "mode", mode ) ); - - return( out ); -} - -VImage VImage::composite2( VImage overlay , VipsBlendMode mode , VOption *options ) const -{ - VImage out; - - call( "composite2" , - (options ? options : VImage::option()) -> - set( "base", *this ) -> - set( "overlay", overlay ) -> - set( "out", &out ) -> - set( "mode", mode ) ); - - return( out ); -} - -VImage VImage::black( int width , int height , VOption *options ) -{ - VImage out; - - call( "black" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::gaussnoise( int width , int height , VOption *options ) -{ - VImage out; - - call( "gaussnoise" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::text( char * text , VOption *options ) -{ - VImage out; - - call( "text" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "text", text ) ); - - return( out ); -} - -VImage VImage::xyz( int width , int height , VOption *options ) -{ - VImage out; - - call( "xyz" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::gaussmat( double sigma , double min_ampl , VOption *options ) -{ - VImage out; - - call( "gaussmat" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "sigma", sigma ) -> - set( "min-ampl", min_ampl ) ); - - return( out ); -} - -VImage VImage::logmat( double sigma , double min_ampl , VOption *options ) -{ - VImage out; - - call( "logmat" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "sigma", sigma ) -> - set( "min-ampl", min_ampl ) ); - - return( out ); -} - -VImage VImage::eye( int width , int height , VOption *options ) -{ - VImage out; - - call( "eye" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::grey( int width , int height , VOption *options ) -{ - VImage out; - - call( "grey" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::zone( int width , int height , VOption *options ) -{ - VImage out; - - call( "zone" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::sines( int width , int height , VOption *options ) -{ - VImage out; - - call( "sines" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::mask_ideal( int width , int height , double frequency_cutoff , VOption *options ) -{ - VImage out; - - call( "mask_ideal" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "frequency-cutoff", frequency_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_ideal_ring( int width , int height , double frequency_cutoff , double ringwidth , VOption *options ) -{ - VImage out; - - call( "mask_ideal_ring" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "frequency-cutoff", frequency_cutoff ) -> - set( "ringwidth", ringwidth ) ); - - return( out ); -} - -VImage VImage::mask_ideal_band( int width , int height , double frequency_cutoff_x , double frequency_cutoff_y , double radius , VOption *options ) -{ - VImage out; - - call( "mask_ideal_band" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "frequency-cutoff-x", frequency_cutoff_x ) -> - set( "frequency-cutoff-y", frequency_cutoff_y ) -> - set( "radius", radius ) ); - - return( out ); -} - -VImage VImage::mask_butterworth( int width , int height , double order , double frequency_cutoff , double amplitude_cutoff , VOption *options ) -{ - VImage out; - - call( "mask_butterworth" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "order", order ) -> - set( "frequency-cutoff", frequency_cutoff ) -> - set( "amplitude-cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_butterworth_ring( int width , int height , double order , double frequency_cutoff , double amplitude_cutoff , double ringwidth , VOption *options ) -{ - VImage out; - - call( "mask_butterworth_ring" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "order", order ) -> - set( "frequency-cutoff", frequency_cutoff ) -> - set( "amplitude-cutoff", amplitude_cutoff ) -> - set( "ringwidth", ringwidth ) ); - - return( out ); -} - -VImage VImage::mask_butterworth_band( int width , int height , double order , double frequency_cutoff_x , double frequency_cutoff_y , double radius , double amplitude_cutoff , VOption *options ) -{ - VImage out; - - call( "mask_butterworth_band" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "order", order ) -> - set( "frequency-cutoff-x", frequency_cutoff_x ) -> - set( "frequency-cutoff-y", frequency_cutoff_y ) -> - set( "radius", radius ) -> - set( "amplitude-cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_gaussian( int width , int height , double frequency_cutoff , double amplitude_cutoff , VOption *options ) -{ - VImage out; - - call( "mask_gaussian" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "frequency-cutoff", frequency_cutoff ) -> - set( "amplitude-cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_gaussian_ring( int width , int height , double frequency_cutoff , double amplitude_cutoff , double ringwidth , VOption *options ) -{ - VImage out; - - call( "mask_gaussian_ring" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "frequency-cutoff", frequency_cutoff ) -> - set( "amplitude-cutoff", amplitude_cutoff ) -> - set( "ringwidth", ringwidth ) ); - - return( out ); -} - -VImage VImage::mask_gaussian_band( int width , int height , double frequency_cutoff_x , double frequency_cutoff_y , double radius , double amplitude_cutoff , VOption *options ) -{ - VImage out; - - call( "mask_gaussian_band" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "frequency-cutoff-x", frequency_cutoff_x ) -> - set( "frequency-cutoff-y", frequency_cutoff_y ) -> - set( "radius", radius ) -> - set( "amplitude-cutoff", amplitude_cutoff ) ); - - return( out ); -} - -VImage VImage::mask_fractal( int width , int height , double fractal_dimension , VOption *options ) -{ - VImage out; - - call( "mask_fractal" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "fractal-dimension", fractal_dimension ) ); - - return( out ); -} - -VImage VImage::buildlut( VOption *options ) const -{ - VImage out; - - call( "buildlut" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::invertlut( VOption *options ) const -{ - VImage out; - - call( "invertlut" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::tonelut( VOption *options ) -{ - VImage out; - - call( "tonelut" , - (options ? options : VImage::option()) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::identity( VOption *options ) -{ - VImage out; - - call( "identity" , - (options ? options : VImage::option()) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::fractsurf( int width , int height , double fractal_dimension , VOption *options ) -{ - VImage out; - - call( "fractsurf" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "fractal-dimension", fractal_dimension ) ); - - return( out ); -} - -VImage VImage::worley( int width , int height , VOption *options ) -{ - VImage out; - - call( "worley" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::perlin( int width , int height , VOption *options ) -{ - VImage out; - - call( "perlin" , - (options ? options : VImage::option()) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -VImage VImage::csvload( char * filename , VOption *options ) -{ - VImage out; - - call( "csvload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::matrixload( char * filename , VOption *options ) -{ - VImage out; - - call( "matrixload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::rawload( char * filename , int width , int height , int bands , VOption *options ) -{ - VImage out; - - call( "rawload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "bands", bands ) ); - - return( out ); -} - -VImage VImage::vipsload( char * filename , VOption *options ) -{ - VImage out; - - call( "vipsload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::analyzeload( char * filename , VOption *options ) -{ - VImage out; - - call( "analyzeload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::ppmload( char * filename , VOption *options ) -{ - VImage out; - - call( "ppmload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::radload( char * filename , VOption *options ) -{ - VImage out; - - call( "radload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::pdfload( char * filename , VOption *options ) -{ - VImage out; - - call( "pdfload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::pdfload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "pdfload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::svgload( char * filename , VOption *options ) -{ - VImage out; - - call( "svgload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::svgload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "svgload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::gifload( char * filename , VOption *options ) -{ - VImage out; - - call( "gifload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::gifload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "gifload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::pngload( char * filename , VOption *options ) -{ - VImage out; - - call( "pngload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::pngload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "pngload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::matload( char * filename , VOption *options ) -{ - VImage out; - - call( "matload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::jpegload( char * filename , VOption *options ) -{ - VImage out; - - call( "jpegload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::jpegload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "jpegload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::webpload( char * filename , VOption *options ) -{ - VImage out; - - call( "webpload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::webpload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "webpload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::tiffload( char * filename , VOption *options ) -{ - VImage out; - - call( "tiffload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::tiffload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "tiffload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::openslideload( char * filename , VOption *options ) -{ - VImage out; - - call( "openslideload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::magickload( char * filename , VOption *options ) -{ - VImage out; - - call( "magickload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::magickload_buffer( VipsBlob * buffer , VOption *options ) -{ - VImage out; - - call( "magickload_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::fitsload( char * filename , VOption *options ) -{ - VImage out; - - call( "fitsload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::openexrload( char * filename , VOption *options ) -{ - VImage out; - - call( "openexrload" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) ); - - return( out ); -} - -void VImage::csvsave( char * filename , VOption *options ) const -{ - call( "csvsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -void VImage::matrixsave( char * filename , VOption *options ) const -{ - call( "matrixsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -void VImage::matrixprint( VOption *options ) const -{ - call( "matrixprint" , - (options ? options : VImage::option()) -> - set( "in", *this ) ); -} - -void VImage::rawsave( char * filename , VOption *options ) const -{ - call( "rawsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -void VImage::rawsave_fd( int fd , VOption *options ) const -{ - call( "rawsave_fd" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "fd", fd ) ); -} - -void VImage::vipssave( char * filename , VOption *options ) const -{ - call( "vipssave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -void VImage::ppmsave( char * filename , VOption *options ) const -{ - call( "ppmsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -void VImage::radsave( char * filename , VOption *options ) const -{ - call( "radsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VipsBlob * VImage::radsave_buffer( VOption *options ) const -{ - VipsBlob * buffer; - - call( "radsave_buffer" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::dzsave( char * filename , VOption *options ) const -{ - call( "dzsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VipsBlob * VImage::dzsave_buffer( VOption *options ) const -{ - VipsBlob * buffer; - - call( "dzsave_buffer" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::pngsave( char * filename , VOption *options ) const -{ - call( "pngsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VipsBlob * VImage::pngsave_buffer( VOption *options ) const -{ - VipsBlob * buffer; - - call( "pngsave_buffer" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::jpegsave( char * filename , VOption *options ) const -{ - call( "jpegsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VipsBlob * VImage::jpegsave_buffer( VOption *options ) const -{ - VipsBlob * buffer; - - call( "jpegsave_buffer" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::jpegsave_mime( VOption *options ) const -{ - call( "jpegsave_mime" , - (options ? options : VImage::option()) -> - set( "in", *this ) ); -} - -void VImage::webpsave( char * filename , VOption *options ) const -{ - call( "webpsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VipsBlob * VImage::webpsave_buffer( VOption *options ) const -{ - VipsBlob * buffer; - - call( "webpsave_buffer" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::tiffsave( char * filename , VOption *options ) const -{ - call( "tiffsave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VipsBlob * VImage::tiffsave_buffer( VOption *options ) const -{ - VipsBlob * buffer; - - call( "tiffsave_buffer" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::magicksave( char * filename , VOption *options ) const -{ - call( "magicksave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VipsBlob * VImage::magicksave_buffer( VOption *options ) const -{ - VipsBlob * buffer; - - call( "magicksave_buffer" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "buffer", &buffer ) ); - - return( buffer ); -} - -void VImage::fitssave( char * filename , VOption *options ) const -{ - call( "fitssave" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "filename", filename ) ); -} - -VImage VImage::thumbnail( char * filename , int width , VOption *options ) -{ - VImage out; - - call( "thumbnail" , - (options ? options : VImage::option()) -> - set( "filename", filename ) -> - set( "out", &out ) -> - set( "width", width ) ); - - return( out ); -} - -VImage VImage::thumbnail_buffer( VipsBlob * buffer , int width , VOption *options ) -{ - VImage out; - - call( "thumbnail_buffer" , - (options ? options : VImage::option()) -> - set( "buffer", buffer ) -> - set( "out", &out ) -> - set( "width", width ) ); - - return( out ); -} - -VImage VImage::thumbnail_image( int width , VOption *options ) const -{ - VImage out; - - call( "thumbnail_image" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "width", width ) ); - - return( out ); -} - -VImage VImage::mapim( VImage index , VOption *options ) const -{ - VImage out; - - call( "mapim" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "index", index ) ); - - return( out ); -} - -VImage VImage::shrink( double hshrink , double vshrink , VOption *options ) const -{ - VImage out; - - call( "shrink" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "hshrink", hshrink ) -> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::shrinkh( int hshrink , VOption *options ) const -{ - VImage out; - - call( "shrinkh" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "hshrink", hshrink ) ); - - return( out ); -} - -VImage VImage::shrinkv( int vshrink , VOption *options ) const -{ - VImage out; - - call( "shrinkv" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::reduceh( double hshrink , VOption *options ) const -{ - VImage out; - - call( "reduceh" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "hshrink", hshrink ) ); - - return( out ); -} - -VImage VImage::reducev( double vshrink , VOption *options ) const -{ - VImage out; - - call( "reducev" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::reduce( double hshrink , double vshrink , VOption *options ) const -{ - VImage out; - - call( "reduce" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "hshrink", hshrink ) -> - set( "vshrink", vshrink ) ); - - return( out ); -} - -VImage VImage::quadratic( VImage coeff , VOption *options ) const -{ - VImage out; - - call( "quadratic" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "coeff", coeff ) ); - - return( out ); -} - -VImage VImage::affine( std::vector matrix , VOption *options ) const -{ - VImage out; - - call( "affine" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "matrix", matrix ) ); - - return( out ); -} - -VImage VImage::similarity( VOption *options ) const -{ - VImage out; - - call( "similarity" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::rotate( double angle , VOption *options ) const -{ - VImage out; - - call( "rotate" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "angle", angle ) ); - - return( out ); -} - -VImage VImage::resize( double scale , VOption *options ) const -{ - VImage out; - - call( "resize" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "scale", scale ) ); - - return( out ); -} - -VImage VImage::colourspace( VipsInterpretation space , VOption *options ) const -{ - VImage out; - - call( "colourspace" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "space", space ) ); - - return( out ); -} - -VImage VImage::Lab2XYZ( VOption *options ) const -{ - VImage out; - - call( "Lab2XYZ" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::XYZ2Lab( VOption *options ) const -{ - VImage out; - - call( "XYZ2Lab" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Lab2LCh( VOption *options ) const -{ - VImage out; - - call( "Lab2LCh" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LCh2Lab( VOption *options ) const -{ - VImage out; - - call( "LCh2Lab" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LCh2CMC( VOption *options ) const -{ - VImage out; - - call( "LCh2CMC" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - VImage VImage::CMC2LCh( VOption *options ) const { VImage out; - call( "CMC2LCh" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "CMC2LCh", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::XYZ2Yxy( VOption *options ) const +VImage VImage::CMYK2XYZ( VOption *options ) const { VImage out; - call( "XYZ2Yxy" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Yxy2XYZ( VOption *options ) const -{ - VImage out; - - call( "Yxy2XYZ" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::scRGB2XYZ( VOption *options ) const -{ - VImage out; - - call( "scRGB2XYZ" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::XYZ2scRGB( VOption *options ) const -{ - VImage out; - - call( "XYZ2scRGB" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabQ2Lab( VOption *options ) const -{ - VImage out; - - call( "LabQ2Lab" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Lab2LabQ( VOption *options ) const -{ - VImage out; - - call( "Lab2LabQ" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabQ2LabS( VOption *options ) const -{ - VImage out; - - call( "LabQ2LabS" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabS2LabQ( VOption *options ) const -{ - VImage out; - - call( "LabS2LabQ" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabS2Lab( VOption *options ) const -{ - VImage out; - - call( "LabS2Lab" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::Lab2LabS( VOption *options ) const -{ - VImage out; - - call( "Lab2LabS" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::rad2float( VOption *options ) const -{ - VImage out; - - call( "rad2float" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::float2rad( VOption *options ) const -{ - VImage out; - - call( "float2rad" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::LabQ2sRGB( VOption *options ) const -{ - VImage out; - - call( "LabQ2sRGB" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::sRGB2HSV( VOption *options ) const -{ - VImage out; - - call( "sRGB2HSV" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "CMYK2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); @@ -2420,198 +30,1299 @@ VImage VImage::HSV2sRGB( VOption *options ) const { VImage out; - call( "HSV2sRGB" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "HSV2sRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::icc_import( VOption *options ) const +VImage VImage::LCh2CMC( VOption *options ) const { VImage out; - call( "icc_import" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "LCh2CMC", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::icc_export( VOption *options ) const +VImage VImage::LCh2Lab( VOption *options ) const { VImage out; - call( "icc_export" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "LCh2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::icc_transform( char * output_profile , VOption *options ) const +VImage VImage::Lab2LCh( VOption *options ) const { VImage out; - call( "icc_transform" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "output-profile", output_profile ) ); - - return( out ); -} - -VImage VImage::dE76( VImage right , VOption *options ) const -{ - VImage out; - - call( "dE76" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> + call( "Lab2LCh", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::dE00( VImage right , VOption *options ) const +VImage VImage::Lab2LabQ( VOption *options ) const { VImage out; - call( "dE00" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> + call( "Lab2LabQ", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::dECMC( VImage right , VOption *options ) const +VImage VImage::Lab2LabS( VOption *options ) const { VImage out; - call( "dECMC" , - (options ? options : VImage::option()) -> - set( "left", *this ) -> - set( "right", right ) -> + call( "Lab2LabS", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::sRGB2scRGB( VOption *options ) const +VImage VImage::Lab2XYZ( VOption *options ) const { VImage out; - call( "sRGB2scRGB" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "Lab2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::scRGB2BW( VOption *options ) const +VImage VImage::LabQ2Lab( VOption *options ) const { VImage out; - call( "scRGB2BW" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "LabQ2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::scRGB2sRGB( VOption *options ) const +VImage VImage::LabQ2LabS( VOption *options ) const { VImage out; - call( "scRGB2sRGB" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "LabQ2LabS", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::maplut( VImage lut , VOption *options ) const +VImage VImage::LabQ2sRGB( VOption *options ) const { VImage out; - call( "maplut" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "lut", lut ) ); + call( "LabQ2sRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); return( out ); } -int VImage::percent( double percent , VOption *options ) const -{ - 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 ) const +VImage VImage::LabS2Lab( VOption *options ) const { VImage out; - call( "stdif" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "width", width ) -> + call( "LabS2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::LabS2LabQ( VOption *options ) const +{ + VImage out; + + call( "LabS2LabQ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2CMYK( VOption *options ) const +{ + VImage out; + + call( "XYZ2CMYK", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2Lab( VOption *options ) const +{ + VImage out; + + call( "XYZ2Lab", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2Yxy( VOption *options ) const +{ + VImage out; + + call( "XYZ2Yxy", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::XYZ2scRGB( VOption *options ) const +{ + VImage out; + + call( "XYZ2scRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::Yxy2XYZ( VOption *options ) const +{ + VImage out; + + call( "Yxy2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::abs( VOption *options ) const +{ + VImage out; + + call( "abs", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::add( VImage right, VOption *options ) const +{ + VImage out; + + call( "add", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::affine( std::vector matrix, VOption *options ) const +{ + VImage out; + + call( "affine", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "matrix", matrix ) ); + + return( out ); +} + +VImage VImage::analyzeload( const char *filename, VOption *options ) +{ + VImage out; + + call( "analyzeload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::arrayjoin( std::vector in, VOption *options ) +{ + VImage out; + + call( "arrayjoin", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::autorot( VOption *options ) const +{ + VImage out; + + call( "autorot", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +double VImage::avg( VOption *options ) const +{ + double out; + + call( "avg", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::bandbool( VipsOperationBoolean boolean, VOption *options ) const +{ + VImage out; + + call( "bandbool", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "boolean", boolean ) ); + + return( out ); +} + +VImage VImage::bandfold( VOption *options ) const +{ + VImage out; + + call( "bandfold", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::bandjoin( std::vector in, VOption *options ) +{ + VImage out; + + call( "bandjoin", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::bandjoin_const( std::vector c, VOption *options ) const +{ + VImage out; + + call( "bandjoin_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::bandmean( VOption *options ) const +{ + VImage out; + + call( "bandmean", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::bandrank( std::vector in, VOption *options ) +{ + VImage out; + + call( "bandrank", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in ) ); + + return( out ); +} + +VImage VImage::bandunfold( VOption *options ) const +{ + VImage out; + + call( "bandunfold", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::black( int width, int height, VOption *options ) +{ + VImage out; + + call( "black", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> set( "height", height ) ); return( out ); } +VImage VImage::boolean( VImage right, VipsOperationBoolean boolean, VOption *options ) const +{ + VImage out; + + call( "boolean", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right )-> + set( "boolean", boolean ) ); + + return( out ); +} + +VImage VImage::boolean_const( VipsOperationBoolean boolean, std::vector c, VOption *options ) const +{ + VImage out; + + call( "boolean_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "boolean", boolean )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::buildlut( VOption *options ) const +{ + VImage out; + + call( "buildlut", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::byteswap( VOption *options ) const +{ + VImage out; + + call( "byteswap", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::cache( VOption *options ) const +{ + VImage out; + + call( "cache", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::canny( VOption *options ) const +{ + VImage out; + + call( "canny", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::cast( VipsBandFormat format, VOption *options ) const +{ + VImage out; + + call( "cast", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "format", format ) ); + + return( out ); +} + +VImage VImage::colourspace( VipsInterpretation space, VOption *options ) const +{ + VImage out; + + call( "colourspace", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "space", space ) ); + + return( out ); +} + +VImage VImage::compass( VImage mask, VOption *options ) const +{ + VImage out; + + call( "compass", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::complex( VipsOperationComplex cmplx, VOption *options ) const +{ + VImage out; + + call( "complex", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "cmplx", cmplx ) ); + + return( out ); +} + +VImage VImage::complex2( VImage right, VipsOperationComplex2 cmplx, VOption *options ) const +{ + VImage out; + + call( "complex2", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right )-> + set( "cmplx", cmplx ) ); + + return( out ); +} + +VImage VImage::complexform( VImage right, VOption *options ) const +{ + VImage out; + + call( "complexform", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::complexget( VipsOperationComplexget get, VOption *options ) const +{ + VImage out; + + call( "complexget", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "get", get ) ); + + return( out ); +} + +VImage VImage::composite( std::vector in, std::vector mode, VOption *options ) +{ + VImage out; + + call( "composite", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in )-> + set( "mode", mode ) ); + + return( out ); +} + +VImage VImage::composite2( VImage overlay, VipsBlendMode mode, VOption *options ) const +{ + VImage out; + + call( "composite2", + (options ? options : VImage::option())-> + set( "base", *this )-> + set( "out", &out )-> + set( "overlay", overlay )-> + set( "mode", mode ) ); + + return( out ); +} + +VImage VImage::conv( VImage mask, VOption *options ) const +{ + VImage out; + + call( "conv", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::conva( VImage mask, VOption *options ) const +{ + VImage out; + + call( "conva", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::convasep( VImage mask, VOption *options ) const +{ + VImage out; + + call( "convasep", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::convf( VImage mask, VOption *options ) const +{ + VImage out; + + call( "convf", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::convi( VImage mask, VOption *options ) const +{ + VImage out; + + call( "convi", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::convsep( VImage mask, VOption *options ) const +{ + VImage out; + + call( "convsep", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::copy( VOption *options ) const +{ + VImage out; + + call( "copy", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +double VImage::countlines( VipsDirection direction, VOption *options ) const +{ + double nolines; + + call( "countlines", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "nolines", &nolines )-> + set( "direction", direction ) ); + + return( nolines ); +} + +VImage VImage::crop( int left, int top, int width, int height, VOption *options ) const +{ + VImage out; + + call( "crop", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "left", left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::csvload( const char *filename, VOption *options ) +{ + VImage out; + + call( "csvload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::csvsave( const char *filename, VOption *options ) const +{ + call( "csvsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::dE00( VImage right, VOption *options ) const +{ + VImage out; + + call( "dE00", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::dE76( VImage right, VOption *options ) const +{ + VImage out; + + call( "dE76", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::dECMC( VImage right, VOption *options ) const +{ + VImage out; + + call( "dECMC", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +double VImage::deviate( VOption *options ) const +{ + double out; + + call( "deviate", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::divide( VImage right, VOption *options ) const +{ + VImage out; + + call( "divide", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +void VImage::draw_circle( std::vector ink, int cx, int cy, int radius, VOption *options ) const +{ + 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 ) const +{ + 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 ) const +{ + call( "draw_image", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "sub", sub )-> + set( "x", x )-> + set( "y", y ) ); +} + +void VImage::draw_line( std::vector ink, int x1, int y1, int x2, int y2, VOption *options ) const +{ + call( "draw_line", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "ink", ink )-> + set( "x1", x1 )-> + set( "y1", y1 )-> + set( "x2", x2 )-> + set( "y2", y2 ) ); +} + +void VImage::draw_mask( std::vector ink, VImage mask, int x, int y, VOption *options ) const +{ + call( "draw_mask", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "ink", ink )-> + set( "mask", mask )-> + set( "x", x )-> + set( "y", y ) ); +} + +void VImage::draw_rect( std::vector ink, int left, int top, int width, int height, VOption *options ) const +{ + call( "draw_rect", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "ink", ink )-> + set( "left", left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); +} + +void VImage::draw_smudge( int left, int top, int width, int height, VOption *options ) const +{ + call( "draw_smudge", + (options ? options : VImage::option())-> + set( "image", *this )-> + set( "left", left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); +} + +void VImage::dzsave( const char *filename, VOption *options ) const +{ + call( "dzsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::dzsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "dzsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::embed( int x, int y, int width, int height, VOption *options ) const +{ + VImage out; + + call( "embed", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "x", x )-> + set( "y", y )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::extract_area( int left, int top, int width, int height, VOption *options ) const +{ + VImage out; + + call( "extract_area", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "left", left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::extract_band( int band, VOption *options ) const +{ + VImage out; + + call( "extract_band", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "band", band ) ); + + return( out ); +} + +VImage VImage::eye( int width, int height, VOption *options ) +{ + VImage out; + + call( "eye", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::falsecolour( VOption *options ) const +{ + VImage out; + + call( "falsecolour", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::fastcor( VImage ref, VOption *options ) const +{ + VImage out; + + call( "fastcor", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "ref", ref ) ); + + return( out ); +} + +VImage VImage::fill_nearest( VOption *options ) const +{ + VImage out; + + call( "fill_nearest", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +int VImage::find_trim( int *top, int *width, int *height, VOption *options ) const +{ + int left; + + call( "find_trim", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "left", &left )-> + set( "top", top )-> + set( "width", width )-> + set( "height", height ) ); + + return( left ); +} + +VImage VImage::fitsload( const char *filename, VOption *options ) +{ + VImage out; + + call( "fitsload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::fitssave( const char *filename, VOption *options ) const +{ + call( "fitssave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::flatten( VOption *options ) const +{ + VImage out; + + call( "flatten", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::flip( VipsDirection direction, VOption *options ) const +{ + VImage out; + + call( "flip", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "direction", direction ) ); + + return( out ); +} + +VImage VImage::float2rad( VOption *options ) const +{ + VImage out; + + call( "float2rad", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::fractsurf( int width, int height, double fractal_dimension, VOption *options ) +{ + VImage out; + + call( "fractsurf", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "fractal_dimension", fractal_dimension ) ); + + return( out ); +} + +VImage VImage::freqmult( VImage mask, VOption *options ) const +{ + VImage out; + + call( "freqmult", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask ) ); + + return( out ); +} + +VImage VImage::fwfft( VOption *options ) const +{ + VImage out; + + call( "fwfft", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::gamma( VOption *options ) const +{ + VImage out; + + call( "gamma", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::gaussblur( double sigma, VOption *options ) const +{ + VImage out; + + call( "gaussblur", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "sigma", sigma ) ); + + return( out ); +} + +VImage VImage::gaussmat( double sigma, double min_ampl, VOption *options ) +{ + VImage out; + + call( "gaussmat", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "sigma", sigma )-> + set( "min_ampl", min_ampl ) ); + + return( out ); +} + +VImage VImage::gaussnoise( int width, int height, VOption *options ) +{ + VImage out; + + call( "gaussnoise", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +std::vector VImage::getpoint( int x, int y, VOption *options ) const +{ + std::vector out_array; + + call( "getpoint", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out_array", &out_array )-> + set( "x", x )-> + set( "y", y ) ); + + return( out_array ); +} + +VImage VImage::gifload( const char *filename, VOption *options ) +{ + VImage out; + + call( "gifload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::gifload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "gifload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +VImage VImage::globalbalance( VOption *options ) const +{ + VImage out; + + call( "globalbalance", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::gravity( VipsCompassDirection direction, int width, int height, VOption *options ) const +{ + VImage out; + + call( "gravity", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "direction", direction )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::grey( int width, int height, VOption *options ) +{ + VImage out; + + call( "grey", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::grid( int tile_height, int across, int down, VOption *options ) const +{ + VImage out; + + call( "grid", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "tile_height", tile_height )-> + set( "across", across )-> + set( "down", down ) ); + + return( out ); +} + +VImage VImage::heifload( const char *filename, VOption *options ) +{ + VImage out; + + call( "heifload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::heifload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "heifload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::heifsave( const char *filename, VOption *options ) const +{ + call( "heifsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::heifsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "heifsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + VImage VImage::hist_cum( VOption *options ) const { VImage out; - call( "hist_cum" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "hist_cum", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::hist_match( VImage ref , VOption *options ) const +double VImage::hist_entropy( VOption *options ) const { - VImage out; + double out; - call( "hist_match" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "ref", ref ) -> - set( "out", &out ) ); - - return( out ); -} - -VImage VImage::hist_norm( VOption *options ) const -{ - VImage out; - - call( "hist_norm" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "hist_entropy", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); @@ -2621,9 +1332,97 @@ VImage VImage::hist_equal( VOption *options ) const { VImage out; - call( "hist_equal" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "hist_equal", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_find( VOption *options ) const +{ + VImage out; + + call( "hist_find", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::hist_find_indexed( VImage index, VOption *options ) const +{ + VImage out; + + call( "hist_find_indexed", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "index", index ) ); + + return( out ); +} + +VImage VImage::hist_find_ndim( VOption *options ) const +{ + VImage out; + + call( "hist_find_ndim", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +bool VImage::hist_ismonotonic( VOption *options ) const +{ + bool monotonic; + + call( "hist_ismonotonic", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "monotonic", &monotonic ) ); + + return( monotonic ); +} + +VImage VImage::hist_local( int width, int height, VOption *options ) const +{ + VImage out; + + call( "hist_local", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::hist_match( VImage ref, VOption *options ) const +{ + VImage out; + + call( "hist_match", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "ref", ref ) ); + + return( out ); +} + +VImage VImage::hist_norm( VOption *options ) const +{ + VImage out; + + call( "hist_norm", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); @@ -2633,225 +1432,134 @@ VImage VImage::hist_plot( VOption *options ) const { VImage out; - call( "hist_plot" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "hist_plot", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::hist_local( int width , int height , VOption *options ) const +VImage VImage::hough_circle( VOption *options ) const { VImage out; - call( "hist_local" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) ); - - return( out ); -} - -bool VImage::hist_ismonotonic( VOption *options ) const -{ - bool monotonic; - - call( "hist_ismonotonic" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "monotonic", &monotonic ) ); - - return( monotonic ); -} - -double VImage::hist_entropy( VOption *options ) const -{ - double out; - - call( "hist_entropy" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "hough_circle", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::conv( VImage mask , VOption *options ) const +VImage VImage::hough_line( VOption *options ) const { VImage out; - call( "conv" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::conva( VImage mask , VOption *options ) const -{ - VImage out; - - call( "conva" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::convf( VImage mask , VOption *options ) const -{ - VImage out; - - call( "convf" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::convi( VImage mask , VOption *options ) const -{ - VImage out; - - call( "convi" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::compass( VImage mask , VOption *options ) const -{ - VImage out; - - call( "compass" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::convsep( VImage mask , VOption *options ) const -{ - VImage out; - - call( "convsep" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::convasep( VImage mask , VOption *options ) const -{ - VImage out; - - call( "convasep" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) ); - - return( out ); -} - -VImage VImage::fastcor( VImage ref , VOption *options ) const -{ - VImage out; - - call( "fastcor" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "ref", ref ) -> + call( "hough_line", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::spcor( VImage ref , VOption *options ) const +VImage VImage::icc_export( VOption *options ) const { VImage out; - call( "spcor" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "ref", ref ) -> + call( "icc_export", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::sharpen( VOption *options ) const +VImage VImage::icc_import( VOption *options ) const { VImage out; - call( "sharpen" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "icc_import", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::gaussblur( double sigma , VOption *options ) const +VImage VImage::icc_transform( const char *output_profile, VOption *options ) const { VImage out; - call( "gaussblur" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "sigma", sigma ) ); + call( "icc_transform", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "output_profile", output_profile ) ); return( out ); } -VImage VImage::canny( VOption *options ) const +VImage VImage::identity( VOption *options ) { VImage out; - call( "canny" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "identity", + (options ? options : VImage::option())-> set( "out", &out ) ); return( out ); } -VImage VImage::sobel( VOption *options ) const +VImage VImage::ifthenelse( VImage in1, VImage in2, VOption *options ) const { VImage out; - call( "sobel" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "ifthenelse", + (options ? options : VImage::option())-> + set( "cond", *this )-> + set( "out", &out )-> + set( "in1", in1 )-> + set( "in2", in2 ) ); + + return( out ); +} + +VImage VImage::insert( VImage sub, int x, int y, VOption *options ) const +{ + VImage out; + + call( "insert", + (options ? options : VImage::option())-> + set( "main", *this )-> + set( "out", &out )-> + set( "sub", sub )-> + set( "x", x )-> + set( "y", y ) ); + + return( out ); +} + +VImage VImage::invert( VOption *options ) const +{ + VImage out; + + call( "invert", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::fwfft( VOption *options ) const +VImage VImage::invertlut( VOption *options ) const { VImage out; - call( "fwfft" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "invertlut", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); @@ -2861,281 +1569,1688 @@ VImage VImage::invfft( VOption *options ) const { VImage out; - call( "invfft" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "invfft", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::freqmult( VImage mask , VOption *options ) const +VImage VImage::join( VImage in2, VipsDirection direction, VOption *options ) const { VImage out; - call( "freqmult" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "mask", mask ) -> + call( "join", + (options ? options : VImage::option())-> + set( "in1", *this )-> + set( "out", &out )-> + set( "in2", in2 )-> + set( "direction", direction ) ); + + return( out ); +} + +VImage VImage::jpegload( const char *filename, VOption *options ) +{ + VImage out; + + call( "jpegload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::jpegload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "jpegload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::jpegsave( const char *filename, VOption *options ) const +{ + call( "jpegsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::jpegsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "jpegsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +void VImage::jpegsave_mime( VOption *options ) const +{ + call( "jpegsave_mime", + (options ? options : VImage::option())-> + set( "in", *this ) ); +} + +VImage VImage::labelregions( VOption *options ) const +{ + VImage mask; + + call( "labelregions", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "mask", &mask ) ); + + return( mask ); +} + +VImage VImage::linear( std::vector a, std::vector b, VOption *options ) const +{ + VImage out; + + call( "linear", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "a", a )-> + set( "b", b ) ); + + return( out ); +} + +VImage VImage::linecache( VOption *options ) const +{ + VImage out; + + call( "linecache", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } +VImage VImage::logmat( double sigma, double min_ampl, VOption *options ) +{ + VImage out; + + call( "logmat", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "sigma", sigma )-> + set( "min_ampl", min_ampl ) ); + + return( out ); +} + +VImage VImage::magickload( const char *filename, VOption *options ) +{ + VImage out; + + call( "magickload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::magickload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "magickload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::magicksave( const char *filename, VOption *options ) const +{ + call( "magicksave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::magicksave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "magicksave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::mapim( VImage index, VOption *options ) const +{ + VImage out; + + call( "mapim", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "index", index ) ); + + return( out ); +} + +VImage VImage::maplut( VImage lut, VOption *options ) const +{ + VImage out; + + call( "maplut", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "lut", lut ) ); + + return( out ); +} + +VImage VImage::mask_butterworth( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_butterworth", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "order", order )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_butterworth_band( int width, int height, double order, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_butterworth_band", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "order", order )-> + set( "frequency_cutoff_x", frequency_cutoff_x )-> + set( "frequency_cutoff_y", frequency_cutoff_y )-> + set( "radius", radius )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_butterworth_ring( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options ) +{ + VImage out; + + call( "mask_butterworth_ring", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "order", order )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff )-> + set( "ringwidth", ringwidth ) ); + + return( out ); +} + +VImage VImage::mask_fractal( int width, int height, double fractal_dimension, VOption *options ) +{ + VImage out; + + call( "mask_fractal", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "fractal_dimension", fractal_dimension ) ); + + return( out ); +} + +VImage VImage::mask_gaussian( int width, int height, double frequency_cutoff, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_gaussian", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_gaussian_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_gaussian_band", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff_x", frequency_cutoff_x )-> + set( "frequency_cutoff_y", frequency_cutoff_y )-> + set( "radius", radius )-> + set( "amplitude_cutoff", amplitude_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_gaussian_ring( int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options ) +{ + VImage out; + + call( "mask_gaussian_ring", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "amplitude_cutoff", amplitude_cutoff )-> + set( "ringwidth", ringwidth ) ); + + return( out ); +} + +VImage VImage::mask_ideal( int width, int height, double frequency_cutoff, VOption *options ) +{ + VImage out; + + call( "mask_ideal", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff ) ); + + return( out ); +} + +VImage VImage::mask_ideal_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, VOption *options ) +{ + VImage out; + + call( "mask_ideal_band", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff_x", frequency_cutoff_x )-> + set( "frequency_cutoff_y", frequency_cutoff_y )-> + set( "radius", radius ) ); + + return( out ); +} + +VImage VImage::mask_ideal_ring( int width, int height, double frequency_cutoff, double ringwidth, VOption *options ) +{ + VImage out; + + call( "mask_ideal_ring", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "frequency_cutoff", frequency_cutoff )-> + set( "ringwidth", ringwidth ) ); + + return( out ); +} + +VImage VImage::match( VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options ) const +{ + VImage out; + + call( "match", + (options ? options : VImage::option())-> + set( "ref", *this )-> + set( "out", &out )-> + set( "sec", sec )-> + set( "xr1", xr1 )-> + set( "yr1", yr1 )-> + set( "xs1", xs1 )-> + set( "ys1", ys1 )-> + set( "xr2", xr2 )-> + set( "yr2", yr2 )-> + set( "xs2", xs2 )-> + set( "ys2", ys2 ) ); + + return( out ); +} + +VImage VImage::math( VipsOperationMath math, VOption *options ) const +{ + VImage out; + + call( "math", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "math", math ) ); + + return( out ); +} + +VImage VImage::math2( VImage right, VipsOperationMath2 math2, VOption *options ) const +{ + VImage out; + + call( "math2", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right )-> + set( "math2", math2 ) ); + + return( out ); +} + +VImage VImage::math2_const( VipsOperationMath2 math2, std::vector c, VOption *options ) const +{ + VImage out; + + call( "math2_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "math2", math2 )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::matload( const char *filename, VOption *options ) +{ + VImage out; + + call( "matload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::matrixload( const char *filename, VOption *options ) +{ + VImage out; + + call( "matrixload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::matrixprint( VOption *options ) const +{ + call( "matrixprint", + (options ? options : VImage::option())-> + set( "in", *this ) ); +} + +void VImage::matrixsave( const char *filename, VOption *options ) const +{ + call( "matrixsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +double VImage::max( VOption *options ) const +{ + double out; + + call( "max", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::measure( int h, int v, VOption *options ) const +{ + VImage out; + + call( "measure", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "h", h )-> + set( "v", v ) ); + + return( out ); +} + +VImage VImage::merge( VImage sec, VipsDirection direction, int dx, int dy, VOption *options ) const +{ + VImage out; + + call( "merge", + (options ? options : VImage::option())-> + set( "ref", *this )-> + set( "out", &out )-> + set( "sec", sec )-> + set( "direction", direction )-> + set( "dx", dx )-> + set( "dy", dy ) ); + + return( out ); +} + +double VImage::min( VOption *options ) const +{ + double out; + + call( "min", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::morph( VImage mask, VipsOperationMorphology morph, VOption *options ) const +{ + VImage out; + + call( "morph", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "mask", mask )-> + set( "morph", morph ) ); + + return( out ); +} + +VImage VImage::mosaic( VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VOption *options ) const +{ + VImage out; + + call( "mosaic", + (options ? options : VImage::option())-> + set( "ref", *this )-> + set( "out", &out )-> + set( "sec", sec )-> + 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 ) const +{ + VImage out; + + call( "mosaic1", + (options ? options : VImage::option())-> + set( "ref", *this )-> + set( "out", &out )-> + set( "sec", sec )-> + 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::msb( VOption *options ) const +{ + VImage out; + + call( "msb", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::multiply( VImage right, VOption *options ) const +{ + VImage out; + + call( "multiply", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::niftiload( const char *filename, VOption *options ) +{ + VImage out; + + call( "niftiload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::niftisave( const char *filename, VOption *options ) const +{ + call( "niftisave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::openexrload( const char *filename, VOption *options ) +{ + VImage out; + + call( "openexrload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::openslideload( const char *filename, VOption *options ) +{ + VImage out; + + call( "openslideload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pdfload( const char *filename, VOption *options ) +{ + VImage out; + + call( "pdfload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pdfload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "pdfload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +int VImage::percent( double percent, VOption *options ) const +{ + int threshold; + + call( "percent", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "threshold", &threshold )-> + set( "percent", percent ) ); + + return( threshold ); +} + +VImage VImage::perlin( int width, int height, VOption *options ) +{ + VImage out; + + call( "perlin", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::phasecor( VImage in2, VOption *options ) const +{ + VImage out; + + call( "phasecor", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "in2", in2 ) ); + + return( out ); +} + +VImage VImage::pngload( const char *filename, VOption *options ) +{ + VImage out; + + call( "pngload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::pngload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "pngload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::pngsave( const char *filename, VOption *options ) const +{ + call( "pngsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::pngsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "pngsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::ppmload( const char *filename, VOption *options ) +{ + VImage out; + + call( "ppmload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::ppmsave( const char *filename, VOption *options ) const +{ + call( "ppmsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::premultiply( VOption *options ) const +{ + VImage out; + + call( "premultiply", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::profile( VImage *rows, VOption *options ) const +{ + VImage columns; + + call( "profile", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "columns", &columns )-> + set( "rows", rows ) ); + + return( columns ); +} + +VipsBlob *VImage::profile_load( const char *name, VOption *options ) +{ + VipsBlob *profile; + + call( "profile_load", + (options ? options : VImage::option())-> + set( "profile", &profile )-> + set( "name", name ) ); + + return( profile ); +} + +VImage VImage::project( VImage *rows, VOption *options ) const +{ + VImage columns; + + call( "project", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "columns", &columns )-> + set( "rows", rows ) ); + + return( columns ); +} + +VImage VImage::quadratic( VImage coeff, VOption *options ) const +{ + VImage out; + + call( "quadratic", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "coeff", coeff ) ); + + return( out ); +} + +VImage VImage::rad2float( VOption *options ) const +{ + VImage out; + + call( "rad2float", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::radload( const char *filename, VOption *options ) +{ + VImage out; + + call( "radload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::radsave( const char *filename, VOption *options ) const +{ + call( "radsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::radsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "radsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::rank( int width, int height, int index, VOption *options ) const +{ + VImage out; + + call( "rank", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height )-> + set( "index", index ) ); + + return( out ); +} + +VImage VImage::rawload( const char *filename, int width, int height, int bands, VOption *options ) +{ + VImage out; + + call( "rawload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename )-> + set( "width", width )-> + set( "height", height )-> + set( "bands", bands ) ); + + return( out ); +} + +void VImage::rawsave( const char *filename, VOption *options ) const +{ + call( "rawsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +void VImage::rawsave_fd( int fd, VOption *options ) const +{ + call( "rawsave_fd", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "fd", fd ) ); +} + +VImage VImage::recomb( VImage m, VOption *options ) const +{ + VImage out; + + call( "recomb", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "m", m ) ); + + return( out ); +} + +VImage VImage::reduce( double hshrink, double vshrink, VOption *options ) const +{ + VImage out; + + call( "reduce", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::reduceh( double hshrink, VOption *options ) const +{ + VImage out; + + call( "reduceh", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink ) ); + + return( out ); +} + +VImage VImage::reducev( double vshrink, VOption *options ) const +{ + VImage out; + + call( "reducev", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::relational( VImage right, VipsOperationRelational relational, VOption *options ) const +{ + VImage out; + + call( "relational", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right )-> + set( "relational", relational ) ); + + return( out ); +} + +VImage VImage::relational_const( VipsOperationRelational relational, std::vector c, VOption *options ) const +{ + VImage out; + + call( "relational_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "relational", relational )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::remainder( VImage right, VOption *options ) const +{ + VImage out; + + call( "remainder", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); + + return( out ); +} + +VImage VImage::remainder_const( std::vector c, VOption *options ) const +{ + VImage out; + + call( "remainder_const", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "c", c ) ); + + return( out ); +} + +VImage VImage::replicate( int across, int down, VOption *options ) const +{ + VImage out; + + call( "replicate", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "across", across )-> + set( "down", down ) ); + + return( out ); +} + +VImage VImage::resize( double scale, VOption *options ) const +{ + VImage out; + + call( "resize", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "scale", scale ) ); + + return( out ); +} + +VImage VImage::rot( VipsAngle angle, VOption *options ) const +{ + VImage out; + + call( "rot", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "angle", angle ) ); + + return( out ); +} + +VImage VImage::rot45( VOption *options ) const +{ + VImage out; + + call( "rot45", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::rotate( double angle, VOption *options ) const +{ + VImage out; + + call( "rotate", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "angle", angle ) ); + + return( out ); +} + +VImage VImage::round( VipsOperationRound round, VOption *options ) const +{ + VImage out; + + call( "round", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "round", round ) ); + + return( out ); +} + +VImage VImage::sRGB2HSV( VOption *options ) const +{ + VImage out; + + call( "sRGB2HSV", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sRGB2scRGB( VOption *options ) const +{ + VImage out; + + call( "sRGB2scRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scRGB2BW( VOption *options ) const +{ + VImage out; + + call( "scRGB2BW", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scRGB2XYZ( VOption *options ) const +{ + VImage out; + + call( "scRGB2XYZ", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scRGB2sRGB( VOption *options ) const +{ + VImage out; + + call( "scRGB2sRGB", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scale( VOption *options ) const +{ + VImage out; + + call( "scale", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sequential( VOption *options ) const +{ + VImage out; + + call( "sequential", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sharpen( VOption *options ) const +{ + VImage out; + + call( "sharpen", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::shrink( double hshrink, double vshrink, VOption *options ) const +{ + VImage out; + + call( "shrink", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::shrinkh( int hshrink, VOption *options ) const +{ + VImage out; + + call( "shrinkh", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "hshrink", hshrink ) ); + + return( out ); +} + +VImage VImage::shrinkv( int vshrink, VOption *options ) const +{ + VImage out; + + call( "shrinkv", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "vshrink", vshrink ) ); + + return( out ); +} + +VImage VImage::sign( VOption *options ) const +{ + VImage out; + + call( "sign", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::similarity( VOption *options ) const +{ + VImage out; + + call( "similarity", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sines( int width, int height, VOption *options ) +{ + VImage out; + + call( "sines", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::smartcrop( int width, int height, VOption *options ) const +{ + VImage out; + + call( "smartcrop", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::sobel( VOption *options ) const +{ + VImage out; + + call( "sobel", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::spcor( VImage ref, VOption *options ) const +{ + VImage out; + + call( "spcor", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "ref", ref ) ); + + return( out ); +} + VImage VImage::spectrum( VOption *options ) const { VImage out; - call( "spectrum" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "spectrum", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::phasecor( VImage in2 , VOption *options ) const +VImage VImage::stats( VOption *options ) const { VImage out; - call( "phasecor" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "in2", in2 ) -> + call( "stats", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } -VImage VImage::morph( VImage mask , VipsOperationMorphology morph , VOption *options ) const +VImage VImage::stdif( int width, int height, VOption *options ) const { VImage out; - call( "morph" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "mask", mask ) -> - set( "morph", morph ) ); - - return( out ); -} - -VImage VImage::rank( int width , int height , int index , VOption *options ) const -{ - VImage out; - - call( "rank" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) -> - set( "width", width ) -> - set( "height", height ) -> - set( "index", index ) ); - - return( out ); -} - -double VImage::countlines( VipsDirection direction , VOption *options ) const -{ - double nolines; - - call( "countlines" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "nolines", &nolines ) -> - set( "direction", direction ) ); - - return( nolines ); -} - -VImage VImage::labelregions( VOption *options ) const -{ - VImage mask; - - call( "labelregions" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "mask", &mask ) ); - - return( mask ); -} - -VImage VImage::fill_nearest( VOption *options ) const -{ - VImage out; - - call( "fill_nearest" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> - set( "out", &out ) ); - - return( out ); -} - -void VImage::draw_rect( std::vector ink , int left , int top , int width , int height , VOption *options ) const -{ - call( "draw_rect" , - (options ? options : VImage::option()) -> - set( "image", *this ) -> - set( "ink", ink ) -> - set( "left", left ) -> - set( "top", top ) -> - set( "width", width ) -> + call( "stdif", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width )-> set( "height", height ) ); -} - -void VImage::draw_mask( std::vector ink , VImage mask , int x , int y , VOption *options ) const -{ - call( "draw_mask" , - (options ? options : VImage::option()) -> - set( "image", *this ) -> - set( "ink", ink ) -> - set( "mask", mask ) -> - set( "x", x ) -> - set( "y", y ) ); -} - -void VImage::draw_line( std::vector ink , int x1 , int y1 , int x2 , int y2 , VOption *options ) const -{ - call( "draw_line" , - (options ? options : VImage::option()) -> - set( "image", *this ) -> - set( "ink", ink ) -> - set( "x1", x1 ) -> - set( "y1", y1 ) -> - set( "x2", x2 ) -> - set( "y2", y2 ) ); -} - -void VImage::draw_circle( std::vector ink , int cx , int cy , int radius , VOption *options ) const -{ - 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 ) const -{ - 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 ) const -{ - 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 ) const -{ - 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 ) const -{ - 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 ) const +VImage VImage::subsample( int xfac, int yfac, VOption *options ) const { 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 ) ); + call( "subsample", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "xfac", xfac )-> + set( "yfac", yfac ) ); 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 ) const +VImage VImage::subtract( VImage right, VOption *options ) const { 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 ) ); + call( "subtract", + (options ? options : VImage::option())-> + set( "left", *this )-> + set( "out", &out )-> + set( "right", right ) ); return( out ); } -VImage VImage::match( VImage sec , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options ) const +VImage VImage::sum( std::vector in, VOption *options ) { 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 ) ); + call( "sum", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "in", in ) ); return( out ); } -VImage VImage::globalbalance( VOption *options ) const +VImage VImage::svgload( const char *filename, VOption *options ) { VImage out; - call( "globalbalance" , - (options ? options : VImage::option()) -> - set( "in", *this ) -> + call( "svgload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::svgload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "svgload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::system( const char *cmd_format, VOption *options ) +{ + call( "system", + (options ? options : VImage::option())-> + set( "cmd_format", cmd_format ) ); +} + +VImage VImage::text( const char *text, VOption *options ) +{ + VImage out; + + call( "text", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "text", text ) ); + + return( out ); +} + +VImage VImage::thumbnail( const char *filename, int width, VOption *options ) +{ + VImage out; + + call( "thumbnail", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename )-> + set( "width", width ) ); + + return( out ); +} + +VImage VImage::thumbnail_buffer( VipsBlob *buffer, int width, VOption *options ) +{ + VImage out; + + call( "thumbnail_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer )-> + set( "width", width ) ); + + return( out ); +} + +VImage VImage::thumbnail_image( int width, VOption *options ) const +{ + VImage out; + + call( "thumbnail_image", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out )-> + set( "width", width ) ); + + return( out ); +} + +VImage VImage::tiffload( const char *filename, VOption *options ) +{ + VImage out; + + call( "tiffload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::tiffload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "tiffload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::tiffsave( const char *filename, VOption *options ) const +{ + call( "tiffsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::tiffsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "tiffsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::tilecache( VOption *options ) const +{ + VImage out; + + call( "tilecache", + (options ? options : VImage::option())-> + set( "in", *this )-> set( "out", &out ) ); return( out ); } +VImage VImage::tonelut( VOption *options ) +{ + VImage out; + + call( "tonelut", + (options ? options : VImage::option())-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::transpose3d( VOption *options ) const +{ + VImage out; + + call( "transpose3d", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::unpremultiply( VOption *options ) const +{ + VImage out; + + call( "unpremultiply", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::vipsload( const char *filename, VOption *options ) +{ + VImage out; + + call( "vipsload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +void VImage::vipssave( const char *filename, VOption *options ) const +{ + call( "vipssave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VImage VImage::webpload( const char *filename, VOption *options ) +{ + VImage out; + + call( "webpload", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "filename", filename ) ); + + return( out ); +} + +VImage VImage::webpload_buffer( VipsBlob *buffer, VOption *options ) +{ + VImage out; + + call( "webpload_buffer", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "buffer", buffer ) ); + + return( out ); +} + +void VImage::webpsave( const char *filename, VOption *options ) const +{ + call( "webpsave", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "filename", filename ) ); +} + +VipsBlob *VImage::webpsave_buffer( VOption *options ) const +{ + VipsBlob *buffer; + + call( "webpsave_buffer", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +VImage VImage::worley( int width, int height, VOption *options ) +{ + VImage out; + + call( "worley", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::wrap( VOption *options ) const +{ + VImage out; + + call( "wrap", + (options ? options : VImage::option())-> + set( "in", *this )-> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::xyz( int width, int height, VOption *options ) +{ + VImage out; + + call( "xyz", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::zone( int width, int height, VOption *options ) +{ + VImage out; + + call( "zone", + (options ? options : VImage::option())-> + set( "out", &out )-> + set( "width", width )-> + set( "height", height ) ); + + return( out ); +} + +VImage VImage::zoom( int xfac, int yfac, VOption *options ) const +{ + VImage out; + + call( "zoom", + (options ? options : VImage::option())-> + set( "input", *this )-> + set( "out", &out )-> + set( "xfac", xfac )-> + set( "yfac", yfac ) ); + + return( out ); +} diff --git a/src/pipeline.cc b/src/pipeline.cc index 6f61b8a7..0fda3b8e 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -30,6 +32,17 @@ #include "operations.h" #include "pipeline.h" +#if defined(WIN32) +#define STAT64_STRUCT __stat64 +#define STAT64_FUNCTION _stat64 +#elif defined(__APPLE__) +#define STAT64_STRUCT stat +#define STAT64_FUNCTION stat +#else +#define STAT64_STRUCT stat64 +#define STAT64_FUNCTION stat64 +#endif + class PipelineWorker : public Nan::AsyncWorker { public: PipelineWorker( @@ -1005,8 +1018,8 @@ class PipelineWorker : public Nan::AsyncWorker { argv[2] = info; } else { // Add file size to info - GStatBuf st; - if (g_stat(baton->fileOut.data(), &st) == 0) { + struct STAT64_STRUCT st; + if (STAT64_FUNCTION(baton->fileOut.data(), &st) == 0) { Set(info, New("size").ToLocalChecked(), New(static_cast(st.st_size))); } argv[1] = info; diff --git a/src/pipeline.h b/src/pipeline.h index 8d95a10f..10ae3508 100644 --- a/src/pipeline.h +++ b/src/pipeline.h @@ -194,7 +194,7 @@ struct PipelineBaton { blurSigma(0.0), brightness(1.0), saturation(1.0), - hue(0.0), + hue(0), medianSize(0), sharpenSigma(0.0), sharpenFlat(1.0), diff --git a/src/stats.cc b/src/stats.cc index 799578cc..60567d05 100644 --- a/src/stats.cc +++ b/src/stats.cc @@ -115,7 +115,7 @@ class StatsWorker : public Nan::AsyncWorker { std::vector::iterator it; int i = 0; - for (it=baton->channelStats.begin() ; it < baton->channelStats.end(); it++, i++) { + for (it = baton->channelStats.begin(); it < baton->channelStats.end(); it++, i++) { v8::Local channelStat = New(); Set(channelStat, New("min").ToLocalChecked(), New(it->min)); Set(channelStat, New("max").ToLocalChecked(), New(it->max)); @@ -127,7 +127,7 @@ class StatsWorker : public Nan::AsyncWorker { Set(channelStat, New("minY").ToLocalChecked(), New(it->minY)); Set(channelStat, New("maxX").ToLocalChecked(), New(it->maxX)); Set(channelStat, New("maxY").ToLocalChecked(), New(it->maxY)); - channels->Set(i, channelStat); + Set(channels, i, channelStat); } Set(info, New("channels").ToLocalChecked(), channels); diff --git a/test/bench/package.json b/test/bench/package.json index 31c86692..c065350e 100644 --- a/test/bench/package.json +++ b/test/bench/package.json @@ -8,17 +8,17 @@ "test": "node perf && node random && node parallel" }, "devDependencies": { - "async": "^2.6.1", + "async": "^3.1.0", "benchmark": "^2.1.4", "gm": "^1.23.1", "imagemagick": "^0.1.3", "imagemagick-native": "^1.9.3", - "jimp": "^0.5.3", - "mapnik": "^4.0.1", - "semver": "^5.5.1" + "jimp": "^0.6.4", + "mapnik": "^4.2.1", + "semver": "^6.1.2" }, "license": "Apache-2.0", "engines": { - "node": ">=6" + "node": ">=8.5.0" } } diff --git a/test/fixtures/alpha-layer-1-fill-low-alpha.png b/test/fixtures/alpha-layer-1-fill-low-alpha.png deleted file mode 100644 index db8fc5f5..00000000 Binary files a/test/fixtures/alpha-layer-1-fill-low-alpha.png and /dev/null differ diff --git a/test/fixtures/alpha-layer-2-ink-low-alpha.png b/test/fixtures/alpha-layer-2-ink-low-alpha.png deleted file mode 100644 index 31bf629d..00000000 Binary files a/test/fixtures/alpha-layer-2-ink-low-alpha.png and /dev/null differ diff --git a/test/fixtures/alpha-layer-2-ink.png b/test/fixtures/alpha-layer-2-ink.png deleted file mode 100644 index 6bfb355f..00000000 Binary files a/test/fixtures/alpha-layer-2-ink.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-01-imagemagick.png b/test/fixtures/expected/alpha-layer-01-imagemagick.png deleted file mode 100644 index 45cdfc56..00000000 Binary files a/test/fixtures/expected/alpha-layer-01-imagemagick.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-01-low-alpha-imagemagick.png b/test/fixtures/expected/alpha-layer-01-low-alpha-imagemagick.png deleted file mode 100644 index e8ff9059..00000000 Binary files a/test/fixtures/expected/alpha-layer-01-low-alpha-imagemagick.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-01-low-alpha.png b/test/fixtures/expected/alpha-layer-01-low-alpha.png deleted file mode 100644 index c5cc9416..00000000 Binary files a/test/fixtures/expected/alpha-layer-01-low-alpha.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-01.png b/test/fixtures/expected/alpha-layer-01.png deleted file mode 100644 index a57349d5..00000000 Binary files a/test/fixtures/expected/alpha-layer-01.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-012-imagemagick.png b/test/fixtures/expected/alpha-layer-012-imagemagick.png deleted file mode 100644 index dcf1390c..00000000 Binary files a/test/fixtures/expected/alpha-layer-012-imagemagick.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-012-low-alpha-imagemagick.png b/test/fixtures/expected/alpha-layer-012-low-alpha-imagemagick.png deleted file mode 100644 index a276ae9d..00000000 Binary files a/test/fixtures/expected/alpha-layer-012-low-alpha-imagemagick.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-012-low-alpha.png b/test/fixtures/expected/alpha-layer-012-low-alpha.png deleted file mode 100644 index 1eb13cf9..00000000 Binary files a/test/fixtures/expected/alpha-layer-012-low-alpha.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-012.png b/test/fixtures/expected/alpha-layer-012.png deleted file mode 100644 index a88ad6c6..00000000 Binary files a/test/fixtures/expected/alpha-layer-012.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-12-imagemagick.png b/test/fixtures/expected/alpha-layer-12-imagemagick.png deleted file mode 100644 index 739e1b7b..00000000 Binary files a/test/fixtures/expected/alpha-layer-12-imagemagick.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-12-low-alpha-imagemagick.png b/test/fixtures/expected/alpha-layer-12-low-alpha-imagemagick.png deleted file mode 100644 index 9135af46..00000000 Binary files a/test/fixtures/expected/alpha-layer-12-low-alpha-imagemagick.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-12-low-alpha.png b/test/fixtures/expected/alpha-layer-12-low-alpha.png deleted file mode 100644 index 94001e61..00000000 Binary files a/test/fixtures/expected/alpha-layer-12-low-alpha.png and /dev/null differ diff --git a/test/fixtures/expected/alpha-layer-12.png b/test/fixtures/expected/alpha-layer-12.png deleted file mode 100644 index 68a47f89..00000000 Binary files a/test/fixtures/expected/alpha-layer-12.png and /dev/null differ diff --git a/test/fixtures/expected/crop-strategy-attention.jpg b/test/fixtures/expected/crop-strategy-attention.jpg index e9349e60..f1ef51e6 100644 Binary files a/test/fixtures/expected/crop-strategy-attention.jpg and b/test/fixtures/expected/crop-strategy-attention.jpg differ diff --git a/test/fixtures/expected/svg-embedded.png b/test/fixtures/expected/svg-embedded.png index 7c8cddc2..c08b1f11 100644 Binary files a/test/fixtures/expected/svg-embedded.png and b/test/fixtures/expected/svg-embedded.png differ diff --git a/test/fixtures/index.js b/test/fixtures/index.js index afe36ea1..7a7dadb8 100644 --- a/test/fixtures/index.js +++ b/test/fixtures/index.js @@ -80,9 +80,6 @@ module.exports = { inputPngWithTransparency16bit: getPath('tbgn2c16.png'), // http://www.schaik.com/pngsuite/tbgn2c16.png inputPngOverlayLayer0: getPath('alpha-layer-0-background.png'), inputPngOverlayLayer1: getPath('alpha-layer-1-fill.png'), - inputPngOverlayLayer2: getPath('alpha-layer-2-ink.png'), - inputPngOverlayLayer1LowAlpha: getPath('alpha-layer-1-fill-low-alpha.png'), - inputPngOverlayLayer2LowAlpha: getPath('alpha-layer-2-ink-low-alpha.png'), inputPngAlphaPremultiplicationSmall: getPath('alpha-premultiply-1024x768-paper.png'), inputPngAlphaPremultiplicationLarge: getPath('alpha-premultiply-2048x1536-paper.png'), inputPngBooleanNoAlpha: getPath('bandbool.png'), diff --git a/test/unit/metadata.js b/test/unit/metadata.js index a8406e67..0f3e89df 100644 --- a/test/unit/metadata.js +++ b/test/unit/metadata.js @@ -75,8 +75,8 @@ describe('Image metadata', function () { // XMP assert.strictEqual('object', typeof metadata.xmp); assert.strictEqual(true, metadata.xmp instanceof Buffer); - assert.strictEqual(12495, metadata.xmp.byteLength); - assert.strictEqual(metadata.xmp.indexOf(Buffer.from('http://ns.adobe.com/xap/1.0')), 0); + assert.strictEqual(12466, metadata.xmp.byteLength); + assert.strictEqual(metadata.xmp.indexOf(Buffer.from(' { if (err) throw err; assert.strictEqual('tiff', info.format); - assert(info.size === startSize); + assert.strictEqual(startSize, info.size); rimraf(fixtures.outputTiff, done); }); });