import WorkCenterFinder from "./work-center-finder";

/// <reference lib="webworker" />

addEventListener('message', ({ data }) => {
  let {pagePixels, mapPixels, width, height} = data;
  console.log("worker recive: width=" + width + " height=" + height);
  console.time("calculate centers");
  const centers = new WorkCenterFinder(pagePixels, mapPixels, width, height).calculate();
  console.timeEnd("calculate centers");
  postMessage(centers);

});