|
1 | 1 | import { Image, ResizeMode } from './image.ts'; |
2 | 2 |
|
3 | | -/** Names of the GIF frame disposal modes, see {@link Frame.disposalMode} */ |
| 3 | +/** Names of the frame disposal modes, see {@link Frame.disposalMode} */ |
4 | 4 | export type FrameDisposalModeName = 'any' | 'keep' | 'previous' | 'background'; |
5 | | -/** Ids of the GIF frame disposal modes as stored in the file (0 any, 1 keep, 2 previous, 3 background) */ |
| 5 | +/** Ids of the frame disposal modes, as GIFs store them (0 any, 1 keep, 2 previous, 3 background) */ |
6 | 6 | export type FrameDisposalModeId = 0 | 1 | 2 | 3; |
7 | 7 |
|
8 | 8 | const DISPOSAL_MODES: readonly FrameDisposalModeName[] = ['any', 'keep', 'previous', 'background']; |
9 | 9 |
|
10 | 10 | /** |
11 | | - * Represents a frame in a GIF |
| 11 | + * Represents a frame of an {@link Animation} |
12 | 12 | */ |
13 | 13 | export class Frame extends Image { |
14 | 14 | /** |
15 | | - * Milliseconds. GIFs store hundredths of a second, so this is rounded to 10 ms when encoding; |
| 15 | + * Milliseconds. GIFs store hundredths of a second, so this is rounded to 10 ms when encoding a GIF; |
16 | 16 | * note that browsers play frames shorter than 20 ms with 100 ms |
17 | 17 | */ |
18 | 18 | duration: number; |
19 | | - /** The frame's horizontal offset in the GIF */ |
| 19 | + /** The frame's horizontal offset in the animation */ |
20 | 20 | xOffset: number; |
21 | | - /** The frame's vertical offset in the GIF */ |
| 21 | + /** The frame's vertical offset in the animation */ |
22 | 22 | yOffset: number; |
23 | 23 | /** @internal */ |
24 | 24 | private __disposalMode__: FrameDisposalModeId = 1; |
25 | 25 |
|
26 | | - /** GIF frame disposal mode ANY: the decoder decides (in practice like KEEP). For use with {@link Frame} */ |
| 26 | + /** Frame disposal mode ANY: the decoder decides (in practice like KEEP). For use with {@link Frame} */ |
27 | 27 | static get DISPOSAL_ANY(): 'any' { |
28 | 28 | return 'any'; |
29 | 29 | } |
30 | 30 |
|
31 | | - /** GIF frame disposal mode KEEP. For use with {@link Frame} */ |
| 31 | + /** Frame disposal mode KEEP. For use with {@link Frame} */ |
32 | 32 | static get DISPOSAL_KEEP(): 'keep' { |
33 | 33 | return 'keep'; |
34 | 34 | } |
35 | 35 |
|
36 | | - /** GIF frame disposal mode PREVIOUS. For use with {@link Frame} */ |
| 36 | + /** Frame disposal mode PREVIOUS. For use with {@link Frame} */ |
37 | 37 | static get DISPOSAL_PREVIOUS(): 'previous' { |
38 | 38 | return 'previous'; |
39 | 39 | } |
40 | 40 |
|
41 | | - /** GIF frame disposal mode BACKGROUND. For use with {@link Frame} */ |
| 41 | + /** Frame disposal mode BACKGROUND. For use with {@link Frame} */ |
42 | 42 | static get DISPOSAL_BACKGROUND(): 'background' { |
43 | 43 | return 'background'; |
44 | 44 | } |
|
0 commit comments