generated from napi-rs/package-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
32 lines (32 loc) · 1.08 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
export class GIFEncoder {
/**
* Create a new GIF Encoder instance.
* @param width Image width. Must be < 65535.
* @param height Image height. Must be < 65535.
* @param file Absolute path to output file.
*/
constructor(width: number, height: number, file: string)
/**
* Add a frame to the GIF.
* @param frame Buffer containing RGBA pixel data.
*/
addFrame(frame: Buffer): void
/**
* Sets the framerate for the GIF. Defaults to 25.
* @param framerate Frame rate in FPS for the target GIF.
*/
setFrameRate(framerate: number): void
/**
* Sets the sampling factor for the Neuquant color quantization algorithm.
* Generally: 1 is highest quality and slowest, 10 or higher is low
* quality (lots of color banding) but fast. Must be < 65535.
* Defaults to 10.
* @param factor The new sampling factor.
*/
setSampleFactor(factor: number): void
/**
* Render the GIF and write it to disk. As the most time consuming step,
* it is asynchronous.
*/
finish(): Promise<void>
}