@basemaps/lambda-tiler 7.12.0 → 7.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/routes/__tests__/tile.style.json.test.js +3 -1
  3. package/build/routes/__tests__/tile.style.json.test.js.map +1 -1
  4. package/build/routes/tile.style.json.d.ts +4 -0
  5. package/build/routes/tile.style.json.js +1 -1
  6. package/build/routes/tile.style.json.js.map +1 -1
  7. package/build/util/__test__/nztm.style.test.js +16 -7
  8. package/build/util/__test__/nztm.style.test.js.map +1 -1
  9. package/build/util/nztm.style.js +0 -3
  10. package/build/util/nztm.style.js.map +1 -1
  11. package/dist/index.js +86646 -0
  12. package/dist/node_modules/.package-lock.json +179 -0
  13. package/dist/node_modules/@img/sharp-libvips-linux-arm64/README.md +47 -0
  14. package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/glib-2.0/include/glibconfig.h +219 -0
  15. package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/index.js +1 -0
  16. package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/libvips-cpp.so.42 +0 -0
  17. package/dist/node_modules/@img/sharp-libvips-linux-arm64/package.json +45 -0
  18. package/dist/node_modules/@img/sharp-libvips-linux-arm64/versions.json +31 -0
  19. package/dist/node_modules/@img/sharp-linux-arm64/LICENSE +191 -0
  20. package/dist/node_modules/@img/sharp-linux-arm64/README.md +18 -0
  21. package/dist/node_modules/@img/sharp-linux-arm64/lib/sharp-linux-arm64.node +0 -0
  22. package/dist/node_modules/@img/sharp-linux-arm64/package.json +47 -0
  23. package/dist/node_modules/color/LICENSE +21 -0
  24. package/dist/node_modules/color/README.md +123 -0
  25. package/dist/node_modules/color/index.js +496 -0
  26. package/dist/node_modules/color/package.json +47 -0
  27. package/dist/node_modules/color-convert/CHANGELOG.md +54 -0
  28. package/dist/node_modules/color-convert/LICENSE +21 -0
  29. package/dist/node_modules/color-convert/README.md +68 -0
  30. package/dist/node_modules/color-convert/conversions.js +839 -0
  31. package/dist/node_modules/color-convert/index.js +81 -0
  32. package/dist/node_modules/color-convert/package.json +48 -0
  33. package/dist/node_modules/color-convert/route.js +97 -0
  34. package/dist/node_modules/color-name/LICENSE +8 -0
  35. package/dist/node_modules/color-name/README.md +11 -0
  36. package/dist/node_modules/color-name/index.js +152 -0
  37. package/dist/node_modules/color-name/package.json +28 -0
  38. package/dist/node_modules/color-string/LICENSE +21 -0
  39. package/dist/node_modules/color-string/README.md +62 -0
  40. package/dist/node_modules/color-string/index.js +242 -0
  41. package/dist/node_modules/color-string/package.json +39 -0
  42. package/dist/node_modules/detect-libc/LICENSE +201 -0
  43. package/dist/node_modules/detect-libc/README.md +163 -0
  44. package/dist/node_modules/detect-libc/index.d.ts +14 -0
  45. package/dist/node_modules/detect-libc/lib/detect-libc.js +267 -0
  46. package/dist/node_modules/detect-libc/lib/filesystem.js +41 -0
  47. package/dist/node_modules/detect-libc/lib/process.js +24 -0
  48. package/dist/node_modules/detect-libc/package.json +40 -0
  49. package/dist/node_modules/is-arrayish/LICENSE +21 -0
  50. package/dist/node_modules/is-arrayish/README.md +16 -0
  51. package/dist/node_modules/is-arrayish/index.js +9 -0
  52. package/dist/node_modules/is-arrayish/package.json +45 -0
  53. package/dist/node_modules/is-arrayish/yarn-error.log +1443 -0
  54. package/dist/node_modules/lerc/CHANGELOG.md +69 -0
  55. package/dist/node_modules/lerc/LercDecode.d.ts +61 -0
  56. package/dist/node_modules/lerc/LercDecode.es.d.ts +61 -0
  57. package/dist/node_modules/lerc/LercDecode.es.js +434 -0
  58. package/dist/node_modules/lerc/LercDecode.es.min.js +17 -0
  59. package/dist/node_modules/lerc/LercDecode.js +448 -0
  60. package/dist/node_modules/lerc/LercDecode.min.js +17 -0
  61. package/dist/node_modules/lerc/README.md +123 -0
  62. package/dist/node_modules/lerc/lerc-wasm.wasm +0 -0
  63. package/dist/node_modules/lerc/package.json +30 -0
  64. package/dist/node_modules/semver/LICENSE +15 -0
  65. package/dist/node_modules/semver/README.md +654 -0
  66. package/dist/node_modules/semver/bin/semver.js +188 -0
  67. package/dist/node_modules/semver/classes/comparator.js +141 -0
  68. package/dist/node_modules/semver/classes/index.js +5 -0
  69. package/dist/node_modules/semver/classes/range.js +554 -0
  70. package/dist/node_modules/semver/classes/semver.js +302 -0
  71. package/dist/node_modules/semver/functions/clean.js +6 -0
  72. package/dist/node_modules/semver/functions/cmp.js +52 -0
  73. package/dist/node_modules/semver/functions/coerce.js +60 -0
  74. package/dist/node_modules/semver/functions/compare-build.js +7 -0
  75. package/dist/node_modules/semver/functions/compare-loose.js +3 -0
  76. package/dist/node_modules/semver/functions/compare.js +5 -0
  77. package/dist/node_modules/semver/functions/diff.js +65 -0
  78. package/dist/node_modules/semver/functions/eq.js +3 -0
  79. package/dist/node_modules/semver/functions/gt.js +3 -0
  80. package/dist/node_modules/semver/functions/gte.js +3 -0
  81. package/dist/node_modules/semver/functions/inc.js +19 -0
  82. package/dist/node_modules/semver/functions/lt.js +3 -0
  83. package/dist/node_modules/semver/functions/lte.js +3 -0
  84. package/dist/node_modules/semver/functions/major.js +3 -0
  85. package/dist/node_modules/semver/functions/minor.js +3 -0
  86. package/dist/node_modules/semver/functions/neq.js +3 -0
  87. package/dist/node_modules/semver/functions/parse.js +16 -0
  88. package/dist/node_modules/semver/functions/patch.js +3 -0
  89. package/dist/node_modules/semver/functions/prerelease.js +6 -0
  90. package/dist/node_modules/semver/functions/rcompare.js +3 -0
  91. package/dist/node_modules/semver/functions/rsort.js +3 -0
  92. package/dist/node_modules/semver/functions/satisfies.js +10 -0
  93. package/dist/node_modules/semver/functions/sort.js +3 -0
  94. package/dist/node_modules/semver/functions/valid.js +6 -0
  95. package/dist/node_modules/semver/index.js +89 -0
  96. package/dist/node_modules/semver/internal/constants.js +35 -0
  97. package/dist/node_modules/semver/internal/debug.js +9 -0
  98. package/dist/node_modules/semver/internal/identifiers.js +23 -0
  99. package/dist/node_modules/semver/internal/lrucache.js +40 -0
  100. package/dist/node_modules/semver/internal/parse-options.js +15 -0
  101. package/dist/node_modules/semver/internal/re.js +217 -0
  102. package/dist/node_modules/semver/package.json +77 -0
  103. package/dist/node_modules/semver/preload.js +2 -0
  104. package/dist/node_modules/semver/range.bnf +16 -0
  105. package/dist/node_modules/semver/ranges/gtr.js +4 -0
  106. package/dist/node_modules/semver/ranges/intersects.js +7 -0
  107. package/dist/node_modules/semver/ranges/ltr.js +4 -0
  108. package/dist/node_modules/semver/ranges/max-satisfying.js +25 -0
  109. package/dist/node_modules/semver/ranges/min-satisfying.js +24 -0
  110. package/dist/node_modules/semver/ranges/min-version.js +61 -0
  111. package/dist/node_modules/semver/ranges/outside.js +80 -0
  112. package/dist/node_modules/semver/ranges/simplify.js +47 -0
  113. package/dist/node_modules/semver/ranges/subset.js +247 -0
  114. package/dist/node_modules/semver/ranges/to-comparators.js +8 -0
  115. package/dist/node_modules/semver/ranges/valid.js +11 -0
  116. package/dist/node_modules/sharp/LICENSE +191 -0
  117. package/dist/node_modules/sharp/README.md +118 -0
  118. package/dist/node_modules/sharp/install/check.js +36 -0
  119. package/dist/node_modules/sharp/lib/channel.js +174 -0
  120. package/dist/node_modules/sharp/lib/colour.js +182 -0
  121. package/dist/node_modules/sharp/lib/composite.js +210 -0
  122. package/dist/node_modules/sharp/lib/constructor.js +444 -0
  123. package/dist/node_modules/sharp/lib/index.d.ts +1717 -0
  124. package/dist/node_modules/sharp/lib/index.js +16 -0
  125. package/dist/node_modules/sharp/lib/input.js +657 -0
  126. package/dist/node_modules/sharp/lib/is.js +169 -0
  127. package/dist/node_modules/sharp/lib/libvips.js +171 -0
  128. package/dist/node_modules/sharp/lib/operation.js +919 -0
  129. package/dist/node_modules/sharp/lib/output.js +1561 -0
  130. package/dist/node_modules/sharp/lib/resize.js +582 -0
  131. package/dist/node_modules/sharp/lib/sharp.js +86 -0
  132. package/dist/node_modules/sharp/lib/utility.js +287 -0
  133. package/dist/node_modules/sharp/package.json +219 -0
  134. package/dist/node_modules/sharp/src/binding.gyp +277 -0
  135. package/dist/node_modules/sharp/src/common.cc +1090 -0
  136. package/dist/node_modules/sharp/src/common.h +393 -0
  137. package/dist/node_modules/sharp/src/metadata.cc +287 -0
  138. package/dist/node_modules/sharp/src/metadata.h +82 -0
  139. package/dist/node_modules/sharp/src/operations.cc +471 -0
  140. package/dist/node_modules/sharp/src/operations.h +125 -0
  141. package/dist/node_modules/sharp/src/pipeline.cc +1724 -0
  142. package/dist/node_modules/sharp/src/pipeline.h +385 -0
  143. package/dist/node_modules/sharp/src/sharp.cc +40 -0
  144. package/dist/node_modules/sharp/src/stats.cc +183 -0
  145. package/dist/node_modules/sharp/src/stats.h +59 -0
  146. package/dist/node_modules/sharp/src/utilities.cc +269 -0
  147. package/dist/node_modules/sharp/src/utilities.h +19 -0
  148. package/dist/node_modules/simple-swizzle/LICENSE +21 -0
  149. package/dist/node_modules/simple-swizzle/README.md +39 -0
  150. package/dist/node_modules/simple-swizzle/index.js +29 -0
  151. package/dist/node_modules/simple-swizzle/package.json +36 -0
  152. package/dist/package-lock.json +610 -0
  153. package/dist/package.json +40 -0
  154. package/dist/static/expected_tile_2193_153_255_z7.png +0 -0
  155. package/dist/static/expected_tile_NZTM2000Quad_30_33_z6.png +0 -0
  156. package/dist/static/expected_tile_WebMercatorQuad_252_156_z8.png +0 -0
  157. package/package.json +6 -6
  158. package/src/routes/__tests__/tile.style.json.test.ts +3 -2
  159. package/src/routes/tile.style.json.ts +1 -1
  160. package/src/util/__test__/nztm.style.test.ts +18 -8
  161. package/src/util/nztm.style.ts +0 -3
  162. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,919 @@
1
+ // Copyright 2013 Lovell Fuller and others.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ 'use strict';
5
+
6
+ const color = require('color');
7
+ const is = require('./is');
8
+
9
+ /**
10
+ * Rotate the output image by either an explicit angle
11
+ * or auto-orient based on the EXIF `Orientation` tag.
12
+ *
13
+ * If an angle is provided, it is converted to a valid positive degree rotation.
14
+ * For example, `-450` will produce a 270 degree rotation.
15
+ *
16
+ * When rotating by an angle other than a multiple of 90,
17
+ * the background colour can be provided with the `background` option.
18
+ *
19
+ * If no angle is provided, it is determined from the EXIF data.
20
+ * Mirroring is supported and may infer the use of a flip operation.
21
+ *
22
+ * The use of `rotate` without an angle will remove the EXIF `Orientation` tag, if any.
23
+ *
24
+ * Only one rotation can occur per pipeline.
25
+ * Previous calls to `rotate` in the same pipeline will be ignored.
26
+ *
27
+ * Method order is important when rotating, resizing and/or extracting regions,
28
+ * for example `.rotate(x).extract(y)` will produce a different result to `.extract(y).rotate(x)`.
29
+ *
30
+ * @example
31
+ * const pipeline = sharp()
32
+ * .rotate()
33
+ * .resize(null, 200)
34
+ * .toBuffer(function (err, outputBuffer, info) {
35
+ * // outputBuffer contains 200px high JPEG image data,
36
+ * // auto-rotated using EXIF Orientation tag
37
+ * // info.width and info.height contain the dimensions of the resized image
38
+ * });
39
+ * readableStream.pipe(pipeline);
40
+ *
41
+ * @example
42
+ * const rotateThenResize = await sharp(input)
43
+ * .rotate(90)
44
+ * .resize({ width: 16, height: 8, fit: 'fill' })
45
+ * .toBuffer();
46
+ * const resizeThenRotate = await sharp(input)
47
+ * .resize({ width: 16, height: 8, fit: 'fill' })
48
+ * .rotate(90)
49
+ * .toBuffer();
50
+ *
51
+ * @param {number} [angle=auto] angle of rotation.
52
+ * @param {Object} [options] - if present, is an Object with optional attributes.
53
+ * @param {string|Object} [options.background="#000000"] parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
54
+ * @returns {Sharp}
55
+ * @throws {Error} Invalid parameters
56
+ */
57
+ function rotate (angle, options) {
58
+ if (this.options.useExifOrientation || this.options.angle || this.options.rotationAngle) {
59
+ this.options.debuglog('ignoring previous rotate options');
60
+ }
61
+ if (!is.defined(angle)) {
62
+ this.options.useExifOrientation = true;
63
+ } else if (is.integer(angle) && !(angle % 90)) {
64
+ this.options.angle = angle;
65
+ } else if (is.number(angle)) {
66
+ this.options.rotationAngle = angle;
67
+ if (is.object(options) && options.background) {
68
+ const backgroundColour = color(options.background);
69
+ this.options.rotationBackground = [
70
+ backgroundColour.red(),
71
+ backgroundColour.green(),
72
+ backgroundColour.blue(),
73
+ Math.round(backgroundColour.alpha() * 255)
74
+ ];
75
+ }
76
+ } else {
77
+ throw is.invalidParameterError('angle', 'numeric', angle);
78
+ }
79
+ return this;
80
+ }
81
+
82
+ /**
83
+ * Mirror the image vertically (up-down) about the x-axis.
84
+ * This always occurs before rotation, if any.
85
+ *
86
+ * This operation does not work correctly with multi-page images.
87
+ *
88
+ * @example
89
+ * const output = await sharp(input).flip().toBuffer();
90
+ *
91
+ * @param {Boolean} [flip=true]
92
+ * @returns {Sharp}
93
+ */
94
+ function flip (flip) {
95
+ this.options.flip = is.bool(flip) ? flip : true;
96
+ return this;
97
+ }
98
+
99
+ /**
100
+ * Mirror the image horizontally (left-right) about the y-axis.
101
+ * This always occurs before rotation, if any.
102
+ *
103
+ * @example
104
+ * const output = await sharp(input).flop().toBuffer();
105
+ *
106
+ * @param {Boolean} [flop=true]
107
+ * @returns {Sharp}
108
+ */
109
+ function flop (flop) {
110
+ this.options.flop = is.bool(flop) ? flop : true;
111
+ return this;
112
+ }
113
+
114
+ /**
115
+ * Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any.
116
+ *
117
+ * You must provide an array of length 4 or a 2x2 affine transformation matrix.
118
+ * By default, new pixels are filled with a black background. You can provide a background color with the `background` option.
119
+ * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`.
120
+ *
121
+ * In the case of a 2x2 matrix, the transform is:
122
+ * - X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx`
123
+ * - Y = `matrix[1, 0]` \* (x + `idx`) + `matrix[1, 1]` \* (y + `idy`) + `ody`
124
+ *
125
+ * where:
126
+ * - x and y are the coordinates in input image.
127
+ * - X and Y are the coordinates in output image.
128
+ * - (0,0) is the upper left corner.
129
+ *
130
+ * @since 0.27.0
131
+ *
132
+ * @example
133
+ * const pipeline = sharp()
134
+ * .affine([[1, 0.3], [0.1, 0.7]], {
135
+ * background: 'white',
136
+ * interpolator: sharp.interpolators.nohalo
137
+ * })
138
+ * .toBuffer((err, outputBuffer, info) => {
139
+ * // outputBuffer contains the transformed image
140
+ * // info.width and info.height contain the new dimensions
141
+ * });
142
+ *
143
+ * inputStream
144
+ * .pipe(pipeline);
145
+ *
146
+ * @param {Array<Array<number>>|Array<number>} matrix - affine transformation matrix
147
+ * @param {Object} [options] - if present, is an Object with optional attributes.
148
+ * @param {String|Object} [options.background="#000000"] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
149
+ * @param {Number} [options.idx=0] - input horizontal offset
150
+ * @param {Number} [options.idy=0] - input vertical offset
151
+ * @param {Number} [options.odx=0] - output horizontal offset
152
+ * @param {Number} [options.ody=0] - output vertical offset
153
+ * @param {String} [options.interpolator=sharp.interpolators.bicubic] - interpolator
154
+ * @returns {Sharp}
155
+ * @throws {Error} Invalid parameters
156
+ */
157
+ function affine (matrix, options) {
158
+ const flatMatrix = [].concat(...matrix);
159
+ if (flatMatrix.length === 4 && flatMatrix.every(is.number)) {
160
+ this.options.affineMatrix = flatMatrix;
161
+ } else {
162
+ throw is.invalidParameterError('matrix', '1x4 or 2x2 array', matrix);
163
+ }
164
+
165
+ if (is.defined(options)) {
166
+ if (is.object(options)) {
167
+ this._setBackgroundColourOption('affineBackground', options.background);
168
+ if (is.defined(options.idx)) {
169
+ if (is.number(options.idx)) {
170
+ this.options.affineIdx = options.idx;
171
+ } else {
172
+ throw is.invalidParameterError('options.idx', 'number', options.idx);
173
+ }
174
+ }
175
+ if (is.defined(options.idy)) {
176
+ if (is.number(options.idy)) {
177
+ this.options.affineIdy = options.idy;
178
+ } else {
179
+ throw is.invalidParameterError('options.idy', 'number', options.idy);
180
+ }
181
+ }
182
+ if (is.defined(options.odx)) {
183
+ if (is.number(options.odx)) {
184
+ this.options.affineOdx = options.odx;
185
+ } else {
186
+ throw is.invalidParameterError('options.odx', 'number', options.odx);
187
+ }
188
+ }
189
+ if (is.defined(options.ody)) {
190
+ if (is.number(options.ody)) {
191
+ this.options.affineOdy = options.ody;
192
+ } else {
193
+ throw is.invalidParameterError('options.ody', 'number', options.ody);
194
+ }
195
+ }
196
+ if (is.defined(options.interpolator)) {
197
+ if (is.inArray(options.interpolator, Object.values(this.constructor.interpolators))) {
198
+ this.options.affineInterpolator = options.interpolator;
199
+ } else {
200
+ throw is.invalidParameterError('options.interpolator', 'valid interpolator name', options.interpolator);
201
+ }
202
+ }
203
+ } else {
204
+ throw is.invalidParameterError('options', 'object', options);
205
+ }
206
+ }
207
+
208
+ return this;
209
+ }
210
+
211
+ /**
212
+ * Sharpen the image.
213
+ *
214
+ * When used without parameters, performs a fast, mild sharpen of the output image.
215
+ *
216
+ * When a `sigma` is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space.
217
+ * Fine-grained control over the level of sharpening in "flat" (m1) and "jagged" (m2) areas is available.
218
+ *
219
+ * See {@link https://www.libvips.org/API/current/libvips-convolution.html#vips-sharpen|libvips sharpen} operation.
220
+ *
221
+ * @example
222
+ * const data = await sharp(input).sharpen().toBuffer();
223
+ *
224
+ * @example
225
+ * const data = await sharp(input).sharpen({ sigma: 2 }).toBuffer();
226
+ *
227
+ * @example
228
+ * const data = await sharp(input)
229
+ * .sharpen({
230
+ * sigma: 2,
231
+ * m1: 0,
232
+ * m2: 3,
233
+ * x1: 3,
234
+ * y2: 15,
235
+ * y3: 15,
236
+ * })
237
+ * .toBuffer();
238
+ *
239
+ * @param {Object|number} [options] - if present, is an Object with attributes
240
+ * @param {number} [options.sigma] - the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`, between 0.000001 and 10
241
+ * @param {number} [options.m1=1.0] - the level of sharpening to apply to "flat" areas, between 0 and 1000000
242
+ * @param {number} [options.m2=2.0] - the level of sharpening to apply to "jagged" areas, between 0 and 1000000
243
+ * @param {number} [options.x1=2.0] - threshold between "flat" and "jagged", between 0 and 1000000
244
+ * @param {number} [options.y2=10.0] - maximum amount of brightening, between 0 and 1000000
245
+ * @param {number} [options.y3=20.0] - maximum amount of darkening, between 0 and 1000000
246
+ * @param {number} [flat] - (deprecated) see `options.m1`.
247
+ * @param {number} [jagged] - (deprecated) see `options.m2`.
248
+ * @returns {Sharp}
249
+ * @throws {Error} Invalid parameters
250
+ */
251
+ function sharpen (options, flat, jagged) {
252
+ if (!is.defined(options)) {
253
+ // No arguments: default to mild sharpen
254
+ this.options.sharpenSigma = -1;
255
+ } else if (is.bool(options)) {
256
+ // Deprecated boolean argument: apply mild sharpen?
257
+ this.options.sharpenSigma = options ? -1 : 0;
258
+ } else if (is.number(options) && is.inRange(options, 0.01, 10000)) {
259
+ // Deprecated numeric argument: specific sigma
260
+ this.options.sharpenSigma = options;
261
+ // Deprecated control over flat areas
262
+ if (is.defined(flat)) {
263
+ if (is.number(flat) && is.inRange(flat, 0, 10000)) {
264
+ this.options.sharpenM1 = flat;
265
+ } else {
266
+ throw is.invalidParameterError('flat', 'number between 0 and 10000', flat);
267
+ }
268
+ }
269
+ // Deprecated control over jagged areas
270
+ if (is.defined(jagged)) {
271
+ if (is.number(jagged) && is.inRange(jagged, 0, 10000)) {
272
+ this.options.sharpenM2 = jagged;
273
+ } else {
274
+ throw is.invalidParameterError('jagged', 'number between 0 and 10000', jagged);
275
+ }
276
+ }
277
+ } else if (is.plainObject(options)) {
278
+ if (is.number(options.sigma) && is.inRange(options.sigma, 0.000001, 10)) {
279
+ this.options.sharpenSigma = options.sigma;
280
+ } else {
281
+ throw is.invalidParameterError('options.sigma', 'number between 0.000001 and 10', options.sigma);
282
+ }
283
+ if (is.defined(options.m1)) {
284
+ if (is.number(options.m1) && is.inRange(options.m1, 0, 1000000)) {
285
+ this.options.sharpenM1 = options.m1;
286
+ } else {
287
+ throw is.invalidParameterError('options.m1', 'number between 0 and 1000000', options.m1);
288
+ }
289
+ }
290
+ if (is.defined(options.m2)) {
291
+ if (is.number(options.m2) && is.inRange(options.m2, 0, 1000000)) {
292
+ this.options.sharpenM2 = options.m2;
293
+ } else {
294
+ throw is.invalidParameterError('options.m2', 'number between 0 and 1000000', options.m2);
295
+ }
296
+ }
297
+ if (is.defined(options.x1)) {
298
+ if (is.number(options.x1) && is.inRange(options.x1, 0, 1000000)) {
299
+ this.options.sharpenX1 = options.x1;
300
+ } else {
301
+ throw is.invalidParameterError('options.x1', 'number between 0 and 1000000', options.x1);
302
+ }
303
+ }
304
+ if (is.defined(options.y2)) {
305
+ if (is.number(options.y2) && is.inRange(options.y2, 0, 1000000)) {
306
+ this.options.sharpenY2 = options.y2;
307
+ } else {
308
+ throw is.invalidParameterError('options.y2', 'number between 0 and 1000000', options.y2);
309
+ }
310
+ }
311
+ if (is.defined(options.y3)) {
312
+ if (is.number(options.y3) && is.inRange(options.y3, 0, 1000000)) {
313
+ this.options.sharpenY3 = options.y3;
314
+ } else {
315
+ throw is.invalidParameterError('options.y3', 'number between 0 and 1000000', options.y3);
316
+ }
317
+ }
318
+ } else {
319
+ throw is.invalidParameterError('sigma', 'number between 0.01 and 10000', options);
320
+ }
321
+ return this;
322
+ }
323
+
324
+ /**
325
+ * Apply median filter.
326
+ * When used without parameters the default window is 3x3.
327
+ *
328
+ * @example
329
+ * const output = await sharp(input).median().toBuffer();
330
+ *
331
+ * @example
332
+ * const output = await sharp(input).median(5).toBuffer();
333
+ *
334
+ * @param {number} [size=3] square mask size: size x size
335
+ * @returns {Sharp}
336
+ * @throws {Error} Invalid parameters
337
+ */
338
+ function median (size) {
339
+ if (!is.defined(size)) {
340
+ // No arguments: default to 3x3
341
+ this.options.medianSize = 3;
342
+ } else if (is.integer(size) && is.inRange(size, 1, 1000)) {
343
+ // Numeric argument: specific sigma
344
+ this.options.medianSize = size;
345
+ } else {
346
+ throw is.invalidParameterError('size', 'integer between 1 and 1000', size);
347
+ }
348
+ return this;
349
+ }
350
+
351
+ /**
352
+ * Blur the image.
353
+ *
354
+ * When used without parameters, performs a fast 3x3 box blur (equivalent to a box linear filter).
355
+ *
356
+ * When a `sigma` is provided, performs a slower, more accurate Gaussian blur.
357
+ *
358
+ * @example
359
+ * const boxBlurred = await sharp(input)
360
+ * .blur()
361
+ * .toBuffer();
362
+ *
363
+ * @example
364
+ * const gaussianBlurred = await sharp(input)
365
+ * .blur(5)
366
+ * .toBuffer();
367
+ *
368
+ * @param {number} [sigma] a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
369
+ * @returns {Sharp}
370
+ * @throws {Error} Invalid parameters
371
+ */
372
+ function blur (sigma) {
373
+ if (!is.defined(sigma)) {
374
+ // No arguments: default to mild blur
375
+ this.options.blurSigma = -1;
376
+ } else if (is.bool(sigma)) {
377
+ // Boolean argument: apply mild blur?
378
+ this.options.blurSigma = sigma ? -1 : 0;
379
+ } else if (is.number(sigma) && is.inRange(sigma, 0.3, 1000)) {
380
+ // Numeric argument: specific sigma
381
+ this.options.blurSigma = sigma;
382
+ } else {
383
+ throw is.invalidParameterError('sigma', 'number between 0.3 and 1000', sigma);
384
+ }
385
+ return this;
386
+ }
387
+
388
+ /**
389
+ * Merge alpha transparency channel, if any, with a background, then remove the alpha channel.
390
+ *
391
+ * See also {@link /api-channel#removealpha|removeAlpha}.
392
+ *
393
+ * @example
394
+ * await sharp(rgbaInput)
395
+ * .flatten({ background: '#F0A703' })
396
+ * .toBuffer();
397
+ *
398
+ * @param {Object} [options]
399
+ * @param {string|Object} [options.background={r: 0, g: 0, b: 0}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black.
400
+ * @returns {Sharp}
401
+ */
402
+ function flatten (options) {
403
+ this.options.flatten = is.bool(options) ? options : true;
404
+ if (is.object(options)) {
405
+ this._setBackgroundColourOption('flattenBackground', options.background);
406
+ }
407
+ return this;
408
+ }
409
+
410
+ /**
411
+ * Ensure the image has an alpha channel
412
+ * with all white pixel values made fully transparent.
413
+ *
414
+ * Existing alpha channel values for non-white pixels remain unchanged.
415
+ *
416
+ * This feature is experimental and the API may change.
417
+ *
418
+ * @since 0.32.1
419
+ *
420
+ * @example
421
+ * await sharp(rgbInput)
422
+ * .unflatten()
423
+ * .toBuffer();
424
+ *
425
+ * @example
426
+ * await sharp(rgbInput)
427
+ * .threshold(128, { grayscale: false }) // converter bright pixels to white
428
+ * .unflatten()
429
+ * .toBuffer();
430
+ */
431
+ function unflatten () {
432
+ this.options.unflatten = true;
433
+ return this;
434
+ }
435
+
436
+ /**
437
+ * Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of `1/gamma`
438
+ * then increasing the encoding (brighten) post-resize at a factor of `gamma`.
439
+ * This can improve the perceived brightness of a resized image in non-linear colour spaces.
440
+ * JPEG and WebP input images will not take advantage of the shrink-on-load performance optimisation
441
+ * when applying a gamma correction.
442
+ *
443
+ * Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases.
444
+ *
445
+ * @param {number} [gamma=2.2] value between 1.0 and 3.0.
446
+ * @param {number} [gammaOut] value between 1.0 and 3.0. (optional, defaults to same as `gamma`)
447
+ * @returns {Sharp}
448
+ * @throws {Error} Invalid parameters
449
+ */
450
+ function gamma (gamma, gammaOut) {
451
+ if (!is.defined(gamma)) {
452
+ // Default gamma correction of 2.2 (sRGB)
453
+ this.options.gamma = 2.2;
454
+ } else if (is.number(gamma) && is.inRange(gamma, 1, 3)) {
455
+ this.options.gamma = gamma;
456
+ } else {
457
+ throw is.invalidParameterError('gamma', 'number between 1.0 and 3.0', gamma);
458
+ }
459
+ if (!is.defined(gammaOut)) {
460
+ // Default gamma correction for output is same as input
461
+ this.options.gammaOut = this.options.gamma;
462
+ } else if (is.number(gammaOut) && is.inRange(gammaOut, 1, 3)) {
463
+ this.options.gammaOut = gammaOut;
464
+ } else {
465
+ throw is.invalidParameterError('gammaOut', 'number between 1.0 and 3.0', gammaOut);
466
+ }
467
+ return this;
468
+ }
469
+
470
+ /**
471
+ * Produce the "negative" of the image.
472
+ *
473
+ * @example
474
+ * const output = await sharp(input)
475
+ * .negate()
476
+ * .toBuffer();
477
+ *
478
+ * @example
479
+ * const output = await sharp(input)
480
+ * .negate({ alpha: false })
481
+ * .toBuffer();
482
+ *
483
+ * @param {Object} [options]
484
+ * @param {Boolean} [options.alpha=true] Whether or not to negate any alpha channel
485
+ * @returns {Sharp}
486
+ */
487
+ function negate (options) {
488
+ this.options.negate = is.bool(options) ? options : true;
489
+ if (is.plainObject(options) && 'alpha' in options) {
490
+ if (!is.bool(options.alpha)) {
491
+ throw is.invalidParameterError('alpha', 'should be boolean value', options.alpha);
492
+ } else {
493
+ this.options.negateAlpha = options.alpha;
494
+ }
495
+ }
496
+ return this;
497
+ }
498
+
499
+ /**
500
+ * Enhance output image contrast by stretching its luminance to cover a full dynamic range.
501
+ *
502
+ * Uses a histogram-based approach, taking a default range of 1% to 99% to reduce sensitivity to noise at the extremes.
503
+ *
504
+ * Luminance values below the `lower` percentile will be underexposed by clipping to zero.
505
+ * Luminance values above the `upper` percentile will be overexposed by clipping to the max pixel value.
506
+ *
507
+ * @example
508
+ * const output = await sharp(input)
509
+ * .normalise()
510
+ * .toBuffer();
511
+ *
512
+ * @example
513
+ * const output = await sharp(input)
514
+ * .normalise({ lower: 0, upper: 100 })
515
+ * .toBuffer();
516
+ *
517
+ * @param {Object} [options]
518
+ * @param {number} [options.lower=1] - Percentile below which luminance values will be underexposed.
519
+ * @param {number} [options.upper=99] - Percentile above which luminance values will be overexposed.
520
+ * @returns {Sharp}
521
+ */
522
+ function normalise (options) {
523
+ if (is.plainObject(options)) {
524
+ if (is.defined(options.lower)) {
525
+ if (is.number(options.lower) && is.inRange(options.lower, 0, 99)) {
526
+ this.options.normaliseLower = options.lower;
527
+ } else {
528
+ throw is.invalidParameterError('lower', 'number between 0 and 99', options.lower);
529
+ }
530
+ }
531
+ if (is.defined(options.upper)) {
532
+ if (is.number(options.upper) && is.inRange(options.upper, 1, 100)) {
533
+ this.options.normaliseUpper = options.upper;
534
+ } else {
535
+ throw is.invalidParameterError('upper', 'number between 1 and 100', options.upper);
536
+ }
537
+ }
538
+ }
539
+ if (this.options.normaliseLower >= this.options.normaliseUpper) {
540
+ throw is.invalidParameterError('range', 'lower to be less than upper',
541
+ `${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);
542
+ }
543
+ this.options.normalise = true;
544
+ return this;
545
+ }
546
+
547
+ /**
548
+ * Alternative spelling of normalise.
549
+ *
550
+ * @example
551
+ * const output = await sharp(input)
552
+ * .normalize()
553
+ * .toBuffer();
554
+ *
555
+ * @param {Object} [options]
556
+ * @param {number} [options.lower=1] - Percentile below which luminance values will be underexposed.
557
+ * @param {number} [options.upper=99] - Percentile above which luminance values will be overexposed.
558
+ * @returns {Sharp}
559
+ */
560
+ function normalize (options) {
561
+ return this.normalise(options);
562
+ }
563
+
564
+ /**
565
+ * Perform contrast limiting adaptive histogram equalization
566
+ * {@link https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE|CLAHE}.
567
+ *
568
+ * This will, in general, enhance the clarity of the image by bringing out darker details.
569
+ *
570
+ * @since 0.28.3
571
+ *
572
+ * @example
573
+ * const output = await sharp(input)
574
+ * .clahe({
575
+ * width: 3,
576
+ * height: 3,
577
+ * })
578
+ * .toBuffer();
579
+ *
580
+ * @param {Object} options
581
+ * @param {number} options.width - Integral width of the search window, in pixels.
582
+ * @param {number} options.height - Integral height of the search window, in pixels.
583
+ * @param {number} [options.maxSlope=3] - Integral level of brightening, between 0 and 100, where 0 disables contrast limiting.
584
+ * @returns {Sharp}
585
+ * @throws {Error} Invalid parameters
586
+ */
587
+ function clahe (options) {
588
+ if (is.plainObject(options)) {
589
+ if (is.integer(options.width) && options.width > 0) {
590
+ this.options.claheWidth = options.width;
591
+ } else {
592
+ throw is.invalidParameterError('width', 'integer greater than zero', options.width);
593
+ }
594
+ if (is.integer(options.height) && options.height > 0) {
595
+ this.options.claheHeight = options.height;
596
+ } else {
597
+ throw is.invalidParameterError('height', 'integer greater than zero', options.height);
598
+ }
599
+ if (is.defined(options.maxSlope)) {
600
+ if (is.integer(options.maxSlope) && is.inRange(options.maxSlope, 0, 100)) {
601
+ this.options.claheMaxSlope = options.maxSlope;
602
+ } else {
603
+ throw is.invalidParameterError('maxSlope', 'integer between 0 and 100', options.maxSlope);
604
+ }
605
+ }
606
+ } else {
607
+ throw is.invalidParameterError('options', 'plain object', options);
608
+ }
609
+ return this;
610
+ }
611
+
612
+ /**
613
+ * Convolve the image with the specified kernel.
614
+ *
615
+ * @example
616
+ * sharp(input)
617
+ * .convolve({
618
+ * width: 3,
619
+ * height: 3,
620
+ * kernel: [-1, 0, 1, -2, 0, 2, -1, 0, 1]
621
+ * })
622
+ * .raw()
623
+ * .toBuffer(function(err, data, info) {
624
+ * // data contains the raw pixel data representing the convolution
625
+ * // of the input image with the horizontal Sobel operator
626
+ * });
627
+ *
628
+ * @param {Object} kernel
629
+ * @param {number} kernel.width - width of the kernel in pixels.
630
+ * @param {number} kernel.height - height of the kernel in pixels.
631
+ * @param {Array<number>} kernel.kernel - Array of length `width*height` containing the kernel values.
632
+ * @param {number} [kernel.scale=sum] - the scale of the kernel in pixels.
633
+ * @param {number} [kernel.offset=0] - the offset of the kernel in pixels.
634
+ * @returns {Sharp}
635
+ * @throws {Error} Invalid parameters
636
+ */
637
+ function convolve (kernel) {
638
+ if (!is.object(kernel) || !Array.isArray(kernel.kernel) ||
639
+ !is.integer(kernel.width) || !is.integer(kernel.height) ||
640
+ !is.inRange(kernel.width, 3, 1001) || !is.inRange(kernel.height, 3, 1001) ||
641
+ kernel.height * kernel.width !== kernel.kernel.length
642
+ ) {
643
+ // must pass in a kernel
644
+ throw new Error('Invalid convolution kernel');
645
+ }
646
+ // Default scale is sum of kernel values
647
+ if (!is.integer(kernel.scale)) {
648
+ kernel.scale = kernel.kernel.reduce(function (a, b) {
649
+ return a + b;
650
+ }, 0);
651
+ }
652
+ // Clip scale to a minimum value of 1
653
+ if (kernel.scale < 1) {
654
+ kernel.scale = 1;
655
+ }
656
+ if (!is.integer(kernel.offset)) {
657
+ kernel.offset = 0;
658
+ }
659
+ this.options.convKernel = kernel;
660
+ return this;
661
+ }
662
+
663
+ /**
664
+ * Any pixel value greater than or equal to the threshold value will be set to 255, otherwise it will be set to 0.
665
+ * @param {number} [threshold=128] - a value in the range 0-255 representing the level at which the threshold will be applied.
666
+ * @param {Object} [options]
667
+ * @param {Boolean} [options.greyscale=true] - convert to single channel greyscale.
668
+ * @param {Boolean} [options.grayscale=true] - alternative spelling for greyscale.
669
+ * @returns {Sharp}
670
+ * @throws {Error} Invalid parameters
671
+ */
672
+ function threshold (threshold, options) {
673
+ if (!is.defined(threshold)) {
674
+ this.options.threshold = 128;
675
+ } else if (is.bool(threshold)) {
676
+ this.options.threshold = threshold ? 128 : 0;
677
+ } else if (is.integer(threshold) && is.inRange(threshold, 0, 255)) {
678
+ this.options.threshold = threshold;
679
+ } else {
680
+ throw is.invalidParameterError('threshold', 'integer between 0 and 255', threshold);
681
+ }
682
+ if (!is.object(options) || options.greyscale === true || options.grayscale === true) {
683
+ this.options.thresholdGrayscale = true;
684
+ } else {
685
+ this.options.thresholdGrayscale = false;
686
+ }
687
+ return this;
688
+ }
689
+
690
+ /**
691
+ * Perform a bitwise boolean operation with operand image.
692
+ *
693
+ * This operation creates an output image where each pixel is the result of
694
+ * the selected bitwise boolean `operation` between the corresponding pixels of the input images.
695
+ *
696
+ * @param {Buffer|string} operand - Buffer containing image data or string containing the path to an image file.
697
+ * @param {string} operator - one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.
698
+ * @param {Object} [options]
699
+ * @param {Object} [options.raw] - describes operand when using raw pixel data.
700
+ * @param {number} [options.raw.width]
701
+ * @param {number} [options.raw.height]
702
+ * @param {number} [options.raw.channels]
703
+ * @returns {Sharp}
704
+ * @throws {Error} Invalid parameters
705
+ */
706
+ function boolean (operand, operator, options) {
707
+ this.options.boolean = this._createInputDescriptor(operand, options);
708
+ if (is.string(operator) && is.inArray(operator, ['and', 'or', 'eor'])) {
709
+ this.options.booleanOp = operator;
710
+ } else {
711
+ throw is.invalidParameterError('operator', 'one of: and, or, eor', operator);
712
+ }
713
+ return this;
714
+ }
715
+
716
+ /**
717
+ * Apply the linear formula `a` * input + `b` to the image to adjust image levels.
718
+ *
719
+ * When a single number is provided, it will be used for all image channels.
720
+ * When an array of numbers is provided, the array length must match the number of channels.
721
+ *
722
+ * @example
723
+ * await sharp(input)
724
+ * .linear(0.5, 2)
725
+ * .toBuffer();
726
+ *
727
+ * @example
728
+ * await sharp(rgbInput)
729
+ * .linear(
730
+ * [0.25, 0.5, 0.75],
731
+ * [150, 100, 50]
732
+ * )
733
+ * .toBuffer();
734
+ *
735
+ * @param {(number|number[])} [a=[]] multiplier
736
+ * @param {(number|number[])} [b=[]] offset
737
+ * @returns {Sharp}
738
+ * @throws {Error} Invalid parameters
739
+ */
740
+ function linear (a, b) {
741
+ if (!is.defined(a) && is.number(b)) {
742
+ a = 1.0;
743
+ } else if (is.number(a) && !is.defined(b)) {
744
+ b = 0.0;
745
+ }
746
+ if (!is.defined(a)) {
747
+ this.options.linearA = [];
748
+ } else if (is.number(a)) {
749
+ this.options.linearA = [a];
750
+ } else if (Array.isArray(a) && a.length && a.every(is.number)) {
751
+ this.options.linearA = a;
752
+ } else {
753
+ throw is.invalidParameterError('a', 'number or array of numbers', a);
754
+ }
755
+ if (!is.defined(b)) {
756
+ this.options.linearB = [];
757
+ } else if (is.number(b)) {
758
+ this.options.linearB = [b];
759
+ } else if (Array.isArray(b) && b.length && b.every(is.number)) {
760
+ this.options.linearB = b;
761
+ } else {
762
+ throw is.invalidParameterError('b', 'number or array of numbers', b);
763
+ }
764
+ if (this.options.linearA.length !== this.options.linearB.length) {
765
+ throw new Error('Expected a and b to be arrays of the same length');
766
+ }
767
+ return this;
768
+ }
769
+
770
+ /**
771
+ * Recombine the image with the specified matrix.
772
+ *
773
+ * @since 0.21.1
774
+ *
775
+ * @example
776
+ * sharp(input)
777
+ * .recomb([
778
+ * [0.3588, 0.7044, 0.1368],
779
+ * [0.2990, 0.5870, 0.1140],
780
+ * [0.2392, 0.4696, 0.0912],
781
+ * ])
782
+ * .raw()
783
+ * .toBuffer(function(err, data, info) {
784
+ * // data contains the raw pixel data after applying the matrix
785
+ * // With this example input, a sepia filter has been applied
786
+ * });
787
+ *
788
+ * @param {Array<Array<number>>} inputMatrix - 3x3 Recombination matrix
789
+ * @returns {Sharp}
790
+ * @throws {Error} Invalid parameters
791
+ */
792
+ function recomb (inputMatrix) {
793
+ if (!Array.isArray(inputMatrix) || inputMatrix.length !== 3 ||
794
+ inputMatrix[0].length !== 3 ||
795
+ inputMatrix[1].length !== 3 ||
796
+ inputMatrix[2].length !== 3
797
+ ) {
798
+ // must pass in a kernel
799
+ throw new Error('Invalid recombination matrix');
800
+ }
801
+ this.options.recombMatrix = [
802
+ inputMatrix[0][0], inputMatrix[0][1], inputMatrix[0][2],
803
+ inputMatrix[1][0], inputMatrix[1][1], inputMatrix[1][2],
804
+ inputMatrix[2][0], inputMatrix[2][1], inputMatrix[2][2]
805
+ ].map(Number);
806
+ return this;
807
+ }
808
+
809
+ /**
810
+ * Transforms the image using brightness, saturation, hue rotation, and lightness.
811
+ * Brightness and lightness both operate on luminance, with the difference being that
812
+ * brightness is multiplicative whereas lightness is additive.
813
+ *
814
+ * @since 0.22.1
815
+ *
816
+ * @example
817
+ * // increase brightness by a factor of 2
818
+ * const output = await sharp(input)
819
+ * .modulate({
820
+ * brightness: 2
821
+ * })
822
+ * .toBuffer();
823
+ *
824
+ * @example
825
+ * // hue-rotate by 180 degrees
826
+ * const output = await sharp(input)
827
+ * .modulate({
828
+ * hue: 180
829
+ * })
830
+ * .toBuffer();
831
+ *
832
+ * @example
833
+ * // increase lightness by +50
834
+ * const output = await sharp(input)
835
+ * .modulate({
836
+ * lightness: 50
837
+ * })
838
+ * .toBuffer();
839
+ *
840
+ * @example
841
+ * // decrease brightness and saturation while also hue-rotating by 90 degrees
842
+ * const output = await sharp(input)
843
+ * .modulate({
844
+ * brightness: 0.5,
845
+ * saturation: 0.5,
846
+ * hue: 90,
847
+ * })
848
+ * .toBuffer();
849
+ *
850
+ * @param {Object} [options]
851
+ * @param {number} [options.brightness] Brightness multiplier
852
+ * @param {number} [options.saturation] Saturation multiplier
853
+ * @param {number} [options.hue] Degrees for hue rotation
854
+ * @param {number} [options.lightness] Lightness addend
855
+ * @returns {Sharp}
856
+ */
857
+ function modulate (options) {
858
+ if (!is.plainObject(options)) {
859
+ throw is.invalidParameterError('options', 'plain object', options);
860
+ }
861
+ if ('brightness' in options) {
862
+ if (is.number(options.brightness) && options.brightness >= 0) {
863
+ this.options.brightness = options.brightness;
864
+ } else {
865
+ throw is.invalidParameterError('brightness', 'number above zero', options.brightness);
866
+ }
867
+ }
868
+ if ('saturation' in options) {
869
+ if (is.number(options.saturation) && options.saturation >= 0) {
870
+ this.options.saturation = options.saturation;
871
+ } else {
872
+ throw is.invalidParameterError('saturation', 'number above zero', options.saturation);
873
+ }
874
+ }
875
+ if ('hue' in options) {
876
+ if (is.integer(options.hue)) {
877
+ this.options.hue = options.hue % 360;
878
+ } else {
879
+ throw is.invalidParameterError('hue', 'number', options.hue);
880
+ }
881
+ }
882
+ if ('lightness' in options) {
883
+ if (is.number(options.lightness)) {
884
+ this.options.lightness = options.lightness;
885
+ } else {
886
+ throw is.invalidParameterError('lightness', 'number', options.lightness);
887
+ }
888
+ }
889
+ return this;
890
+ }
891
+
892
+ /**
893
+ * Decorate the Sharp prototype with operation-related functions.
894
+ * @private
895
+ */
896
+ module.exports = function (Sharp) {
897
+ Object.assign(Sharp.prototype, {
898
+ rotate,
899
+ flip,
900
+ flop,
901
+ affine,
902
+ sharpen,
903
+ median,
904
+ blur,
905
+ flatten,
906
+ unflatten,
907
+ gamma,
908
+ negate,
909
+ normalise,
910
+ normalize,
911
+ clahe,
912
+ convolve,
913
+ threshold,
914
+ boolean,
915
+ linear,
916
+ recomb,
917
+ modulate
918
+ });
919
+ };