code: function getSum(sp, boundingBox, dataHandles) {
    const sum = {
      value: 0,
      squared: 0,
      count: 0,
    };
    let index = 0;
  
    for (let y = boundingBox.top; y < boundingBox.top + boundingBox.height; y++) {
      for (
        let x = boundingBox.left;
        x < boundingBox.left + boundingBox.width;
        x++
      ) {
        const point = {
          x,
          y,
        };
  
        sumPointIfInFreehand(dataHandles, point, sum, sp[index]);
        index++;
      }
    }
  
    return sum;
  }
docs: Calculates the sum, squared sum and count of all pixels within the polygon.
  @private
  @method
  @name getSum
  
  @param {Object} sp An array of the pixel data.
  @param {Object} boundingBox Rectangular box enclosing the polygon.
  @param {Object} dataHandles Data object associated with the tool.
  @returns {Object} Object containing the sum, squared sum and pixel count.