k-centroid-scaler 1.3.2 → 1.3.3
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/k_centroid_scaler.d.ts +103 -0
- package/k_centroid_scaler_bg.wasm +0 -0
- package/package.json +4 -2
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export function k_centroid_resize(image_data: Uint8Array, original_width: number, original_height: number, target_width: number, target_height: number, centroids: number, iterations: number): ImageResult;
|
|
4
|
+
export function quantize_perceptual(image_data: Uint8Array, width: number, height: number, num_colors: number, dithering: boolean): ImageResult;
|
|
5
|
+
export function quantize_colors_median_cut(image_data: Uint8Array, width: number, height: number, num_colors: number, dithering: boolean): ImageResult;
|
|
6
|
+
export function extract_palette(image_data: Uint8Array, num_colors: number): ColorPalette;
|
|
7
|
+
export function analyze_colors(image_data: Uint8Array, max_colors: number, sort_method: string): ColorAnalysis;
|
|
8
|
+
export function get_dominant_colors(image_data: Uint8Array, num_colors: number, min_coverage: number): ColorAnalysis;
|
|
9
|
+
export class ColorAnalysis {
|
|
10
|
+
private constructor();
|
|
11
|
+
free(): void;
|
|
12
|
+
[Symbol.dispose](): void;
|
|
13
|
+
total_colors: number;
|
|
14
|
+
total_pixels: number;
|
|
15
|
+
readonly colors: any[];
|
|
16
|
+
}
|
|
17
|
+
export class ColorInfo {
|
|
18
|
+
private constructor();
|
|
19
|
+
free(): void;
|
|
20
|
+
[Symbol.dispose](): void;
|
|
21
|
+
readonly hex: string;
|
|
22
|
+
readonly percentage: number;
|
|
23
|
+
readonly count: number;
|
|
24
|
+
readonly r: number;
|
|
25
|
+
readonly g: number;
|
|
26
|
+
readonly b: number;
|
|
27
|
+
}
|
|
28
|
+
export class ColorPalette {
|
|
29
|
+
private constructor();
|
|
30
|
+
free(): void;
|
|
31
|
+
[Symbol.dispose](): void;
|
|
32
|
+
count: number;
|
|
33
|
+
readonly colors: Uint8Array;
|
|
34
|
+
}
|
|
35
|
+
export class ImageResult {
|
|
36
|
+
private constructor();
|
|
37
|
+
free(): void;
|
|
38
|
+
[Symbol.dispose](): void;
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
readonly data: Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
45
|
+
|
|
46
|
+
export interface InitOutput {
|
|
47
|
+
readonly memory: WebAssembly.Memory;
|
|
48
|
+
readonly __wbg_imageresult_free: (a: number, b: number) => void;
|
|
49
|
+
readonly imageresult_data: (a: number, b: number) => void;
|
|
50
|
+
readonly __wbg_colorpalette_free: (a: number, b: number) => void;
|
|
51
|
+
readonly __wbg_set_colorpalette_count: (a: number, b: number) => void;
|
|
52
|
+
readonly colorpalette_colors: (a: number, b: number) => void;
|
|
53
|
+
readonly __wbg_colorinfo_free: (a: number, b: number) => void;
|
|
54
|
+
readonly colorinfo_hex: (a: number, b: number) => void;
|
|
55
|
+
readonly colorinfo_percentage: (a: number) => number;
|
|
56
|
+
readonly colorinfo_count: (a: number) => number;
|
|
57
|
+
readonly colorinfo_r: (a: number) => number;
|
|
58
|
+
readonly colorinfo_g: (a: number) => number;
|
|
59
|
+
readonly colorinfo_b: (a: number) => number;
|
|
60
|
+
readonly __wbg_coloranalysis_free: (a: number, b: number) => void;
|
|
61
|
+
readonly __wbg_get_coloranalysis_total_colors: (a: number) => number;
|
|
62
|
+
readonly __wbg_set_coloranalysis_total_colors: (a: number, b: number) => void;
|
|
63
|
+
readonly __wbg_get_coloranalysis_total_pixels: (a: number) => number;
|
|
64
|
+
readonly __wbg_set_coloranalysis_total_pixels: (a: number, b: number) => void;
|
|
65
|
+
readonly coloranalysis_colors: (a: number, b: number) => void;
|
|
66
|
+
readonly k_centroid_resize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
67
|
+
readonly quantize_perceptual: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
68
|
+
readonly quantize_colors_median_cut: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
69
|
+
readonly extract_palette: (a: number, b: number, c: number) => number;
|
|
70
|
+
readonly analyze_colors: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
71
|
+
readonly get_dominant_colors: (a: number, b: number, c: number, d: number) => number;
|
|
72
|
+
readonly __wbg_set_imageresult_width: (a: number, b: number) => void;
|
|
73
|
+
readonly __wbg_set_imageresult_height: (a: number, b: number) => void;
|
|
74
|
+
readonly __wbg_get_imageresult_width: (a: number) => number;
|
|
75
|
+
readonly __wbg_get_imageresult_height: (a: number) => number;
|
|
76
|
+
readonly __wbg_get_colorpalette_count: (a: number) => number;
|
|
77
|
+
readonly __wbindgen_export_0: (a: number) => void;
|
|
78
|
+
readonly __wbindgen_export_1: (a: number, b: number) => number;
|
|
79
|
+
readonly __wbindgen_export_2: (a: number, b: number, c: number, d: number) => number;
|
|
80
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
81
|
+
readonly __wbindgen_export_3: (a: number, b: number, c: number) => void;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
85
|
+
/**
|
|
86
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
87
|
+
* a precompiled `WebAssembly.Module`.
|
|
88
|
+
*
|
|
89
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
90
|
+
*
|
|
91
|
+
* @returns {InitOutput}
|
|
92
|
+
*/
|
|
93
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
97
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
98
|
+
*
|
|
99
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
100
|
+
*
|
|
101
|
+
* @returns {Promise<InitOutput>}
|
|
102
|
+
*/
|
|
103
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "k-centroid-scaler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.3",
|
|
5
5
|
"files": [
|
|
6
6
|
"k_centroid_scaler_bg.wasm",
|
|
7
|
-
"k_centroid_scaler.js"
|
|
7
|
+
"k_centroid_scaler.js",
|
|
8
|
+
"k_centroid_scaler.d.ts"
|
|
8
9
|
],
|
|
9
10
|
"main": "k_centroid_scaler.js",
|
|
11
|
+
"types": "k_centroid_scaler.d.ts",
|
|
10
12
|
"sideEffects": [
|
|
11
13
|
"./snippets/*"
|
|
12
14
|
]
|