@yft-design/psd-lib 1.0.1
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/README.md +45 -0
- package/dist/abr.d.ts +143 -0
- package/dist/abr.js +300 -0
- package/dist/additionalInfo.d.ts +26 -0
- package/dist/additionalInfo.js +3891 -0
- package/dist/csh.d.ts +10 -0
- package/dist/csh.js +32 -0
- package/dist/descriptor.d.ts +566 -0
- package/dist/descriptor.js +1958 -0
- package/dist/effectsHelpers.d.ts +5 -0
- package/dist/effectsHelpers.js +280 -0
- package/dist/engineData.d.ts +2 -0
- package/dist/engineData.js +330 -0
- package/dist/engineData2.d.ts +2 -0
- package/dist/engineData2.js +405 -0
- package/dist/helpers.d.ts +89 -0
- package/dist/helpers.js +300 -0
- package/dist/imageResources.d.ts +17 -0
- package/dist/imageResources.js +1070 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +30 -0
- package/dist/initializeCanvas.d.ts +1 -0
- package/dist/initializeCanvas.js +21 -0
- package/dist/jpeg.d.ts +1 -0
- package/dist/jpeg.js +1017 -0
- package/dist/psd.d.ts +1822 -0
- package/dist/psd.js +7 -0
- package/dist/psdReader.d.ts +46 -0
- package/dist/psdReader.js +1188 -0
- package/dist/psdWriter.d.ts +33 -0
- package/dist/psdWriter.js +733 -0
- package/dist/text.d.ts +179 -0
- package/dist/text.js +556 -0
- package/dist/utf8.d.ts +4 -0
- package/dist/utf8.js +150 -0
- package/package.json +46 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/// Engine data 2 experiments
|
|
2
|
+
// /test/engineData2.json:1109 is character codes
|
|
3
|
+
const keysColor = {
|
|
4
|
+
'0': {
|
|
5
|
+
uproot: true,
|
|
6
|
+
children: {
|
|
7
|
+
'0': { name: 'Type' },
|
|
8
|
+
'1': { name: 'Values' },
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const keysStyleSheet = {
|
|
13
|
+
'0': { name: 'Font' },
|
|
14
|
+
'1': { name: 'FontSize' },
|
|
15
|
+
'2': { name: 'FauxBold' },
|
|
16
|
+
'3': { name: 'FauxItalic' },
|
|
17
|
+
'4': { name: 'AutoLeading' },
|
|
18
|
+
'5': { name: 'Leading' },
|
|
19
|
+
'6': { name: 'HorizontalScale' },
|
|
20
|
+
'7': { name: 'VerticalScale' },
|
|
21
|
+
'8': { name: 'Tracking' },
|
|
22
|
+
'9': { name: 'BaselineShift' },
|
|
23
|
+
// '10': ???
|
|
24
|
+
'11': { name: 'Kerning?' }, // different value than EngineData (0 - numerical value, 1 - metric, 2 - optical)
|
|
25
|
+
'12': { name: 'FontCaps' },
|
|
26
|
+
'13': { name: 'FontBaseline' },
|
|
27
|
+
'15': { name: 'Strikethrough?' }, // number instead of bool
|
|
28
|
+
'16': { name: 'Underline?' }, // number instead of bool
|
|
29
|
+
'18': { name: 'Ligatures' },
|
|
30
|
+
'19': { name: 'DLigatures' },
|
|
31
|
+
// '20': ???
|
|
32
|
+
// '21': ???
|
|
33
|
+
// '22': ???
|
|
34
|
+
'23': { name: 'Fractions' }, // not present in EngineData
|
|
35
|
+
'24': { name: 'Ordinals' }, // not present in EngineData
|
|
36
|
+
// '25': ???
|
|
37
|
+
// '26': ???
|
|
38
|
+
// '27': ???
|
|
39
|
+
'28': { name: 'StylisticAlternates' }, // not present in EngineData
|
|
40
|
+
// '29': ???
|
|
41
|
+
'30': { name: 'OldStyle?' }, // OpenType > OldStyle, number instead of bool, not present in EngineData
|
|
42
|
+
'35': { name: 'BaselineDirection' },
|
|
43
|
+
'38': { name: 'Language' },
|
|
44
|
+
'52': { name: 'NoBreak' },
|
|
45
|
+
'53': { name: 'FillColor', children: keysColor },
|
|
46
|
+
'54': { name: 'StrokeColor', children: keysColor },
|
|
47
|
+
'55': { children: { '99': { uproot: true } } },
|
|
48
|
+
// '68': ???
|
|
49
|
+
// '70': ???
|
|
50
|
+
// '71': ???
|
|
51
|
+
// '72': ???
|
|
52
|
+
// '73': ???
|
|
53
|
+
'79': { children: keysColor },
|
|
54
|
+
// '85': ???
|
|
55
|
+
// '87': ???
|
|
56
|
+
// '88': ???
|
|
57
|
+
};
|
|
58
|
+
const keysParagraph = {
|
|
59
|
+
'0': { name: 'Justification' },
|
|
60
|
+
'1': { name: 'FirstLineIndent' },
|
|
61
|
+
'2': { name: 'StartIndent' },
|
|
62
|
+
'3': { name: 'EndIndent' },
|
|
63
|
+
'4': { name: 'SpaceBefore' },
|
|
64
|
+
'5': { name: 'SpaceAfter' },
|
|
65
|
+
'7': { name: 'AutoLeading' },
|
|
66
|
+
'9': { name: 'AutoHyphenate' },
|
|
67
|
+
'10': { name: 'HyphenatedWordSize' },
|
|
68
|
+
'11': { name: 'PreHyphen' },
|
|
69
|
+
'12': { name: 'PostHyphen' },
|
|
70
|
+
'13': { name: 'ConsecutiveHyphens?' }, // different value than EngineData
|
|
71
|
+
'14': { name: 'Zone' },
|
|
72
|
+
'15': { name: 'HypenateCapitalizedWords' }, // not present in EngineData
|
|
73
|
+
'17': { name: 'WordSpacing' },
|
|
74
|
+
'18': { name: 'LetterSpacing' },
|
|
75
|
+
'19': { name: 'GlyphSpacing' },
|
|
76
|
+
'32': { name: 'StyleSheet', children: keysStyleSheet },
|
|
77
|
+
};
|
|
78
|
+
const keysStyleSheetData = {
|
|
79
|
+
name: 'StyleSheetData',
|
|
80
|
+
children: keysStyleSheet,
|
|
81
|
+
};
|
|
82
|
+
const keysRoot = {
|
|
83
|
+
'0': {
|
|
84
|
+
name: 'ResourceDict',
|
|
85
|
+
children: {
|
|
86
|
+
'1': {
|
|
87
|
+
name: 'FontSet',
|
|
88
|
+
children: {
|
|
89
|
+
'0': {
|
|
90
|
+
uproot: true,
|
|
91
|
+
children: {
|
|
92
|
+
'0': {
|
|
93
|
+
uproot: true,
|
|
94
|
+
children: {
|
|
95
|
+
'0': {
|
|
96
|
+
uproot: true,
|
|
97
|
+
children: {
|
|
98
|
+
'0': { name: 'Name' },
|
|
99
|
+
'2': { name: 'FontType' },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
'2': {
|
|
109
|
+
name: '2',
|
|
110
|
+
children: {},
|
|
111
|
+
},
|
|
112
|
+
'3': {
|
|
113
|
+
name: 'MojiKumiSet',
|
|
114
|
+
children: {
|
|
115
|
+
'0': {
|
|
116
|
+
uproot: true,
|
|
117
|
+
children: {
|
|
118
|
+
'0': {
|
|
119
|
+
uproot: true,
|
|
120
|
+
children: {
|
|
121
|
+
'0': { name: 'InternalName' },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
'4': {
|
|
129
|
+
name: 'KinsokuSet',
|
|
130
|
+
children: {
|
|
131
|
+
'0': {
|
|
132
|
+
uproot: true,
|
|
133
|
+
children: {
|
|
134
|
+
'0': {
|
|
135
|
+
uproot: true,
|
|
136
|
+
children: {
|
|
137
|
+
'0': { name: 'Name' },
|
|
138
|
+
'5': {
|
|
139
|
+
uproot: true,
|
|
140
|
+
children: {
|
|
141
|
+
'0': { name: 'NoStart' },
|
|
142
|
+
'1': { name: 'NoEnd' },
|
|
143
|
+
'2': { name: 'Keep' },
|
|
144
|
+
'3': { name: 'Hanging' },
|
|
145
|
+
'4': { name: 'Name' },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
'5': {
|
|
155
|
+
name: 'StyleSheetSet',
|
|
156
|
+
children: {
|
|
157
|
+
'0': {
|
|
158
|
+
uproot: true,
|
|
159
|
+
children: {
|
|
160
|
+
'0': {
|
|
161
|
+
uproot: true,
|
|
162
|
+
children: {
|
|
163
|
+
'0': { name: 'Name' },
|
|
164
|
+
'6': keysStyleSheetData,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
'6': {
|
|
172
|
+
name: 'ParagraphSheetSet',
|
|
173
|
+
children: {
|
|
174
|
+
'0': {
|
|
175
|
+
uproot: true,
|
|
176
|
+
children: {
|
|
177
|
+
'0': {
|
|
178
|
+
uproot: true,
|
|
179
|
+
children: {
|
|
180
|
+
'0': { name: 'Name' },
|
|
181
|
+
'5': {
|
|
182
|
+
name: 'Properties',
|
|
183
|
+
children: keysParagraph,
|
|
184
|
+
},
|
|
185
|
+
'6': { name: 'DefaultStyleSheet' },
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
'8': {
|
|
193
|
+
name: 'TextFrameSet',
|
|
194
|
+
children: {
|
|
195
|
+
'0': {
|
|
196
|
+
uproot: true,
|
|
197
|
+
children: {
|
|
198
|
+
'0': {
|
|
199
|
+
name: 'path',
|
|
200
|
+
children: {
|
|
201
|
+
'0': { name: 'name' },
|
|
202
|
+
'1': {
|
|
203
|
+
name: 'bezierCurve',
|
|
204
|
+
children: {
|
|
205
|
+
'0': { name: 'controlPoints' },
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
'2': {
|
|
209
|
+
name: 'data',
|
|
210
|
+
children: {
|
|
211
|
+
'0': { name: 'type' },
|
|
212
|
+
'1': { name: 'orientation' },
|
|
213
|
+
'2': { name: 'frameMatrix' },
|
|
214
|
+
'4': { name: '4' },
|
|
215
|
+
'6': { name: 'textRange' },
|
|
216
|
+
'7': { name: 'rowGutter' },
|
|
217
|
+
'8': { name: 'columnGutter' },
|
|
218
|
+
'9': { name: '9' },
|
|
219
|
+
'10': {
|
|
220
|
+
name: 'baselineAlignment',
|
|
221
|
+
children: {
|
|
222
|
+
'0': { name: 'flag' },
|
|
223
|
+
'1': { name: 'min' },
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
'11': {
|
|
227
|
+
name: 'pathData',
|
|
228
|
+
children: {
|
|
229
|
+
'1': { name: '1' },
|
|
230
|
+
'0': { name: 'reversed' },
|
|
231
|
+
'2': { name: '2' },
|
|
232
|
+
'3': { name: '3' },
|
|
233
|
+
'4': { name: 'spacing' },
|
|
234
|
+
'5': { name: '5' },
|
|
235
|
+
'6': { name: '6' },
|
|
236
|
+
'7': { name: '7' },
|
|
237
|
+
'18': { name: '18' },
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
'12': { name: '12' },
|
|
241
|
+
'13': { name: '13' },
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
'3': { name: '3' },
|
|
245
|
+
'97': { name: 'uuid' },
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
'9': {
|
|
253
|
+
name: 'Predefined',
|
|
254
|
+
children: {
|
|
255
|
+
'0': {
|
|
256
|
+
children: { '0': { uproot: true } },
|
|
257
|
+
},
|
|
258
|
+
'1': {
|
|
259
|
+
children: { '0': { uproot: true } },
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
'1': {
|
|
266
|
+
name: 'EngineDict',
|
|
267
|
+
children: {
|
|
268
|
+
'0': {
|
|
269
|
+
name: '0',
|
|
270
|
+
children: {
|
|
271
|
+
// 0: ???
|
|
272
|
+
// 1: ???
|
|
273
|
+
// 2: ???
|
|
274
|
+
'3': { name: 'SuperscriptSize' },
|
|
275
|
+
'4': { name: 'SuperscriptPosition' },
|
|
276
|
+
'5': { name: 'SubscriptSize' },
|
|
277
|
+
'6': { name: 'SubscriptPosition' },
|
|
278
|
+
'7': { name: 'SmallCapSize' },
|
|
279
|
+
'8': { name: 'UseFractionalGlyphWidths' }, // ???
|
|
280
|
+
'15': { children: { '0': { uproot: true } } },
|
|
281
|
+
// 16: ???
|
|
282
|
+
// 17: ???
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
'1': {
|
|
286
|
+
name: 'Editors?', // layer.text.index is specifying the index of the editor related to the layer
|
|
287
|
+
children: {
|
|
288
|
+
'0': {
|
|
289
|
+
name: 'Editor',
|
|
290
|
+
children: {
|
|
291
|
+
'0': { name: 'Text' },
|
|
292
|
+
'5': {
|
|
293
|
+
name: 'ParagraphRun',
|
|
294
|
+
children: {
|
|
295
|
+
'0': {
|
|
296
|
+
name: 'RunArray',
|
|
297
|
+
children: {
|
|
298
|
+
'0': {
|
|
299
|
+
name: 'ParagraphSheet',
|
|
300
|
+
children: {
|
|
301
|
+
'0': {
|
|
302
|
+
uproot: true,
|
|
303
|
+
children: {
|
|
304
|
+
'0': { name: '0' },
|
|
305
|
+
'5': {
|
|
306
|
+
name: '5',
|
|
307
|
+
children: keysParagraph,
|
|
308
|
+
},
|
|
309
|
+
'6': { name: '6' },
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
'1': { name: 'RunLength' },
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
'6': {
|
|
320
|
+
name: 'StyleRun',
|
|
321
|
+
children: {
|
|
322
|
+
'0': {
|
|
323
|
+
name: 'RunArray',
|
|
324
|
+
children: {
|
|
325
|
+
'0': {
|
|
326
|
+
name: 'StyleSheet',
|
|
327
|
+
children: {
|
|
328
|
+
'0': {
|
|
329
|
+
uproot: true,
|
|
330
|
+
children: {
|
|
331
|
+
'6': keysStyleSheetData,
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
'1': { name: 'RunLength' },
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
'1': {
|
|
344
|
+
name: 'FontVectorData ???',
|
|
345
|
+
// children: {
|
|
346
|
+
// '0': {},
|
|
347
|
+
// '2': {
|
|
348
|
+
// // '5'
|
|
349
|
+
// // '6'
|
|
350
|
+
// },
|
|
351
|
+
// }
|
|
352
|
+
// "1": [ // this is probably bounding box? there seem to be many of them nested
|
|
353
|
+
// 0,
|
|
354
|
+
// 0,
|
|
355
|
+
// 999,
|
|
356
|
+
// 176.30014
|
|
357
|
+
// ],
|
|
358
|
+
// various types: /PC, /F, /R, /L, /S, /G
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
'2': {
|
|
363
|
+
name: 'StyleSheet',
|
|
364
|
+
children: keysStyleSheet,
|
|
365
|
+
},
|
|
366
|
+
'3': {
|
|
367
|
+
name: 'ParagraphSheet',
|
|
368
|
+
children: keysParagraph,
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
function decodeObj(obj, keys) {
|
|
374
|
+
if (obj === null)
|
|
375
|
+
return obj;
|
|
376
|
+
if (Array.isArray(obj))
|
|
377
|
+
return obj.map(x => decodeObj(x, keys));
|
|
378
|
+
if (typeof obj !== 'object')
|
|
379
|
+
return obj;
|
|
380
|
+
let result = {};
|
|
381
|
+
for (const key of Object.keys(obj)) {
|
|
382
|
+
if (keys[key]) {
|
|
383
|
+
if (keys[key].uproot) {
|
|
384
|
+
if (key !== '99')
|
|
385
|
+
result = decodeObj(obj[key], keys[key].children ?? {});
|
|
386
|
+
if (obj['99'])
|
|
387
|
+
result._type = obj['99'];
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
result[keys[key].name || key] = decodeObj(obj[key], keys[key].children ?? {});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else if (key === '99') {
|
|
395
|
+
result._type = obj[key];
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
result[key] = decodeObj(obj[key], {});
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return result;
|
|
402
|
+
}
|
|
403
|
+
export function decodeEngineData2(data) {
|
|
404
|
+
return decodeObj(data, keysRoot);
|
|
405
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Layer, BlendMode, LayerColor, PixelData, PixelArray } from './psd';
|
|
2
|
+
export declare const MOCK_HANDLERS = false;
|
|
3
|
+
export declare const RAW_IMAGE_DATA = false;
|
|
4
|
+
export declare const fromBlendMode: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const toBlendMode: {
|
|
8
|
+
[key: string]: BlendMode;
|
|
9
|
+
};
|
|
10
|
+
export declare const layerColors: LayerColor[];
|
|
11
|
+
export declare const largeAdditionalInfoKeys: string[];
|
|
12
|
+
export interface Dict {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function revMap(map: Dict): Dict;
|
|
16
|
+
export declare function createEnum<T>(prefix: string, def: string, map: Dict): {
|
|
17
|
+
decode: (val: string) => T;
|
|
18
|
+
encode: (val: T | undefined) => string;
|
|
19
|
+
};
|
|
20
|
+
export declare const enum ColorSpace {
|
|
21
|
+
RGB = 0,
|
|
22
|
+
HSB = 1,
|
|
23
|
+
CMYK = 2,
|
|
24
|
+
Lab = 7,
|
|
25
|
+
Grayscale = 8
|
|
26
|
+
}
|
|
27
|
+
export declare const enum LayerMaskFlags {
|
|
28
|
+
PositionRelativeToLayer = 1,
|
|
29
|
+
LayerMaskDisabled = 2,
|
|
30
|
+
InvertLayerMaskWhenBlending = 4,// obsolete
|
|
31
|
+
LayerMaskFromRenderingOtherData = 8,
|
|
32
|
+
MaskHasParametersAppliedToIt = 16
|
|
33
|
+
}
|
|
34
|
+
export declare const enum MaskParams {
|
|
35
|
+
UserMaskDensity = 1,
|
|
36
|
+
UserMaskFeather = 2,
|
|
37
|
+
VectorMaskDensity = 4,
|
|
38
|
+
VectorMaskFeather = 8
|
|
39
|
+
}
|
|
40
|
+
export declare const enum ChannelID {
|
|
41
|
+
Color0 = 0,// red (rgb) / cyan (cmyk)
|
|
42
|
+
Color1 = 1,// green (rgb) / magenta (cmyk)
|
|
43
|
+
Color2 = 2,// blue (rgb) / yellow (cmyk)
|
|
44
|
+
Color3 = 3,// - (rgb) / black (cmyk)
|
|
45
|
+
Transparency = -1,
|
|
46
|
+
UserMask = -2,
|
|
47
|
+
RealUserMask = -3
|
|
48
|
+
}
|
|
49
|
+
export declare const enum Compression {
|
|
50
|
+
RawData = 0,
|
|
51
|
+
RleCompressed = 1,
|
|
52
|
+
ZipWithoutPrediction = 2,
|
|
53
|
+
ZipWithPrediction = 3
|
|
54
|
+
}
|
|
55
|
+
export interface ChannelData {
|
|
56
|
+
channelId: ChannelID;
|
|
57
|
+
compression: Compression;
|
|
58
|
+
buffer: Uint8Array | undefined;
|
|
59
|
+
length: number;
|
|
60
|
+
}
|
|
61
|
+
export interface Bounds {
|
|
62
|
+
top: number;
|
|
63
|
+
left: number;
|
|
64
|
+
right: number;
|
|
65
|
+
bottom: number;
|
|
66
|
+
}
|
|
67
|
+
export interface LayerChannelData {
|
|
68
|
+
layer: Layer;
|
|
69
|
+
channels: ChannelData[];
|
|
70
|
+
top: number;
|
|
71
|
+
left: number;
|
|
72
|
+
right: number;
|
|
73
|
+
bottom: number;
|
|
74
|
+
mask?: Bounds;
|
|
75
|
+
realMask?: Bounds;
|
|
76
|
+
}
|
|
77
|
+
export declare function offsetForChannel(channelId: ChannelID, cmyk: boolean): number;
|
|
78
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
79
|
+
export declare function hasAlpha(data: PixelData): boolean;
|
|
80
|
+
export declare function resetImageData({ data }: PixelData): void;
|
|
81
|
+
export declare function imageDataToCanvas(pixelData: PixelData): HTMLCanvasElement;
|
|
82
|
+
export declare function decodeBitmap(input: PixelArray, output: PixelArray, width: number, height: number): void;
|
|
83
|
+
export declare function writeDataRaw(data: PixelData, offset: number, width: number, height: number): Uint8Array<ArrayBuffer> | undefined;
|
|
84
|
+
export declare function writeDataRLE(buffer: Uint8Array, { data, width, height }: PixelData, offsets: number[], large: boolean): Uint8Array<ArrayBuffer> | undefined;
|
|
85
|
+
export declare function writeDataZipWithoutPrediction({ data, width, height }: PixelData, offsets: number[]): Uint8Array<ArrayBufferLike>;
|
|
86
|
+
export declare let createCanvas: (width: number, height: number) => HTMLCanvasElement;
|
|
87
|
+
export declare let createCanvasFromData: (data: Uint8Array) => HTMLCanvasElement;
|
|
88
|
+
export declare let createImageData: (width: number, height: number) => ImageData;
|
|
89
|
+
export declare function initializeCanvas(createCanvasMethod: (width: number, height: number) => HTMLCanvasElement, createCanvasFromDataMethod?: (data: Uint8Array) => HTMLCanvasElement, createImageDataMethod?: (width: number, height: number) => ImageData): void;
|