rust-editor 0.1.6 → 0.1.8
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/package.json +1 -1
- package/rust_editor.d.ts +4 -10
- package/rust_editor.js +32 -80
- package/rust_editor_bg.wasm +0 -0
package/package.json
CHANGED
package/rust_editor.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function resize(image_data: Uint8Array, height: number, width: number): Uint8Array;
|
|
4
|
-
export function resize_exact(image_data: Uint8Array, width: number, height: number): Uint8Array;
|
|
5
|
-
export function resize_one_side(image_data: Uint8Array, width: number, height: number): Uint8Array;
|
|
6
|
-
export function crop(image_data: Uint8Array, x: number, y: number, width: number, height: number): Uint8Array;
|
|
7
|
-
export function change_scale_image(image_data: Uint8Array, scale: number): Uint8Array;
|
|
8
3
|
export function get_size(image_data: Uint8Array): Uint32Array;
|
|
9
4
|
export function switch_color(image_source: Uint8Array, image_reference: Uint8Array): Uint8Array;
|
|
10
5
|
export function blur(image_data: Uint8Array, radius: number): Uint8Array;
|
|
@@ -12,6 +7,8 @@ export function sharpen(image_data: Uint8Array, radius: number): Uint8Array;
|
|
|
12
7
|
export function fix_size_image(image_data: Uint8Array): Uint8Array;
|
|
13
8
|
export function grayscale_image(image_data: Uint8Array): Uint8Array;
|
|
14
9
|
export function adjust_saturation_image(image_data: Uint8Array, saturation: number): Uint8Array;
|
|
10
|
+
export function adjust_temperature_image(image_data: Uint8Array, temperature: number): Uint8Array;
|
|
11
|
+
export function adjust_tint_image(image_data: Uint8Array, tint: number): Uint8Array;
|
|
15
12
|
export function adjust_exposure_image(image_data: Uint8Array, exposure: number): Uint8Array;
|
|
16
13
|
export function adjust_contrasts_image(image_data: Uint8Array, contrasts: number): Uint8Array;
|
|
17
14
|
|
|
@@ -19,11 +16,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
19
16
|
|
|
20
17
|
export interface InitOutput {
|
|
21
18
|
readonly memory: WebAssembly.Memory;
|
|
22
|
-
readonly resize: (a: number, b: number, c: number, d: number) => [number, number];
|
|
23
|
-
readonly resize_exact: (a: number, b: number, c: number, d: number) => [number, number];
|
|
24
|
-
readonly resize_one_side: (a: number, b: number, c: number, d: number) => [number, number];
|
|
25
|
-
readonly crop: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
26
|
-
readonly change_scale_image: (a: number, b: number, c: number) => [number, number];
|
|
27
19
|
readonly get_size: (a: number, b: number) => [number, number];
|
|
28
20
|
readonly switch_color: (a: number, b: number, c: number, d: number) => [number, number];
|
|
29
21
|
readonly blur: (a: number, b: number, c: number) => [number, number];
|
|
@@ -31,6 +23,8 @@ export interface InitOutput {
|
|
|
31
23
|
readonly fix_size_image: (a: number, b: number) => [number, number];
|
|
32
24
|
readonly grayscale_image: (a: number, b: number) => [number, number];
|
|
33
25
|
readonly adjust_saturation_image: (a: number, b: number, c: number) => [number, number];
|
|
26
|
+
readonly adjust_temperature_image: (a: number, b: number, c: number) => [number, number];
|
|
27
|
+
readonly adjust_tint_image: (a: number, b: number, c: number) => [number, number];
|
|
34
28
|
readonly adjust_exposure_image: (a: number, b: number, c: number) => [number, number];
|
|
35
29
|
readonly adjust_contrasts_image: (a: number, b: number, c: number) => [number, number];
|
|
36
30
|
readonly __wbindgen_export_0: WebAssembly.Table;
|
package/rust_editor.js
CHANGED
|
@@ -18,86 +18,6 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
18
18
|
return ptr;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
22
|
-
ptr = ptr >>> 0;
|
|
23
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @param {Uint8Array} image_data
|
|
27
|
-
* @param {number} height
|
|
28
|
-
* @param {number} width
|
|
29
|
-
* @returns {Uint8Array}
|
|
30
|
-
*/
|
|
31
|
-
export function resize(image_data, height, width) {
|
|
32
|
-
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
33
|
-
const len0 = WASM_VECTOR_LEN;
|
|
34
|
-
const ret = wasm.resize(ptr0, len0, height, width);
|
|
35
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
36
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
37
|
-
return v2;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @param {Uint8Array} image_data
|
|
42
|
-
* @param {number} width
|
|
43
|
-
* @param {number} height
|
|
44
|
-
* @returns {Uint8Array}
|
|
45
|
-
*/
|
|
46
|
-
export function resize_exact(image_data, width, height) {
|
|
47
|
-
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
48
|
-
const len0 = WASM_VECTOR_LEN;
|
|
49
|
-
const ret = wasm.resize_exact(ptr0, len0, width, height);
|
|
50
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
51
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
52
|
-
return v2;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @param {Uint8Array} image_data
|
|
57
|
-
* @param {number} width
|
|
58
|
-
* @param {number} height
|
|
59
|
-
* @returns {Uint8Array}
|
|
60
|
-
*/
|
|
61
|
-
export function resize_one_side(image_data, width, height) {
|
|
62
|
-
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
63
|
-
const len0 = WASM_VECTOR_LEN;
|
|
64
|
-
const ret = wasm.resize_one_side(ptr0, len0, width, height);
|
|
65
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
66
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
67
|
-
return v2;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @param {Uint8Array} image_data
|
|
72
|
-
* @param {number} x
|
|
73
|
-
* @param {number} y
|
|
74
|
-
* @param {number} width
|
|
75
|
-
* @param {number} height
|
|
76
|
-
* @returns {Uint8Array}
|
|
77
|
-
*/
|
|
78
|
-
export function crop(image_data, x, y, width, height) {
|
|
79
|
-
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
80
|
-
const len0 = WASM_VECTOR_LEN;
|
|
81
|
-
const ret = wasm.crop(ptr0, len0, x, y, width, height);
|
|
82
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
83
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
84
|
-
return v2;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @param {Uint8Array} image_data
|
|
89
|
-
* @param {number} scale
|
|
90
|
-
* @returns {Uint8Array}
|
|
91
|
-
*/
|
|
92
|
-
export function change_scale_image(image_data, scale) {
|
|
93
|
-
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
94
|
-
const len0 = WASM_VECTOR_LEN;
|
|
95
|
-
const ret = wasm.change_scale_image(ptr0, len0, scale);
|
|
96
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
97
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
98
|
-
return v2;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
21
|
let cachedUint32ArrayMemory0 = null;
|
|
102
22
|
|
|
103
23
|
function getUint32ArrayMemory0() {
|
|
@@ -124,6 +44,10 @@ export function get_size(image_data) {
|
|
|
124
44
|
return v2;
|
|
125
45
|
}
|
|
126
46
|
|
|
47
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
48
|
+
ptr = ptr >>> 0;
|
|
49
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
50
|
+
}
|
|
127
51
|
/**
|
|
128
52
|
* @param {Uint8Array} image_source
|
|
129
53
|
* @param {Uint8Array} image_reference
|
|
@@ -208,6 +132,34 @@ export function adjust_saturation_image(image_data, saturation) {
|
|
|
208
132
|
return v2;
|
|
209
133
|
}
|
|
210
134
|
|
|
135
|
+
/**
|
|
136
|
+
* @param {Uint8Array} image_data
|
|
137
|
+
* @param {number} temperature
|
|
138
|
+
* @returns {Uint8Array}
|
|
139
|
+
*/
|
|
140
|
+
export function adjust_temperature_image(image_data, temperature) {
|
|
141
|
+
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
142
|
+
const len0 = WASM_VECTOR_LEN;
|
|
143
|
+
const ret = wasm.adjust_temperature_image(ptr0, len0, temperature);
|
|
144
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
145
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
146
|
+
return v2;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @param {Uint8Array} image_data
|
|
151
|
+
* @param {number} tint
|
|
152
|
+
* @returns {Uint8Array}
|
|
153
|
+
*/
|
|
154
|
+
export function adjust_tint_image(image_data, tint) {
|
|
155
|
+
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
156
|
+
const len0 = WASM_VECTOR_LEN;
|
|
157
|
+
const ret = wasm.adjust_tint_image(ptr0, len0, tint);
|
|
158
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
159
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
160
|
+
return v2;
|
|
161
|
+
}
|
|
162
|
+
|
|
211
163
|
/**
|
|
212
164
|
* @param {Uint8Array} image_data
|
|
213
165
|
* @param {number} exposure
|
package/rust_editor_bg.wasm
CHANGED
|
Binary file
|