Type alias IDNumberingFunc

IDNumberingFunc: ((r: number, g: number, b: number, a: number) => number)

Type declaration

    • (r: number, g: number, b: number, a: number): number
    • represents a function that takes 4 or less arguments as each pixel's color (0 to 255), and spits out a float id for the provided color
      this pixel color identification is used by fromJAtlasImage and fromJAtlasImageData
      in general, any id equal to 0 or less (negative) is considered background, and thus omitted
      while, ids greater than 0 are registered in entries
      the static methods mentioned above fallback to a default pixel identification function when none is provided:

      const default_id_numbering_func: IDNumberingFunc = (r, g, b, a) => a === 0 ? 0 : (255 - a) / 100 + b * (2 ** 0) + g * (2 ** 8) + r * (2 ** 16)
      

      Parameters

      • r: number
      • g: number
      • b: number
      • a: number

      Returns number

Generated using TypeDoc