rust-editor 0.1.8 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rust-editor",
3
3
  "type": "module",
4
- "version": "0.1.8",
4
+ "version": "0.2.0",
5
5
  "files": [
6
6
  "rust_editor_bg.wasm",
7
7
  "rust_editor.js",
package/rust_editor.d.ts CHANGED
@@ -11,6 +11,7 @@ export function adjust_temperature_image(image_data: Uint8Array, temperature: nu
11
11
  export function adjust_tint_image(image_data: Uint8Array, tint: number): Uint8Array;
12
12
  export function adjust_exposure_image(image_data: Uint8Array, exposure: number): Uint8Array;
13
13
  export function adjust_contrasts_image(image_data: Uint8Array, contrasts: number): Uint8Array;
14
+ export function adjust_color_image(image_data: Uint8Array, saturation: number, temperature: number, tint: number): Uint8Array;
14
15
 
15
16
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
16
17
 
@@ -27,6 +28,7 @@ export interface InitOutput {
27
28
  readonly adjust_tint_image: (a: number, b: number, c: number) => [number, number];
28
29
  readonly adjust_exposure_image: (a: number, b: number, c: number) => [number, number];
29
30
  readonly adjust_contrasts_image: (a: number, b: number, c: number) => [number, number];
31
+ readonly adjust_color_image: (a: number, b: number, c: number, d: number, e: 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
@@ -188,6 +188,22 @@ export function adjust_contrasts_image(image_data, contrasts) {
188
188
  return v2;
189
189
  }
190
190
 
191
+ /**
192
+ * @param {Uint8Array} image_data
193
+ * @param {number} saturation
194
+ * @param {number} temperature
195
+ * @param {number} tint
196
+ * @returns {Uint8Array}
197
+ */
198
+ export function adjust_color_image(image_data, saturation, temperature, tint) {
199
+ const ptr0 = passArray8ToWasm0(image_data, wasm.__wbindgen_malloc);
200
+ const len0 = WASM_VECTOR_LEN;
201
+ const ret = wasm.adjust_color_image(ptr0, len0, saturation, temperature, tint);
202
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
203
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
204
+ return v2;
205
+ }
206
+
191
207
  async function __wbg_load(module, imports) {
192
208
  if (typeof Response === 'function' && module instanceof Response) {
193
209
  if (typeof WebAssembly.instantiateStreaming === 'function') {
Binary file