constants.js 662 B

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