@kitware/vtk.js 21.3.1 → 21.5.1
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.
- package/Common/Core/Math.d.ts +233 -218
- package/Common/DataModel/ITKHelper.js +34 -8
- package/Interaction/Style/InteractorStyleTrackballCamera.js +5 -4
- package/Rendering/Core/ColorTransferFunction.js +11 -2
- package/Rendering/Core/RenderWindowInteractor/Constants.js +15 -3
- package/Rendering/Core/RenderWindowInteractor.js +27 -21
- package/Rendering/Misc/SynchronizableRenderWindow/vtkObjectManager.js +56 -8
- package/Rendering/OpenGL/RenderWindow.js +40 -18
- package/Rendering/WebGPU/RenderWindow.js +3 -2
- package/macros.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +5 -0
package/Common/Core/Math.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Bounds, Extent, RGBAColor, RGBColor } from '@kitware/vtk.js/types';
|
|
1
|
+
import { Bounds, Extent, HSVColor, RGBAColor, RGBColor, Matrix, Matrix3x3, Range, Vector2, Vector3, Vector4 } from '@kitware/vtk.js/types';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
*
|
|
@@ -156,102 +155,102 @@ export function random(minValue: number, maxValue: number): number;
|
|
|
156
155
|
|
|
157
156
|
/**
|
|
158
157
|
* Addition of two 3-vectors.
|
|
159
|
-
* @param {
|
|
160
|
-
* @param {
|
|
161
|
-
* @param {
|
|
158
|
+
* @param {Vector3} a The first 3D vector.
|
|
159
|
+
* @param {Vector3} b The second 3D vector.
|
|
160
|
+
* @param {Vector3} out The output 3D vector.
|
|
162
161
|
* @example
|
|
163
162
|
* ```js
|
|
164
163
|
* a[3] + b[3] => out[3]
|
|
165
164
|
* ```
|
|
166
165
|
*/
|
|
167
|
-
export function add(a:
|
|
166
|
+
export function add(a: Vector3, b: Vector3, out: Vector3): Vector3;
|
|
168
167
|
|
|
169
168
|
/**
|
|
170
169
|
* Subtraction of two 3-vectors.
|
|
171
|
-
* @param {
|
|
172
|
-
* @param {
|
|
173
|
-
* @param {
|
|
170
|
+
* @param {Vector3} a The first 3D vector.
|
|
171
|
+
* @param {Vector3} b The second 3D vector.
|
|
172
|
+
* @param {Vector3} out The output 3D vector.
|
|
174
173
|
* @example
|
|
175
174
|
* ```js
|
|
176
175
|
* a[3] - b[3] => out[3]
|
|
177
176
|
* ```
|
|
178
177
|
*/
|
|
179
|
-
export function subtract(a:
|
|
178
|
+
export function subtract(a: Vector3, b: Vector3, out: Vector3): Vector3;
|
|
180
179
|
|
|
181
180
|
/**
|
|
182
181
|
*
|
|
183
|
-
* @param {
|
|
182
|
+
* @param {Vector3} vec
|
|
184
183
|
* @param {Number} scalar
|
|
185
184
|
* @example
|
|
186
185
|
* ```js
|
|
187
186
|
* vec[3] * scalar => vec[3]
|
|
188
187
|
* ```
|
|
189
188
|
*/
|
|
190
|
-
export function multiplyScalar(vec:
|
|
189
|
+
export function multiplyScalar(vec: Vector3, scalar: number): Vector3;
|
|
191
190
|
|
|
192
191
|
/**
|
|
193
192
|
*
|
|
194
|
-
* @param {
|
|
193
|
+
* @param {Vector2} vec
|
|
195
194
|
* @param {Number} scalar
|
|
196
195
|
* @example
|
|
197
196
|
* ```js
|
|
198
197
|
* vec[3] * scalar => vec[3]
|
|
199
198
|
* ```
|
|
200
199
|
*/
|
|
201
|
-
export function multiplyScalar2D(vec:
|
|
200
|
+
export function multiplyScalar2D(vec: Vector2, scalar: number): Vector2;
|
|
202
201
|
|
|
203
202
|
/**
|
|
204
203
|
*
|
|
205
|
-
* @param {
|
|
206
|
-
* @param {
|
|
204
|
+
* @param {Vector3} a
|
|
205
|
+
* @param {Vector3} b
|
|
207
206
|
* @param {Number} scalar
|
|
208
|
-
* @param {
|
|
207
|
+
* @param {Vector3} out
|
|
209
208
|
* @example
|
|
210
209
|
* ```js
|
|
211
210
|
* a[3] + b[3] * scalar => out[3]
|
|
212
211
|
* ```
|
|
213
212
|
*/
|
|
214
|
-
export function multiplyAccumulate(a:
|
|
213
|
+
export function multiplyAccumulate(a: Vector3, b: Vector3, scalar: number, out: Vector3): Vector3;
|
|
215
214
|
|
|
216
215
|
/**
|
|
217
216
|
*
|
|
218
|
-
* @param {
|
|
219
|
-
* @param {
|
|
217
|
+
* @param {Vector2} a
|
|
218
|
+
* @param {Vector2} b
|
|
220
219
|
* @param {Number} scalar
|
|
221
|
-
* @param {
|
|
220
|
+
* @param {Vector2} out
|
|
222
221
|
* @example
|
|
223
222
|
* ```js
|
|
224
223
|
* a[2] + b[2] * scalar => out[2]
|
|
225
224
|
* ```
|
|
226
225
|
*/
|
|
227
|
-
export function multiplyAccumulate2D(a:
|
|
226
|
+
export function multiplyAccumulate2D(a: Vector2, b: Vector2, scalar: number, out: Vector2): Vector2;
|
|
228
227
|
|
|
229
228
|
/**
|
|
230
229
|
*
|
|
231
|
-
* @param {
|
|
232
|
-
* @param {
|
|
230
|
+
* @param {Vector3} x
|
|
231
|
+
* @param {Vector3} y
|
|
233
232
|
* @example
|
|
234
233
|
* ```js
|
|
235
234
|
* a[2] + b[2] * scalar => out[2]
|
|
236
235
|
* ```
|
|
237
236
|
*/
|
|
238
|
-
export function dot(x:
|
|
237
|
+
export function dot(x: Vector3, y: Vector3): number;
|
|
239
238
|
|
|
240
239
|
/**
|
|
241
240
|
* Outer product of two 3-vectors.
|
|
242
|
-
* @param {
|
|
243
|
-
* @param {
|
|
244
|
-
* @param {
|
|
241
|
+
* @param {Vector3} x The first 3D vector.
|
|
242
|
+
* @param {Vector3} y The second 3D vector.
|
|
243
|
+
* @param {Matrix3x3} out_3x3 The output 3x3 matrix.
|
|
245
244
|
*/
|
|
246
|
-
export function outer(x:
|
|
245
|
+
export function outer(x: Vector3, y: Vector3, out_3x3: Matrix3x3): void;
|
|
247
246
|
|
|
248
247
|
/**
|
|
249
248
|
* Computes cross product of 3D vectors x and y.
|
|
250
|
-
* @param {
|
|
251
|
-
* @param {
|
|
252
|
-
* @param {
|
|
249
|
+
* @param {Vector3} x The first 3D vector.
|
|
250
|
+
* @param {Vector3} y The second 3D vector.
|
|
251
|
+
* @param {Vector3} out The output 3D vector.
|
|
253
252
|
*/
|
|
254
|
-
export function cross(x:
|
|
253
|
+
export function cross(x: Vector3, y: Vector3, out: Vector3): Vector3;
|
|
255
254
|
|
|
256
255
|
/**
|
|
257
256
|
*
|
|
@@ -262,56 +261,56 @@ export function norm(x: number[], n: number): number;
|
|
|
262
261
|
|
|
263
262
|
/**
|
|
264
263
|
* Normalize in place. Returns norm.
|
|
265
|
-
* @param {
|
|
264
|
+
* @param {Vector3} x The vector to normlize.
|
|
266
265
|
*/
|
|
267
|
-
export function normalize(x:
|
|
266
|
+
export function normalize(x: Vector3): number;
|
|
268
267
|
|
|
269
268
|
/**
|
|
270
269
|
* Given a unit vector v1, find two unit vectors v2 and v3 such that v1 cross v2 = v3
|
|
271
|
-
* @param {
|
|
272
|
-
* @param {
|
|
273
|
-
* @param {
|
|
270
|
+
* @param {Vector3} x The first vector.
|
|
271
|
+
* @param {Vector3} y The second vector.
|
|
272
|
+
* @param {Vector3} z The third vector.
|
|
274
273
|
* @param {Number} theta
|
|
275
274
|
*/
|
|
276
|
-
export function perpendiculars(x:
|
|
275
|
+
export function perpendiculars(x: Vector3, y: Vector3, z: Vector3, theta: number): void;
|
|
277
276
|
|
|
278
277
|
/**
|
|
279
278
|
*
|
|
280
|
-
* @param {
|
|
281
|
-
* @param {
|
|
282
|
-
* @param {
|
|
279
|
+
* @param {Vector3} a
|
|
280
|
+
* @param {Vector3} b
|
|
281
|
+
* @param {Vector3} projection
|
|
283
282
|
*/
|
|
284
|
-
export function projectVector(a:
|
|
283
|
+
export function projectVector(a: Vector3, b: Vector3, projection: Vector3): boolean;
|
|
285
284
|
|
|
286
285
|
/**
|
|
287
286
|
*
|
|
288
|
-
* @param {
|
|
289
|
-
* @param {
|
|
287
|
+
* @param {Vector2} x
|
|
288
|
+
* @param {Vector2} y
|
|
290
289
|
*/
|
|
291
|
-
export function dot2D(x:
|
|
290
|
+
export function dot2D(x: Vector2, y: Vector2): number;
|
|
292
291
|
|
|
293
292
|
/**
|
|
294
293
|
* Compute the projection of 2D vector `a` on 2D vector `b` and returns the
|
|
295
294
|
* result in projection vector.
|
|
296
|
-
* @param {
|
|
297
|
-
* @param {
|
|
298
|
-
* @param {
|
|
295
|
+
* @param {Vector2} a The first 2D vector.
|
|
296
|
+
* @param {Vector2} b The second 2D vector.
|
|
297
|
+
* @param {Vector2} projection The projection 2D vector.
|
|
299
298
|
*/
|
|
300
|
-
export function projectVector2D(a:
|
|
299
|
+
export function projectVector2D(a: Vector2, b: Vector2, projection: Vector2): boolean;
|
|
301
300
|
|
|
302
301
|
/**
|
|
303
302
|
* Compute distance squared between two points p1 and p2.
|
|
304
|
-
* @param {
|
|
305
|
-
* @param {
|
|
303
|
+
* @param {Vector3} x The first 3D vector.
|
|
304
|
+
* @param {Vector3} y The second 3D vector.
|
|
306
305
|
*/
|
|
307
|
-
export function distance2BetweenPoints(x:
|
|
306
|
+
export function distance2BetweenPoints(x: Vector3, y: Vector3): number;
|
|
308
307
|
|
|
309
308
|
/**
|
|
310
309
|
* Angle between 3D vectors.
|
|
311
|
-
* @param {
|
|
312
|
-
* @param {
|
|
310
|
+
* @param {Vector3} v1 The first 3D vector.
|
|
311
|
+
* @param {Vector3} v2 The second 3D vector.
|
|
313
312
|
*/
|
|
314
|
-
export function angleBetweenVectors(v1:
|
|
313
|
+
export function angleBetweenVectors(v1: Vector3, v2: Vector3): number;
|
|
315
314
|
|
|
316
315
|
|
|
317
316
|
/**
|
|
@@ -319,11 +318,11 @@ export function angleBetweenVectors(v1: vec3, v2: vec3): number;
|
|
|
319
318
|
* angle between v1 and v2 with regards to plane defined by normal vN.Signed
|
|
320
319
|
* angle between v1 and v2 with regards to plane defined by normal
|
|
321
320
|
* vN.t3(mat_3x3, in_3, out_3)
|
|
322
|
-
* @param {
|
|
323
|
-
* @param {
|
|
324
|
-
* @param {
|
|
321
|
+
* @param {Vector3} v1 The first 3D vector.
|
|
322
|
+
* @param {Vector3} v2 The second 3D vector.
|
|
323
|
+
* @param {Vector3} vN
|
|
325
324
|
*/
|
|
326
|
-
export function signedAngleBetweenVectors(v1:
|
|
325
|
+
export function signedAngleBetweenVectors(v1: Vector3, v2: Vector3, vN: Vector3): number;
|
|
327
326
|
|
|
328
327
|
|
|
329
328
|
/**
|
|
@@ -345,121 +344,121 @@ export function gaussianWeight(mean: number, variance: number, position: number)
|
|
|
345
344
|
|
|
346
345
|
/**
|
|
347
346
|
* Outer product of two 2-vectors.
|
|
348
|
-
* @param {
|
|
349
|
-
* @param {
|
|
350
|
-
* @param {
|
|
347
|
+
* @param {Vector2} x The first 2D vector.
|
|
348
|
+
* @param {Vector2} y The second 2D vector.
|
|
349
|
+
* @param {Matrix} out_2x2 The output 2x2 matrix.
|
|
351
350
|
*/
|
|
352
|
-
export function outer2D(x:
|
|
351
|
+
export function outer2D(x: Vector2, y: Vector2, out_2x2: Matrix): void;
|
|
353
352
|
|
|
354
353
|
/**
|
|
355
354
|
* Compute the norm of a 2-vector.
|
|
356
|
-
* @param {
|
|
355
|
+
* @param {Vector2} x2D x The 2D vector.
|
|
357
356
|
*/
|
|
358
|
-
export function norm2D(x2D:
|
|
357
|
+
export function norm2D(x2D: Vector2): number;
|
|
359
358
|
|
|
360
359
|
/**
|
|
361
360
|
* Normalize (in place) a 2-vector.
|
|
362
|
-
* @param {
|
|
361
|
+
* @param {Vector2} x The 2D vector.
|
|
363
362
|
*/
|
|
364
|
-
export function normalize2D(x:
|
|
363
|
+
export function normalize2D(x: Vector2): number;
|
|
365
364
|
|
|
366
365
|
/**
|
|
367
366
|
*
|
|
368
|
-
* @param {Number[]} args
|
|
367
|
+
* @param {Number[][]|Number[]} args
|
|
369
368
|
*/
|
|
370
|
-
export function determinant2x2(args: number[]): number;
|
|
369
|
+
export function determinant2x2(args: number[][]|number[]): number;
|
|
371
370
|
|
|
372
371
|
/**
|
|
373
372
|
* LU Factorization of a 3x3 matrix.
|
|
374
|
-
* @param {
|
|
375
|
-
* @param {
|
|
373
|
+
* @param {Matrix3x3} mat_3x3
|
|
374
|
+
* @param {Vector3} index_3
|
|
376
375
|
*/
|
|
377
|
-
export function LUFactor3x3(mat_3x3:
|
|
376
|
+
export function LUFactor3x3(mat_3x3: Matrix3x3, index_3: Vector3): void;
|
|
378
377
|
|
|
379
378
|
/**
|
|
380
379
|
* LU back substitution for a 3x3 matrix.
|
|
381
|
-
* @param {
|
|
382
|
-
* @param {
|
|
383
|
-
* @param {
|
|
380
|
+
* @param {Matrix3x3} mat_3x3
|
|
381
|
+
* @param {Vector3} index_3
|
|
382
|
+
* @param {Vector3} x_3
|
|
384
383
|
*/
|
|
385
|
-
export function LUSolve3x3(mat_3x3:
|
|
384
|
+
export function LUSolve3x3(mat_3x3: Matrix3x3, index_3: Vector3, x_3: Vector3): void;
|
|
386
385
|
|
|
387
386
|
/**
|
|
388
387
|
* Solve mat_3x3y_3 = x_3 for y and place the result in y.
|
|
389
|
-
* @param {
|
|
390
|
-
* @param {
|
|
391
|
-
* @param {
|
|
388
|
+
* @param {Matrix3x3} mat_3x3
|
|
389
|
+
* @param {Vector3} x_3
|
|
390
|
+
* @param {Vector3} y_3
|
|
392
391
|
*/
|
|
393
|
-
export function linearSolve3x3(mat_3x3:
|
|
392
|
+
export function linearSolve3x3(mat_3x3: Matrix3x3, x_3: Vector3, y_3: Vector3): void;
|
|
394
393
|
|
|
395
394
|
/**
|
|
396
395
|
*
|
|
397
|
-
* @param {
|
|
398
|
-
* @param {
|
|
399
|
-
* @param {
|
|
396
|
+
* @param {Matrix3x3} mat_3x3
|
|
397
|
+
* @param {Vector3} in_3
|
|
398
|
+
* @param {Vector3} out_3
|
|
400
399
|
*/
|
|
401
|
-
export function multiply3x3_vect3(mat_3x3:
|
|
400
|
+
export function multiply3x3_vect3(mat_3x3: Matrix3x3, in_3: Vector3, out_3: Vector3): void;
|
|
402
401
|
|
|
403
402
|
/**
|
|
404
403
|
*
|
|
405
|
-
* @param {
|
|
406
|
-
* @param {
|
|
407
|
-
* @param {
|
|
404
|
+
* @param {Matrix3x3} a_3x3
|
|
405
|
+
* @param {Matrix3x3} b_3x3
|
|
406
|
+
* @param {Matrix3x3} out_3x3
|
|
408
407
|
*/
|
|
409
|
-
export function multiply3x3_mat3(a_3x3:
|
|
408
|
+
export function multiply3x3_mat3(a_3x3: Matrix3x3, b_3x3: Matrix3x3, out_3x3: Matrix3x3): void;
|
|
410
409
|
|
|
411
410
|
/**
|
|
412
|
-
*
|
|
413
|
-
* @param {
|
|
414
|
-
* @param {
|
|
411
|
+
* Multiply two matrices.
|
|
412
|
+
* @param {Matrix} a
|
|
413
|
+
* @param {Matrix} b
|
|
415
414
|
* @param {Number} rowA
|
|
416
415
|
* @param {Number} colA
|
|
417
416
|
* @param {Number} rowB
|
|
418
417
|
* @param {Number} colB
|
|
419
|
-
* @param {
|
|
418
|
+
* @param {Matrix} out_rowXcol
|
|
420
419
|
*/
|
|
421
|
-
export function multiplyMatrix(a:
|
|
420
|
+
export function multiplyMatrix(a: Matrix, b: Matrix, rowA: number, colA: number, rowB: number, colB: number, out_rowXcol: Matrix): void;
|
|
422
421
|
|
|
423
422
|
/**
|
|
424
423
|
* Transpose a 3x3 matrix.
|
|
425
|
-
* @param {
|
|
426
|
-
* @param {
|
|
424
|
+
* @param {Matrix3x3} in_3x3 The input 3x3 matrix.
|
|
425
|
+
* @param {Matrix3x3} outT_3x3 The output 3x3 matrix.
|
|
427
426
|
*/
|
|
428
|
-
export function transpose3x3(in_3x3:
|
|
427
|
+
export function transpose3x3(in_3x3: Matrix3x3, outT_3x3: Matrix3x3): void;
|
|
429
428
|
|
|
430
429
|
/**
|
|
431
430
|
* Invert a 3x3 matrix.
|
|
432
|
-
* @param {
|
|
433
|
-
* @param {
|
|
431
|
+
* @param {Matrix3x3} in_3x3 The input 3x3 matrix.
|
|
432
|
+
* @param {Matrix3x3} outI_3x3 The output 3x3 matrix.
|
|
434
433
|
*/
|
|
435
|
-
export function invert3x3(in_3x3:
|
|
434
|
+
export function invert3x3(in_3x3: Matrix3x3, outI_3x3: Matrix3x3): void;
|
|
436
435
|
|
|
437
436
|
/**
|
|
438
437
|
* Set mat_3x3 to the identity matrix.
|
|
439
|
-
* @param {
|
|
438
|
+
* @param {Matrix3x3} mat_3x3 The input 3x3 matrix.
|
|
440
439
|
*/
|
|
441
|
-
export function identity3x3(mat_3x3:
|
|
440
|
+
export function identity3x3(mat_3x3: Matrix3x3): void;
|
|
442
441
|
|
|
443
442
|
/**
|
|
444
443
|
* Calculate the determinant of a 3x3 matrix.
|
|
445
|
-
* @param {
|
|
444
|
+
* @param {Matrix3x3} mat_3x3 The input 3x3 matrix.
|
|
446
445
|
*/
|
|
447
|
-
export function determinant3x3(mat_3x3:
|
|
446
|
+
export function determinant3x3(mat_3x3: Matrix3x3): number;
|
|
448
447
|
|
|
449
448
|
/**
|
|
450
449
|
*
|
|
451
|
-
* @param {
|
|
452
|
-
* @param {
|
|
450
|
+
* @param {Vector4} quat_4
|
|
451
|
+
* @param {Matrix3x3} mat_3x3
|
|
453
452
|
*/
|
|
454
|
-
export function quaternionToMatrix3x3(quat_4:
|
|
453
|
+
export function quaternionToMatrix3x3(quat_4: Vector4, mat_3x3: Matrix3x3): void;
|
|
455
454
|
|
|
456
455
|
/**
|
|
457
|
-
*
|
|
458
|
-
* @param {Number[]} a
|
|
459
|
-
* @param {Number[]} b
|
|
460
|
-
* @param {Number} eps
|
|
456
|
+
* Returns true if elements of both arrays are equals.
|
|
457
|
+
* @param {Number[]} a An array of numbers (vector, point, matrix...)
|
|
458
|
+
* @param {Number[]} b An array of numbers (vector, point, matrix...)
|
|
459
|
+
* @param {Number} [eps] The tolerance value.
|
|
461
460
|
*/
|
|
462
|
-
export function areEquals(a: number[], b: number[], eps
|
|
461
|
+
export function areEquals(a: number[], b: number[], eps?: number): boolean;
|
|
463
462
|
|
|
464
463
|
/**
|
|
465
464
|
*
|
|
@@ -470,213 +469,229 @@ export function roundNumber(num: number, digits?: number): number;
|
|
|
470
469
|
|
|
471
470
|
/**
|
|
472
471
|
*
|
|
473
|
-
* @param {
|
|
474
|
-
* @param {
|
|
472
|
+
* @param {Vector3} vector
|
|
473
|
+
* @param {Vector3} [out]
|
|
475
474
|
* @param {Number} [digits]
|
|
476
475
|
*/
|
|
477
|
-
export function roundVector(vector:
|
|
476
|
+
export function roundVector(vector: Vector3, out?: Vector3, digits?: number): Vector3;
|
|
478
477
|
|
|
479
478
|
/**
|
|
480
479
|
*
|
|
481
|
-
* @param {
|
|
480
|
+
* @param {Matrix} a
|
|
482
481
|
* @param {Number} n
|
|
483
482
|
* @param {Number[]} w
|
|
484
483
|
* @param {Number[]} v
|
|
485
484
|
*/
|
|
486
|
-
export function jacobiN(a:
|
|
485
|
+
export function jacobiN(a: Matrix, n: number, w: number[], v: number[]): number;
|
|
487
486
|
|
|
488
487
|
/**
|
|
489
488
|
*
|
|
490
|
-
* @param {
|
|
491
|
-
* @param {
|
|
489
|
+
* @param {Matrix3x3} mat_3x3
|
|
490
|
+
* @param {Vector4} quat_4
|
|
492
491
|
*/
|
|
493
|
-
export function matrix3x3ToQuaternion(mat_3x3:
|
|
492
|
+
export function matrix3x3ToQuaternion(mat_3x3: Matrix3x3, quat_4: Vector4): void;
|
|
494
493
|
|
|
495
494
|
/**
|
|
496
495
|
*
|
|
497
|
-
* @param {
|
|
498
|
-
* @param {
|
|
499
|
-
* @param {
|
|
496
|
+
* @param {Vector4} quat_1
|
|
497
|
+
* @param {Vector4} quat_2
|
|
498
|
+
* @param {Vector4} quat_out
|
|
500
499
|
*/
|
|
501
|
-
export function multiplyQuaternion(quat_1:
|
|
500
|
+
export function multiplyQuaternion(quat_1: Vector4, quat_2: Vector4, quat_out: Vector4): void;
|
|
502
501
|
|
|
503
502
|
/**
|
|
504
503
|
*
|
|
505
|
-
* @param {
|
|
506
|
-
* @param {
|
|
504
|
+
* @param {Matrix3x3} a_3x3
|
|
505
|
+
* @param {Matrix3x3} out_3x3
|
|
507
506
|
*/
|
|
508
|
-
export function orthogonalize3x3(a_3x3:
|
|
507
|
+
export function orthogonalize3x3(a_3x3: Matrix3x3, out_3x3: Matrix3x3): void;
|
|
509
508
|
|
|
510
509
|
/**
|
|
511
510
|
*
|
|
512
|
-
* @param {
|
|
513
|
-
* @param {
|
|
514
|
-
* @param {
|
|
511
|
+
* @param {Matrix3x3} a_3x3
|
|
512
|
+
* @param {Vector3} w_3
|
|
513
|
+
* @param {Matrix3x3} v_3x3
|
|
515
514
|
*/
|
|
516
|
-
export function diagonalize3x3(a_3x3:
|
|
515
|
+
export function diagonalize3x3(a_3x3: Matrix3x3, w_3: Vector3, v_3x3: Matrix3x3): void;
|
|
517
516
|
|
|
518
517
|
/**
|
|
519
518
|
*
|
|
520
|
-
* @param {
|
|
521
|
-
* @param {
|
|
522
|
-
* @param {
|
|
523
|
-
* @param {
|
|
519
|
+
* @param {Matrix3x3} a_3x3
|
|
520
|
+
* @param {Matrix3x3} u_3x3
|
|
521
|
+
* @param {Vector3} w_3
|
|
522
|
+
* @param {Matrix3x3} vT_3x3
|
|
524
523
|
*/
|
|
525
|
-
export function singularValueDecomposition3x3(a_3x3:
|
|
524
|
+
export function singularValueDecomposition3x3(a_3x3: Matrix3x3, u_3x3: Matrix3x3, w_3: Vector3, vT_3x3: Matrix3x3): void;
|
|
526
525
|
|
|
527
526
|
/**
|
|
528
527
|
*
|
|
529
|
-
* @param {
|
|
528
|
+
* @param {Matrix} A
|
|
530
529
|
* @param {Number[]} index
|
|
531
530
|
* @param {Number} size
|
|
532
531
|
*/
|
|
533
|
-
export function luFactorLinearSystem(A:
|
|
532
|
+
export function luFactorLinearSystem(A: Matrix, index: number[], size: number): number;
|
|
534
533
|
|
|
535
534
|
/**
|
|
536
535
|
*
|
|
537
|
-
* @param {
|
|
536
|
+
* @param {Matrix} A
|
|
538
537
|
* @param {Number[]} index
|
|
539
538
|
* @param {Number[]} x
|
|
540
539
|
* @param {Number} size
|
|
541
540
|
*/
|
|
542
|
-
export function luSolveLinearSystem(A:
|
|
541
|
+
export function luSolveLinearSystem(A: Matrix, index: number[], x: number[], size: number): void;
|
|
543
542
|
|
|
544
543
|
/**
|
|
545
544
|
*
|
|
546
|
-
* @param {
|
|
545
|
+
* @param {Matrix} A
|
|
547
546
|
* @param {Number[]} x
|
|
548
547
|
* @param {Number} size
|
|
549
548
|
*/
|
|
550
|
-
export function solveLinearSystem(A:
|
|
549
|
+
export function solveLinearSystem(A: Matrix, x: number[], size: number): number;
|
|
551
550
|
|
|
552
551
|
/**
|
|
553
552
|
*
|
|
554
|
-
* @param {
|
|
555
|
-
* @param {
|
|
556
|
-
* @param {Number} size
|
|
557
|
-
* @param {
|
|
558
|
-
* @param {
|
|
553
|
+
* @param {Matrix} A
|
|
554
|
+
* @param {Matrix} AI
|
|
555
|
+
* @param {Number} [size]
|
|
556
|
+
* @param {Number[]} [index]
|
|
557
|
+
* @param {Number[]} [column]
|
|
559
558
|
*/
|
|
560
|
-
export function invertMatrix(A:
|
|
559
|
+
export function invertMatrix(A: Matrix, AI: Matrix, size?: number, index?: number[], column?: number[]): number;
|
|
561
560
|
|
|
562
561
|
/**
|
|
563
562
|
*
|
|
564
|
-
* @param {
|
|
563
|
+
* @param {Matrix} A
|
|
565
564
|
* @param {Number} size
|
|
566
565
|
*/
|
|
567
|
-
export function estimateMatrixCondition(A:
|
|
566
|
+
export function estimateMatrixCondition(A: Matrix, size: number): number;
|
|
568
567
|
|
|
569
568
|
/**
|
|
570
569
|
*
|
|
571
|
-
* @param {
|
|
570
|
+
* @param {Matrix3x3} a_3x3
|
|
572
571
|
* @param {Number[]} w
|
|
573
572
|
* @param {Number[]} v
|
|
574
573
|
*/
|
|
575
|
-
export function jacobi(a_3x3:
|
|
574
|
+
export function jacobi(a_3x3: Matrix3x3, w: number[], v: number[]): number;
|
|
576
575
|
|
|
577
576
|
/**
|
|
578
|
-
*
|
|
577
|
+
* Solves for the least squares best fit matrix for the homogeneous equation
|
|
578
|
+
* X'M' = 0'. Uses the method described on pages 40-41 of Computer Vision by
|
|
579
|
+
* Forsyth and Ponce, which is that the solution is the eigenvector associated
|
|
580
|
+
* with the minimum eigenvalue of T(X)X, where T(X) is the transpose of X. The
|
|
581
|
+
* inputs and output are transposed matrices. Dimensions: X' is numberOfSamples
|
|
582
|
+
* by xOrder, M' dimension is xOrder by yOrder. M' should be pre-allocated. All
|
|
583
|
+
* matrices are row major. The resultant matrix M' should be pre-multiplied to
|
|
584
|
+
* X' to get 0', or transposed and then post multiplied to X to get 0
|
|
579
585
|
* @param {Number} numberOfSamples
|
|
580
|
-
* @param {
|
|
586
|
+
* @param {Matrix} xt
|
|
581
587
|
* @param {Number} xOrder
|
|
582
|
-
* @param {
|
|
588
|
+
* @param {Matrix} mt
|
|
583
589
|
*/
|
|
584
|
-
export function solveHomogeneousLeastSquares(numberOfSamples: number, xt:
|
|
590
|
+
export function solveHomogeneousLeastSquares(numberOfSamples: number, xt: Matrix, xOrder: number, mt: Matrix): number;
|
|
585
591
|
|
|
586
592
|
/**
|
|
587
|
-
*
|
|
593
|
+
* Solves for the least squares best fit matrix for the equation X'M' = Y'. Uses
|
|
594
|
+
* pseudoinverse to get the ordinary least squares. The inputs and output are
|
|
595
|
+
* transposed matrices. Dimensions: X' is numberOfSamples by xOrder, Y' is
|
|
596
|
+
* numberOfSamples by yOrder, M' dimension is xOrder by yOrder. M' should be
|
|
597
|
+
* pre-allocated. All matrices are row major. The resultant matrix M' should be
|
|
598
|
+
* pre-multiplied to X' to get Y', or transposed and then post multiplied to X
|
|
599
|
+
* to get Y By default, this method checks for the homogeneous condition where
|
|
600
|
+
* Y==0, and if so, invokes SolveHomogeneousLeastSquares. For better performance
|
|
601
|
+
* when the system is known not to be homogeneous, invoke with
|
|
602
|
+
* checkHomogeneous=0.
|
|
588
603
|
* @param {Number} numberOfSamples
|
|
589
|
-
* @param {
|
|
604
|
+
* @param {Matrix} xt
|
|
590
605
|
* @param {Number} xOrder
|
|
591
|
-
* @param {
|
|
606
|
+
* @param {Matrix} yt
|
|
592
607
|
* @param {Number} yOrder
|
|
593
|
-
* @param {
|
|
594
|
-
* @param {Boolean} checkHomogeneous
|
|
608
|
+
* @param {Matrix} mt
|
|
609
|
+
* @param {Boolean} [checkHomogeneous]
|
|
595
610
|
*/
|
|
596
|
-
export function solveLeastSquares(numberOfSamples: number, xt:
|
|
611
|
+
export function solveLeastSquares(numberOfSamples: number, xt: Matrix, xOrder: number, yt: Matrix, yOrder: number, mt: Matrix, checkHomogeneous?: boolean): number;
|
|
597
612
|
|
|
598
613
|
/**
|
|
599
614
|
*
|
|
600
615
|
* @param {String} hexStr
|
|
601
|
-
* @param {Number[]} outFloatArray
|
|
616
|
+
* @param {Number[]} [outFloatArray]
|
|
602
617
|
*/
|
|
603
|
-
export function hex2float(hexStr: string, outFloatArray
|
|
618
|
+
export function hex2float(hexStr: string, outFloatArray?: number[]): number[];
|
|
604
619
|
|
|
605
620
|
/**
|
|
606
621
|
*
|
|
607
|
-
* @param {
|
|
608
|
-
* @param {
|
|
622
|
+
* @param {RGBColor} rgb An Array of the RGB color.
|
|
623
|
+
* @param {HSVColor} hsv An Array of the HSV color.
|
|
609
624
|
*/
|
|
610
|
-
export function rgb2hsv(rgb:
|
|
625
|
+
export function rgb2hsv(rgb: RGBColor, hsv: HSVColor): void;
|
|
611
626
|
|
|
612
627
|
/**
|
|
613
628
|
*
|
|
614
|
-
* @param {
|
|
615
|
-
* @param {
|
|
629
|
+
* @param {HSVColor} hsv An Array of the HSV color.
|
|
630
|
+
* @param {RGBColor} rgb An Array of the RGB color.
|
|
616
631
|
*/
|
|
617
|
-
export function hsv2rgb(hsv:
|
|
632
|
+
export function hsv2rgb(hsv: HSVColor, rgb: RGBColor): void;
|
|
618
633
|
|
|
619
634
|
/**
|
|
620
635
|
*
|
|
621
|
-
* @param {
|
|
622
|
-
* @param {
|
|
636
|
+
* @param {Vector3} lab
|
|
637
|
+
* @param {Vector3} xyz
|
|
623
638
|
*/
|
|
624
|
-
export function lab2xyz(lab:
|
|
639
|
+
export function lab2xyz(lab: Vector3, xyz: Vector3): void;
|
|
625
640
|
|
|
626
641
|
/**
|
|
627
642
|
*
|
|
628
|
-
* @param {
|
|
629
|
-
* @param {
|
|
643
|
+
* @param {Vector3} xyz
|
|
644
|
+
* @param {Vector3} lab
|
|
630
645
|
*/
|
|
631
|
-
export function xyz2lab(xyz:
|
|
646
|
+
export function xyz2lab(xyz: Vector3, lab: Vector3): void;
|
|
632
647
|
|
|
633
648
|
/**
|
|
634
649
|
*
|
|
635
|
-
* @param {
|
|
636
|
-
* @param {
|
|
650
|
+
* @param {Vector3} xyz
|
|
651
|
+
* @param {RGBColor} rgb An Array of the RGB color.
|
|
637
652
|
*/
|
|
638
|
-
export function xyz2rgb(xyz:
|
|
653
|
+
export function xyz2rgb(xyz: Vector3, rgb: RGBColor): void;
|
|
639
654
|
|
|
640
655
|
/**
|
|
641
656
|
*
|
|
642
|
-
* @param {
|
|
643
|
-
* @param {
|
|
657
|
+
* @param {RGBColor} rgb An Array of the RGB color.
|
|
658
|
+
* @param {Vector3} xyz
|
|
644
659
|
*/
|
|
645
|
-
export function rgb2xyz(rgb:
|
|
660
|
+
export function rgb2xyz(rgb: RGBColor, xyz: Vector3): void;
|
|
646
661
|
|
|
647
662
|
/**
|
|
648
663
|
*
|
|
649
|
-
* @param {
|
|
650
|
-
* @param {
|
|
664
|
+
* @param {RGBColor} rgb
|
|
665
|
+
* @param {Vector3} lab
|
|
651
666
|
*/
|
|
652
|
-
export function rgb2lab(rgb:
|
|
667
|
+
export function rgb2lab(rgb: RGBColor, lab: Vector3): void;
|
|
653
668
|
|
|
654
669
|
/**
|
|
655
670
|
*
|
|
656
|
-
* @param {
|
|
657
|
-
* @param {
|
|
671
|
+
* @param {Vector3} lab
|
|
672
|
+
* @param {RGBColor} rgb An Array of the RGB color.
|
|
658
673
|
*/
|
|
659
|
-
export function lab2rgb(lab:
|
|
674
|
+
export function lab2rgb(lab: Vector3, rgb: RGBColor): void;
|
|
660
675
|
|
|
661
676
|
/**
|
|
662
677
|
* Returns bounds.
|
|
663
|
-
* @param {
|
|
678
|
+
* @param {Bounds} bounds Output array that hold bounds, optionally empty.
|
|
664
679
|
*/
|
|
665
|
-
export function uninitializeBounds(bounds:
|
|
680
|
+
export function uninitializeBounds(bounds: Bounds): Bounds;
|
|
666
681
|
|
|
667
682
|
/**
|
|
668
683
|
*
|
|
669
|
-
* @param {
|
|
684
|
+
* @param {Bounds} bounds The bounds to check.
|
|
670
685
|
*/
|
|
671
|
-
export function areBoundsInitialized(bounds:
|
|
686
|
+
export function areBoundsInitialized(bounds: Bounds): boolean;
|
|
672
687
|
|
|
673
688
|
/**
|
|
674
689
|
* Compute the bounds from points.
|
|
675
|
-
* @param {
|
|
676
|
-
* @param {
|
|
677
|
-
* @param {
|
|
690
|
+
* @param {Vector3} point1 The coordinate of the first point.
|
|
691
|
+
* @param {Vector3} point2 The coordinate of the second point.
|
|
692
|
+
* @param {Bounds} bounds Output array that hold bounds, optionally empty.
|
|
678
693
|
*/
|
|
679
|
-
export function computeBoundsFromPoints(point1:
|
|
694
|
+
export function computeBoundsFromPoints(point1: Vector3, point2: Vector3, bounds: Bounds): Bounds;
|
|
680
695
|
|
|
681
696
|
/**
|
|
682
697
|
* Clamp some value against a range.
|
|
@@ -688,26 +703,26 @@ export function clampValue(value: number, minValue: number, maxValue: number): n
|
|
|
688
703
|
|
|
689
704
|
/**
|
|
690
705
|
* Clamp some vector against a range.
|
|
691
|
-
* @param {
|
|
692
|
-
* @param {
|
|
693
|
-
* @param {
|
|
694
|
-
* @param {
|
|
706
|
+
* @param {Vector3} vector The vector to clamp.
|
|
707
|
+
* @param {Vector3} minVector The minimum vector.
|
|
708
|
+
* @param {Vector3} maxVector The maximum vector.
|
|
709
|
+
* @param {Vector3} out The output vector.
|
|
695
710
|
*/
|
|
696
|
-
export function clampVector(vector:
|
|
711
|
+
export function clampVector(vector: Vector3, minVector: Vector3, maxVector: Vector3, out: Vector3): Vector3;
|
|
697
712
|
|
|
698
713
|
/**
|
|
699
714
|
*
|
|
700
|
-
* @param {
|
|
701
|
-
* @param {
|
|
715
|
+
* @param {Vector3} vector
|
|
716
|
+
* @param {Vector3} out
|
|
702
717
|
*/
|
|
703
|
-
export function roundVector(vector:
|
|
718
|
+
export function roundVector(vector: Vector3, out: Vector3): Vector3;
|
|
704
719
|
|
|
705
720
|
/**
|
|
706
721
|
*
|
|
707
722
|
* @param {Number} value
|
|
708
|
-
* @param {
|
|
723
|
+
* @param {Range} range
|
|
709
724
|
*/
|
|
710
|
-
export function clampAndNormalizeValue(value: number, range:
|
|
725
|
+
export function clampAndNormalizeValue(value: number, range: Range): number;
|
|
711
726
|
|
|
712
727
|
/**
|
|
713
728
|
* Get the scalar type that is most likely to have enough precision to store a
|
|
@@ -731,17 +746,17 @@ export function extentIsWithinOtherExtent(extent1: Extent, extent2: Extent): num
|
|
|
731
746
|
* Check if first 3D bounds is within the second 3D bounds.
|
|
732
747
|
* @param {Bounds} bounds1_6 The first bounds.
|
|
733
748
|
* @param {Bounds} bounds2_6 The second bounds.
|
|
734
|
-
* @param {
|
|
749
|
+
* @param {Vector3} delta_3 The error margin along each axis.
|
|
735
750
|
*/
|
|
736
|
-
export function boundsIsWithinOtherBounds(bounds1_6: Bounds, bounds2_6: Bounds, delta_3:
|
|
751
|
+
export function boundsIsWithinOtherBounds(bounds1_6: Bounds, bounds2_6: Bounds, delta_3: Vector3): number;
|
|
737
752
|
|
|
738
753
|
/**
|
|
739
754
|
* Check if point is within the given 3D bounds.
|
|
740
|
-
* @param {
|
|
755
|
+
* @param {Vector3} point_3 The coordinate of the point.
|
|
741
756
|
* @param {Bounds} bounds_6 The bounds.
|
|
742
|
-
* @param {
|
|
757
|
+
* @param {Vector3} delta_3 The error margin along each axis.
|
|
743
758
|
*/
|
|
744
|
-
export function pointIsWithinBounds(point_3:
|
|
759
|
+
export function pointIsWithinBounds(point_3: Vector3, bounds_6: Bounds, delta_3: Vector3): number;
|
|
745
760
|
|
|
746
761
|
/**
|
|
747
762
|
* In Euclidean space, there is a unique circle passing through any given three
|
|
@@ -752,12 +767,12 @@ export function pointIsWithinBounds(point_3: vec3, bounds_6: Bounds, delta_3: ve
|
|
|
752
767
|
* and center of the circle. See:
|
|
753
768
|
* http://en.wikipedia.org/wiki/Circumscribed_circle and more specifically the
|
|
754
769
|
* section Barycentric coordinates from cross- and dot-products
|
|
755
|
-
* @param {
|
|
756
|
-
* @param {
|
|
757
|
-
* @param {
|
|
758
|
-
* @param {
|
|
770
|
+
* @param {Vector3} p1 The coordinate of the first point.
|
|
771
|
+
* @param {Vector3} p2 The coordinate of the second point.
|
|
772
|
+
* @param {Vector3} p3 The coordinate of the third point.
|
|
773
|
+
* @param {Vector3} center The coordinate of the center point.
|
|
759
774
|
*/
|
|
760
|
-
export function solve3PointCircle(p1:
|
|
775
|
+
export function solve3PointCircle(p1: Vector3, p2: Vector3, p3: Vector3, center: Vector3): number;
|
|
761
776
|
|
|
762
777
|
/**
|
|
763
778
|
* Determines whether the passed value is a infinite number.
|
|
@@ -784,10 +799,10 @@ export function floatToHex2(value: number): string;
|
|
|
784
799
|
|
|
785
800
|
/**
|
|
786
801
|
*
|
|
787
|
-
* @param {
|
|
802
|
+
* @param {RGBColor} rgbArray
|
|
788
803
|
* @param {string} [prefix]
|
|
789
804
|
*/
|
|
790
|
-
export function floatRGB2HexCode(rgbArray:
|
|
805
|
+
export function floatRGB2HexCode(rgbArray: RGBColor | RGBAColor, prefix?: string): string;
|
|
791
806
|
|
|
792
807
|
/**
|
|
793
808
|
* Convert RGB or RGBA color array to CSS representation
|