code: def encodefuns():
      
  
      def desc(ascii):
          """Return textDescription type [ICC 2001] 6.5.17.  The ASCII part is
          filled in with the string `ascii`, the Unicode and ScriptCode parts
          are empty."""
  
          ascii += '\x00'
          n = len(ascii)
  
          return struct.pack('>L%ds2LHB67s' % n,
                             n, ascii, 0, 0, 0, 0, '')
  
      def text(ascii):
          """Return textType [ICC 2001] 6.5.18."""
  
          return ascii + '\x00'
  
      def curv(f=None, n=256):
          """Return a curveType, [ICC 2001] 6.5.3.  If no arguments are
          supplied then a TRC for a linear response is generated (no entries).
          If an argument is supplied and it is a number (for *f* to be a
          number it  means that ``float(f)==f``) then a TRC for that
          gamma value is generated.
          Otherwise `f` is assumed to be a function that maps [0.0, 1.0] to
          [0.0, 1.0]; an `n` element table is generated for it.
          """
  
          if f is None:
              return struct.pack('>L', 0)
          try:
              if float(f) == f:
                  return struct.pack('>LH', 1, int(round(f * 2 ** 8)))
          except (TypeError, ValueError):
              pass
          assert n >= 2
          table = []
          M = float(n - 1)
          for i in range(n):
              x = i / M
              table.append(int(round(f(x) * 65535)))
          return struct.pack('>L%dH' % n, n, *table)
  
      def XYZ(*l):
          return struct.pack('>3l', *map(fs15f16, l))
  
      return locals()
docs: Returns a dictionary mapping ICC type signature sig to encoding
      function.  Each function returns a string comprising the content of
      the encoded value.  To form the full value, the type sig and the 4
      zero bytes should be prefixed (8 bytes).