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HlB,EAAM,IAAIsB,WACRR,EAAOV,EAAIH,EAASe,EAAQV,EAAgBL,EAASe,EAAQV,GAE/D,MACF,KAAK,GACHN,EAAM,IAAIuB,YACRT,EAAOV,EAAIH,EAASe,EAAQV,EAAgBL,EAASe,EAAQV,EAAiB,GAEhF,MACF,KAAK,GACHN,EAAM,IAAIwB,YACRV,EAAOV,EAAIH,EAASe,EAAQV,EAAgBL,EAASe,EAAQV,EAAiB,GAEhF,MACF,QACE,MAAM,IAAIc,MAAJ,uCAA0CF,EAAc,GAAxD,sBAEVnB,EAAaC,EAAKC,QACK,IAAdc,GAITV,EAHAL,EAAM,IAAIsB,WACRR,EAAOV,EAAIH,EAASe,EAAQV,EAAgBL,EAASe,EAAQV,GAEnCL,EAAQK,GAGxC,OAAOQ,E,mUCpFYW,EAAAA,W,gMACnB,WAAaC,EAAeC,GAA5B,8GACwBC,KAAKC,YAAYF,GADzC,UACQG,EADR,OAGoB,KADZf,EAAYW,EAAcK,WAAa,GAF/C,uBAIUC,GAAWN,EAAcO,aACzBC,EAAYF,EAAUN,EAAcS,UAAYT,EAAcU,WAC9DC,EAAaL,EAAUN,EAAcY,WACzCZ,EAAca,cAAgBb,EAAcc,YAPlD,kBASW3B,EACLiB,EAASf,EAAWmB,EAAWG,EAAYX,EAAce,cACzDf,EAAcgB,sBAXpB,gCAcSZ,GAdT,gD,mTADmBL,I,29CCAAkB,EAAAA,SAAAA,I,0YACnB,SAAYhB,GACV,OAAOA,O,gFAFUgB,C,OAAmBlB","sources":["webpack://ol/./node_modules/geotiff/dist-module/predictor.js","webpack://ol/./node_modules/geotiff/dist-module/compression/basedecoder.js","webpack://ol/./node_modules/geotiff/dist-module/compression/raw.js"],"sourcesContent":["function decodeRowAcc(row, stride) {\n  let length = row.length - stride;\n  let offset = 0;\n  do {\n    for (let i = stride; i > 0; i--) {\n      row[offset + stride] += row[offset];\n      offset++;\n    }\n\n    length -= stride;\n  } while (length > 0);\n}\n\nfunction decodeRowFloatingPoint(row, stride, bytesPerSample) {\n  let index = 0;\n  let count = row.length;\n  const wc = count / bytesPerSample;\n\n  while (count > stride) {\n    for (let i = stride; i > 0; --i) {\n      row[index + stride] += row[index];\n      ++index;\n    }\n    count -= stride;\n  }\n\n  const copy = row.slice();\n  for (let i = 0; i < wc; ++i) {\n    for (let b = 0; b < bytesPerSample; ++b) {\n      row[(bytesPerSample * i) + b] = copy[((bytesPerSample - b - 1) * wc) + i];\n    }\n  }\n}\n\nexport function applyPredictor(block, predictor, width, height, bitsPerSample,\n  planarConfiguration) {\n  if (!predictor || predictor === 1) {\n    return block;\n  }\n\n  for (let i = 0; i < bitsPerSample.length; ++i) {\n    if (bitsPerSample[i] % 8 !== 0) {\n      throw new Error('When decoding with predictor, only multiple of 8 bits are supported.');\n    }\n    if (bitsPerSample[i] !== bitsPerSample[0]) {\n      throw new Error('When decoding with predictor, all samples must have the same size.');\n    }\n  }\n\n  const bytesPerSample = bitsPerSample[0] / 8;\n  const stride = planarConfiguration === 2 ? 1 : bitsPerSample.length;\n\n  for (let i = 0; i < height; ++i) {\n    // Last strip will be truncated if height % stripHeight != 0\n    if (i * stride * width * bytesPerSample >= block.byteLength) {\n      break;\n    }\n    let row;\n    if (predictor === 2) { // horizontal prediction\n      switch (bitsPerSample[0]) {\n        case 8:\n          row = new Uint8Array(\n            block, i * stride * width * bytesPerSample, stride * width * bytesPerSample,\n          );\n          break;\n        case 16:\n          row = new Uint16Array(\n            block, i * stride * width * bytesPerSample, stride * width * bytesPerSample / 2,\n          );\n          break;\n        case 32:\n          row = new Uint32Array(\n            block, i * stride * width * bytesPerSample, stride * width * bytesPerSample / 4,\n          );\n          break;\n        default:\n          throw new Error(`Predictor 2 not allowed with ${bitsPerSample[0]} bits per sample.`);\n      }\n      decodeRowAcc(row, stride, bytesPerSample);\n    } else if (predictor === 3) { // horizontal floating point\n      row = new Uint8Array(\n        block, i * stride * width * bytesPerSample, stride * width * bytesPerSample,\n      );\n      decodeRowFloatingPoint(row, stride, bytesPerSample);\n    }\n  }\n  return block;\n}\n","import { applyPredictor } from '../predictor.js';\n\nexport default class BaseDecoder {\n  async decode(fileDirectory, buffer) {\n    const decoded = await this.decodeBlock(buffer);\n    const predictor = fileDirectory.Predictor || 1;\n    if (predictor !== 1) {\n      const isTiled = !fileDirectory.StripOffsets;\n      const tileWidth = isTiled ? fileDirectory.TileWidth : fileDirectory.ImageWidth;\n      const tileHeight = isTiled ? fileDirectory.TileLength : (\n        fileDirectory.RowsPerStrip || fileDirectory.ImageLength\n      );\n      return applyPredictor(\n        decoded, predictor, tileWidth, tileHeight, fileDirectory.BitsPerSample,\n        fileDirectory.PlanarConfiguration,\n      );\n    }\n    return decoded;\n  }\n}\n","import BaseDecoder from './basedecoder.js';\n\nexport default class RawDecoder extends BaseDecoder {\n  decodeBlock(buffer) {\n    return buffer;\n  }\n}\n"],"names":["decodeRowAcc","row","stride","length","offset","i","decodeRowFloatingPoint","bytesPerSample","index","count","wc","copy","slice","b","applyPredictor","block","predictor","width","height","bitsPerSample","planarConfiguration","Error","byteLength","Uint8Array","Uint16Array","Uint32Array","BaseDecoder","fileDirectory","buffer","this","decodeBlock","decoded","Predictor","isTiled","StripOffsets","tileWidth","TileWidth","ImageWidth","tileHeight","TileLength","RowsPerStrip","ImageLength","BitsPerSample","PlanarConfiguration","RawDecoder"],"sourceRoot":""}