{"_id":"lerc","_rev":"2926689","name":"lerc","description":"Rapid decoding of Lerc compressed raster data for any standard pixel type.","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"esri_dev","email":"dev_tools@esri.com"}],"time":{"modified":"2023-03-03T06:03:48.000Z","created":"2017-01-12T18:57:45.195Z","4.0.1":"2022-07-19T22:59:16.851Z","4.0.0":"2022-07-15T19:23:13.997Z","3.0.0":"2021-07-30T19:28:22.892Z","2.0.0":"2018-11-07T21:13:39.920Z","1.0.1":"2017-02-22T18:13:46.894Z","1.0.0":"2017-01-12T18:57:45.195Z"},"users":{},"author":{"name":"Esri","email":"dev_tools@esri.com","url":"http://developers.arcgis.com"},"repository":{"type":"git","url":"git+https://github.com/Esri/lerc.git"},"versions":{"4.0.1":{"name":"lerc","version":"4.0.1","browser":"LercDecode.js","bugs":{"url":"https://github.com/esri/lerc/issues"},"description":"Rapid decoding of Lerc compressed raster data for any standard pixel type.","keywords":["Esri","LERC"],"author":{"name":"Esri","email":"dev_tools@esri.com","url":"http://developers.arcgis.com"},"contributors":[{"name":"Thomas Maurer"},{"name":"Wenxue Ju"}],"devDependencies":{},"homepage":"https://github.com/Esri/lerc","license":"Apache-2.0","main":"LercDecode.js","module":"LercDecode.es.js","repository":{"type":"git","url":"git+https://github.com/Esri/lerc.git"},"scripts":{},"dependencies":{},"types":"./LercDecode.d.ts","gitHead":"45b3eaba7559345d00de729002b7a3c0b02bb3b2","_id":"lerc@4.0.1","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"shasum":"a7cc8d4d8e16320d3888fdc743320bdf29c54f2b","size":124673,"noattachment":false,"key":"/lerc/-/lerc-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lerc/download/lerc-4.0.1.tgz"},"_npmUser":{"name":"wjugis","email":"juwenxue@gmail.com"},"directories":{},"maintainers":[{"name":"esri_dev","email":"dev_tools@esri.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lerc_4.0.1_1658271556649_0.8774174295165507"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-19T22:59:33.419Z","publish_time":1658271556851,"_cnpm_publish_time":1658271556851},"4.0.0":{"name":"lerc","version":"4.0.0","browser":"LercDecode.js","bugs":{"url":"https://github.com/esri/lerc/issues"},"description":"Rapid decoding of Lerc compressed raster data for any standard pixel type.","keywords":["Esri","LERC"],"author":{"name":"Esri","email":"dev_tools@esri.com","url":"http://developers.arcgis.com"},"contributors":[{"name":"Thomas Maurer"},{"name":"Wenxue Ju"}],"devDependencies":{},"homepage":"https://github.com/Esri/lerc","license":"Apache-2.0","main":"LercDecode.js","repository":{"type":"git","url":"git+https://github.com/Esri/lerc.git"},"scripts":{},"dependencies":{},"types":"./LercDecode.d.ts","gitHead":"fbeb481120b79d05163f8544c645e9975920526f","_id":"lerc@4.0.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"shasum":"7102e7204330d2f32d7ba644f2327036d9c18903","size":125388,"noattachment":false,"key":"/lerc/-/lerc-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lerc/download/lerc-4.0.0.tgz"},"_npmUser":{"name":"wjugis","email":"juwenxue@gmail.com"},"directories":{},"maintainers":[{"name":"esri_dev","email":"dev_tools@esri.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lerc_4.0.0_1657912993818_0.5865621855023682"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-15T19:24:32.496Z","publish_time":1657912993997,"_cnpm_publish_time":1657912993997},"3.0.0":{"name":"lerc","browser":"LercDecode.js","bugs":{"url":"https://github.com/esri/lerc/issues"},"description":"Rapid decoding of Lerc compressed raster data for any standard pixel type.","version":"3.0.0","author":{"name":"Esri","email":"dev_tools@esri.com","url":"http://developers.arcgis.com"},"contributors":[{"name":"Johannes Schmid"},{"name":"Chayanika Khatua"},{"name":"Wenxue Ju"}],"devDependencies":{"gh-release":"^2.2.1","jsdoc-to-markdown":"^2.0.1","jshint":"^2.13.0","uglify-js":"^3.14.0"},"homepage":"https://github.com/Esri/lerc","license":"Apache-2.0","main":"LercDecode.js","repository":{"type":"git","url":"git+https://github.com/Esri/lerc.git"},"scripts":{"lint":"jshint LercDecode.js","build":"uglifyjs LercDecode.js -o LercDecode.min.js --comments","docs":"jsdoc2md --template README.hbs --files LercDecode.js","release":"./release.sh"},"_id":"lerc@3.0.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"shasum":"36f36fbd4ba46f0abf4833799fff2e7d6865f5cb","size":28759,"noattachment":false,"key":"/lerc/-/lerc-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lerc/download/lerc-3.0.0.tgz"},"_npmUser":{"name":"wjugis","email":"juwenxue@gmail.com"},"directories":{},"maintainers":[{"name":"esri_dev","email":"dev_tools@esri.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lerc_3.0.0_1627673302700_0.8335986597131098"},"_hasShrinkwrap":false,"publish_time":1627673302892,"_cnpm_publish_time":1627673302892,"_cnpmcore_publish_time":"2021-12-16T23:54:38.549Z"},"2.0.0":{"name":"lerc","browser":"LercDecode.js","bugs":{"url":"https://github.com/esri/lerc/issues"},"description":"Rapid decoding of Lerc compressed raster data for any standard pixel type.","version":"2.0.0","author":{"name":"Esri","email":"dev_tools@esri.com","url":"http://developers.arcgis.com"},"contributors":[{"name":"Johannes Schmid"},{"name":"Chayanika Khatua"},{"name":"Wenxue Ju"}],"devDependencies":{"gh-release":"^2.2.1","jsdoc-to-markdown":"^2.0.1","jshint":"^2.9.4","uglify-js":"^2.7.5"},"homepage":"https://github.com/Esri/lerc","license":"Apache-2.0","main":"LercDecode.js","repository":{"type":"git","url":"git+https://github.com/Esri/lerc.git"},"scripts":{"lint":"jshint LercDecode.js","build":"uglifyjs LercDecode.js -o LercDecode.min.js --comments","docs":"jsdoc2md --template README.hbs --files LercDecode.js","release":"./release.sh"},"_id":"lerc@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"6.9.3","_npmUser":{"name":"esri_dev","email":"dev_tools@esri.com"},"dist":{"shasum":"82feca29ea6202799a815ca38f7b66a370e8cf9b","size":26414,"noattachment":false,"key":"/lerc/-/lerc-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lerc/download/lerc-2.0.0.tgz"},"maintainers":[{"name":"esri_dev","email":"dev_tools@esri.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lerc_2.0.0_1541625219773_0.7635253586747766"},"_hasShrinkwrap":false,"publish_time":1541625219920,"_cnpm_publish_time":1541625219920,"_cnpmcore_publish_time":"2021-12-16T23:54:38.813Z"},"1.0.1":{"name":"lerc","browser":"LercDecode.js","bugs":{"url":"https://github.com/esri/lerc/issues"},"description":"Rapid decoding of Lerc compressed raster data for any standard pixel type.","version":"1.0.1","author":{"name":"Esri","email":"dev_tools@esri.com","url":"http://developers.arcgis.com"},"contributors":[{"name":"Johannes Schmid"},{"name":"Chayanika Khatua"},{"name":"Wenxue Ju"}],"devDependencies":{"gh-release":"^2.2.1","jsdoc-to-markdown":"^2.0.1","jshint":"^2.9.4","uglify-js":"^2.7.5"},"homepage":"https://github.com/Esri/lerc","license":"Apache-2.0","main":"LercDecode.js","repository":{"type":"git","url":"git+https://github.com/Esri/lerc.git"},"scripts":{"lint":"jshint LercDecode.js","build":"uglifyjs LercDecode.js -o LercDecode.min.js --comments","docs":"jsdoc2md --template README.hbs --files LercDecode.js","release":"./release.sh"},"_id":"lerc@1.0.1","_shasum":"aefb33670cae23761e8a77440d3ea06ce33e5134","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"esri_dev","email":"dev_tools@esri.com"},"dist":{"shasum":"aefb33670cae23761e8a77440d3ea06ce33e5134","size":19694,"noattachment":false,"key":"/lerc/-/lerc-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/lerc/download/lerc-1.0.1.tgz"},"maintainers":[{"name":"esri_dev","email":"dev_tools@esri.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/lerc-1.0.1.tgz_1487787224992_0.45467108651064336"},"directories":{},"publish_time":1487787226894,"_hasShrinkwrap":false,"_cnpm_publish_time":1487787226894,"_cnpmcore_publish_time":"2021-12-16T23:54:39.057Z"},"1.0.0":{"name":"lerc","browser":"LercDecode.js","bugs":{"url":"https://github.com/esri/lerc/issues"},"description":"Rapid decoding of Lerc compressed raster data for any standard pixel type.","version":"1.0.0","author":{"name":"Esri","email":"dev_tools@esri.com","url":"http://developers.arcgis.com"},"contributors":[{"name":"Johannes Schmid"},{"name":"Chayanika Khatua"},{"name":"Wenxue Ju"}],"devDependencies":{"jsdoc-to-markdown":"^2.0.1","jshint":"^2.9.4","uglify-js":"^2.7.5"},"homepage":"https://github.com/Esri/lerc","license":"Apache-2.0","main":"LercDecode.js","repository":{"type":"git","url":"git+https://github.com/%3AEsri/lerc.git"},"scripts":{"lint":"jshint LercDecode.js","build":"uglifyjs LercDecode.js -o LercDecode.min.js --comments","docs":"jsdoc2md --template README.hbs --files LercDecode.js"},"_id":"lerc@1.0.0","_shasum":"bd264fa7eafc18c17c1fd8dc2a620136b04350a3","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"esri_dev","email":"dev_tools@esri.com"},"dist":{"shasum":"bd264fa7eafc18c17c1fd8dc2a620136b04350a3","size":26967,"noattachment":false,"key":"/lerc/-/lerc-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lerc/download/lerc-1.0.0.tgz"},"maintainers":[{"name":"esri_dev","email":"dev_tools@esri.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/lerc-1.0.0.tgz_1484247463032_0.22730500088073313"},"directories":{},"publish_time":1484247465195,"_hasShrinkwrap":false,"_cnpm_publish_time":1484247465195,"_cnpmcore_publish_time":"2021-12-16T23:54:39.316Z"}},"readme":"[![npm version][npm-img]][npm-url]\n\n[npm-img]: https://img.shields.io/npm/v/lerc.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/lerc\n\n# Lerc JS\n\n> Rapid decoding of Lerc compressed raster data for any standard pixel type, not just rgb or byte.\n\n# Breaking changes\n- [Web Assembly](https://caniuse.com/wasm) support is now required.\n- <code>Lerc.load()</code> must be invoked and the returned promise must be resolved prior to <code>Lerc.decode</code>. This only needs to be done once per worker (or the main thread). There's no extra cost when invoked multiple times as the internal wasm loading promise is cached.\n\n## Get started\n\n```js\nnpm install lerc\n\n// es module\nimport * as Lerc from 'lerc';\n\n// commonJS\nconst Lerc = require('lerc');\n```\n\n```js\n// use umd via a script tag\n<script type=\"text/javascript\" src=\"https://unpkg.com/lerc@latest/LercDecode.min.js\"></script>\n```\n\n## Sample usage\n\n```js\nawait Lerc.load();\n\nconst arrayBuffer = await fetch('http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer/tile/0/0/0')\n  .then(response => response.arrayBuffer());\nconst pixelBlock = Lerc.decode(arrayBuffer);\nconst { height, width, pixels, mask } = pixelBlock;\nfor (let i = 0; i < height; i++) {\n  for (let j = 0; j < width; j++) {\n    if (!mask || mask[i * width + j]) {\n      // do something with valid pixel (i,j)\n    }\n  }\n}\n\n// use options\nconst pixelBlock = Lerc.decode(arrayBuffer, {\n  inputOffset: 10, // start from the 10th byte (default is 0)\n  returnInterleaved: true // only applicable to n-depth lerc blobs (default is false)\n});\n```\n\n\n## API Reference\n\n<a name=\"module_Lerc\"></a>\n\n## Lerc\nA module for decoding LERC blobs.\n\n<a name=\"exp_module_Lerc--load\"></a>\n\n### load([options]) ⇒ <code>Promise<void></code> ⏏\nLoad the dependencies (web assembly). Check whether dependencies has been loaded using <code>Lerc.isLoaded()</code>. The loading promise is cached so it can be invoked multiple times if needed.\n\n\n**Kind**: Exported function\n\n| Param | Type | Description |\n| --- | --- | --- |\n| [options.locateFile] | <code>(wasmFileName?: string, scriptDir?: string) => string</code> | The function to locate lerc-wasm.wasm. Used when the web assembly file is moved to a different location. |\n\n\n<a name=\"exp_module_Lerc--decode\"></a>\n\n### decode(input, [options]) ⇒ <code>Object</code> ⏏\nA function for decoding both LERC1 and LERC2 byte streams capable of handling multiband pixel blocks for various pixel types.\n\n**Kind**: Exported function\n\n| Param | Type | Description |\n| --- | --- | --- |\n| input | <code>ArrayBuffer</code> | The LERC input byte stream |\n| [options] | <code>object</code> | The decoding options below are optional. |\n| [options.inputOffset] | <code>number</code> | The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. |\n| [options.noDataValue] | <code>number</code> | It is recommended to use the returned mask instead of setting this value. |\n| (Deprecated) [options.returnPixelInterleavedDims] | <code>boolean</code> | will be removed in next release, use returnInterleaved instead. |\n| [options.returnInterleaved] | <code>boolean</code> | (ndepth LERC2 only) If true, returned depth values are pixel-interleaved. |\n\n**Result Object Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| width | <code>number</code> | Width of decoded image. |\n| height | <code>number</code> | Height of decoded image. |\n| pixels | <code>array</code> | [band1, band2, …] Each band is a typed array of width * height * depthCount. |\n| pixelType | <code>string</code> | The type of pixels represented in the output. |\n| mask | <code>mask</code> | Typed array with a size of width*height, or null if all pixels are valid. |\n| statistics | <code>array</code> | [statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values |\n| (Deprecated) dimCount | <code>number</code> | Will be removed in next release, use <code>depthCount</code> instead.\n| depthCount | <code>number</code> | Depth count\n| [bandMasks] | <code>array</code> | [band1_mask, band2_mask, …] Each band is a Uint8Array of width * height * depthCount.  |\n\n* * *\n\n## Licensing\n\nCopyright &copy; 2017-2022 Esri\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and limitations under the License.\n\nA local copy of the license and additional notices are located with the source distribution at:\n\nhttp://github.com/Esri/lerc/","_attachments":{},"homepage":"https://github.com/Esri/lerc","bugs":{"url":"https://github.com/esri/lerc/issues"},"license":"Apache-2.0"}