diff --git a/CHANGELOG.md b/CHANGELOG.md index 03dc9797e..3ea229d83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [v0.0.6] - TBD -Uses libvips v8.14.5, compiled with Emscripten v3.1.46. +Uses libvips v8.15.0, compiled with Emscripten v3.1.46. + +### Changed + +- Update methods/enums for libvips 8.15. ## [v0.0.5] - 2023-04-27 diff --git a/build.sh b/build.sh index 98c6ac04b..711336af4 100755 --- a/build.sh +++ b/build.sh @@ -183,7 +183,7 @@ VERSION_TIFF=4.6.0 # https://gitlab.com/libtiff/libtiff VERSION_RESVG=0.36.0 # https://github.com/RazrFalcon/resvg VERSION_AOM=3.7.0 # https://aomedia.googlesource.com/aom VERSION_HEIF=1.16.2 # https://github.com/strukturag/libheif -VERSION_VIPS=8.14.5 # https://github.com/libvips/libvips +VERSION_VIPS=32ddfe7 # https://github.com/libvips/libvips # Remove patch version component without_patch() { @@ -450,14 +450,14 @@ node --version [ -f "$TARGET/lib/pkgconfig/vips.pc" ] || ( stage "Compiling vips" mkdir $DEPS/vips - curl -Ls https://github.com/libvips/libvips/releases/download/v$VERSION_VIPS/vips-$(without_prerelease $VERSION_VIPS).tar.xz | tar xJC $DEPS/vips --strip-components=1 + curl -Ls https://github.com/libvips/libvips/archive/$VERSION_VIPS.tar.gz | tar xzC $DEPS/vips --strip-components=1 cd $DEPS/vips # Emscripten specific patches - curl -Ls https://github.com/libvips/libvips/compare/v$VERSION_VIPS...kleisauke:wasm-vips-8.14.patch | patch -p1 + curl -Ls https://github.com/libvips/libvips/compare/$VERSION_VIPS...kleisauke:wasm-vips-8.15.patch | patch -p1 # Disable building man pages, gettext po files, tools, and (fuzz-)tests sed -i "/subdir('man')/{N;N;N;N;d;}" meson.build meson setup _build --prefix=$TARGET --cross-file=$MESON_CROSS --default-library=static --buildtype=release \ - -Ddeprecated=false -Dexamples=false -Dcplusplus=$LIBVIPS_CPP -Dintrospection=false -Dauto_features=disabled \ + -Ddeprecated=false -Dexamples=false -Dcplusplus=$LIBVIPS_CPP -Dauto_features=disabled \ ${ENABLE_MODULES:+-Dmodules=enabled} -Dcgif=enabled -Dexif=enabled ${ENABLE_AVIF:+-Dheif=enabled} \ -Dheif-module=enabled -Dimagequant=enabled -Djpeg=enabled ${ENABLE_JXL:+-Djpeg-xl=enabled} \ -Djpeg-xl-module=enabled -Dlcms=enabled ${ENABLE_SVG:+-Dresvg=enabled} -Dresvg-module=enabled \ diff --git a/build/preamble_vips.d.ts b/build/preamble_vips.d.ts index 2d8ceab6a..ffe09c920 100644 --- a/build/preamble_vips.d.ts +++ b/build/preamble_vips.d.ts @@ -576,6 +576,10 @@ declare module Vips { * loaders are permissive, that is, [[FailOn.none]]. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean }): Image; /** @@ -641,6 +645,10 @@ declare module Vips { * loaders are permissive, that is, [[FailOn.none]]. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean }): Image; /** @@ -663,6 +671,10 @@ declare module Vips { * loaders are permissive, that is, [[FailOn.none]]. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean }): Image; /** @@ -966,6 +978,10 @@ declare module Vips { * Color for background pixels. */ background?: ArrayConstant + /** + * Enable line art mode. + */ + line_art?: boolean }): { /** * Output left edge. diff --git a/lib/vips.d.ts b/lib/vips.d.ts index e97c352a1..1a0069e2d 100644 --- a/lib/vips.d.ts +++ b/lib/vips.d.ts @@ -576,6 +576,10 @@ declare module Vips { * loaders are permissive, that is, [[FailOn.none]]. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean }): Image; /** @@ -641,6 +645,10 @@ declare module Vips { * loaders are permissive, that is, [[FailOn.none]]. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean }): Image; /** @@ -663,6 +671,10 @@ declare module Vips { * loaders are permissive, that is, [[FailOn.none]]. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean }): Image; /** @@ -966,6 +978,10 @@ declare module Vips { * Color for background pixels. */ background?: ArrayConstant + /** + * Enable line art mode. + */ + line_art?: boolean }): { /** * Output left edge. @@ -1722,30 +1738,28 @@ declare module Vips { } /** - * See vips_image_pipelinev(). Operations can hint to the VIPS image IO - * system about the kind of demand geometry they prefer. + * See vips_image_pipelinev(). Operations can hint + * the kind of demand geometry they prefer + * to the VIPS image IO system. * * These demand styles are given below in order of increasing - * restrictiveness. When demanding output from a pipeline, + * specialisation. When demanding output from a pipeline, * vips_image_generate() - * will use the most restrictive of the styles requested by the operations + * will use the most general style requested by the operations * in the pipeline. * - * #VIPS_DEMAND_STYLE_THINSTRIP --- This operation would like to output strips - * the width of the image and a few pels high. This is option suitable for - * point-to-point operations, such as those in the arithmetic package. - * - * This option is only efficient for cases where each output pel depends - * upon the pel in the corresponding position in the input image. + * #VIPS_DEMAND_STYLE_SMALLTILE --- This is the most general demand format. + * Output is demanded in small (around 100x100 pel) sections. This style works + * reasonably efficiently, even for bizarre operations like 45 degree rotate. * * #VIPS_DEMAND_STYLE_FATSTRIP --- This operation would like to output strips * the width of the image and as high as possible. This option is suitable * for area operations which do not violently transform coordinates, such * as vips_conv(). * - * #VIPS_DEMAND_STYLE_SMALLTILE --- This is the most general demand format. - * Output is demanded in small (around 100x100 pel) sections. This style works - * reasonably efficiently, even for bizzare operations like 45 degree rotate. + * #VIPS_DEMAND_STYLE_THINSTRIP --- This operation would like to output strips + * the width of the image and a few pels high. This option is suitable for + * point-to-point operations, such as those in the arithmetic package. * * #VIPS_DEMAND_STYLE_ANY --- This image is not being demand-read from a disc * file (even indirectly) so any demand style is OK. It's used for things like @@ -1755,11 +1769,11 @@ declare module Vips { */ enum DemandStyle { /** - * Demand in small (typically 64x64 pixel) tiles + * Demand in small (typically 128x128 pixel) tiles */ smalltile = 'smalltile', /** - * Demand in fat (typically 10 pixel high) strips + * Demand in fat (typically 16 pixel high) strips */ fatstrip = 'fatstrip', /** @@ -1829,15 +1843,15 @@ declare module Vips { */ enum OperationMath2 { /** - * Pow( left, right ) + * Pow(left, right) */ pow = 'pow', /** - * Pow( right, left ) + * Pow(right, left) */ wop = 'wop', /** - * Atan2( left, right ) + * Atan2(left, right) */ atan2 = 'atan2' } @@ -2768,6 +2782,40 @@ declare module Vips { add = 'add' } + /** + * Which metadata to retain. + */ + enum ForeignKeep { + /** + * Don't attach metadata + */ + none = 'none', + /** + * Keep Exif metadata + */ + exif = 'exif', + /** + * Keep XMP metadata + */ + xmp = 'xmp', + /** + * Keep IPTC metadata + */ + iptc = 'iptc', + /** + * Keep ICC metadata + */ + icc = 'icc', + /** + * Keep other metadata (e.g. PNG comments and some TIFF tags) + */ + other = 'other', + /** + * Keep all metadata + */ + all = 'all' + } + /** * http://www.w3.org/TR/PNG-Filters.html * The values mirror those of png.h in libpng. @@ -2825,6 +2873,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -2937,6 +2989,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -2978,6 +3034,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3021,6 +3081,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3046,6 +3110,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3128,6 +3196,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3161,6 +3233,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3194,6 +3270,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3249,6 +3329,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3290,6 +3374,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3331,6 +3419,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3380,6 +3472,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3409,6 +3505,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3438,6 +3538,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3475,6 +3579,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3512,6 +3620,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3549,6 +3661,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3574,6 +3690,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3599,6 +3719,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3624,6 +3748,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3679,6 +3807,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -3716,6 +3848,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4029,6 +4165,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4054,6 +4194,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4079,6 +4223,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4104,6 +4252,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4129,6 +4281,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4154,6 +4310,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4199,6 +4359,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4244,6 +4408,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4293,6 +4461,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4342,6 +4514,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4391,6 +4567,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4442,6 +4622,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4471,6 +4655,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4500,6 +4688,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4525,6 +4717,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4550,6 +4746,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4582,6 +4782,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4607,6 +4811,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4632,6 +4840,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4672,6 +4884,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4738,6 +4954,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4775,6 +4995,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -4812,6 +5036,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5087,6 +5315,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5128,6 +5360,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5169,6 +5405,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5242,6 +5482,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5267,6 +5511,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5304,6 +5552,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5341,6 +5593,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5378,6 +5634,10 @@ declare module Vips { * Error level to fail on. */ fail_on?: FailOn | Enum + /** + * Don't use a cached result for this operation. + */ + revalidate?: boolean /** * Flags for this file (output). */ @@ -5924,7 +6184,7 @@ declare module Vips { convi(mask: Image | ArrayConstant): Image; /** - * Seperable convolution operation. + * Separable convolution operation. * @param mask Input matrix image. * @param options Optional options. * @return Output image. @@ -6015,14 +6275,18 @@ declare module Vips { * @param options Optional options. */ csvsave(filename: string, options?: { + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Separator characters. */ separator?: string /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6039,14 +6303,18 @@ declare module Vips { * @param options Optional options. */ csvsaveTarget(target: Target, options?: { + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Separator characters. */ separator?: string /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6205,9 +6473,9 @@ declare module Vips { */ dzsave(filename: string, options?: { /** - * Base name to save to. + * Image name. */ - basename?: string + imagename?: string /** * Directory layout. */ @@ -6224,6 +6492,10 @@ declare module Vips { * Tile size in pixels. */ tile_size?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Center image in tile. */ @@ -6252,18 +6524,18 @@ declare module Vips { * Skip tiles which are nearly equal to the background. */ skip_blanks?: number - /** - * Don't strip tile metadata. - */ - no_strip?: boolean /** * Resource id. */ id?: string /** - * Strip all metadata from image. + * Q factor. */ - strip?: boolean + Q?: number + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6281,9 +6553,9 @@ declare module Vips { */ dzsaveBuffer(options?: { /** - * Base name to save to. + * Image name. */ - basename?: string + imagename?: string /** * Directory layout. */ @@ -6300,6 +6572,10 @@ declare module Vips { * Tile size in pixels. */ tile_size?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Center image in tile. */ @@ -6328,18 +6604,18 @@ declare module Vips { * Skip tiles which are nearly equal to the background. */ skip_blanks?: number - /** - * Don't strip tile metadata. - */ - no_strip?: boolean /** * Resource id. */ id?: string /** - * Strip all metadata from image. + * Q factor. + */ + Q?: number + /** + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6357,9 +6633,9 @@ declare module Vips { */ dzsaveTarget(target: Target, options?: { /** - * Base name to save to. + * Image name. */ - basename?: string + imagename?: string /** * Directory layout. */ @@ -6376,6 +6652,10 @@ declare module Vips { * Tile size in pixels. */ tile_size?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Center image in tile. */ @@ -6404,18 +6684,18 @@ declare module Vips { * Skip tiles which are nearly equal to the background. */ skip_blanks?: number - /** - * Don't strip tile metadata. - */ - no_strip?: boolean /** * Resource id. */ id?: string /** - * Strip all metadata from image. + * Q factor. */ - strip?: boolean + Q?: number + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6501,9 +6781,13 @@ declare module Vips { */ fitssave(filename: string, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6607,6 +6891,10 @@ declare module Vips { * Quantisation effort. */ effort?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Number of bits per pixel. */ @@ -6628,9 +6916,9 @@ declare module Vips { */ interlace?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6655,6 +6943,10 @@ declare module Vips { * Quantisation effort. */ effort?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Number of bits per pixel. */ @@ -6676,9 +6968,9 @@ declare module Vips { */ interlace?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6703,6 +6995,10 @@ declare module Vips { * Quantisation effort. */ effort?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Number of bits per pixel. */ @@ -6724,9 +7020,9 @@ declare module Vips { */ interlace?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6795,6 +7091,10 @@ declare module Vips { * Number of bits per pixel. */ bitdepth?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Enable lossless compression. */ @@ -6816,9 +7116,9 @@ declare module Vips { */ encoder?: ForeignHeifEncoder | Enum /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6843,6 +7143,10 @@ declare module Vips { * Number of bits per pixel. */ bitdepth?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Enable lossless compression. */ @@ -6864,9 +7168,9 @@ declare module Vips { */ encoder?: ForeignHeifEncoder | Enum /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -6891,6 +7195,10 @@ declare module Vips { * Number of bits per pixel. */ bitdepth?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Enable lossless compression. */ @@ -6912,9 +7220,9 @@ declare module Vips { */ encoder?: ForeignHeifEncoder | Enum /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7249,6 +7557,10 @@ declare module Vips { * Tile width in pixels. */ tile_width?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Tile height in pixels. */ @@ -7266,9 +7578,9 @@ declare module Vips { */ subsample_mode?: ForeignSubsample | Enum /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7289,6 +7601,10 @@ declare module Vips { * Tile width in pixels. */ tile_width?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Tile height in pixels. */ @@ -7306,9 +7622,9 @@ declare module Vips { */ subsample_mode?: ForeignSubsample | Enum /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7329,6 +7645,10 @@ declare module Vips { * Tile width in pixels. */ tile_width?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Tile height in pixels. */ @@ -7346,9 +7666,9 @@ declare module Vips { */ subsample_mode?: ForeignSubsample | Enum /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7370,7 +7690,7 @@ declare module Vips { */ Q?: number /** - * Icc profile to embed. + * Filename of icc profile to embed. */ profile?: string /** @@ -7406,9 +7726,9 @@ declare module Vips { */ restart_interval?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7430,7 +7750,7 @@ declare module Vips { */ Q?: number /** - * Icc profile to embed. + * Filename of icc profile to embed. */ profile?: string /** @@ -7466,9 +7786,9 @@ declare module Vips { */ restart_interval?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7489,7 +7809,7 @@ declare module Vips { */ Q?: number /** - * Icc profile to embed. + * Filename of icc profile to embed. */ profile?: string /** @@ -7525,9 +7845,9 @@ declare module Vips { */ restart_interval?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7549,7 +7869,7 @@ declare module Vips { */ Q?: number /** - * Icc profile to embed. + * Filename of icc profile to embed. */ profile?: string /** @@ -7585,9 +7905,9 @@ declare module Vips { */ restart_interval?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7612,6 +7932,10 @@ declare module Vips { * Target butteraugli distance. */ distance?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Encoding effort. */ @@ -7625,9 +7949,9 @@ declare module Vips { */ Q?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7652,6 +7976,10 @@ declare module Vips { * Target butteraugli distance. */ distance?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Encoding effort. */ @@ -7665,9 +7993,9 @@ declare module Vips { */ Q?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7692,6 +8020,10 @@ declare module Vips { * Target butteraugli distance. */ distance?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Encoding effort. */ @@ -7705,9 +8037,9 @@ declare module Vips { */ Q?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7795,9 +8127,13 @@ declare module Vips { */ bitdepth?: number /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7835,9 +8171,13 @@ declare module Vips { */ bitdepth?: number /** - * Strip all metadata from image. + * Filename of icc profile to embed. + */ + profile?: string + /** + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7946,9 +8286,13 @@ declare module Vips { */ matrixprint(options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7966,9 +8310,13 @@ declare module Vips { */ matrixsave(filename: string, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -7986,9 +8334,13 @@ declare module Vips { */ matrixsaveTarget(target: Target, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8231,9 +8583,13 @@ declare module Vips { */ niftisave(filename: string, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8273,7 +8629,7 @@ declare module Vips { */ interlace?: boolean /** - * Icc profile to embed. + * Filename of icc profile to embed. */ profile?: string /** @@ -8301,9 +8657,9 @@ declare module Vips { */ effort?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8329,7 +8685,7 @@ declare module Vips { */ interlace?: boolean /** - * Icc profile to embed. + * Filename of icc profile to embed. */ profile?: string /** @@ -8357,9 +8713,9 @@ declare module Vips { */ effort?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8385,7 +8741,7 @@ declare module Vips { */ interlace?: boolean /** - * Icc profile to embed. + * Filename of icc profile to embed. */ profile?: string /** @@ -8413,9 +8769,9 @@ declare module Vips { */ effort?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8440,14 +8796,18 @@ declare module Vips { * Save as ascii. */ ascii?: boolean + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Set to 1 to write as a 1 bit image. */ bitdepth?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8472,14 +8832,18 @@ declare module Vips { * Save as ascii. */ ascii?: boolean + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Set to 1 to write as a 1 bit image. */ bitdepth?: number /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8502,6 +8866,12 @@ declare module Vips { max_alpha?: number }): Image; + /** + * Prewitt edge detector. + * @return Output image. + */ + prewitt(): Image; + /** * Resample an image with a quadratic transform. * @param coeff Coefficient matrix. @@ -8528,9 +8898,13 @@ declare module Vips { */ radsave(filename: string, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. + */ + profile?: string + /** + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8548,9 +8922,13 @@ declare module Vips { */ radsaveBuffer(options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8568,9 +8946,13 @@ declare module Vips { */ radsaveTarget(target: Target, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. + */ + profile?: string + /** + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8597,9 +8979,13 @@ declare module Vips { */ rawsave(filename: string, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. + */ + profile?: string + /** + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8617,9 +9003,13 @@ declare module Vips { */ rawsaveFd(fd: number, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. */ - strip?: boolean + profile?: string + /** + * Which metadata to retain. + */ + keep?: ForeignKeep | Flag /** * Background value. */ @@ -8850,6 +9240,12 @@ declare module Vips { log?: boolean }): Image; + /** + * Scharr edge detector. + * @return Output image. + */ + scharr(): Image; + /** * Check sequential access. * @param options Optional options. @@ -8992,6 +9388,10 @@ declare module Vips { * How to measure interestingness. */ interesting?: Interesting | Enum + /** + * Input image already has premultiplied alpha. + */ + premultiplied?: boolean /** * Horizontal position of attention centre (output). */ @@ -9137,10 +9537,6 @@ declare module Vips { * Compression prediction. */ predictor?: ForeignTiffPredictor | Enum - /** - * Icc profile to embed. - */ - profile?: string /** * Write a tiled tiff. */ @@ -9149,6 +9545,10 @@ declare module Vips { * Tile width in pixels. */ tile_width?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Tile height in pixels. */ @@ -9210,9 +9610,9 @@ declare module Vips { */ premultiply?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9241,10 +9641,6 @@ declare module Vips { * Compression prediction. */ predictor?: ForeignTiffPredictor | Enum - /** - * Icc profile to embed. - */ - profile?: string /** * Write a tiled tiff. */ @@ -9253,6 +9649,10 @@ declare module Vips { * Tile width in pixels. */ tile_width?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Tile height in pixels. */ @@ -9314,9 +9714,9 @@ declare module Vips { */ premultiply?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9345,10 +9745,6 @@ declare module Vips { * Compression prediction. */ predictor?: ForeignTiffPredictor | Enum - /** - * Icc profile to embed. - */ - profile?: string /** * Write a tiled tiff. */ @@ -9357,6 +9753,10 @@ declare module Vips { * Tile width in pixels. */ tile_width?: number + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Tile height in pixels. */ @@ -9418,9 +9818,9 @@ declare module Vips { */ premultiply?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9498,9 +9898,13 @@ declare module Vips { */ vipssave(filename: string, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. + */ + profile?: string + /** + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9518,9 +9922,13 @@ declare module Vips { */ vipssaveTarget(target: Target, options?: { /** - * Strip all metadata from image. + * Filename of icc profile to embed. + */ + profile?: string + /** + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9545,6 +9953,10 @@ declare module Vips { * Enable lossless compression. */ lossless?: boolean + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Preset for lossy compression. */ @@ -9577,18 +9989,14 @@ declare module Vips { * Level of cpu effort to reduce file size. */ effort?: number - /** - * Icc profile to embed. - */ - profile?: string /** * Allow mixed encoding (might reduce file size). */ mixed?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9613,6 +10021,10 @@ declare module Vips { * Enable lossless compression. */ lossless?: boolean + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Preset for lossy compression. */ @@ -9645,18 +10057,14 @@ declare module Vips { * Level of cpu effort to reduce file size. */ effort?: number - /** - * Icc profile to embed. - */ - profile?: string /** * Allow mixed encoding (might reduce file size). */ mixed?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9680,6 +10088,10 @@ declare module Vips { * Enable lossless compression. */ lossless?: boolean + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Preset for lossy compression. */ @@ -9712,18 +10124,14 @@ declare module Vips { * Level of cpu effort to reduce file size. */ effort?: number - /** - * Icc profile to embed. - */ - profile?: string /** * Allow mixed encoding (might reduce file size). */ mixed?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ @@ -9748,6 +10156,10 @@ declare module Vips { * Enable lossless compression. */ lossless?: boolean + /** + * Filename of icc profile to embed. + */ + profile?: string /** * Preset for lossy compression. */ @@ -9780,18 +10192,14 @@ declare module Vips { * Level of cpu effort to reduce file size. */ effort?: number - /** - * Icc profile to embed. - */ - profile?: string /** * Allow mixed encoding (might reduce file size). */ mixed?: boolean /** - * Strip all metadata from image. + * Which metadata to retain. */ - strip?: boolean + keep?: ForeignKeep | Flag /** * Background value. */ diff --git a/src/bindings/vips-operators.cpp b/src/bindings/vips-operators.cpp index d99f48136..677fd369d 100644 --- a/src/bindings/vips-operators.cpp +++ b/src/bindings/vips-operators.cpp @@ -3186,6 +3186,18 @@ Image Image::premultiply(emscripten::val js_options) const return out; } +Image Image::prewitt() const +{ + Image out; + + this->call("prewitt", + (new Option) + ->set("in", *this) + ->set("out", &out)); + + return out; +} + Image Image::profile(Image *rows) const { Image columns; @@ -3546,6 +3558,18 @@ Image Image::scale(emscripten::val js_options) const return out; } +Image Image::scharr() const +{ + Image out; + + this->call("scharr", + (new Option) + ->set("in", *this) + ->set("out", &out)); + + return out; +} + Image Image::sequential(emscripten::val js_options) const { Image out; diff --git a/src/bindings/vips-operators.h b/src/bindings/vips-operators.h index f3742cdeb..a5837bb92 100644 --- a/src/bindings/vips-operators.h +++ b/src/bindings/vips-operators.h @@ -1068,7 +1068,7 @@ Image convf(emscripten::val mask) const; Image convi(emscripten::val mask) const; /** - * Seperable convolution operation. + * Separable convolution operation. * @param mask Input matrix image. * @param js_options Optional options. * @return Output image. @@ -1889,6 +1889,12 @@ void ppmsave_target(const Target &target, emscripten::val js_options = emscripte */ Image premultiply(emscripten::val js_options = emscripten::val::null()) const; +/** + * Prewitt edge detector. + * @return Output image. + */ +Image prewitt() const; + /** * Find image profiles. * @param rows First non-zero pixel in row. @@ -2092,6 +2098,12 @@ Image scRGB2sRGB(emscripten::val js_options = emscripten::val::null()) const; */ Image scale(emscripten::val js_options = emscripten::val::null()) const; +/** + * Scharr edge detector. + * @return Output image. + */ +Image scharr() const; + /** * Check sequential access. * @param js_options Optional options. diff --git a/src/vips-emscripten.cpp b/src/vips-emscripten.cpp index d5180a4ef..2036cc58c 100644 --- a/src/vips-emscripten.cpp +++ b/src/vips-emscripten.cpp @@ -399,6 +399,15 @@ EMSCRIPTEN_BINDINGS(my_module) { .value("set", VIPS_COMBINE_MODE_SET) .value("add", VIPS_COMBINE_MODE_ADD); + enum_("ForeignKeep") + .value("none", VIPS_FOREIGN_KEEP_NONE) + .value("exif", VIPS_FOREIGN_KEEP_EXIF) + .value("xmp", VIPS_FOREIGN_KEEP_XMP) + .value("iptc", VIPS_FOREIGN_KEEP_IPTC) + .value("icc", VIPS_FOREIGN_KEEP_ICC) + .value("other", VIPS_FOREIGN_KEEP_OTHER) + .value("all", VIPS_FOREIGN_KEEP_ALL); + enum_("ForeignPngFilter") .value("none", VIPS_FOREIGN_PNG_FILTER_NONE) .value("sub", VIPS_FOREIGN_PNG_FILTER_SUB) @@ -1847,6 +1856,7 @@ EMSCRIPTEN_BINDINGS(my_module) { .function("premultiply", optional_override([](const Image &image) { return image.premultiply(); })) + .function("prewitt", &Image::prewitt) .function("quadratic", &Image::quadratic) .function("quadratic", optional_override([](const Image &image, emscripten::val coeff) { return image.quadratic(coeff); @@ -1914,6 +1924,7 @@ EMSCRIPTEN_BINDINGS(my_module) { .function("scale", optional_override([](const Image &image) { return image.scale(); })) + .function("scharr", &Image::scharr) .function("sequential", &Image::sequential) .function("sequential", optional_override([](const Image &image) { return image.sequential(); diff --git a/test/bench/index.html b/test/bench/index.html index fddf6269d..f1893d052 100644 --- a/test/bench/index.html +++ b/test/bench/index.html @@ -13,8 +13,9 @@