{"_id":"@derschmale/spherical-harmonizer","_rev":"2-576af44a7a9281445f4abf4bc89a89f7","name":"@derschmale/spherical-harmonizer","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@derschmale/spherical-harmonizer","version":"0.1.0","main":"build/sh.js","module":"build/sh.module.js","types":"build/types/main.d.ts","repository":{"type":"git","url":"git+https://github.com/DerSchmale/spherical-harmonizer.git"},"scripts":{"build":"rollup -c","docs":"typedoc --out ./docs/ ./src/ --mode file"},"license":"MIT","devDependencies":{"@rollup/plugin-node-resolve":"^11.0.1","@types/chai":"^4.2.14","@types/mocha":"^8.2.0","chai":"^4.2.0","mocha":"^8.2.1","rollup":"^2.35.1","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typedoc":"^0.19.2","typescript":"^4.1.3"},"keywords":["spherical harmonics","3d","irradiance","hdr","hdri"],"gitHead":"6606b84ae3fd24d0247c2033aa6ae2b299d12090","description":"A Typescript library to generate L2 spherical harmonics.","bugs":{"url":"https://github.com/DerSchmale/spherical-harmonizer/issues"},"homepage":"https://github.com/DerSchmale/spherical-harmonizer#readme","_id":"@derschmale/spherical-harmonizer@0.1.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.10","dist":{"integrity":"sha512-GftwWDlj5hrpIZ+bePRxHTFUBu2P+z+gOBac4EifmvR53TvdqggmiSoHbnLieyMUWEIUjg66VzrVlj5bD88tog==","shasum":"59829fc29792203015eed073c649b7d673781cda","tarball":"https://registry.npmjs.org/@derschmale/spherical-harmonizer/-/spherical-harmonizer-0.1.0.tgz","fileCount":9,"unpackedSize":12930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf52b8CRA9TVsSAnZWagAAfikP/3uvZKGah/jXCmYcvJU8\nzRfSWjRx9bjFNkSium+VzAh7iJ2EyJHDFRDxh+l7aznI7qpoF9cfcySHqAn5\n+flj2rd2cibsePJnhZhh9TCicheZCCdYmeUqh4Bwxssjeax2o9OJddnDPlGF\nbfFUyL5PjNC911OmZO/r++giOxohzL0S77YocxrWx3TnsHpjhcl5BGy4WDY1\nAvLA7Mj2XeCe41YCz55TL9WGzjp9DcV+xe72NL37FXRVWB4ussqgwPd2+4dU\nYtWbVnI7Mt0ap9+XQvMpivv2BLXs3SHUFqSX8KlrcEdz3TX45lC2lCOGihh2\ndv2QVLohNSxLBXMOOGRqZ+PmezjUCcjU/MjNNLiAV53pwcD7i/zNbrlbxaIB\nZZrrkSbaAmmZBr2f9Mziq/DISCUSIhZVDtNGvZ7SFxr7W42/pe5evwXGetxt\nbNT/l2LN6ODo06PGaowYCe+Z2UMz9pqFAYLGl8unWlwv0jrSinMT0rBqy30C\nb/uA5DOlypguIy8xwqAM7Jjo4Y9itGu30foIKBsJFDDx0w26f0g20x0aW2+i\nw1/WfWquLHEKcrh03jVYTLMiK7tiqA8WsZSC8k+CT91aYFFagZtbA4wUiyfS\nSBhjwjm+LLt7VEykRpwdENQLp+neBsljFmOICPbAjUjX/ffbRKYS71vTsr27\naaTK\r\n=5AGZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuU4o0xwgRQtztn4qwR6WERrL0se/xVtecI1nHNpJaaAIgb7H6pCLVjYhFu5szOcZUtqCfifl0FSY+SDQccUq9wYI="}]},"_npmUser":{"name":"~derschmale","email":"david.lenaerts@gmail.com"},"directories":{},"maintainers":[{"name":"~derschmale","email":"david.lenaerts@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spherical-harmonizer_0.1.0_1609000699588_0.39105617023142214"},"_hasShrinkwrap":false},"0.1.1":{"name":"@derschmale/spherical-harmonizer","version":"0.1.1","main":"build/sh.js","module":"build/sh.module.js","types":"build/types/main.d.ts","repository":{"type":"git","url":"git+https://github.com/DerSchmale/spherical-harmonizer.git"},"scripts":{"build":"rollup -c","docs":"typedoc --out ./docs/ ./src/ --mode file"},"license":"MIT","devDependencies":{"@rollup/plugin-node-resolve":"^11.0.1","@types/chai":"^4.2.14","@types/mocha":"^8.2.0","chai":"^4.2.0","mocha":"^8.2.1","rollup":"^2.35.1","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typedoc":"^0.19.2","typescript":"^4.1.3"},"keywords":["spherical harmonics","3d","irradiance","hdr","hdri"],"gitHead":"813bdefd1ae54703af85ce3318152b543dd69d38","description":"A Typescript library to generate L2 spherical harmonics.","bugs":{"url":"https://github.com/DerSchmale/spherical-harmonizer/issues"},"homepage":"https://github.com/DerSchmale/spherical-harmonizer#readme","_id":"@derschmale/spherical-harmonizer@0.1.1","_nodeVersion":"12.16.3","_npmVersion":"6.14.10","dist":{"integrity":"sha512-WxNzPKt5Op9htap1C0TgnfEJ+/IrW+oe27xtE+etl3vBXyKXlf76J8ntDRh4sIb3gVpx0bdgf2tMO4KALUAidA==","shasum":"7175424df2734195265f1aee70f89728f72b543e","tarball":"https://registry.npmjs.org/@derschmale/spherical-harmonizer/-/spherical-harmonizer-0.1.1.tgz","fileCount":10,"unpackedSize":17122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf54p8CRA9TVsSAnZWagAA9YUP/36uvKXONFp3LbF1k3kE\nNLQ91CoG+RZTpdDuFvjiO3W6nwhfwhcSI4mpnz9FPiCKhzOXecaTrtFMy4JM\ntF+63ereXTM1yQN86AHt42Fn8z0OCw9Db1bAd8a8sHYn62dnTsvcxHReMlii\nVygs09IuQ8P91Soak9ExzGtAU2sDmGpCPIwTw9LC7b3Im68h+11BD4gg0WNw\ndcGh2zYnLzVJD3dJ214/e6NVC7pJXh9KPdbWv4m4vxvd9L+KlFT6Ul+NHo4y\nsQZMjI9cqNMPeeysTgBmqH4cU3735feXPXpn1i8TVN23dERY32d7M8L4HXL4\nZKlMU/GpGrtTaVAkoD5g0bnG9I0ddy+1G0MlDmvwHZMtkY0eMIcU6GtdCeIY\nIM8ezhFgFHY7vxXDHqDKKQApLs3TW1E7zXxn3j89aDpM3nqACMfxZL7K3xoJ\nIF3Ow55iv+ko6IxRir9QN9xkuTpUHxw1s4ra7qfm4Syqgs7lQde8u9wm7si0\nDH8cXwuVlHid5e6idc5y9Fsdix8KX0Qfzu4t8008KmSw/eFLpOs7lN8V+dDr\naQ79RMzr8HRr420Ye1QFyTWKx8k/RPG1+C312sMevIYEDkKPt1KJoskJ0pcL\nHuLKw/uhYxm5mVB2DKgF9GT+0qGjWm0fJ1XBCzhO/RkwNPmv5/LhJpmkT4Kp\nAbps\r\n=VN/h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZDvg67u+ruACAi+xRkz55hVnWk1/hrCaZZFbGp2ykrAiEAhUFbNFElUXOQ/XEO2j54WR1MrsbJeSZ1Rch+wM3LGBc="}]},"_npmUser":{"name":"~derschmale","email":"david.lenaerts@gmail.com"},"directories":{},"maintainers":[{"name":"~derschmale","email":"david.lenaerts@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spherical-harmonizer_0.1.1_1609009788289_0.6206436521953018"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-26T16:38:19.370Z","0.1.0":"2020-12-26T16:38:19.759Z","modified":"2022-04-05T03:48:52.649Z","0.1.1":"2020-12-26T19:09:48.439Z"},"maintainers":[{"name":"~derschmale","email":"david.lenaerts@gmail.com"}],"description":"A Typescript library to generate L2 spherical harmonics.","homepage":"https://github.com/DerSchmale/spherical-harmonizer#readme","keywords":["spherical harmonics","3d","irradiance","hdr","hdri"],"repository":{"type":"git","url":"git+https://github.com/DerSchmale/spherical-harmonizer.git"},"bugs":{"url":"https://github.com/DerSchmale/spherical-harmonizer/issues"},"license":"MIT","readme":"# Spherical Harmonizer\r\n\r\nA Typescript library to generate L2 spherical harmonics.\r\n\r\n## Example \r\n\r\n[Web interface](http://derschmale.github.io/spherical-harmonizer/example)\r\n\r\n\r\n## Documentation\r\n\r\n[Code reference](http://derschmale.github.io/spherical-harmonizer/docs)\r\n\r\nThere's only one relevant method to be called:\r\n\r\n`generateSH(data, width, height, onComplete, onProgress, options)`\r\n\r\n- `data`: A `Float32Array` with packed RGB data or a `Uint8ClampedArray` containing packed RGBA \r\n  data, containing the panorama image.\r\n- `width`: The width of the image contained in `data`.\r\n- `height`: The height of the image contained in `data`.\r\n- `onComplete`: A function called when the generation is complete. An array of `RGB` values will be\r\n  passed, one for each SH coefficient.\r\n- `onProgress` (optional): Called with a value from 0 - 1.\r\n- `options` (optional): An object containing options for generations (irradiance).\r\n\r\nHere's an example:\r\n\r\n```\r\nimport { decodeRGBE } from \"@derschmale/io-rgbe\";\r\nimport { generateSH } from \"@derschmale/spherical-harmonizer\"; \r\n\r\n\r\nfunction convert(arrayBuffer) {\r\n    const hdr = decodeRGBE(new DataView(arrayBuffer));\r\n    generateSH(hdr.data, hdr.width, hdr.height, onComplete);\r\n}\r\n\r\nfunction onComplete(sh)\r\n{\r\n    // do something with sh coefficients\r\n}\r\n\r\nconst request = new XMLHttpRequest();\r\nrequest.open(\"GET\", \"/panorama.hdr\", true);\r\nrequest.responseType = \"arraybuffer\";\r\nrequest.onload = _ => {\r\n    const arrayBuffer = request.response; // Note: not oReq.responseText\r\n    if (arrayBuffer)\r\n        convert(arrayBuffer);\r\n};\r\n\r\nrequest.send(null);\r\n\r\n\r\n\r\n\r\n```\r\n\r\n\r\n## Building\r\n\r\nBuilding the code is simples:\r\n```\r\nnpm install\r\nnpm run build\r\n```\r\n","readmeFilename":"README.md"}