generated from napi-rs/package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
67 lines (65 loc) · 2.14 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
64
65
66
67
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export interface DecoderOptions {
/** Whether to implement the disposal method of the previous frame, default is `true` */
implementDisposalPrevious: boolean
/** Whether to store the cache of the frame, should be `false` when enabling disableDisposalMethods | rawDecode, default is `true` */
storeCache: boolean
/** Whether to disable the use of any disposal methods, default is `false` */
disableDisposalMethods: boolean
/** Whether to return the raw decoded frame, also disables the use of any disposal methods, default is `false` */
rawDecode: boolean
}
export interface LogicalScreenDescriptor {
width: number
height: number
globalColorFlag: boolean
colorResolution: number
sortedFlag: boolean
globalColorSize: number
backgroundColorIndex: number
pixelAspectRatio: number
}
export interface ImageDescriptor {
left: number
top: number
width: number
height: number
interlaceFlag: boolean
sortFlag: boolean
}
export interface GraphicsControlExtension {
disposalMethod: number
userInputFlag: boolean
transparentColorFlag: boolean
delayTime: number
transparentColorIndex: number
}
export interface Color {
red: number
green: number
blue: number
}
export declare class Gif {
version: string
lsd: LogicalScreenDescriptor
globalTable: Array<Color>
frames: Array<Frame>
decodeFrames(decoderOptions: DecoderOptions): Array<Buffer>
decodeFrame(frameIndex: number, decoderOptions: DecoderOptions): Buffer
}
export declare class Frame {
gcd: GraphicsControlExtension
im: ImageDescriptor
colorTable: Array<Color>
indexStream: Array<number>
/** Generated when decoding the frame, used to properly implement disposal method 0 | 1, can be disabled using DecoderOptions.storeCache */
cachedFrame?: Buffer
/** Generated when decoding the frame if any disposal method is 3 present in the Gif, used when decoding individual frames, can be disabled using DecoderOptions.implementDisposalPrevious */
previousPixels?: Buffer
}
export declare class Decoder {
static decodePath(filePath: string): Gif
static decodeBuffer(buffer: Buffer): Gif
}