# All files constants.js

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    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

    1x

     "use strict";

    module.exports = {
      PNG_SIGNATURE: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a],

      TYPE_IHDR: 0x49484452,
      TYPE_IEND: 0x49454e44,
      TYPE_IDAT: 0x49444154,
      TYPE_PLTE: 0x504c5445,
      TYPE_tRNS: 0x74524e53, // eslint-disable-line camelcase
      TYPE_gAMA: 0x67414d41, // eslint-disable-line camelcase

      // color-type bits
      COLORTYPE_GRAYSCALE: 0,
      COLORTYPE_PALETTE: 1,
      COLORTYPE_COLOR: 2,
      COLORTYPE_ALPHA: 4, // e.g. grayscale and alpha

      // color-type combinations
      COLORTYPE_PALETTE_COLOR: 3,
      COLORTYPE_COLOR_ALPHA: 6,

      COLORTYPE_TO_BPP_MAP: {
        0: 1,
        2: 3,
        3: 1,
        4: 2,
        6: 4,
      },

      GAMMA_DIVISION: 100000,
    };