code: function(image, options) {
          var index = options.imageMaskIndex || this.options.imageMaskIndex;
          if (!index)
              return;
          if (typeof index === 'function') {
              index = index(image, options);
          }
          return index;
      }
docs: This method maintain an index of image masks associated with the provided
  canvas. This method could be overloaded to implement a global index of
  image masks.