rust-editor 0.1.2 → 0.1.4
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 -0
- package/rust_editor.js +28 -0
- package/rust_editor_bg.wasm +0 -0
package/package.json
CHANGED
package/rust_editor.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export function sharpen(image_data: Uint8Array, radius: number): Uint8Array;
|
|
|
12
12
|
export function fix_size_image(image_data: Uint8Array): Uint8Array;
|
|
13
13
|
export function grayscale_image(image_data: Uint8Array): Uint8Array;
|
|
14
14
|
export function adjust_saturation_image(image_data: Uint8Array, saturation: number): Uint8Array;
|
|
15
|
+
export function adjust_exposure_image(image_data: Uint8Array, exposure: number): Uint8Array;
|
|
16
|
+
export function adjust_contrasts_image(image_data: Uint8Array, contrasts: number): Uint8Array;
|
|
15
17
|
|
|
16
18
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
17
19
|
|
|
@@ -29,6 +31,8 @@ export interface InitOutput {
|
|
|
29
31
|
readonly fix_size_image: (a: number, b: number) => [number, number];
|
|
30
32
|
readonly grayscale_image: (a: number, b: number) => [number, number];
|
|
31
33
|
readonly adjust_saturation_image: (a: number, b: number, c: number) => [number, number];
|
|
34
|
+
readonly adjust_exposure_image: (a: number, b: number, c: number) => [number, number];
|
|
35
|
+
readonly adjust_contrasts_image: (a: number, b: number, c: number) => [number, number];
|
|
32
36
|
readonly __wbindgen_export_0: WebAssembly.Table;
|
|
33
37
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
34
38
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
package/rust_editor.js
CHANGED
|
@@ -208,6 +208,34 @@ export function adjust_saturation_image(image_data, saturation) {
|
|
|
208
208
|
return v2;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
/**
|
|
212
|
+
* @param {Uint8Array} image_data
|
|
213
|
+
* @param {number} exposure
|
|
214
|
+
* @returns {Uint8Array}
|
|
215
|
+
*/
|
|
216
|
+
export function adjust_exposure_image(image_data, exposure) {
|
|
217
|
+
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
218
|
+
const len0 = WASM_VECTOR_LEN;
|
|
219
|
+
const ret = wasm.adjust_exposure_image(ptr0, len0, exposure);
|
|
220
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
221
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
222
|
+
return v2;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @param {Uint8Array} image_data
|
|
227
|
+
* @param {number} contrasts
|
|
228
|
+
* @returns {Uint8Array}
|
|
229
|
+
*/
|
|
230
|
+
export function adjust_contrasts_image(image_data, contrasts) {
|
|
231
|
+
const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
|
|
232
|
+
const len0 = WASM_VECTOR_LEN;
|
|
233
|
+
const ret = wasm.adjust_contrasts_image(ptr0, len0, contrasts);
|
|
234
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
235
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
236
|
+
return v2;
|
|
237
|
+
}
|
|
238
|
+
|
|
211
239
|
async function __wbg_load(module, imports) {
|
|
212
240
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
213
241
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
package/rust_editor_bg.wasm
CHANGED
|
Binary file
|