-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
63 lines (61 loc) · 1.94 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export const enum Preset {
Bw = 0,
Poster = 1,
Photo = 2,
}
export const enum ColorMode {
Color = 0,
Binary = 1,
}
export const enum Hierarchical {
Stacked = 0,
Cutout = 1,
}
export const enum PathSimplifyMode {
None = 0,
Polygon = 1,
Spline = 2,
}
export interface Config {
/** True color image or binary image (black and white) */
colorMode: ColorMode;
/** Hierarchial clustering or non-stacked. Only applicable to color images. */
hierarchical: Hierarchical;
/** Discard patches smaller than X pixels in size (cleaner) */
filterSpeckle: number;
/** The number of significant bits to use in an RGB channel (more accurate) */
colorPrecision: number;
/** The color difference between gradient layers (less layers) */
layerDifference: number;
/** Curve fitting mode */
mode: PathSimplifyMode;
/** Minimum momentary angle (degree) to be considered a corner (smoother) */
cornerThreshold: number;
/** Perform iterative subdivide smooth until all segments are shorter than this length */
lengthThreshold: number;
/** The maximum number of iterations to perform */
maxIterations: number;
/** Minimum angle displacement (degree) to splice a spline (less accurate) */
spliceThreshold: number;
/** Number of decimal places to use in path string */
pathPrecision?: number;
}
export interface RawDataConfig {
width: number;
height: number;
}
export declare function vectorize(source: Buffer, config?: Config | Preset | undefined | null): Promise<string>;
export declare function vectorizeRaw(
source: Buffer,
args: RawDataConfig,
config?: Config | Preset | undefined | null,
): Promise<string>;
export declare function vectorizeSync(source: Buffer, config?: Config | Preset | undefined | null): string;
export declare function vectorizeRawSync(
source: Buffer,
args: RawDataConfig,
config?: Config | Preset | undefined | null,
): string;