wasm-vips 0.0.9 → 0.0.11
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/README.md +5 -5
- package/lib/vips-es6.js +217 -232
- package/lib/vips-heif.wasm +0 -0
- package/lib/vips-jxl.wasm +0 -0
- package/lib/vips-node.js +219 -232
- package/lib/vips-node.mjs +220 -232
- package/lib/vips-resvg.wasm +0 -0
- package/lib/vips.d.ts +261 -93
- package/lib/vips.js +216 -231
- package/lib/vips.wasm +0 -0
- package/package.json +8 -4
- package/versions.json +11 -11
package/lib/vips.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare module Vips {
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Queue of handles to be deleted.
|
|
44
|
-
* This is filled when
|
|
44
|
+
* This is filled when {@link deleteLater} is called on the handle.
|
|
45
45
|
*/
|
|
46
46
|
const deletionQueue: DeletionFuncs<Image | Connection | Interpolate>;
|
|
47
47
|
|
|
@@ -112,14 +112,6 @@ declare module Vips {
|
|
|
112
112
|
*/
|
|
113
113
|
function shutdown(): void;
|
|
114
114
|
|
|
115
|
-
/**
|
|
116
|
-
* Convert a bigint value (usually coming from Wasm->JS call) into an int53 JS Number.
|
|
117
|
-
* This is used when we have an incoming i64 that we know is a pointer or size_t and
|
|
118
|
-
* is expected to be withing the int53 range.
|
|
119
|
-
* @return The converted bigint value or NaN if the incoming bigint is outside the range.
|
|
120
|
-
*/
|
|
121
|
-
function bigintToI53Checked(num: bigint): number;
|
|
122
|
-
|
|
123
115
|
//#endregion
|
|
124
116
|
|
|
125
117
|
//#region APIs
|
|
@@ -129,8 +121,8 @@ declare module Vips {
|
|
|
129
121
|
*/
|
|
130
122
|
abstract class EmbindClassHandle<T extends EmbindClassHandle<T>> {
|
|
131
123
|
/**
|
|
132
|
-
* Returns a new handle. It must eventually also be disposed with
|
|
133
|
-
*
|
|
124
|
+
* Returns a new handle. It must eventually also be disposed with {@link delete} or
|
|
125
|
+
* {@link deleteLater}.
|
|
134
126
|
* @return A new handle.
|
|
135
127
|
*/
|
|
136
128
|
clone(): T;
|
|
@@ -142,8 +134,9 @@ declare module Vips {
|
|
|
142
134
|
|
|
143
135
|
/**
|
|
144
136
|
* Signal that a C++ object is no longer needed and can be deleted later.
|
|
137
|
+
* @return `this`.
|
|
145
138
|
*/
|
|
146
|
-
deleteLater():
|
|
139
|
+
deleteLater(): T;
|
|
147
140
|
|
|
148
141
|
/**
|
|
149
142
|
* Check whether two Embind handles point to the same underlying object.
|
|
@@ -157,6 +150,12 @@ declare module Vips {
|
|
|
157
150
|
* @return `true` if this handle is deleted.
|
|
158
151
|
*/
|
|
159
152
|
isDeleted(): boolean;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Prevents the C++ object from being auto deleted.
|
|
156
|
+
* @return `this`.
|
|
157
|
+
*/
|
|
158
|
+
preventAutoDelete(): T;
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
/**
|
|
@@ -310,7 +309,7 @@ declare module Vips {
|
|
|
310
309
|
* ```js
|
|
311
310
|
* const source = vips.Source.newFromFile('myfile.jpg');
|
|
312
311
|
* ```
|
|
313
|
-
* You can pass this source to (for example)
|
|
312
|
+
* You can pass this source to (for example) {@link Image.newFromSource}.
|
|
314
313
|
* @param filename The file.
|
|
315
314
|
* @return A new source.
|
|
316
315
|
*/
|
|
@@ -324,7 +323,7 @@ declare module Vips {
|
|
|
324
323
|
* const data = image.writeToBuffer('.jpg');
|
|
325
324
|
* const source = vips.Source.newFromMemory(data);
|
|
326
325
|
* ```
|
|
327
|
-
* You can pass this source to (for example)
|
|
326
|
+
* You can pass this source to (for example) {@link Image.newFromSource}.
|
|
328
327
|
* @param memory The memory object.
|
|
329
328
|
* @return A new source.
|
|
330
329
|
*/
|
|
@@ -337,11 +336,13 @@ declare module Vips {
|
|
|
337
336
|
class SourceCustom extends Source {
|
|
338
337
|
/**
|
|
339
338
|
* Attach a read handler.
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
339
|
+
* The handler is given a number of bytes to fetch {@link length}, and should return a
|
|
340
|
+
* bytes-like object containing up to that number of bytes. If there's no more data
|
|
341
|
+
* available, it should return `undefined`.
|
|
342
|
+
* @param length The maximum number of bytes to be read.
|
|
343
|
+
* @return A blob up to {@link length} bytes or `undefined` if there's no more data available.
|
|
343
344
|
*/
|
|
344
|
-
onRead: (
|
|
345
|
+
onRead: (length: number) => Blob | undefined;
|
|
345
346
|
|
|
346
347
|
/**
|
|
347
348
|
* Attach a seek handler.
|
|
@@ -351,7 +352,7 @@ declare module Vips {
|
|
|
351
352
|
* @param size A value indicating the reference point used to obtain the new position.
|
|
352
353
|
* @return The new position within the current source.
|
|
353
354
|
*/
|
|
354
|
-
onSeek: (offset:
|
|
355
|
+
onSeek: (offset: number, whence: number) => number;
|
|
355
356
|
}
|
|
356
357
|
|
|
357
358
|
/**
|
|
@@ -365,8 +366,8 @@ declare module Vips {
|
|
|
365
366
|
* ```js
|
|
366
367
|
* const target = vips.Target.newToFile('myfile.jpg');
|
|
367
368
|
* ```
|
|
368
|
-
* You can pass this target to (for example)
|
|
369
|
-
* @param filename Write to this
|
|
369
|
+
* You can pass this target to (for example) {@link image.writeToTarget}.
|
|
370
|
+
* @param filename Write to this file.
|
|
370
371
|
* @return A new target.
|
|
371
372
|
*/
|
|
372
373
|
static newToFile(filename: string): Target;
|
|
@@ -378,9 +379,9 @@ declare module Vips {
|
|
|
378
379
|
* ```js
|
|
379
380
|
* const target = vips.Target.newToMemory();
|
|
380
381
|
* ```
|
|
381
|
-
* You can pass this target to (for example)
|
|
382
|
+
* You can pass this target to (for example) {@link image.writeToTarget}.
|
|
382
383
|
*
|
|
383
|
-
* After writing to the target, fetch the bytes from the target object with
|
|
384
|
+
* After writing to the target, fetch the bytes from the target object with {@link getBlob}.
|
|
384
385
|
* @return A new target.
|
|
385
386
|
*/
|
|
386
387
|
static newToMemory(): Target;
|
|
@@ -400,22 +401,20 @@ declare module Vips {
|
|
|
400
401
|
class TargetCustom extends Target {
|
|
401
402
|
/**
|
|
402
403
|
* Attach a write handler.
|
|
403
|
-
* @param
|
|
404
|
-
* @param length The number of bytes to write.
|
|
404
|
+
* @param data A typed array of 8-bit unsigned integer values.
|
|
405
405
|
* @return The number of bytes that were written.
|
|
406
406
|
*/
|
|
407
|
-
onWrite: (
|
|
407
|
+
onWrite: (data: Uint8Array) => number;
|
|
408
408
|
|
|
409
409
|
/* libtiff needs to be able to seek and read on targets, unfortunately.
|
|
410
410
|
*/
|
|
411
411
|
|
|
412
412
|
/**
|
|
413
413
|
* Attach a read handler.
|
|
414
|
-
* @param
|
|
415
|
-
* @
|
|
416
|
-
* @return The total number of bytes read from the target.
|
|
414
|
+
* @param length The maximum number of bytes to be read.
|
|
415
|
+
* @return A blob up to {@link length} bytes or `undefined` if there's no more data available.
|
|
417
416
|
*/
|
|
418
|
-
onRead: (
|
|
417
|
+
onRead: (length: number) => Blob | undefined;
|
|
419
418
|
|
|
420
419
|
/**
|
|
421
420
|
* Attach a seek handler.
|
|
@@ -423,7 +422,7 @@ declare module Vips {
|
|
|
423
422
|
* @param size A value indicating the reference point used to obtain the new position.
|
|
424
423
|
* @return The new position within the current target.
|
|
425
424
|
*/
|
|
426
|
-
onSeek: (offset:
|
|
425
|
+
onSeek: (offset: number, whence: number) => number;
|
|
427
426
|
|
|
428
427
|
/**
|
|
429
428
|
* Attach an end handler.
|
|
@@ -543,7 +542,7 @@ declare module Vips {
|
|
|
543
542
|
* Make a new temporary image.
|
|
544
543
|
*
|
|
545
544
|
* Returns an image backed by a temporary file. When written to with
|
|
546
|
-
*
|
|
545
|
+
* {@link write}, a temporary file will be created on disc in the
|
|
547
546
|
* specified format. When the image is closed, the file will be deleted
|
|
548
547
|
* automatically.
|
|
549
548
|
*
|
|
@@ -598,7 +597,7 @@ declare module Vips {
|
|
|
598
597
|
access?: Access | Enum
|
|
599
598
|
/**
|
|
600
599
|
* The type of error that will cause load to fail. By default,
|
|
601
|
-
* loaders are permissive, that is,
|
|
600
|
+
* loaders are permissive, that is, {@link FailOn.none}.
|
|
602
601
|
*/
|
|
603
602
|
fail_on?: FailOn | Enum
|
|
604
603
|
/**
|
|
@@ -623,8 +622,8 @@ declare module Vips {
|
|
|
623
622
|
* This method is useful for efficiently transferring images from WebGL into
|
|
624
623
|
* libvips.
|
|
625
624
|
*
|
|
626
|
-
* See
|
|
627
|
-
* Use
|
|
625
|
+
* See {@link writeToMemory} for the opposite operation.
|
|
626
|
+
* Use {@link copy} to set other image attributes.
|
|
628
627
|
* @param data A C-style JavaScript array.
|
|
629
628
|
* @param width Image width in pixels.
|
|
630
629
|
* @param height Image height in pixels.
|
|
@@ -637,7 +636,7 @@ declare module Vips {
|
|
|
637
636
|
/**
|
|
638
637
|
* Wrap an image around a pointer.
|
|
639
638
|
*
|
|
640
|
-
* This behaves exactly as
|
|
639
|
+
* This behaves exactly as {@link newFromMemory}, but the image is
|
|
641
640
|
* loaded from a pointer rather than from a JavaScript array.
|
|
642
641
|
* @param ptr A memory address.
|
|
643
642
|
* @param size Length of memory area.
|
|
@@ -652,7 +651,7 @@ declare module Vips {
|
|
|
652
651
|
/**
|
|
653
652
|
* Load a formatted image from memory.
|
|
654
653
|
*
|
|
655
|
-
* This behaves exactly as
|
|
654
|
+
* This behaves exactly as {@link newFromFile}, but the image is
|
|
656
655
|
* loaded from the memory object rather than from a file. The
|
|
657
656
|
* memory object can be a string or buffer.
|
|
658
657
|
* @param data The memory object to load the image from.
|
|
@@ -667,7 +666,7 @@ declare module Vips {
|
|
|
667
666
|
access?: Access | Enum
|
|
668
667
|
/**
|
|
669
668
|
* The type of error that will cause load to fail. By default,
|
|
670
|
-
* loaders are permissive, that is,
|
|
669
|
+
* loaders are permissive, that is, {@link FailOn.none}.
|
|
671
670
|
*/
|
|
672
671
|
fail_on?: FailOn | Enum
|
|
673
672
|
/**
|
|
@@ -679,7 +678,7 @@ declare module Vips {
|
|
|
679
678
|
/**
|
|
680
679
|
* Load a formatted image from a source.
|
|
681
680
|
*
|
|
682
|
-
* This behaves exactly as
|
|
681
|
+
* This behaves exactly as {@link newFromFile}, but the image is
|
|
683
682
|
* loaded from a source rather than from a file.
|
|
684
683
|
* @param source The source to load the image from.
|
|
685
684
|
* @param strOptions Load options as a string.
|
|
@@ -693,7 +692,7 @@ declare module Vips {
|
|
|
693
692
|
access?: Access | Enum
|
|
694
693
|
/**
|
|
695
694
|
* The type of error that will cause load to fail. By default,
|
|
696
|
-
* loaders are permissive, that is,
|
|
695
|
+
* loaders are permissive, that is, {@link FailOn.none}.
|
|
697
696
|
*/
|
|
698
697
|
fail_on?: FailOn | Enum
|
|
699
698
|
/**
|
|
@@ -705,9 +704,9 @@ declare module Vips {
|
|
|
705
704
|
/**
|
|
706
705
|
* Create an image from a 1D array.
|
|
707
706
|
*
|
|
708
|
-
* A new one-band image with
|
|
707
|
+
* A new one-band image with {@link BandFormat.double} pixels is
|
|
709
708
|
* created from the array. These images are useful with the libvips
|
|
710
|
-
* convolution operator
|
|
709
|
+
* convolution operator {@link conv}.
|
|
711
710
|
* @param width Image width.
|
|
712
711
|
* @param height Image height.
|
|
713
712
|
* @param array Create the image from these values.
|
|
@@ -718,9 +717,9 @@ declare module Vips {
|
|
|
718
717
|
/**
|
|
719
718
|
* Create an image from a 2D array.
|
|
720
719
|
*
|
|
721
|
-
* A new one-band image with
|
|
720
|
+
* A new one-band image with {@link BandFormat.double} pixels is
|
|
722
721
|
* created from the array. These images are useful with the libvips
|
|
723
|
-
* convolution operator
|
|
722
|
+
* convolution operator {@link conv}.
|
|
724
723
|
* @param array Create the image from these values.
|
|
725
724
|
* @param scale Default to 1.0. What to divide each pixel by after
|
|
726
725
|
* convolution. Useful for integer convolution masks.
|
|
@@ -759,7 +758,7 @@ declare module Vips {
|
|
|
759
758
|
* Write an image to another image.
|
|
760
759
|
*
|
|
761
760
|
* This function writes itself to another image. Use something like
|
|
762
|
-
*
|
|
761
|
+
* {@link newTempFile} to make an image that can be written to.
|
|
763
762
|
* @param other The image to write to.
|
|
764
763
|
* @return A new image.
|
|
765
764
|
*/
|
|
@@ -770,7 +769,7 @@ declare module Vips {
|
|
|
770
769
|
*
|
|
771
770
|
* This method can save images in any format supported by libvips. The format
|
|
772
771
|
* is selected from the filename suffix. The filename can include embedded
|
|
773
|
-
* save options, see
|
|
772
|
+
* save options, see {@link newFromFile}.
|
|
774
773
|
*
|
|
775
774
|
* For example:
|
|
776
775
|
* ```js
|
|
@@ -799,7 +798,7 @@ declare module Vips {
|
|
|
799
798
|
*
|
|
800
799
|
* This method can save images in any format supported by libvips. The format
|
|
801
800
|
* is selected from the suffix in the format string. This can include
|
|
802
|
-
* embedded save options, see
|
|
801
|
+
* embedded save options, see {@link newFromFile}.
|
|
803
802
|
*
|
|
804
803
|
* For example:
|
|
805
804
|
* ```js
|
|
@@ -827,7 +826,7 @@ declare module Vips {
|
|
|
827
826
|
/**
|
|
828
827
|
* Write an image to a target.
|
|
829
828
|
*
|
|
830
|
-
* This behaves exactly as
|
|
829
|
+
* This behaves exactly as {@link writeToFile}, but the image is
|
|
831
830
|
* written to a target rather than a file.
|
|
832
831
|
* @param target Write to this target.
|
|
833
832
|
* @param formatString The suffix, plus any string-form arguments.
|
|
@@ -872,28 +871,28 @@ declare module Vips {
|
|
|
872
871
|
setArrayInt(name: string, value: ArrayConstant): void;
|
|
873
872
|
|
|
874
873
|
/**
|
|
875
|
-
* Set
|
|
874
|
+
* Set a double array on an image as metadata.
|
|
876
875
|
* @param name The name of the piece of metadata to set the value of.
|
|
877
876
|
* @param value The metadata value.
|
|
878
877
|
*/
|
|
879
878
|
setArrayDouble(name: string, value: ArrayConstant): void;
|
|
880
879
|
|
|
881
880
|
/**
|
|
882
|
-
* Set
|
|
881
|
+
* Set a double on an image as metadata.
|
|
883
882
|
* @param name The name of the piece of metadata to set the value of.
|
|
884
883
|
* @param value The metadata value.
|
|
885
884
|
*/
|
|
886
885
|
setDouble(name: string, value: number): void;
|
|
887
886
|
|
|
888
887
|
/**
|
|
889
|
-
* Set
|
|
888
|
+
* Set a string on an image as metadata.
|
|
890
889
|
* @param name The name of the piece of metadata to set the value of.
|
|
891
890
|
* @param value The metadata value.
|
|
892
891
|
*/
|
|
893
892
|
setString(name: string, value: string): void;
|
|
894
893
|
|
|
895
894
|
/**
|
|
896
|
-
* Set
|
|
895
|
+
* Set a blob on an image as metadata.
|
|
897
896
|
* The value will internally be copied from JavaScript to WASM.
|
|
898
897
|
* @param name The name of the piece of metadata to set the value of.
|
|
899
898
|
* @param value The metadata value.
|
|
@@ -901,7 +900,7 @@ declare module Vips {
|
|
|
901
900
|
setBlob(name: string, value: Blob): void;
|
|
902
901
|
|
|
903
902
|
/**
|
|
904
|
-
* Set
|
|
903
|
+
* Set a blob pointer on an image as metadata.
|
|
905
904
|
* @param name The name of the piece of metadata to set the value of.
|
|
906
905
|
* @param ptr The metadata value as memory address.
|
|
907
906
|
* @param size Length of blob.
|
|
@@ -931,30 +930,30 @@ declare module Vips {
|
|
|
931
930
|
getArrayInt(name: string): number[];
|
|
932
931
|
|
|
933
932
|
/**
|
|
934
|
-
* Get
|
|
933
|
+
* Get a double array from an image.
|
|
935
934
|
* @param name The name of the piece of metadata to get.
|
|
936
|
-
* @return The metadata item as
|
|
935
|
+
* @return The metadata item as a double array.
|
|
937
936
|
*/
|
|
938
937
|
getArrayDouble(name: string): number[];
|
|
939
938
|
|
|
940
939
|
/**
|
|
941
940
|
* Get an double from an image.
|
|
942
941
|
* @param name The name of the piece of metadata to get.
|
|
943
|
-
* @return The metadata item as
|
|
942
|
+
* @return The metadata item as a double.
|
|
944
943
|
*/
|
|
945
944
|
getDouble(name: string): number;
|
|
946
945
|
|
|
947
946
|
/**
|
|
948
|
-
* Get
|
|
947
|
+
* Get a string from an image.
|
|
949
948
|
* @param name The name of the piece of metadata to get.
|
|
950
|
-
* @return The metadata item as
|
|
949
|
+
* @return The metadata item as a string.
|
|
951
950
|
*/
|
|
952
951
|
getString(name: string): string;
|
|
953
952
|
|
|
954
953
|
/**
|
|
955
|
-
* Get
|
|
954
|
+
* Get a blob from an image.
|
|
956
955
|
* @param name The name of the piece of metadata to get.
|
|
957
|
-
* @return The metadata item as
|
|
956
|
+
* @return The metadata item as a typed array of 8-bit unsigned integer values.
|
|
958
957
|
*/
|
|
959
958
|
getBlob(name: string): Uint8Array;
|
|
960
959
|
|
|
@@ -969,7 +968,7 @@ declare module Vips {
|
|
|
969
968
|
* @param name The name of the piece of metadata to remove.
|
|
970
969
|
* @return `true` if successfully removed.
|
|
971
970
|
*/
|
|
972
|
-
remove(name: string):
|
|
971
|
+
remove(name: string): boolean;
|
|
973
972
|
|
|
974
973
|
//#endregion
|
|
975
974
|
|
|
@@ -984,7 +983,7 @@ declare module Vips {
|
|
|
984
983
|
/**
|
|
985
984
|
* Sets the `delete_on_close` flag for the image.
|
|
986
985
|
* If this flag is set, when image is finalized, the filename held in
|
|
987
|
-
*
|
|
986
|
+
* {@link image.filename} at the time of this call is deleted.
|
|
988
987
|
* This function is clearly extremely dangerous, use with great caution.
|
|
989
988
|
*/
|
|
990
989
|
setDeleteOnClose(flag: boolean): void;
|
|
@@ -2339,6 +2338,30 @@ declare module Vips {
|
|
|
2339
2338
|
none = 3 // 'none'
|
|
2340
2339
|
}
|
|
2341
2340
|
|
|
2341
|
+
/**
|
|
2342
|
+
* The SDF to generate,
|
|
2343
|
+
*
|
|
2344
|
+
* See also: vips_sdf().
|
|
2345
|
+
*/
|
|
2346
|
+
enum SdfShape {
|
|
2347
|
+
/**
|
|
2348
|
+
* A circle at @a, radius @r
|
|
2349
|
+
*/
|
|
2350
|
+
circle = 0, // 'circle'
|
|
2351
|
+
/**
|
|
2352
|
+
* A box from @a to @b
|
|
2353
|
+
*/
|
|
2354
|
+
box = 1, // 'box'
|
|
2355
|
+
/**
|
|
2356
|
+
* A box with rounded @corners from @a to @b
|
|
2357
|
+
*/
|
|
2358
|
+
rounded_box = 2, // 'rounded-box'
|
|
2359
|
+
/**
|
|
2360
|
+
* A line from @a to @b
|
|
2361
|
+
*/
|
|
2362
|
+
line = 3 // 'line'
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2342
2365
|
/**
|
|
2343
2366
|
* How sensitive loaders are to errors, from never stop (very insensitive), to
|
|
2344
2367
|
* stop on the smallest warning (very sensitive).
|
|
@@ -3703,6 +3726,14 @@ declare module Vips {
|
|
|
3703
3726
|
* @return Output image.
|
|
3704
3727
|
*/
|
|
3705
3728
|
static jxlload(filename: string, options?: {
|
|
3729
|
+
/**
|
|
3730
|
+
* First page to load.
|
|
3731
|
+
*/
|
|
3732
|
+
page?: number
|
|
3733
|
+
/**
|
|
3734
|
+
* Number of pages to load, -1 for all.
|
|
3735
|
+
*/
|
|
3736
|
+
n?: number
|
|
3706
3737
|
/**
|
|
3707
3738
|
* Force open via memory.
|
|
3708
3739
|
*/
|
|
@@ -3732,6 +3763,14 @@ declare module Vips {
|
|
|
3732
3763
|
* @return Output image.
|
|
3733
3764
|
*/
|
|
3734
3765
|
static jxlloadBuffer(buffer: Blob, options?: {
|
|
3766
|
+
/**
|
|
3767
|
+
* First page to load.
|
|
3768
|
+
*/
|
|
3769
|
+
page?: number
|
|
3770
|
+
/**
|
|
3771
|
+
* Number of pages to load, -1 for all.
|
|
3772
|
+
*/
|
|
3773
|
+
n?: number
|
|
3735
3774
|
/**
|
|
3736
3775
|
* Force open via memory.
|
|
3737
3776
|
*/
|
|
@@ -3761,6 +3800,14 @@ declare module Vips {
|
|
|
3761
3800
|
* @return Output image.
|
|
3762
3801
|
*/
|
|
3763
3802
|
static jxlloadSource(source: Source, options?: {
|
|
3803
|
+
/**
|
|
3804
|
+
* First page to load.
|
|
3805
|
+
*/
|
|
3806
|
+
page?: number
|
|
3807
|
+
/**
|
|
3808
|
+
* Number of pages to load, -1 for all.
|
|
3809
|
+
*/
|
|
3810
|
+
n?: number
|
|
3764
3811
|
/**
|
|
3765
3812
|
* Force open via memory.
|
|
3766
3813
|
*/
|
|
@@ -4919,6 +4966,33 @@ declare module Vips {
|
|
|
4919
4966
|
flags?: number | undefined
|
|
4920
4967
|
}): Image;
|
|
4921
4968
|
|
|
4969
|
+
/**
|
|
4970
|
+
* Create an sdf image.
|
|
4971
|
+
* @param width Image width in pixels.
|
|
4972
|
+
* @param height Image height in pixels.
|
|
4973
|
+
* @param shape SDF shape to create.
|
|
4974
|
+
* @param options Optional options.
|
|
4975
|
+
* @return Output image.
|
|
4976
|
+
*/
|
|
4977
|
+
static sdf(width: number, height: number, shape: SdfShape | Enum, options?: {
|
|
4978
|
+
/**
|
|
4979
|
+
* Radius.
|
|
4980
|
+
*/
|
|
4981
|
+
r?: number
|
|
4982
|
+
/**
|
|
4983
|
+
* Point a.
|
|
4984
|
+
*/
|
|
4985
|
+
a?: ArrayConstant
|
|
4986
|
+
/**
|
|
4987
|
+
* Point b.
|
|
4988
|
+
*/
|
|
4989
|
+
b?: ArrayConstant
|
|
4990
|
+
/**
|
|
4991
|
+
* Corner radii.
|
|
4992
|
+
*/
|
|
4993
|
+
corners?: ArrayConstant
|
|
4994
|
+
}): Image;
|
|
4995
|
+
|
|
4922
4996
|
/**
|
|
4923
4997
|
* Make a 2d sine wave.
|
|
4924
4998
|
* @param width Image width in pixels.
|
|
@@ -5862,6 +5936,12 @@ declare module Vips {
|
|
|
5862
5936
|
*/
|
|
5863
5937
|
add(right: Image | ArrayConstant): Image;
|
|
5864
5938
|
|
|
5939
|
+
/**
|
|
5940
|
+
* Append an alpha channel.
|
|
5941
|
+
* @return Output image.
|
|
5942
|
+
*/
|
|
5943
|
+
addalpha(): Image;
|
|
5944
|
+
|
|
5865
5945
|
/**
|
|
5866
5946
|
* Affine transform of an image.
|
|
5867
5947
|
* @param matrix Transformation matrix.
|
|
@@ -5986,26 +6066,6 @@ declare module Vips {
|
|
|
5986
6066
|
*/
|
|
5987
6067
|
byteswap(): Image;
|
|
5988
6068
|
|
|
5989
|
-
/**
|
|
5990
|
-
* Cache an image.
|
|
5991
|
-
* @param options Optional options.
|
|
5992
|
-
* @return Output image.
|
|
5993
|
-
*/
|
|
5994
|
-
cache(options?: {
|
|
5995
|
-
/**
|
|
5996
|
-
* Maximum number of tiles to cache.
|
|
5997
|
-
*/
|
|
5998
|
-
max_tiles?: number
|
|
5999
|
-
/**
|
|
6000
|
-
* Tile height in pixels.
|
|
6001
|
-
*/
|
|
6002
|
-
tile_height?: number
|
|
6003
|
-
/**
|
|
6004
|
-
* Tile width in pixels.
|
|
6005
|
-
*/
|
|
6006
|
-
tile_width?: number
|
|
6007
|
-
}): Image;
|
|
6008
|
-
|
|
6009
6069
|
/**
|
|
6010
6070
|
* Canny edge detector.
|
|
6011
6071
|
* @param options Optional options.
|
|
@@ -6042,6 +6102,22 @@ declare module Vips {
|
|
|
6042
6102
|
shift?: boolean
|
|
6043
6103
|
}): Image;
|
|
6044
6104
|
|
|
6105
|
+
/**
|
|
6106
|
+
* Clamp values of an image.
|
|
6107
|
+
* @param options Optional options.
|
|
6108
|
+
* @return Output image.
|
|
6109
|
+
*/
|
|
6110
|
+
clamp(options?: {
|
|
6111
|
+
/**
|
|
6112
|
+
* Minimum value.
|
|
6113
|
+
*/
|
|
6114
|
+
min?: number
|
|
6115
|
+
/**
|
|
6116
|
+
* Maximum value.
|
|
6117
|
+
*/
|
|
6118
|
+
max?: number
|
|
6119
|
+
}): Image;
|
|
6120
|
+
|
|
6045
6121
|
/**
|
|
6046
6122
|
* Convert to a new colorspace.
|
|
6047
6123
|
* @param space Destination color space.
|
|
@@ -6898,9 +6974,15 @@ declare module Vips {
|
|
|
6898
6974
|
* Read a point from an image.
|
|
6899
6975
|
* @param x Point to read.
|
|
6900
6976
|
* @param y Point to read.
|
|
6977
|
+
* @param options Optional options.
|
|
6901
6978
|
* @return Array of output values.
|
|
6902
6979
|
*/
|
|
6903
|
-
getpoint(x: number, y: number
|
|
6980
|
+
getpoint(x: number, y: number, options?: {
|
|
6981
|
+
/**
|
|
6982
|
+
* Complex pixels should be unpacked.
|
|
6983
|
+
*/
|
|
6984
|
+
unpack_complex?: boolean
|
|
6985
|
+
}): number[];
|
|
6904
6986
|
|
|
6905
6987
|
/**
|
|
6906
6988
|
* Save as gif.
|
|
@@ -7574,7 +7656,7 @@ declare module Vips {
|
|
|
7574
7656
|
|
|
7575
7657
|
/**
|
|
7576
7658
|
* Save image in jpeg2000 format.
|
|
7577
|
-
* @param filename Filename to
|
|
7659
|
+
* @param filename Filename to save to.
|
|
7578
7660
|
* @param options Optional options.
|
|
7579
7661
|
*/
|
|
7580
7662
|
jp2ksave(filename: string, options?: {
|
|
@@ -7945,7 +8027,7 @@ declare module Vips {
|
|
|
7945
8027
|
|
|
7946
8028
|
/**
|
|
7947
8029
|
* Save image in jpeg-xl format.
|
|
7948
|
-
* @param filename Filename to
|
|
8030
|
+
* @param filename Filename to save to.
|
|
7949
8031
|
* @param options Optional options.
|
|
7950
8032
|
*/
|
|
7951
8033
|
jxlsave(filename: string, options?: {
|
|
@@ -8408,6 +8490,13 @@ declare module Vips {
|
|
|
8408
8490
|
y_array?: number[] | undefined
|
|
8409
8491
|
}): number;
|
|
8410
8492
|
|
|
8493
|
+
/**
|
|
8494
|
+
* Maximum of a pair of images.
|
|
8495
|
+
* @param right Right-hand image argument.
|
|
8496
|
+
* @return Output image.
|
|
8497
|
+
*/
|
|
8498
|
+
maxpair(right: Image | ArrayConstant): Image;
|
|
8499
|
+
|
|
8411
8500
|
/**
|
|
8412
8501
|
* Measure a set of patches on a color chart.
|
|
8413
8502
|
* @param h Number of patches across chart.
|
|
@@ -8482,6 +8571,13 @@ declare module Vips {
|
|
|
8482
8571
|
y_array?: number[] | undefined
|
|
8483
8572
|
}): number;
|
|
8484
8573
|
|
|
8574
|
+
/**
|
|
8575
|
+
* Minimum of a pair of images.
|
|
8576
|
+
* @param right Right-hand image argument.
|
|
8577
|
+
* @return Output image.
|
|
8578
|
+
*/
|
|
8579
|
+
minpair(right: Image | ArrayConstant): Image;
|
|
8580
|
+
|
|
8485
8581
|
/**
|
|
8486
8582
|
* Morphology operation.
|
|
8487
8583
|
* @param mask Input matrix image.
|
|
@@ -9022,11 +9118,35 @@ declare module Vips {
|
|
|
9022
9118
|
}): void;
|
|
9023
9119
|
|
|
9024
9120
|
/**
|
|
9025
|
-
* Write raw image to
|
|
9026
|
-
* @param fd File descriptor to write to.
|
|
9121
|
+
* Write raw image to buffer.
|
|
9027
9122
|
* @param options Optional options.
|
|
9123
|
+
* @return Buffer to save to.
|
|
9028
9124
|
*/
|
|
9029
|
-
|
|
9125
|
+
rawsaveBuffer(options?: {
|
|
9126
|
+
/**
|
|
9127
|
+
* Which metadata to retain.
|
|
9128
|
+
*/
|
|
9129
|
+
keep?: ForeignKeep | Flag
|
|
9130
|
+
/**
|
|
9131
|
+
* Background value.
|
|
9132
|
+
*/
|
|
9133
|
+
background?: ArrayConstant
|
|
9134
|
+
/**
|
|
9135
|
+
* Set page height for multipage save.
|
|
9136
|
+
*/
|
|
9137
|
+
page_height?: number
|
|
9138
|
+
/**
|
|
9139
|
+
* Filename of icc profile to embed.
|
|
9140
|
+
*/
|
|
9141
|
+
profile?: string
|
|
9142
|
+
}): Uint8Array;
|
|
9143
|
+
|
|
9144
|
+
/**
|
|
9145
|
+
* Write raw image to target.
|
|
9146
|
+
* @param target Target to save to.
|
|
9147
|
+
* @param options Optional options.
|
|
9148
|
+
*/
|
|
9149
|
+
rawsaveTarget(target: Target, options?: {
|
|
9030
9150
|
/**
|
|
9031
9151
|
* Which metadata to retain.
|
|
9032
9152
|
*/
|
|
@@ -9169,7 +9289,7 @@ declare module Vips {
|
|
|
9169
9289
|
|
|
9170
9290
|
/**
|
|
9171
9291
|
* Rotate an image by a number of degrees.
|
|
9172
|
-
* @param angle Rotate
|
|
9292
|
+
* @param angle Rotate clockwise by this many degrees.
|
|
9173
9293
|
* @param options Optional options.
|
|
9174
9294
|
* @return Output image.
|
|
9175
9295
|
*/
|
|
@@ -9372,7 +9492,7 @@ declare module Vips {
|
|
|
9372
9492
|
*/
|
|
9373
9493
|
scale?: number
|
|
9374
9494
|
/**
|
|
9375
|
-
* Rotate
|
|
9495
|
+
* Rotate clockwise by this many degrees.
|
|
9376
9496
|
*/
|
|
9377
9497
|
angle?: number
|
|
9378
9498
|
/**
|
|
@@ -9611,7 +9731,7 @@ declare module Vips {
|
|
|
9611
9731
|
*/
|
|
9612
9732
|
region_shrink?: RegionShrink | Enum
|
|
9613
9733
|
/**
|
|
9614
|
-
*
|
|
9734
|
+
* Deflate (1-9, default 6) or zstd (1-22, default 9) compression level.
|
|
9615
9735
|
*/
|
|
9616
9736
|
level?: number
|
|
9617
9737
|
/**
|
|
@@ -9715,7 +9835,7 @@ declare module Vips {
|
|
|
9715
9835
|
*/
|
|
9716
9836
|
region_shrink?: RegionShrink | Enum
|
|
9717
9837
|
/**
|
|
9718
|
-
*
|
|
9838
|
+
* Deflate (1-9, default 6) or zstd (1-22, default 9) compression level.
|
|
9719
9839
|
*/
|
|
9720
9840
|
level?: number
|
|
9721
9841
|
/**
|
|
@@ -9819,7 +9939,7 @@ declare module Vips {
|
|
|
9819
9939
|
*/
|
|
9820
9940
|
region_shrink?: RegionShrink | Enum
|
|
9821
9941
|
/**
|
|
9822
|
-
*
|
|
9942
|
+
* Deflate (1-9, default 6) or zstd (1-22, default 9) compression level.
|
|
9823
9943
|
*/
|
|
9824
9944
|
level?: number
|
|
9825
9945
|
/**
|
|
@@ -10010,10 +10130,22 @@ declare module Vips {
|
|
|
10010
10130
|
* Level of cpu effort to reduce file size.
|
|
10011
10131
|
*/
|
|
10012
10132
|
effort?: number
|
|
10133
|
+
/**
|
|
10134
|
+
* Desired target size in bytes.
|
|
10135
|
+
*/
|
|
10136
|
+
target_size?: number
|
|
10013
10137
|
/**
|
|
10014
10138
|
* Allow mixed encoding (might reduce file size).
|
|
10015
10139
|
*/
|
|
10016
10140
|
mixed?: boolean
|
|
10141
|
+
/**
|
|
10142
|
+
* Enable auto-adjusting of the deblocking filter.
|
|
10143
|
+
*/
|
|
10144
|
+
smart_deblock?: boolean
|
|
10145
|
+
/**
|
|
10146
|
+
* Number of entropy-analysis passes (in [1..10]).
|
|
10147
|
+
*/
|
|
10148
|
+
passes?: number
|
|
10017
10149
|
/**
|
|
10018
10150
|
* Which metadata to retain.
|
|
10019
10151
|
*/
|
|
@@ -10078,10 +10210,22 @@ declare module Vips {
|
|
|
10078
10210
|
* Level of cpu effort to reduce file size.
|
|
10079
10211
|
*/
|
|
10080
10212
|
effort?: number
|
|
10213
|
+
/**
|
|
10214
|
+
* Desired target size in bytes.
|
|
10215
|
+
*/
|
|
10216
|
+
target_size?: number
|
|
10081
10217
|
/**
|
|
10082
10218
|
* Allow mixed encoding (might reduce file size).
|
|
10083
10219
|
*/
|
|
10084
10220
|
mixed?: boolean
|
|
10221
|
+
/**
|
|
10222
|
+
* Enable auto-adjusting of the deblocking filter.
|
|
10223
|
+
*/
|
|
10224
|
+
smart_deblock?: boolean
|
|
10225
|
+
/**
|
|
10226
|
+
* Number of entropy-analysis passes (in [1..10]).
|
|
10227
|
+
*/
|
|
10228
|
+
passes?: number
|
|
10085
10229
|
/**
|
|
10086
10230
|
* Which metadata to retain.
|
|
10087
10231
|
*/
|
|
@@ -10145,10 +10289,22 @@ declare module Vips {
|
|
|
10145
10289
|
* Level of cpu effort to reduce file size.
|
|
10146
10290
|
*/
|
|
10147
10291
|
effort?: number
|
|
10292
|
+
/**
|
|
10293
|
+
* Desired target size in bytes.
|
|
10294
|
+
*/
|
|
10295
|
+
target_size?: number
|
|
10148
10296
|
/**
|
|
10149
10297
|
* Allow mixed encoding (might reduce file size).
|
|
10150
10298
|
*/
|
|
10151
10299
|
mixed?: boolean
|
|
10300
|
+
/**
|
|
10301
|
+
* Enable auto-adjusting of the deblocking filter.
|
|
10302
|
+
*/
|
|
10303
|
+
smart_deblock?: boolean
|
|
10304
|
+
/**
|
|
10305
|
+
* Number of entropy-analysis passes (in [1..10]).
|
|
10306
|
+
*/
|
|
10307
|
+
passes?: number
|
|
10152
10308
|
/**
|
|
10153
10309
|
* Which metadata to retain.
|
|
10154
10310
|
*/
|
|
@@ -10213,10 +10369,22 @@ declare module Vips {
|
|
|
10213
10369
|
* Level of cpu effort to reduce file size.
|
|
10214
10370
|
*/
|
|
10215
10371
|
effort?: number
|
|
10372
|
+
/**
|
|
10373
|
+
* Desired target size in bytes.
|
|
10374
|
+
*/
|
|
10375
|
+
target_size?: number
|
|
10216
10376
|
/**
|
|
10217
10377
|
* Allow mixed encoding (might reduce file size).
|
|
10218
10378
|
*/
|
|
10219
10379
|
mixed?: boolean
|
|
10380
|
+
/**
|
|
10381
|
+
* Enable auto-adjusting of the deblocking filter.
|
|
10382
|
+
*/
|
|
10383
|
+
smart_deblock?: boolean
|
|
10384
|
+
/**
|
|
10385
|
+
* Number of entropy-analysis passes (in [1..10]).
|
|
10386
|
+
*/
|
|
10387
|
+
passes?: number
|
|
10220
10388
|
/**
|
|
10221
10389
|
* Which metadata to retain.
|
|
10222
10390
|
*/
|