_resolveJob() {
    const job = this._job;
    const threads = this._workers.length;
    let data, meta;
    if (threads === 1) {
      data = new Uint8ClampedArray(this._dataLookup[0]['buffer']);
      meta = this._dataLookup[0]['meta'];
    } else {
      const length = job.inputs[0].data.length;
      data = new Uint8ClampedArray(length);
      meta = new Array(threads);
      const segmentLength = 4 * Math.ceil(length / 4 / threads);
      for (let i = 0; i < threads; ++i) {
        const buffer = this._dataLookup[i]['buffer'];
        const offset = i * segmentLength;
        data.set(new Uint8ClampedArray(buffer), offset);
        meta[i] = this._dataLookup[i]['meta'];
      }
    }
    this._job = null;
    this._dataLookup = {};
    job.callback(
      null,
      newImageData(data, job.inputs[0].width, job.inputs[0].height),
      meta
    );
    this._dispatch();
  }
/**
   * Resolve a job.  If there are no more worker threads, the processor callback
   * will be called.
   */
Resolve a job.  If there are no more worker threads, the processor callback
will be called.
Resolve a job . If there are no more worker threads the processor callback will be called .
_resolveJob() {
    const job = this._job;
    const threads = this._workers.length;
    let data, meta;
    if (threads === 1) {
      data = new Uint8ClampedArray(this._dataLookup[0]['buffer']);
      meta = this._dataLookup[0]['meta'];
    } else {
      const length = job.inputs[0].data.length;
      data = new Uint8ClampedArray(length);
      meta = new Array(threads);
      const segmentLength = 4 * Math.ceil(length / 4 / threads);
      for (let i = 0; i < threads; ++i) {
        const buffer = this._dataLookup[i]['buffer'];
        const offset = i * segmentLength;
        data.set(new Uint8ClampedArray(buffer), offset);
        meta[i] = this._dataLookup[i]['meta'];
      }
    }
    this._job = null;
    this._dataLookup = {};
    job.callback(
      null,
      newImageData(data, job.inputs[0].width, job.inputs[0].height),
      meta
    );
    this._dispatch();
  }
_resolveJob ( ) { const job = this . _job ; const threads = this . _workers . length ; let data , meta ; if ( threads === 1 ) { data = new Uint8ClampedArray ( this . _dataLookup [ 0 ] [ 'buffer' ] ) ; meta = this . _dataLookup [ 0 ] [ 'meta' ] ; } else { const length = job . inputs [ 0 ] . data . length ; data = new Uint8ClampedArray ( length ) ; meta = new Array ( threads ) ; const segmentLength = 4 * Math . ceil ( length / 4 / threads ) ; for ( let i = 0 ; i < threads ; ++ i ) { const buffer = this . _dataLookup [ i ] [ 'buffer' ] ; const offset = i * segmentLength ; data . set ( new Uint8ClampedArray ( buffer ) , offset ) ; meta [ i ] = this . _dataLookup [ i ] [ 'meta' ] ; } } this . _job = null ; this . _dataLookup = { } ; job . callback ( null , newImageData ( data , job . inputs [ 0 ] . width , job . inputs [ 0 ] . height ) , meta ) ; this . _dispatch ( ) ; }
Resolve a job.
Resolve a job .