rust-editor 0.1.0 → 0.1.2
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 -2
- package/rust_editor.js +22 -7
- package/rust_editor_bg.wasm +0 -0
package/package.json
CHANGED
package/rust_editor.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ export function switch_color(image_source: Uint8Array, image_reference: Uint8Arr
|
|
|
10
10
|
export function blur(image_data: Uint8Array, radius: number): Uint8Array;
|
|
11
11
|
export function sharpen(image_data: Uint8Array, radius: number): Uint8Array;
|
|
12
12
|
export function fix_size_image(image_data: Uint8Array): Uint8Array;
|
|
13
|
-
export function
|
|
13
|
+
export function grayscale_image(image_data: Uint8Array): Uint8Array;
|
|
14
|
+
export function adjust_saturation_image(image_data: Uint8Array, saturation: number): Uint8Array;
|
|
14
15
|
|
|
15
16
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
16
17
|
|
|
@@ -26,7 +27,8 @@ export interface InitOutput {
|
|
|
26
27
|
readonly blur: (a: number, b: number, c: number) => [number, number];
|
|
27
28
|
readonly sharpen: (a: number, b: number, c: number) => [number, number];
|
|
28
29
|
readonly fix_size_image: (a: number, b: number) => [number, number];
|
|
29
|
-
readonly
|
|
30
|
+
readonly grayscale_image: (a: number, b: number) => [number, number];
|
|
31
|
+
readonly adjust_saturation_image: (a: number, b: number, c: number) => [number, number];
|
|
30
32
|
readonly __wbindgen_export_0: WebAssembly.Table;
|
|
31
33
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
32
34
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
package/rust_editor.js
CHANGED
|
@@ -182,15 +182,30 @@ export function fix_size_image(image_data) {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
|
-
* @param {Uint8Array}
|
|
186
|
-
* @
|
|
185
|
+
* @param {Uint8Array} image_data
|
|
186
|
+
* @returns {Uint8Array}
|
|
187
187
|
*/
|
|
188
|
-
export function
|
|
189
|
-
const ptr0 = passArray8ToWasm0(
|
|
188
|
+
export function grayscale_image(image_data) {
|
|
189
|
+
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
190
190
|
const len0 = WASM_VECTOR_LEN;
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
wasm.
|
|
191
|
+
const ret = wasm.grayscale_image(ptr0, len0);
|
|
192
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
193
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
194
|
+
return v2;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @param {Uint8Array} image_data
|
|
199
|
+
* @param {number} saturation
|
|
200
|
+
* @returns {Uint8Array}
|
|
201
|
+
*/
|
|
202
|
+
export function adjust_saturation_image(image_data, saturation) {
|
|
203
|
+
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
204
|
+
const len0 = WASM_VECTOR_LEN;
|
|
205
|
+
const ret = wasm.adjust_saturation_image(ptr0, len0, saturation);
|
|
206
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
207
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
208
|
+
return v2;
|
|
194
209
|
}
|
|
195
210
|
|
|
196
211
|
async function __wbg_load(module, imports) {
|
package/rust_editor_bg.wasm
CHANGED
|
Binary file
|