UNPKG

662 BJavaScriptView Raw
1"use strict";
2
3module.exports = {
4 PNG_SIGNATURE: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a],
5
6 TYPE_IHDR: 0x49484452,
7 TYPE_IEND: 0x49454e44,
8 TYPE_IDAT: 0x49444154,
9 TYPE_PLTE: 0x504c5445,
10 TYPE_tRNS: 0x74524e53, // eslint-disable-line camelcase
11 TYPE_gAMA: 0x67414d41, // eslint-disable-line camelcase
12
13 // color-type bits
14 COLORTYPE_GRAYSCALE: 0,
15 COLORTYPE_PALETTE: 1,
16 COLORTYPE_COLOR: 2,
17 COLORTYPE_ALPHA: 4, // e.g. grayscale and alpha
18
19 // color-type combinations
20 COLORTYPE_PALETTE_COLOR: 3,
21 COLORTYPE_COLOR_ALPHA: 6,
22
23 COLORTYPE_TO_BPP_MAP: {
24 0: 1,
25 2: 3,
26 3: 1,
27 4: 2,
28 6: 4,
29 },
30
31 GAMMA_DIVISION: 100000,
32};