@mountaya/elements 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +235 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1509 -2
- package/THIRD-PARTY-NOTICES.txt +103 -0
- package/dist/accentColor-GNKBD2CW.js +4 -0
- package/dist/accentColor-GNKBD2CW.js.map +1 -0
- package/dist/accentColor-VX2JSMGE.cjs +17 -0
- package/dist/accentColor-VX2JSMGE.cjs.map +1 -0
- package/dist/agent/index.cjs +1964 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +2016 -0
- package/dist/agent/index.d.ts +2016 -0
- package/dist/agent/index.js +1937 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/amenities-B3-qAjxu.d.cts +160 -0
- package/dist/amenities-B3-qAjxu.d.ts +160 -0
- package/dist/bundle-Je5zsRFg.d.cts +222 -0
- package/dist/bundle-xYrrbJTH.d.ts +222 -0
- package/dist/camera/index.cjs +3477 -0
- package/dist/camera/index.cjs.map +1 -0
- package/dist/camera/index.d.cts +1751 -0
- package/dist/camera/index.d.ts +1751 -0
- package/dist/camera/index.js +3328 -0
- package/dist/camera/index.js.map +1 -0
- package/dist/camera-BrFLU1DH.d.cts +549 -0
- package/dist/camera-C48Ykaxv.d.ts +549 -0
- package/dist/chunk-23PFRRB6.js +3 -0
- package/dist/chunk-23PFRRB6.js.map +1 -0
- package/dist/chunk-2GI5SAH2.js +71 -0
- package/dist/chunk-2GI5SAH2.js.map +1 -0
- package/dist/chunk-2MQK6A74.js +39 -0
- package/dist/chunk-2MQK6A74.js.map +1 -0
- package/dist/chunk-2RE7R4LD.js +73 -0
- package/dist/chunk-2RE7R4LD.js.map +1 -0
- package/dist/chunk-3JZQKN4O.js +6 -0
- package/dist/chunk-3JZQKN4O.js.map +1 -0
- package/dist/chunk-3NDXVUUI.js +50 -0
- package/dist/chunk-3NDXVUUI.js.map +1 -0
- package/dist/chunk-3R4GFTUM.cjs +59 -0
- package/dist/chunk-3R4GFTUM.cjs.map +1 -0
- package/dist/chunk-3RVUQ6JN.cjs +22 -0
- package/dist/chunk-3RVUQ6JN.cjs.map +1 -0
- package/dist/chunk-4F6BJMJC.cjs +49 -0
- package/dist/chunk-4F6BJMJC.cjs.map +1 -0
- package/dist/chunk-4NWQD4BX.js +132 -0
- package/dist/chunk-4NWQD4BX.js.map +1 -0
- package/dist/chunk-5K2MH3R6.js +10 -0
- package/dist/chunk-5K2MH3R6.js.map +1 -0
- package/dist/chunk-6ACRNQQQ.cjs +8 -0
- package/dist/chunk-6ACRNQQQ.cjs.map +1 -0
- package/dist/chunk-6D26E3IA.js +66 -0
- package/dist/chunk-6D26E3IA.js.map +1 -0
- package/dist/chunk-6ESAW35P.cjs +80 -0
- package/dist/chunk-6ESAW35P.cjs.map +1 -0
- package/dist/chunk-6LIW2A5M.cjs +1176 -0
- package/dist/chunk-6LIW2A5M.cjs.map +1 -0
- package/dist/chunk-6OTTWVCA.js +57 -0
- package/dist/chunk-6OTTWVCA.js.map +1 -0
- package/dist/chunk-6VROJ4UG.js +862 -0
- package/dist/chunk-6VROJ4UG.js.map +1 -0
- package/dist/chunk-6Y7FTGO4.js +23 -0
- package/dist/chunk-6Y7FTGO4.js.map +1 -0
- package/dist/chunk-75I4CG64.js +104 -0
- package/dist/chunk-75I4CG64.js.map +1 -0
- package/dist/chunk-7CUBXHAH.cjs +14 -0
- package/dist/chunk-7CUBXHAH.cjs.map +1 -0
- package/dist/chunk-7GTCURVY.js +52 -0
- package/dist/chunk-7GTCURVY.js.map +1 -0
- package/dist/chunk-7IWOL6AM.cjs +100 -0
- package/dist/chunk-7IWOL6AM.cjs.map +1 -0
- package/dist/chunk-7QN7M667.cjs +151 -0
- package/dist/chunk-7QN7M667.cjs.map +1 -0
- package/dist/chunk-A6KQDKLM.cjs +1197 -0
- package/dist/chunk-A6KQDKLM.cjs.map +1 -0
- package/dist/chunk-A77EA67G.js +354 -0
- package/dist/chunk-A77EA67G.js.map +1 -0
- package/dist/chunk-AFKOABJ4.cjs +7194 -0
- package/dist/chunk-AFKOABJ4.cjs.map +1 -0
- package/dist/chunk-AG6JV5Z2.cjs +183 -0
- package/dist/chunk-AG6JV5Z2.cjs.map +1 -0
- package/dist/chunk-APBK7NMS.js +30 -0
- package/dist/chunk-APBK7NMS.js.map +1 -0
- package/dist/chunk-AWO5YA7A.cjs +33 -0
- package/dist/chunk-AWO5YA7A.cjs.map +1 -0
- package/dist/chunk-AZATU6QW.js +108 -0
- package/dist/chunk-AZATU6QW.js.map +1 -0
- package/dist/chunk-BD2U3WST.cjs +623 -0
- package/dist/chunk-BD2U3WST.cjs.map +1 -0
- package/dist/chunk-BHBEOU6L.cjs +65 -0
- package/dist/chunk-BHBEOU6L.cjs.map +1 -0
- package/dist/chunk-CNOSNYNE.js +8 -0
- package/dist/chunk-CNOSNYNE.js.map +1 -0
- package/dist/chunk-CW3EFR4O.js +12 -0
- package/dist/chunk-CW3EFR4O.js.map +1 -0
- package/dist/chunk-DASVRNBK.js +7187 -0
- package/dist/chunk-DASVRNBK.js.map +1 -0
- package/dist/chunk-DJ6LCKYP.js +42 -0
- package/dist/chunk-DJ6LCKYP.js.map +1 -0
- package/dist/chunk-E5FHQAIO.cjs +45 -0
- package/dist/chunk-E5FHQAIO.cjs.map +1 -0
- package/dist/chunk-EOML5OTY.cjs +360 -0
- package/dist/chunk-EOML5OTY.cjs.map +1 -0
- package/dist/chunk-EP5CASHL.js +613 -0
- package/dist/chunk-EP5CASHL.js.map +1 -0
- package/dist/chunk-EP5OEEVZ.cjs +14 -0
- package/dist/chunk-EP5OEEVZ.cjs.map +1 -0
- package/dist/chunk-EUXI3FGQ.js +150 -0
- package/dist/chunk-EUXI3FGQ.js.map +1 -0
- package/dist/chunk-EWFSHCOS.js +40 -0
- package/dist/chunk-EWFSHCOS.js.map +1 -0
- package/dist/chunk-EX2C5K2T.cjs +25 -0
- package/dist/chunk-EX2C5K2T.cjs.map +1 -0
- package/dist/chunk-FEXWDQIZ.cjs +8 -0
- package/dist/chunk-FEXWDQIZ.cjs.map +1 -0
- package/dist/chunk-FEYBFY7H.cjs +358 -0
- package/dist/chunk-FEYBFY7H.cjs.map +1 -0
- package/dist/chunk-FRGAV6N6.cjs +34 -0
- package/dist/chunk-FRGAV6N6.cjs.map +1 -0
- package/dist/chunk-G5DHP5VF.js +6 -0
- package/dist/chunk-G5DHP5VF.js.map +1 -0
- package/dist/chunk-G5W2UHV2.js +99 -0
- package/dist/chunk-G5W2UHV2.js.map +1 -0
- package/dist/chunk-G7OP7O2C.cjs +39 -0
- package/dist/chunk-G7OP7O2C.cjs.map +1 -0
- package/dist/chunk-GE6CFCAM.cjs +25 -0
- package/dist/chunk-GE6CFCAM.cjs.map +1 -0
- package/dist/chunk-GIFALLHI.cjs +111 -0
- package/dist/chunk-GIFALLHI.cjs.map +1 -0
- package/dist/chunk-GLFET5GM.js +129 -0
- package/dist/chunk-GLFET5GM.js.map +1 -0
- package/dist/chunk-GQ6UFPFM.js +22 -0
- package/dist/chunk-GQ6UFPFM.js.map +1 -0
- package/dist/chunk-GQJWVMXS.js +129 -0
- package/dist/chunk-GQJWVMXS.js.map +1 -0
- package/dist/chunk-GVVJPUKC.js +80 -0
- package/dist/chunk-GVVJPUKC.js.map +1 -0
- package/dist/chunk-GZ2HOCQ2.cjs +134 -0
- package/dist/chunk-GZ2HOCQ2.cjs.map +1 -0
- package/dist/chunk-HCBOHXWP.js +37 -0
- package/dist/chunk-HCBOHXWP.js.map +1 -0
- package/dist/chunk-IBQJDVHF.cjs +281 -0
- package/dist/chunk-IBQJDVHF.cjs.map +1 -0
- package/dist/chunk-ISLB6Y5Q.cjs +106 -0
- package/dist/chunk-ISLB6Y5Q.cjs.map +1 -0
- package/dist/chunk-J55CRR4F.js +105 -0
- package/dist/chunk-J55CRR4F.js.map +1 -0
- package/dist/chunk-JBG6Z6MQ.cjs +28 -0
- package/dist/chunk-JBG6Z6MQ.cjs.map +1 -0
- package/dist/chunk-K3RQOZRU.js +61 -0
- package/dist/chunk-K3RQOZRU.js.map +1 -0
- package/dist/chunk-KDJYS4GB.cjs +703 -0
- package/dist/chunk-KDJYS4GB.cjs.map +1 -0
- package/dist/chunk-KMCAHUZM.cjs +4 -0
- package/dist/chunk-KMCAHUZM.cjs.map +1 -0
- package/dist/chunk-KUCBNPC6.js +87 -0
- package/dist/chunk-KUCBNPC6.js.map +1 -0
- package/dist/chunk-KV6UE5A4.js +50 -0
- package/dist/chunk-KV6UE5A4.js.map +1 -0
- package/dist/chunk-L6TZ2HQR.cjs +18 -0
- package/dist/chunk-L6TZ2HQR.cjs.map +1 -0
- package/dist/chunk-L7QHHGG2.cjs +141 -0
- package/dist/chunk-L7QHHGG2.cjs.map +1 -0
- package/dist/chunk-LHK3Y2AL.js +271 -0
- package/dist/chunk-LHK3Y2AL.js.map +1 -0
- package/dist/chunk-LO5RYRBH.cjs +6317 -0
- package/dist/chunk-LO5RYRBH.cjs.map +1 -0
- package/dist/chunk-LS5SJMUO.cjs +194 -0
- package/dist/chunk-LS5SJMUO.cjs.map +1 -0
- package/dist/chunk-LUGTMZFN.cjs +42 -0
- package/dist/chunk-LUGTMZFN.cjs.map +1 -0
- package/dist/chunk-LVUQU6D5.js +32 -0
- package/dist/chunk-LVUQU6D5.js.map +1 -0
- package/dist/chunk-M2QRC2GZ.js +166 -0
- package/dist/chunk-M2QRC2GZ.js.map +1 -0
- package/dist/chunk-M6QJYQIM.cjs +53 -0
- package/dist/chunk-M6QJYQIM.cjs.map +1 -0
- package/dist/chunk-MGCPH5EO.js +12 -0
- package/dist/chunk-MGCPH5EO.js.map +1 -0
- package/dist/chunk-MLVUWEZR.cjs +474 -0
- package/dist/chunk-MLVUWEZR.cjs.map +1 -0
- package/dist/chunk-MTAMJMZL.cjs +707 -0
- package/dist/chunk-MTAMJMZL.cjs.map +1 -0
- package/dist/chunk-MXL5AT3N.js +48 -0
- package/dist/chunk-MXL5AT3N.js.map +1 -0
- package/dist/chunk-MYEQSESM.cjs +75 -0
- package/dist/chunk-MYEQSESM.cjs.map +1 -0
- package/dist/chunk-N3VPF6ZD.js +427 -0
- package/dist/chunk-N3VPF6ZD.js.map +1 -0
- package/dist/chunk-N6VUAIGI.js +7 -0
- package/dist/chunk-N6VUAIGI.js.map +1 -0
- package/dist/chunk-N6XRLUN6.js +6286 -0
- package/dist/chunk-N6XRLUN6.js.map +1 -0
- package/dist/chunk-NOGDOZIT.cjs +114 -0
- package/dist/chunk-NOGDOZIT.cjs.map +1 -0
- package/dist/chunk-NUWXEISH.cjs +10 -0
- package/dist/chunk-NUWXEISH.cjs.map +1 -0
- package/dist/chunk-NZCZHXYN.cjs +161 -0
- package/dist/chunk-NZCZHXYN.cjs.map +1 -0
- package/dist/chunk-ODROSWQX.cjs +53 -0
- package/dist/chunk-ODROSWQX.cjs.map +1 -0
- package/dist/chunk-OE36AYKG.cjs +82 -0
- package/dist/chunk-OE36AYKG.cjs.map +1 -0
- package/dist/chunk-OLON7MO6.cjs +437 -0
- package/dist/chunk-OLON7MO6.cjs.map +1 -0
- package/dist/chunk-PBUOR2IT.js +277 -0
- package/dist/chunk-PBUOR2IT.js.map +1 -0
- package/dist/chunk-PC2ELXFF.cjs +225 -0
- package/dist/chunk-PC2ELXFF.cjs.map +1 -0
- package/dist/chunk-PCSGXLOC.js +71 -0
- package/dist/chunk-PCSGXLOC.js.map +1 -0
- package/dist/chunk-PFNMP6FQ.js +56 -0
- package/dist/chunk-PFNMP6FQ.js.map +1 -0
- package/dist/chunk-PIWSZTIP.js +690 -0
- package/dist/chunk-PIWSZTIP.js.map +1 -0
- package/dist/chunk-PKWHJ2GI.js +136 -0
- package/dist/chunk-PKWHJ2GI.js.map +1 -0
- package/dist/chunk-PLMVBX2A.cjs +76 -0
- package/dist/chunk-PLMVBX2A.cjs.map +1 -0
- package/dist/chunk-PM3XCD2G.cjs +113 -0
- package/dist/chunk-PM3XCD2G.cjs.map +1 -0
- package/dist/chunk-QAL4GZO7.cjs +143 -0
- package/dist/chunk-QAL4GZO7.cjs.map +1 -0
- package/dist/chunk-QDB2SEA2.js +74 -0
- package/dist/chunk-QDB2SEA2.js.map +1 -0
- package/dist/chunk-QOV7UNUN.js +25 -0
- package/dist/chunk-QOV7UNUN.js.map +1 -0
- package/dist/chunk-QQUWYLSF.cjs +50 -0
- package/dist/chunk-QQUWYLSF.cjs.map +1 -0
- package/dist/chunk-QUMBH3U4.cjs +9 -0
- package/dist/chunk-QUMBH3U4.cjs.map +1 -0
- package/dist/chunk-R4KA7OFQ.js +12 -0
- package/dist/chunk-R4KA7OFQ.js.map +1 -0
- package/dist/chunk-RBSGAZQQ.js +17 -0
- package/dist/chunk-RBSGAZQQ.js.map +1 -0
- package/dist/chunk-RM5YJWZI.js +46 -0
- package/dist/chunk-RM5YJWZI.js.map +1 -0
- package/dist/chunk-ROKNKXA4.cjs +8 -0
- package/dist/chunk-ROKNKXA4.cjs.map +1 -0
- package/dist/chunk-RQG6D546.cjs +75 -0
- package/dist/chunk-RQG6D546.cjs.map +1 -0
- package/dist/chunk-SG4YDD5L.cjs +74 -0
- package/dist/chunk-SG4YDD5L.cjs.map +1 -0
- package/dist/chunk-SNRCA7EO.js +56 -0
- package/dist/chunk-SNRCA7EO.js.map +1 -0
- package/dist/chunk-SO75R4WW.cjs +22 -0
- package/dist/chunk-SO75R4WW.cjs.map +1 -0
- package/dist/chunk-SP34NHFI.js +45 -0
- package/dist/chunk-SP34NHFI.js.map +1 -0
- package/dist/chunk-SSKSSBWJ.cjs +179 -0
- package/dist/chunk-SSKSSBWJ.cjs.map +1 -0
- package/dist/chunk-TB5663C2.js +1108 -0
- package/dist/chunk-TB5663C2.js.map +1 -0
- package/dist/chunk-TGH4NRES.js +220 -0
- package/dist/chunk-TGH4NRES.js.map +1 -0
- package/dist/chunk-TJ6ZPNID.js +189 -0
- package/dist/chunk-TJ6ZPNID.js.map +1 -0
- package/dist/chunk-U45T35N2.cjs +90 -0
- package/dist/chunk-U45T35N2.cjs.map +1 -0
- package/dist/chunk-UKVOPEZ2.js +442 -0
- package/dist/chunk-UKVOPEZ2.js.map +1 -0
- package/dist/chunk-UTB4NROA.cjs +887 -0
- package/dist/chunk-UTB4NROA.cjs.map +1 -0
- package/dist/chunk-UTW33B5V.js +6 -0
- package/dist/chunk-UTW33B5V.js.map +1 -0
- package/dist/chunk-UYUBSD2V.cjs +33 -0
- package/dist/chunk-UYUBSD2V.cjs.map +1 -0
- package/dist/chunk-V3JEP5AG.cjs +59 -0
- package/dist/chunk-V3JEP5AG.cjs.map +1 -0
- package/dist/chunk-VFAGJXHR.js +18 -0
- package/dist/chunk-VFAGJXHR.js.map +1 -0
- package/dist/chunk-VMEE57E5.cjs +58 -0
- package/dist/chunk-VMEE57E5.cjs.map +1 -0
- package/dist/chunk-VQVBEX3Y.cjs +113 -0
- package/dist/chunk-VQVBEX3Y.cjs.map +1 -0
- package/dist/chunk-VZDXX7TT.cjs +64 -0
- package/dist/chunk-VZDXX7TT.cjs.map +1 -0
- package/dist/chunk-WE5ZTI4D.js +346 -0
- package/dist/chunk-WE5ZTI4D.js.map +1 -0
- package/dist/chunk-WEFUVABP.js +19 -0
- package/dist/chunk-WEFUVABP.js.map +1 -0
- package/dist/chunk-WMU4LRKC.js +28 -0
- package/dist/chunk-WMU4LRKC.js.map +1 -0
- package/dist/chunk-WQ24RRHL.cjs +354 -0
- package/dist/chunk-WQ24RRHL.cjs.map +1 -0
- package/dist/chunk-WW4CGS7G.cjs +26 -0
- package/dist/chunk-WW4CGS7G.cjs.map +1 -0
- package/dist/chunk-WXE5WCTM.js +1144 -0
- package/dist/chunk-WXE5WCTM.js.map +1 -0
- package/dist/chunk-X23BGIYA.cjs +37 -0
- package/dist/chunk-X23BGIYA.cjs.map +1 -0
- package/dist/chunk-XEW4FTR2.js +98 -0
- package/dist/chunk-XEW4FTR2.js.map +1 -0
- package/dist/chunk-XIOI4IYW.js +167 -0
- package/dist/chunk-XIOI4IYW.js.map +1 -0
- package/dist/chunk-XLVPJ37V.cjs +44 -0
- package/dist/chunk-XLVPJ37V.cjs.map +1 -0
- package/dist/chunk-XOHAXXZA.cjs +51 -0
- package/dist/chunk-XOHAXXZA.cjs.map +1 -0
- package/dist/chunk-Y4NRIHK6.cjs +313 -0
- package/dist/chunk-Y4NRIHK6.cjs.map +1 -0
- package/dist/chunk-Y4YMMKL3.js +23 -0
- package/dist/chunk-Y4YMMKL3.js.map +1 -0
- package/dist/chunk-YJNYBVE3.cjs +14 -0
- package/dist/chunk-YJNYBVE3.cjs.map +1 -0
- package/dist/chunk-Z762QNQP.cjs +60 -0
- package/dist/chunk-Z762QNQP.cjs.map +1 -0
- package/dist/chunk-ZG5KMBOF.js +669 -0
- package/dist/chunk-ZG5KMBOF.js.map +1 -0
- package/dist/chunk-ZKONQEFA.js +344 -0
- package/dist/chunk-ZKONQEFA.js.map +1 -0
- package/dist/chunk-ZR5X7QMH.js +39 -0
- package/dist/chunk-ZR5X7QMH.js.map +1 -0
- package/dist/chunk-ZW4BJQ26.js +84 -0
- package/dist/chunk-ZW4BJQ26.js.map +1 -0
- package/dist/climbs-BhlWuu0x.d.ts +70 -0
- package/dist/climbs-DgBFwySV.d.cts +70 -0
- package/dist/collab/index.cjs +1283 -0
- package/dist/collab/index.cjs.map +1 -0
- package/dist/collab/index.d.cts +850 -0
- package/dist/collab/index.d.ts +850 -0
- package/dist/collab/index.js +1274 -0
- package/dist/collab/index.js.map +1 -0
- package/dist/data/index.cjs +132 -0
- package/dist/data/index.cjs.map +1 -0
- package/dist/data/index.d.cts +468 -0
- package/dist/data/index.d.ts +468 -0
- package/dist/data/index.js +15 -0
- package/dist/data/index.js.map +1 -0
- package/dist/editor/index.cjs +4506 -0
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.d.cts +59 -0
- package/dist/editor/index.d.ts +59 -0
- package/dist/editor/index.js +4486 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/elevationTiles-pmsb9wnU.d.cts +77 -0
- package/dist/elevationTiles-pmsb9wnU.d.ts +77 -0
- package/dist/errors/index.cjs +28 -0
- package/dist/errors/index.cjs.map +1 -0
- package/dist/errors/index.d.cts +125 -0
- package/dist/errors/index.d.ts +125 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/geo/index.cjs +232 -0
- package/dist/geo/index.cjs.map +1 -0
- package/dist/geo/index.d.cts +821 -0
- package/dist/geo/index.d.ts +821 -0
- package/dist/geo/index.js +15 -0
- package/dist/geo/index.js.map +1 -0
- package/dist/geodesy-543qXKtI.d.cts +78 -0
- package/dist/geodesy-543qXKtI.d.ts +78 -0
- package/dist/geolocation-DDkQdWMN.d.cts +106 -0
- package/dist/geolocation-DDkQdWMN.d.ts +106 -0
- package/dist/i18n/fr/index.cjs +338 -0
- package/dist/i18n/fr/index.cjs.map +1 -0
- package/dist/i18n/fr/index.d.cts +25 -0
- package/dist/i18n/fr/index.d.ts +25 -0
- package/dist/i18n/fr/index.js +336 -0
- package/dist/i18n/fr/index.js.map +1 -0
- package/dist/i18n/index.cjs +464 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +227 -0
- package/dist/i18n/index.d.ts +227 -0
- package/dist/i18n/index.js +430 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/icons/index.cjs +116 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +457 -0
- package/dist/icons/index.d.ts +457 -0
- package/dist/icons/index.js +11 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +1869 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +251 -0
- package/dist/index.d.ts +251 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/itinerary-Dp2ZnqgD.d.cts +178 -0
- package/dist/itinerary-Dp2ZnqgD.d.ts +178 -0
- package/dist/language-CEWQ5uYw.d.cts +69 -0
- package/dist/language-CEWQ5uYw.d.ts +69 -0
- package/dist/layers/index.cjs +318 -0
- package/dist/layers/index.cjs.map +1 -0
- package/dist/layers/index.d.cts +1555 -0
- package/dist/layers/index.d.ts +1555 -0
- package/dist/layers/index.js +17 -0
- package/dist/layers/index.js.map +1 -0
- package/dist/map-client/index.cjs +4 -0
- package/dist/map-client/index.cjs.map +1 -0
- package/dist/map-client/index.d.cts +1856 -0
- package/dist/map-client/index.d.ts +1856 -0
- package/dist/map-client/index.js +3 -0
- package/dist/map-client/index.js.map +1 -0
- package/dist/maplibre-worker.mjs +12 -0
- package/dist/markerSprite-DGBQF6PO.cjs +49 -0
- package/dist/markerSprite-DGBQF6PO.cjs.map +1 -0
- package/dist/markerSprite-DZLTR6F6.js +8 -0
- package/dist/markerSprite-DZLTR6F6.js.map +1 -0
- package/dist/mountayaMap-C9mxRFib.d.cts +3277 -0
- package/dist/mountayaMap-DgnlQ2fE.d.ts +3277 -0
- package/dist/navigation/index.cjs +699 -0
- package/dist/navigation/index.cjs.map +1 -0
- package/dist/navigation/index.d.cts +632 -0
- package/dist/navigation/index.d.ts +632 -0
- package/dist/navigation/index.js +689 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/order-BLhsGsH8.d.ts +132 -0
- package/dist/order-BZkUwMou.d.cts +132 -0
- package/dist/paint-BgUcj8l7.d.cts +118 -0
- package/dist/paint-Dx_qGNE_.d.ts +118 -0
- package/dist/profile/index.cjs +675 -0
- package/dist/profile/index.cjs.map +1 -0
- package/dist/profile/index.d.cts +2086 -0
- package/dist/profile/index.d.ts +2086 -0
- package/dist/profile/index.js +18 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/provider-DM71XnLX.d.cts +121 -0
- package/dist/provider-DM71XnLX.d.ts +121 -0
- package/dist/roadAccess-D_rOE4xW.d.cts +86 -0
- package/dist/roadAccess-D_rOE4xW.d.ts +86 -0
- package/dist/routeProfile-BKfSfxx6.d.ts +210 -0
- package/dist/routeProfile-BsSUABXv.d.cts +210 -0
- package/dist/seams/index.cjs +39 -0
- package/dist/seams/index.cjs.map +1 -0
- package/dist/seams/index.d.cts +254 -0
- package/dist/seams/index.d.ts +254 -0
- package/dist/seams/index.js +6 -0
- package/dist/seams/index.js.map +1 -0
- package/dist/search/index.cjs +147 -0
- package/dist/search/index.cjs.map +1 -0
- package/dist/search/index.d.cts +888 -0
- package/dist/search/index.d.ts +888 -0
- package/dist/search/index.js +14 -0
- package/dist/search/index.js.map +1 -0
- package/dist/searchHighlight-DFE7LVIL.cjs +33 -0
- package/dist/searchHighlight-DFE7LVIL.cjs.map +1 -0
- package/dist/searchHighlight-MHAQZVWG.js +12 -0
- package/dist/searchHighlight-MHAQZVWG.js.map +1 -0
- package/dist/searchLimits-j99-NTXR.d.cts +24 -0
- package/dist/searchLimits-j99-NTXR.d.ts +24 -0
- package/dist/sections-CVlc2Inr.d.cts +953 -0
- package/dist/sections-CmtaduLc.d.ts +953 -0
- package/dist/segmentRoute-C5UL_5bp.d.ts +172 -0
- package/dist/segmentRoute-CIo6dR8Y.d.cts +172 -0
- package/dist/strings-30RSdIat.d.cts +552 -0
- package/dist/strings-DPTIbzT5.d.ts +552 -0
- package/dist/stripeImage-CQUXM2YI.js +14 -0
- package/dist/stripeImage-CQUXM2YI.js.map +1 -0
- package/dist/stripeImage-R43OPA6U.cjs +39 -0
- package/dist/stripeImage-R43OPA6U.cjs.map +1 -0
- package/dist/style/index.cjs +116 -0
- package/dist/style/index.cjs.map +1 -0
- package/dist/style/index.d.cts +538 -0
- package/dist/style/index.d.ts +538 -0
- package/dist/style/index.js +11 -0
- package/dist/style/index.js.map +1 -0
- package/dist/styles.css +11 -0
- package/dist/testing/index.cjs +629 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +265 -0
- package/dist/testing/index.d.ts +265 -0
- package/dist/testing/index.js +623 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/timezone/index.cjs +759 -0
- package/dist/timezone/index.cjs.map +1 -0
- package/dist/timezone/index.d.cts +53 -0
- package/dist/timezone/index.d.ts +53 -0
- package/dist/timezone/index.js +757 -0
- package/dist/timezone/index.js.map +1 -0
- package/dist/types-B034JMjl.d.ts +973 -0
- package/dist/types-B2NDLxQA.d.cts +21 -0
- package/dist/types-B2NDLxQA.d.ts +21 -0
- package/dist/types-BEv8V_8V.d.cts +55 -0
- package/dist/types-BEv8V_8V.d.ts +55 -0
- package/dist/types-C8aX5KMU.d.cts +973 -0
- package/dist/types-CTQwbSdA.d.cts +321 -0
- package/dist/types-nO2joeRk.d.ts +321 -0
- package/dist/units/index.cjs +99 -0
- package/dist/units/index.cjs.map +1 -0
- package/dist/units/index.d.cts +75 -0
- package/dist/units/index.d.ts +75 -0
- package/dist/units/index.js +6 -0
- package/dist/units/index.js.map +1 -0
- package/dist/units-D9mBrusY.d.cts +900 -0
- package/dist/units-D9mBrusY.d.ts +900 -0
- package/dist/video/index.cjs +2198 -0
- package/dist/video/index.cjs.map +1 -0
- package/dist/video/index.d.cts +873 -0
- package/dist/video/index.d.ts +873 -0
- package/dist/video/index.js +2173 -0
- package/dist/video/index.js.map +1 -0
- package/dist/videoOverlay-Dh_D5_Zs.d.cts +44 -0
- package/dist/videoOverlay-Dh_D5_Zs.d.ts +44 -0
- package/dist/view/index.cjs +43 -0
- package/dist/view/index.cjs.map +1 -0
- package/dist/view/index.d.cts +836 -0
- package/dist/view/index.d.ts +836 -0
- package/dist/view/index.js +34 -0
- package/dist/view/index.js.map +1 -0
- package/dist/zones-B05QA8fy.d.cts +75 -0
- package/dist/zones-B05QA8fy.d.ts +75 -0
- package/package.json +433 -4
- package/src/agent/engines/session.ts +2255 -0
- package/src/agent/index.ts +109 -0
- package/src/agent/rules/agentError.ts +128 -0
- package/src/agent/rules/boundedInputJson.ts +53 -0
- package/src/agent/rules/conversation.ts +629 -0
- package/src/agent/rules/conversationFaults.ts +349 -0
- package/src/agent/rules/conversationHost.ts +390 -0
- package/src/agent/rules/dispatcher.ts +102 -0
- package/src/agent/rules/errorCodes.ts +78 -0
- package/src/agent/rules/errorStatus.ts +65 -0
- package/src/agent/rules/scriptedTransport.ts +390 -0
- package/src/agent/rules/stickToBottom.ts +38 -0
- package/src/agent/rules/toolResultPayload.ts +197 -0
- package/src/auth/rules/clientHeader.ts +22 -0
- package/src/auth/rules/sentCredential.ts +76 -0
- package/src/auth/rules/transformRequest.ts +803 -0
- package/src/camera/engines/videoFlight.ts +1758 -0
- package/src/camera/index.ts +157 -0
- package/src/camera/rules/clearance.ts +1099 -0
- package/src/camera/rules/fit.ts +132 -0
- package/src/camera/rules/modes.ts +1023 -0
- package/src/camera/rules/plan.ts +478 -0
- package/src/camera/rules/planner.ts +129 -0
- package/src/camera/rules/poseRanges.ts +38 -0
- package/src/camera/rules/presets.ts +185 -0
- package/src/camera/rules/profileSamples.ts +243 -0
- package/src/camera/rules/route.ts +596 -0
- package/src/camera/rules/routeContent.ts +104 -0
- package/src/camera/rules/spline.ts +765 -0
- package/src/camera/rules/sweptViewports.ts +39 -0
- package/src/camera/rules/track.ts +1412 -0
- package/src/camera/rules/vocabulary.ts +130 -0
- package/src/camera/rules/zoom.ts +216 -0
- package/src/collab/engines/session.ts +1902 -0
- package/src/collab/engines/trailingThrottle.ts +151 -0
- package/src/collab/index.ts +56 -0
- package/src/collab/rules/dispatch.ts +143 -0
- package/src/collab/rules/peerNames.ts +51 -0
- package/src/collab/rules/scriptedTransport.ts +244 -0
- package/src/compose/engines/baseMapSwitch.ts +1136 -0
- package/src/compose/engines/events.ts +962 -0
- package/src/compose/engines/mountayaMap.ts +5674 -0
- package/src/compose/engines/sentCredentials.ts +146 -0
- package/src/compose/engines/slotRequests.ts +413 -0
- package/src/compose/rules/accessRefusal.ts +109 -0
- package/src/compose/rules/accessStanding.ts +75 -0
- package/src/compose/rules/analysisKinds.ts +331 -0
- package/src/compose/rules/analysisLayers.ts +176 -0
- package/src/compose/rules/cameraMoves.ts +38 -0
- package/src/compose/rules/carriedLayers.ts +87 -0
- package/src/compose/rules/developmentWarnings.ts +166 -0
- package/src/compose/rules/fitCamera.ts +54 -0
- package/src/compose/rules/geoJsonSlot.ts +61 -0
- package/src/compose/rules/geometrySlots.ts +155 -0
- package/src/compose/rules/glyphNode.ts +62 -0
- package/src/compose/rules/layerKeys.ts +92 -0
- package/src/compose/rules/layerOrder.ts +85 -0
- package/src/compose/rules/layersManifest.ts +26 -0
- package/src/compose/rules/mapOptions.ts +300 -0
- package/src/compose/rules/maplibreWorkerVersion.gen.ts +8 -0
- package/src/compose/rules/markerPin.ts +122 -0
- package/src/compose/rules/markerRegistry.ts +85 -0
- package/src/compose/rules/markerSprite.ts +382 -0
- package/src/compose/rules/maxBounds.ts +120 -0
- package/src/compose/rules/overlayLookup.ts +49 -0
- package/src/compose/rules/paintDiff.ts +38 -0
- package/src/compose/rules/panLock.ts +77 -0
- package/src/compose/rules/patch.ts +124 -0
- package/src/compose/rules/queriedFeature.ts +55 -0
- package/src/compose/rules/queryLayers.ts +46 -0
- package/src/compose/rules/searchHighlight.ts +313 -0
- package/src/compose/rules/slotNames.ts +19 -0
- package/src/compose/rules/stripeImage.ts +253 -0
- package/src/compose/rules/swapMarker.ts +66 -0
- package/src/compose/rules/terrainVariant.ts +88 -0
- package/src/compose/rules/types.ts +566 -0
- package/src/compose/rules/urlHash.ts +19 -0
- package/src/compose/rules/viewOptions.ts +451 -0
- package/src/compose/rules/workerUrl.ts +96 -0
- package/src/data/engines/itineraryResource.ts +643 -0
- package/src/data/index.ts +78 -0
- package/src/data/rules/adapt.ts +473 -0
- package/src/data/rules/editModes.ts +51 -0
- package/src/data/rules/itinerary.ts +168 -0
- package/src/data/rules/nullable.ts +63 -0
- package/src/data/rules/roadAccess.ts +169 -0
- package/src/data/rules/segmentGroups.ts +309 -0
- package/src/data/rules/selectors.ts +95 -0
- package/src/data/rules/zones.ts +79 -0
- package/src/draw/engines/boundaryEngine.ts +1003 -0
- package/src/draw/engines/framedAdapter.ts +198 -0
- package/src/draw/engines/pointerCursor.ts +205 -0
- package/src/draw/engines/segmentEngine.ts +1405 -0
- package/src/draw/engines/snapIndex.ts +254 -0
- package/src/draw/engines/waypointEngine.ts +574 -0
- package/src/draw/engines/zoneEngine.ts +1137 -0
- package/src/draw/rules/drawFrame.ts +123 -0
- package/src/draw/rules/insertVertex.ts +226 -0
- package/src/draw/rules/screenSpace.ts +62 -0
- package/src/draw/rules/seeds.ts +185 -0
- package/src/draw/rules/snap.ts +115 -0
- package/src/draw/rules/snapCameraKey.ts +50 -0
- package/src/draw/rules/terraDrawShared.ts +214 -0
- package/src/draw/rules/zoneOutline.ts +213 -0
- package/src/editing/engines/cursor.ts +505 -0
- package/src/editing/engines/draftMarker.ts +149 -0
- package/src/editing/rules/accent.ts +11 -0
- package/src/editing/rules/engine.ts +286 -0
- package/src/editing/rules/placement.ts +22 -0
- package/src/editing/rules/positions.ts +89 -0
- package/src/editing/rules/sources.ts +9 -0
- package/src/editing/rules/types.ts +457 -0
- package/src/editing/rules/vocabulary.ts +10 -0
- package/src/editing/rules/waypointCursor.ts +228 -0
- package/src/editor/engines/directionArrows.ts +459 -0
- package/src/editor/engines/directions.ts +1383 -0
- package/src/editor/engines/editorClient.ts +134 -0
- package/src/editor/engines/eventScope.ts +59 -0
- package/src/editor/engines/frameLoop.ts +159 -0
- package/src/editor/engines/itineraryPreview.ts +272 -0
- package/src/editor/engines/mapLockGuard.ts +66 -0
- package/src/editor/engines/overlayRenderer.ts +2696 -0
- package/src/editor/engines/peerDraft.ts +760 -0
- package/src/editor/engines/poiPick.ts +305 -0
- package/src/editor/engines/pointPick.ts +84 -0
- package/src/editor/engines/roadAccessLine.ts +140 -0
- package/src/editor/engines/searchHighlight.ts +183 -0
- package/src/editor/engines/viewClient.ts +4083 -0
- package/src/editor/engines/zoneBadges.ts +503 -0
- package/src/editor/index.ts +97 -0
- package/src/editor/rules/accentColor.ts +116 -0
- package/src/editor/rules/camera.ts +121 -0
- package/src/editor/rules/contract.ts +125 -0
- package/src/editor/rules/icons.ts +825 -0
- package/src/editor/rules/markerElements.ts +244 -0
- package/src/editor/rules/style.ts +51 -0
- package/src/editor/rules/terrain.ts +98 -0
- package/src/editor/rules/tileWarm.ts +191 -0
- package/src/editor/rules/tilesReload.ts +158 -0
- package/src/editor/rules/zoneBadgePlacement.ts +1832 -0
- package/src/editor/rules/zoneTimeStyling.ts +119 -0
- package/src/errors/index.ts +25 -0
- package/src/errors/rules/errors.ts +157 -0
- package/src/errors/rules/print.ts +129 -0
- package/src/geo/index.ts +94 -0
- package/src/geo/rules/boundaries.ts +105 -0
- package/src/geo/rules/camera.ts +496 -0
- package/src/geo/rules/corridor.ts +242 -0
- package/src/geo/rules/elevationTiles.ts +269 -0
- package/src/geo/rules/formatLngLat.ts +63 -0
- package/src/geo/rules/geodesy.ts +125 -0
- package/src/geo/rules/geometry.ts +362 -0
- package/src/geo/rules/lineWalk.ts +77 -0
- package/src/geo/rules/longitude.ts +99 -0
- package/src/geo/rules/searchLimits.ts +22 -0
- package/src/geo/rules/segmentGeometry.ts +80 -0
- package/src/geo/rules/terrain.ts +107 -0
- package/src/geo/rules/tuples.ts +124 -0
- package/src/geo/rules/types.ts +54 -0
- package/src/geo/rules/webMercator.ts +57 -0
- package/src/i18n/fr/index.ts +17 -0
- package/src/i18n/fr/rules/fr.ts +85 -0
- package/src/i18n/fr/rules/words.gen.ts +277 -0
- package/src/i18n/index.ts +81 -0
- package/src/i18n/rules/bundle.ts +378 -0
- package/src/i18n/rules/config.ts +71 -0
- package/src/i18n/rules/endonyms.gen.ts +19 -0
- package/src/i18n/rules/language.ts +92 -0
- package/src/i18n/rules/localizedName.ts +33 -0
- package/src/i18n/rules/merge.ts +106 -0
- package/src/i18n/rules/scope.ts +127 -0
- package/src/i18n/rules/strings.ts +632 -0
- package/src/i18n/rules/videoOverlay.ts +121 -0
- package/src/i18n/rules/wordForms.ts +95 -0
- package/src/i18n/rules/words.gen.ts +277 -0
- package/src/icons/index.ts +54 -0
- package/src/icons/rules/activities.ts +40 -0
- package/src/icons/rules/amenities.ts +250 -0
- package/src/icons/rules/artwork.gen.ts +83 -0
- package/src/icons/rules/artwork.ts +47 -0
- package/src/icons/rules/fallback.ts +21 -0
- package/src/icons/rules/lucideMarkers.gen.ts +112 -0
- package/src/icons/rules/lucideUi.gen.ts +197 -0
- package/src/icons/rules/paint.ts +107 -0
- package/src/icons/rules/parse.ts +475 -0
- package/src/icons/rules/provider.ts +373 -0
- package/src/icons/rules/sprites.ts +54 -0
- package/src/icons/rules/ui.ts +348 -0
- package/src/icons/rules/waypoints.ts +215 -0
- package/src/index.ts +1012 -0
- package/src/layers/engines/layersSelection.ts +515 -0
- package/src/layers/engines/readoutEngine.ts +131 -0
- package/src/layers/index.ts +151 -0
- package/src/layers/rules/analysis.ts +135 -0
- package/src/layers/rules/enrichment.ts +30 -0
- package/src/layers/rules/geoJson.ts +270 -0
- package/src/layers/rules/hover.ts +67 -0
- package/src/layers/rules/itineraries.ts +182 -0
- package/src/layers/rules/layersPanel.ts +237 -0
- package/src/layers/rules/order.ts +194 -0
- package/src/layers/rules/overlayInstant.ts +49 -0
- package/src/layers/rules/overlays.ts +52 -0
- package/src/layers/rules/poiPanel.ts +119 -0
- package/src/layers/rules/pois.ts +114 -0
- package/src/layers/rules/readout.ts +340 -0
- package/src/layers/rules/streetView.ts +16 -0
- package/src/layers/rules/tileTimestamp.ts +146 -0
- package/src/layers/rules/timeSlider.ts +192 -0
- package/src/layers/rules/timeWindow.ts +123 -0
- package/src/layers/rules/zones.ts +43 -0
- package/src/layers/rules/zoom.ts +77 -0
- package/src/map-client/index.ts +71 -0
- package/src/map-client/rules/mapClient.ts +1943 -0
- package/src/navigation/engines/navigation.ts +493 -0
- package/src/navigation/index.ts +51 -0
- package/src/navigation/rules/followedRoute.ts +78 -0
- package/src/navigation/rules/instructions.ts +89 -0
- package/src/navigation/rules/itineraryRoute.ts +232 -0
- package/src/navigation/rules/offRoute.ts +41 -0
- package/src/navigation/rules/progress.ts +230 -0
- package/src/navigation/rules/prompts.ts +217 -0
- package/src/navigation/rules/routeRequest.ts +98 -0
- package/src/navigation/rules/status.ts +142 -0
- package/src/navigation/rules/steps.ts +234 -0
- package/src/navigation/rules/types.ts +83 -0
- package/src/profile/index.ts +307 -0
- package/src/profile/rules/amenityBadge.ts +35 -0
- package/src/profile/rules/amenityFilter.ts +74 -0
- package/src/profile/rules/amenityStacks.ts +66 -0
- package/src/profile/rules/axis.ts +89 -0
- package/src/profile/rules/axisCulling.ts +83 -0
- package/src/profile/rules/axisLookup.ts +180 -0
- package/src/profile/rules/climbs.ts +292 -0
- package/src/profile/rules/cursorMarker.ts +122 -0
- package/src/profile/rules/cursorReadout.ts +104 -0
- package/src/profile/rules/curvePlacement.ts +216 -0
- package/src/profile/rules/dock.ts +293 -0
- package/src/profile/rules/elevation.ts +1263 -0
- package/src/profile/rules/instant.ts +89 -0
- package/src/profile/rules/intl.ts +237 -0
- package/src/profile/rules/legEmphasis.ts +53 -0
- package/src/profile/rules/profileColors.ts +66 -0
- package/src/profile/rules/profileLayout.ts +59 -0
- package/src/profile/rules/profileSlices.ts +55 -0
- package/src/profile/rules/routeProfile.ts +475 -0
- package/src/profile/rules/rowMatch.ts +50 -0
- package/src/profile/rules/scale.ts +650 -0
- package/src/profile/rules/scaleFrame.ts +171 -0
- package/src/profile/rules/sectionChips.ts +83 -0
- package/src/profile/rules/sections.ts +923 -0
- package/src/profile/rules/slopeRamp.ts +160 -0
- package/src/profile/rules/statStrip.ts +103 -0
- package/src/profile/rules/steepness.ts +51 -0
- package/src/profile/rules/tableCells.ts +269 -0
- package/src/profile/rules/tableCursor.ts +87 -0
- package/src/profile/rules/unitPatterns.ts +335 -0
- package/src/profile/rules/units.ts +1025 -0
- package/src/profile/rules/waypointCard.ts +593 -0
- package/src/profile/rules/webAddress.ts +130 -0
- package/src/profile/rules/windowSpans.ts +65 -0
- package/src/rules/asciiFold.ts +17 -0
- package/src/rules/inDevelopment.ts +54 -0
- package/src/rules/listeners.ts +62 -0
- package/src/rules/timers.ts +9 -0
- package/src/rules/types.ts +22 -0
- package/src/rules/uuid.ts +87 -0
- package/src/seams/engines/geolocateControl.ts +286 -0
- package/src/seams/index.ts +50 -0
- package/src/seams/rules/clock.ts +169 -0
- package/src/seams/rules/geolocation.ts +165 -0
- package/src/seams/rules/segmentRoute.ts +187 -0
- package/src/search/engines/search.ts +1093 -0
- package/src/search/index.ts +114 -0
- package/src/search/rules/describe.ts +383 -0
- package/src/search/rules/filters.ts +195 -0
- package/src/search/rules/highlight.ts +270 -0
- package/src/search/rules/pick.ts +90 -0
- package/src/search/rules/rows.ts +258 -0
- package/src/search/rules/searchFocus.ts +27 -0
- package/src/search/rules/searchViewport.ts +44 -0
- package/src/search/rules/shown.ts +77 -0
- package/src/search/rules/types.ts +340 -0
- package/src/stream/rules/reconnectSchedule.ts +83 -0
- package/src/style/engines/organizationRead.ts +80 -0
- package/src/style/index.ts +63 -0
- package/src/style/rules/apply.ts +268 -0
- package/src/style/rules/attribution.ts +119 -0
- package/src/style/rules/itineraryLine.ts +142 -0
- package/src/style/rules/language.ts +668 -0
- package/src/style/rules/layout.gen.ts +27 -0
- package/src/style/rules/organization.ts +96 -0
- package/src/style/rules/paint.ts +143 -0
- package/src/style/rules/panelLayout.ts +51 -0
- package/src/style/rules/roadAccessColors.ts +29 -0
- package/src/style/rules/roadAccessLine.ts +267 -0
- package/src/style/rules/segmentColors.ts +207 -0
- package/src/testing/catalogs.ts +103 -0
- package/src/testing/index.ts +30 -0
- package/src/testing/mapClient.ts +241 -0
- package/src/testing/mountayaMap.ts +741 -0
- package/src/timezone/index.ts +14 -0
- package/src/timezone/rules/viewport.ts +875 -0
- package/src/units/index.ts +55 -0
- package/src/units/rules/conversions.ts +620 -0
- package/src/units/rules/preferenceChoices.ts +124 -0
- package/src/units/rules/preferences.ts +77 -0
- package/src/units/rules/rounding.ts +69 -0
- package/src/video/engines/videoRun.ts +654 -0
- package/src/video/engines/viewClient.ts +6 -0
- package/src/video/index.ts +83 -0
- package/src/video/profileOverlay/rules/contract.ts +212 -0
- package/src/video/profileOverlay/rules/curve.ts +216 -0
- package/src/video/profileOverlay/rules/draw.ts +410 -0
- package/src/video/profileOverlay/rules/fonts.ts +54 -0
- package/src/video/profileOverlay/rules/graphDesign.ts +690 -0
- package/src/video/profileOverlay/rules/minimalDesign.ts +144 -0
- package/src/video/profileOverlay/rules/registry.ts +23 -0
- package/src/video/profileOverlay/rules/staticLayer.ts +582 -0
- package/src/video/profileOverlay/rules/stripDesign.ts +327 -0
- package/src/video/profileOverlay/rules/types.ts +78 -0
- package/src/video/rules/videoConstants.ts +250 -0
- package/src/video/rules/videoEncoder.ts +277 -0
- package/src/video/rules/videoFrames.ts +99 -0
- package/src/video/rules/videoPreview.ts +185 -0
- package/src/video/rules/videoRecorder.ts +746 -0
- package/src/video/rules/videoWatermark.ts +155 -0
- package/src/video/rules/watermarkMark.ts +40 -0
- package/src/view/engines/viewClient.ts +6 -0
- package/src/view/index.ts +20 -0
|
@@ -0,0 +1,1751 @@
|
|
|
1
|
+
import { f as RouteGeometry, C as CameraMode, g as CameraPlan, h as ProfileSource, P as ProfileSample, S as ShotCamera, e as ProfileDesign, c as VideoRecordingPhase, b as RecordingCamera, V as VideoProgress, R as RecordOutput, a as RecordProfile, d as VideoRecordingResult, i as CameraAspect, j as CameraOutputFormat, k as CameraFps, l as CameraResolution, Q as Quality, m as VideoPreset } from '../camera-C48Ykaxv.js';
|
|
2
|
+
export { n as CAMERA_ASPECTS, o as CAMERA_BEARING_MODES, p as CAMERA_FPS, q as CAMERA_MODES, r as CAMERA_OUTPUT_FORMATS, s as CAMERA_RESOLUTIONS, t as CameraBearingMode, u as CameraOutput, v as CameraPlanInput, w as CameraShot, D as DEFAULT_TARGET_DURATION_MS, x as PROFILE_DESIGNS, y as QUALITY_TIERS, z as SegmentSpan, A as VIDEO_PRESETS_AVAILABLE, B as VIDEO_RECORDING_PHASES, E as createCameraPlan, F as defaultCameraOutput, G as defaultCameraShot, H as insertShotSorted, I as resolveProfileSamples } from '../camera-C48Ykaxv.js';
|
|
3
|
+
import { L as LngLat, B as BoundingBox } from '../types-BEv8V_8V.js';
|
|
4
|
+
import { U as UnitFormatOptions } from '../units-D9mBrusY.js';
|
|
5
|
+
import { ItineraryWithDetails } from '../data/index.js';
|
|
6
|
+
export { c as cumulativeMeters, r as routeLengthMeters } from '../geodesy-543qXKtI.js';
|
|
7
|
+
import '../climbs-BhlWuu0x.js';
|
|
8
|
+
import '@mountaya/client';
|
|
9
|
+
import 'geojson';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* RouteCursor is a sampled position along an itinerary: the interpolated [lng, lat]
|
|
13
|
+
* `point`, the `bearingDeg` of the itinerary's tangent there (the heading the path
|
|
14
|
+
* is travelling, 0..360), and the `index` of the line vertex at or before the
|
|
15
|
+
* point (so a caller can read a per-vertex channel such as elevation without a
|
|
16
|
+
* second search). Produced by cursorAtFraction.
|
|
17
|
+
*/
|
|
18
|
+
interface RouteCursor {
|
|
19
|
+
bearingDeg: number;
|
|
20
|
+
index: number;
|
|
21
|
+
point: LngLat;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* pointAtMeters returns the [lng, lat] located at the given arc-length along the
|
|
25
|
+
* line, linearly interpolating between the two vertices whose cumulative
|
|
26
|
+
* distances bracket the target. The target is clamped to the line, so a value
|
|
27
|
+
* below 0 resolves to the first vertex and one past the end to the last. An
|
|
28
|
+
* empty line yields [0, 0]. The optional precomputed `cumulative` avoids
|
|
29
|
+
* re-measuring the line when the caller already holds it (the per-frame path).
|
|
30
|
+
*
|
|
31
|
+
* A vertex that names no place is passed over, as {@link cumulativeMeters} bridges it, so the
|
|
32
|
+
* first vertex is the first that names one. A line none of whose vertices names a place, and a
|
|
33
|
+
* distance that is no number, have no position along the line: the answer is `[NaN, NaN]`.
|
|
34
|
+
*
|
|
35
|
+
* A leg is interpolated the short way round ({@link longitudeDelta}), as its length is
|
|
36
|
+
* measured: on a leg written 179.9 then -179.9 the point halfway is on the antimeridian, never
|
|
37
|
+
* on the prime meridian the two numbers average to. The longitude continues from the leg's
|
|
38
|
+
* first vertex, so it runs past 180 where the leg crosses eastward and below -180 where it
|
|
39
|
+
* crosses westward, which a renderer reads as the same place.
|
|
40
|
+
*
|
|
41
|
+
* @param line The route's vertices, `[lng, lat]` in degrees.
|
|
42
|
+
* @param targetMeters How far along the line, in meters; held to the line's length.
|
|
43
|
+
* @param cumulative The line's {@link cumulativeMeters}. Defaults to measuring the line again.
|
|
44
|
+
*/
|
|
45
|
+
declare const pointAtMeters: (line: readonly LngLat[], targetMeters: number, cumulative?: readonly number[]) => LngLat;
|
|
46
|
+
/**
|
|
47
|
+
* bearingDegBetween returns the initial great-circle bearing in degrees (0..360)
|
|
48
|
+
* from a to b: the heading to travel to go from the first point to the second.
|
|
49
|
+
* Two identical points have no defined heading and return 0.
|
|
50
|
+
*/
|
|
51
|
+
declare const bearingDegBetween: (a: LngLat, b: LngLat) => number;
|
|
52
|
+
/**
|
|
53
|
+
* tangentBearingAtMeters returns the itinerary's heading in degrees (0..360) at the
|
|
54
|
+
* given arc-length, sampled by looking `lookaheadMeters` further along the line
|
|
55
|
+
* and taking the bearing from the cursor to that ahead-point. A larger lookahead
|
|
56
|
+
* yields a steadier heading through dense vertices (the camera anticipates turns
|
|
57
|
+
* rather than twitching); the ahead-point is clamped to the itinerary end. Falls
|
|
58
|
+
* back to the heading of the bracketing leg when the lookahead collapses to the
|
|
59
|
+
* same point (at the very end of the itinerary, or with a lookahead of zero): the
|
|
60
|
+
* leg that starts at the vertex at or before the cursor, or the nearest leg before
|
|
61
|
+
* it that has a length, so a route that writes its last vertex twice keeps the
|
|
62
|
+
* heading it arrived with. Where no leg up to the cursor has a length (a route that
|
|
63
|
+
* writes its first vertex twice), the first leg after the cursor that has one is
|
|
64
|
+
* read: the heading the route leaves on. A line with no leg that has a length answers 0. The
|
|
65
|
+
* optional precomputed `cumulative` is reused on the per-frame path.
|
|
66
|
+
*
|
|
67
|
+
* @param line The route's vertices, `[lng, lat]` in degrees.
|
|
68
|
+
* @param targetMeters Where along the line the heading is read, in meters.
|
|
69
|
+
* @param lookaheadMeters How far ahead of that point the heading aims, in meters.
|
|
70
|
+
* @param cumulative The line's {@link cumulativeMeters}. Defaults to measuring the line again.
|
|
71
|
+
*/
|
|
72
|
+
declare const tangentBearingAtMeters: (line: readonly LngLat[], targetMeters: number, lookaheadMeters: number, cumulative?: readonly number[]) => number;
|
|
73
|
+
/**
|
|
74
|
+
* cursorAtFraction samples an itinerary at a progress fraction (0..1 of total
|
|
75
|
+
* length): it returns the interpolated point, the tangent bearing there (using
|
|
76
|
+
* `lookaheadMeters` for a steady heading), and the index of the vertex at or
|
|
77
|
+
* before the point. The fraction is clamped to [0, 1] so an out-of-range value
|
|
78
|
+
* resolves to an endpoint. This is the single seam the resolver and the
|
|
79
|
+
* generators sample the itinerary through, so progress maps to a position the same
|
|
80
|
+
* way for every consumer.
|
|
81
|
+
*
|
|
82
|
+
* @param line The route's vertices, `[lng, lat]` in degrees.
|
|
83
|
+
* @param fraction The progress along the line, 0 at its start and 1 at its end.
|
|
84
|
+
* @param lookaheadMeters How far ahead of the point the tangent bearing aims, in meters.
|
|
85
|
+
* @param cumulative The line's {@link cumulativeMeters}. Defaults to measuring the line again.
|
|
86
|
+
*/
|
|
87
|
+
declare const cursorAtFraction: (line: readonly LngLat[], fraction: number, lookaheadMeters: number, cumulative?: readonly number[]) => RouteCursor;
|
|
88
|
+
/**
|
|
89
|
+
* itineraryToRouteGeometry flattens an itinerary, or one of its segments, into the single
|
|
90
|
+
* {@link RouteGeometry} a camera plan resolves against.
|
|
91
|
+
*
|
|
92
|
+
* Every line a segment holds is laid end to end, in the order the segments and their lines are
|
|
93
|
+
* written: the lines {@link extractLines} answers, a `MultiLineString`'s tracks included, so the
|
|
94
|
+
* flight follows the vertices the profile's points and bands stand on. A directions segment's
|
|
95
|
+
* via `MultiPoint` is no line and is left out. The vertex each line after the first starts on is
|
|
96
|
+
* named in `jumps`, since the camera flies the leg that reaches it and the itinerary's distance
|
|
97
|
+
* axis charges nothing for it. A route read off one line states none.
|
|
98
|
+
*
|
|
99
|
+
* `elevations` is stated only when every vertex kept carries a finite one. A route mixing 2D
|
|
100
|
+
* and 3D vertices, or holding an elevation that is no finite number, is flown as a 2D one: a
|
|
101
|
+
* partial list would not line up with `line`, and {@link elevationAtFraction} reads the two by
|
|
102
|
+
* one index.
|
|
103
|
+
*
|
|
104
|
+
* A vertex that names no place ({@link namesPlace}) is left out, with its elevation: kept, it
|
|
105
|
+
* would turn the route's length into `NaN`, and every pose resolved over it.
|
|
106
|
+
*
|
|
107
|
+
* @param itinerary The itinerary, or null where none is loaded.
|
|
108
|
+
* @param segmentId The one segment to fly, or null for the whole itinerary.
|
|
109
|
+
* @returns The route, or null where fewer than two vertices name a place: no itinerary, an
|
|
110
|
+
* unknown segment, or segments holding no line. A flight needs a direction.
|
|
111
|
+
*/
|
|
112
|
+
declare const itineraryToRouteGeometry: (itinerary: ItineraryWithDetails | null, segmentId?: string | null) => RouteGeometry | null;
|
|
113
|
+
/**
|
|
114
|
+
* elevationAtFraction returns the itinerary's embedded surface elevation in meters at
|
|
115
|
+
* a progress fraction (0..1), interpolating linearly between the two vertices
|
|
116
|
+
* whose arc-length brackets the target. Returns null when the itinerary carries no
|
|
117
|
+
* elevations or the count does not match the line (so a caller falls back to a
|
|
118
|
+
* distance heuristic rather than trusting a mismatched array). The fraction is
|
|
119
|
+
* clamped to [0, 1]. The optional precomputed `cumulative`, the route's own
|
|
120
|
+
* {@link cumulativeMeters}, keeps a caller that reads many fractions of one route
|
|
121
|
+
* (one per frame of a flight) from measuring the whole line again for each.
|
|
122
|
+
*
|
|
123
|
+
* @param itinerary The route, with the elevations it states.
|
|
124
|
+
* @param fraction The progress along the route, 0 at its start and 1 at its end.
|
|
125
|
+
* @param cumulative The route's {@link cumulativeMeters}. Defaults to measuring the line again.
|
|
126
|
+
*/
|
|
127
|
+
declare const elevationAtFraction: (itinerary: RouteGeometry, fraction: number, cumulative?: readonly number[]) => number | null;
|
|
128
|
+
/**
|
|
129
|
+
* slopeDegAtFraction returns the itinerary's local slope in degrees at a progress
|
|
130
|
+
* fraction (positive climbing, negative descending), measured as the rise over
|
|
131
|
+
* the run across a `lookaheadMeters` window starting at the fraction. Returns 0
|
|
132
|
+
* when the itinerary has no usable elevations (a flat default the smart preset then
|
|
133
|
+
* frames level), which includes a window whose elevations are no finite numbers.
|
|
134
|
+
* The slope drives the smart mode's per-keyframe pitch.
|
|
135
|
+
*
|
|
136
|
+
* The window never runs past the route's end. Within one window of the finish it slides back
|
|
137
|
+
* to end there, so the slope is the grade of the last `lookaheadMeters` of the route, and on a
|
|
138
|
+
* route shorter than the window it is the grade of the whole route. The run the rise is divided
|
|
139
|
+
* by is the window's real length, so a route that ends on a climb reads that climb at its last
|
|
140
|
+
* point. A window that is zero, negative or no finite number is floored at a meter. The floor
|
|
141
|
+
* is the window's and not the route's: a route shorter than a meter is read over its own
|
|
142
|
+
* length, so two elevations a few centimeters apart read as steep a grade as they make.
|
|
143
|
+
*
|
|
144
|
+
* @param itinerary The route, with the elevations it states.
|
|
145
|
+
* @param fraction The progress along the route the window starts at, 0 to 1.
|
|
146
|
+
* @param lookaheadMeters The length of the window the grade is measured over, in meters.
|
|
147
|
+
*/
|
|
148
|
+
declare const slopeDegAtFraction: (itinerary: RouteGeometry, fraction: number, lookaheadMeters: number) => number;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* TerrainSampler reads the DEM elevation in meters at a [lng, lat], or null when
|
|
152
|
+
* the terrain is not loaded there (off-coverage, or no DEM configured at all). It
|
|
153
|
+
* is injected into the clearance pass so the renderer-free core owns the clearance
|
|
154
|
+
* maths while the renderer, the only layer that can read the terrain, supplies the
|
|
155
|
+
* data. A null sample contributes no constraint, so the pass degrades to a no-op
|
|
156
|
+
* when the terrain is absent. The longitude it is asked at is within [-180, 180],
|
|
157
|
+
* also for a flight that crosses the antimeridian. An answer that is no finite
|
|
158
|
+
* number reads as null.
|
|
159
|
+
*/
|
|
160
|
+
type TerrainSampler = (lngLat: [number, number]) => number | null;
|
|
161
|
+
/**
|
|
162
|
+
* ClearanceFrame is the per-frame camera state the clearance pass reads: the
|
|
163
|
+
* look-at `center` (lng/lat), the framing `zoom`, the `pitch` in degrees (MapLibre
|
|
164
|
+
* convention, 0 = straight down), the `bearing` in degrees, and the `fraction` of
|
|
165
|
+
* itinerary progress the frame sits at (so a missing terrain sample under the centre
|
|
166
|
+
* can fall back to the itinerary's own surface elevation). It is the channel slice the
|
|
167
|
+
* resolver already holds per frame, handed across without copying the whole pose.
|
|
168
|
+
*/
|
|
169
|
+
interface ClearanceFrame {
|
|
170
|
+
bearing: number;
|
|
171
|
+
center: LngLat;
|
|
172
|
+
fraction: number;
|
|
173
|
+
pitch: number;
|
|
174
|
+
zoom: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* ClearanceOptions tune the clearance pass.
|
|
178
|
+
*
|
|
179
|
+
* The frame count and the itinerary length size the anticipation window: a fixed
|
|
180
|
+
* itinerary DISTANCE, not a wall-clock span, so the lead/lag covers the same stretch of
|
|
181
|
+
* trail regardless of how fast the flight crosses it. `viewportHeightPx` calibrates the
|
|
182
|
+
* zoom↔altitude model to the live canvas (the same value the resolver passes
|
|
183
|
+
* everywhere); absent, the model reads a nominal canvas of 800 CSS pixels.
|
|
184
|
+
* `anticipationMeters` is how far ahead of a peak the reframing begins (and how far
|
|
185
|
+
* past it releases): a windowed minimum over that span pulls the clearing response
|
|
186
|
+
* early so the camera reframes before the ridge rather than snapping at it. The window
|
|
187
|
+
* is a distance, so no frame rate sets it; absent, the mode's own distance applies.
|
|
188
|
+
* `mode` selects the per-mode eye-margin scale and anticipation distance, so a floaty
|
|
189
|
+
* mode keeps more air beneath the eye; absent, it is `"smart"`.
|
|
190
|
+
*
|
|
191
|
+
* `sampleStride` decimates the per-frame frustum solve: the pass solves only every
|
|
192
|
+
* `sampleStride`-th frame (always including the first and last) and linearly
|
|
193
|
+
* interpolates the raw envelopes across the gaps before the dilation and smoothing
|
|
194
|
+
* tail. It is visually identical to solving every frame because that tail already
|
|
195
|
+
* averages the envelope over tens of frames (far coarser than the meters between
|
|
196
|
+
* adjacent frames) while issuing a fraction of the DEM readbacks. Absent or 1 solves
|
|
197
|
+
* every frame and is bit-identical to an unstrided pass; a larger stride is how a long
|
|
198
|
+
* preview flight resolves without stalling the main thread. clearanceSampleStride
|
|
199
|
+
* derives the stride a preview should pass.
|
|
200
|
+
*/
|
|
201
|
+
interface ClearanceOptions {
|
|
202
|
+
anticipationMeters?: number | undefined;
|
|
203
|
+
mode?: CameraMode | undefined;
|
|
204
|
+
sampleStride?: number | undefined;
|
|
205
|
+
viewportHeightPx?: number | undefined;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* ClearanceAdjustment is the per-frame clearance solution: aligned `zoom` and
|
|
209
|
+
* `pitch` arrays the resolver mins against its mode-smoothed channels. Both hold
|
|
210
|
+
* one entry per input frame and only ever move the camera toward clearing the
|
|
211
|
+
* terrain: `zoom` only lowers (widens the eye), `pitch` only lowers (tilts toward
|
|
212
|
+
* top-down). When nothing is occluded both arrays equal the input channels, so the
|
|
213
|
+
* resolver's min is a no-op and an un-cleared track is reproduced exactly.
|
|
214
|
+
*/
|
|
215
|
+
interface ClearanceAdjustment {
|
|
216
|
+
pitch: number[];
|
|
217
|
+
zoom: number[];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* resolveClearanceAdjustments returns a clearance-adjusted zoom AND pitch per
|
|
221
|
+
* frame: zoom only ever LOWERS the input (raising/widening the camera), and pitch
|
|
222
|
+
* only ever LOWERS toward top-down (tilting the eye over the target), never the
|
|
223
|
+
* reverse. For each frame it derives the camera eye from the zoom, pitch and bearing
|
|
224
|
+
* (the eye sits behind the look-at point at the pitch offset), then enforces:
|
|
225
|
+
*
|
|
226
|
+
* - an underground floor: the eye must sit at least EYE_CLEARANCE_MARGIN (scaled by
|
|
227
|
+
* the mode) above the terrain beneath and around it (cleared by widening zoom);
|
|
228
|
+
* - frustum occlusion: every sample across the visible frustum (the central
|
|
229
|
+
* eye→target ray, a forward fan past the look-at, lateral frame-edge shoulders, and
|
|
230
|
+
* near-foreground points) must clear its terrain by RAY_CLEARANCE_MARGIN, or the
|
|
231
|
+
* view clips a mountain in frame. This is cleared by first tilting toward top-down
|
|
232
|
+
* (down to PITCH_FLOOR), which repositions the eye over the target so a ridge no
|
|
233
|
+
* longer occludes it; if the floor still cannot clear it, by widening zoom.
|
|
234
|
+
*
|
|
235
|
+
* A frustum sample that falls on unloaded DEM (a null sample) is treated as a
|
|
236
|
+
* possible ridge (its terrain is estimated as the itinerary surface or nearby known
|
|
237
|
+
* ground plus NULL_DEM_HAZARD_MARGIN), so an unloaded tile under-protects nothing.
|
|
238
|
+
* The lone exception is the genuine no-terrain case (a 2D itinerary with no elevations
|
|
239
|
+
* whose every sample is null): no hazard can be estimated there, so no frame is
|
|
240
|
+
* constrained and the all-clear short-circuit returns the input verbatim.
|
|
241
|
+
*
|
|
242
|
+
* Each per-frame raw series (zoom and pitch) is dilated by a windowed minimum over
|
|
243
|
+
* the anticipation window, so the reframing starts before a peak and releases
|
|
244
|
+
* after, and Gaussian-smoothed, so neither channel jolts.
|
|
245
|
+
*
|
|
246
|
+
* @param frames The camera state per frame, in flight order.
|
|
247
|
+
* @param itinerary The route the frames fly over, read for its surface elevation
|
|
248
|
+
* where the terrain answers nothing.
|
|
249
|
+
* @param sampler The terrain the frames are cleared against.
|
|
250
|
+
* @param options The anticipation, viewport, mode and stride the pass runs with.
|
|
251
|
+
* @returns One zoom and one pitch per frame, each at or under the frame's own input.
|
|
252
|
+
*/
|
|
253
|
+
declare const resolveClearanceAdjustments: (frames: readonly ClearanceFrame[], itinerary: RouteGeometry, sampler: TerrainSampler, options: ClearanceOptions) => ClearanceAdjustment;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* CameraPlanner is where a camera plan is turned into the per-frame arrays a preview flies and
|
|
257
|
+
* a record composites.
|
|
258
|
+
*
|
|
259
|
+
* It wraps nothing a caller cannot do: the maths is in this entry point and runs inline. What a
|
|
260
|
+
* host may need to decide differently is WHERE it runs. Resolving a flight is the heaviest
|
|
261
|
+
* synchronous computation in the family: a spline, a timeline and a Gaussian over every frame,
|
|
262
|
+
* which for a minute at 60 fps is thousands of frames, plus a DEM clearance solve per frame on
|
|
263
|
+
* the record path. All of it happens on whichever thread calls it, and in a browser that is the
|
|
264
|
+
* one painting the page.
|
|
265
|
+
*
|
|
266
|
+
* The planner makes the thread a host's decision without the code that flies a plan having to
|
|
267
|
+
* know. It lives here rather than in `@mountaya/studio` because it touches only
|
|
268
|
+
* `resolveCameraTrack` and `resolveProfileSamples`, both published from this entry: a consumer
|
|
269
|
+
* building a flythrough over their own GeoJSON decides the thread without installing a studio.
|
|
270
|
+
* What ships is {@link synchronousCameraPlanner}, which resolves on the calling thread, and
|
|
271
|
+
* {@link measuredCameraPlanner}, which answers whether anything else is warranted.
|
|
272
|
+
*
|
|
273
|
+
* **Both methods are synchronous, and that is a deliberate limit rather than an oversight.** An
|
|
274
|
+
* async planner would let a host move the work to a worker, and the record path could not use
|
|
275
|
+
* it: `resolveTrack`'s clearance pass reads the DEM through a `TerrainSampler` that calls into
|
|
276
|
+
* the live map, which exists on the main thread and cannot cross a worker boundary. A worker
|
|
277
|
+
* implementation is therefore only ever possible for the sampler-free resolve, and making the
|
|
278
|
+
* whole seam async to reach it would turn every caller into an await for a capability most of
|
|
279
|
+
* them cannot use. The honest shape is the one the callers actually have; widening it is a
|
|
280
|
+
* decision to take when there is a worker to widen it for.
|
|
281
|
+
*/
|
|
282
|
+
interface CameraPlanner {
|
|
283
|
+
/**
|
|
284
|
+
* resolveSamples produces the per-frame overlay readout (distance, elevation, running
|
|
285
|
+
* ascent, the categorical bands), index-aligned with the poses.
|
|
286
|
+
*/
|
|
287
|
+
readonly resolveSamples: (plan: CameraPlan, itinerary: RouteGeometry, source: ProfileSource) => ProfileSample[];
|
|
288
|
+
/**
|
|
289
|
+
* resolveTrack produces the per-frame camera poses.
|
|
290
|
+
*
|
|
291
|
+
* `sampler` is the map's DEM readout, which turns on the clearance pass; `clearanceStride`
|
|
292
|
+
* decimates that pass for a preview. Both are absent on the sampler-free call a host makes to
|
|
293
|
+
* warm tiles.
|
|
294
|
+
*/
|
|
295
|
+
readonly resolveTrack: (plan: CameraPlan, itinerary: RouteGeometry, sampler?: TerrainSampler, clearanceStride?: number) => readonly ShotCamera[];
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* synchronousCameraPlanner resolves on the calling thread, exactly as `resolveCameraTrack` and
|
|
299
|
+
* `resolveProfileSamples` do when called directly.
|
|
300
|
+
*
|
|
301
|
+
* The default, and the right one until a measurement says otherwise. Both functions it delegates
|
|
302
|
+
* to memoize their own results, so a second call for an unchanged plan and route costs a map
|
|
303
|
+
* lookup, which is most of what a session of authoring does.
|
|
304
|
+
*/
|
|
305
|
+
declare const synchronousCameraPlanner: () => CameraPlanner;
|
|
306
|
+
/**
|
|
307
|
+
* measuredCameraPlanner wraps a planner so each resolve lands on the performance timeline.
|
|
308
|
+
*
|
|
309
|
+
* This is the debug instrument, and it is a DECORATOR a host opts into rather than a flag read
|
|
310
|
+
* from somewhere:
|
|
311
|
+
*
|
|
312
|
+
* ```ts
|
|
313
|
+
* const planner = measuredCameraPlanner(synchronousCameraPlanner());
|
|
314
|
+
* ```
|
|
315
|
+
*
|
|
316
|
+
* A decorator rather than a global switch because a global switch is a second way to configure
|
|
317
|
+
* the thing, readable from nowhere and testable only by setting it. Handing over a different
|
|
318
|
+
* planner is how this capability is changed, and it means the measurement is scoped to the caller
|
|
319
|
+
* that asked for it rather than to the process. In the studio it is one member of the seams.
|
|
320
|
+
*
|
|
321
|
+
* It exists to answer one question with a number: whether a real plan on a real machine exceeds
|
|
322
|
+
* the frame budget by enough to be worth a worker. Under a few tens of milliseconds the answer
|
|
323
|
+
* is no (the resolve is memoized and a session of authoring mostly hits it), and a worker would
|
|
324
|
+
* buy a message round trip and a structured clone of every pose in exchange.
|
|
325
|
+
*
|
|
326
|
+
* `onMeasure` receives each duration in milliseconds, for a host collecting its own telemetry
|
|
327
|
+
* rather than reading a devtools timeline. The User Timing entries are written either way, and
|
|
328
|
+
* a runtime without `performance.mark` simply gets the durations: the wrapper never changes what
|
|
329
|
+
* the planner returns, and never throws where the planner would not.
|
|
330
|
+
*/
|
|
331
|
+
declare const measuredCameraPlanner: (planner: CameraPlanner, onMeasure?: (name: string, durationMs: number) => void) => CameraPlanner;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Authoring and running one fly-through, with no product around it.
|
|
335
|
+
*
|
|
336
|
+
* This is the orchestration between a camera plan and a map: resolve the plan to poses against
|
|
337
|
+
* whatever terrain is loaded, warm the tiles the flight will cross, fly it live, capture it, and
|
|
338
|
+
* report progress while that happens. `VideoRunEngine` of `@mountaya/elements/video` owns a
|
|
339
|
+
* single RUN (the abort signal, the camera it restores to, the moving dot). This owns the SESSION: the plan being
|
|
340
|
+
* authored, the route it is anchored to, the overlay settings, the progress a UI reads, and the
|
|
341
|
+
* resolved-pose cache that makes a burst of plan edits cheap. It is a fly-through over a route a
|
|
342
|
+
* host holds, with no product around it: no itinerary id, no entitlement, no store, no bus.
|
|
343
|
+
*
|
|
344
|
+
* It names no renderer: the map is declared structurally and every type it reads is
|
|
345
|
+
* renderer-free, so `@mountaya/elements/camera` publishes it. A consumer recording with MapLibre
|
|
346
|
+
* builds the map from `@mountaya/elements/video`, and `@mountaya/studio` flies its video wizard
|
|
347
|
+
* on it with no renderer in its graph.
|
|
348
|
+
*
|
|
349
|
+
* **State, subscribe, commands, teardown**, in that order, because it is the contract a
|
|
350
|
+
* binding is written against. `getSnapshot` and `subscribe` are `useSyncExternalStore`'s two
|
|
351
|
+
* arguments exactly, so a React binding is a few lines; they are equally a Vue `shallowRef` or a
|
|
352
|
+
* Svelte store, which is the property that makes this the layer a second framework binds to rather
|
|
353
|
+
* than a layer it reimplements. Nothing here imports React.
|
|
354
|
+
*/
|
|
355
|
+
/**
|
|
356
|
+
* The map surface a flight drives, declared structurally.
|
|
357
|
+
*
|
|
358
|
+
* Structural rather than `MapClient`, for the same reason `CollabDispatch` is: a flight needs a
|
|
359
|
+
* few methods, and a consumer driving their own renderer should be able to satisfy it without
|
|
360
|
+
* adopting a platform-agnostic command interface built for a tool bus. `MapLibreClient` satisfies
|
|
361
|
+
* it by having the right shape, and so does a test double.
|
|
362
|
+
*
|
|
363
|
+
* `prewarmTerrain` and `warmPoses` are two warms and not one, which looks redundant until the
|
|
364
|
+
* failure is named. `prewarmTerrain` frames the route's bounds and settles the DEM, so the
|
|
365
|
+
* clearance pass reads real peak heights rather than null: without it a flight plans through a
|
|
366
|
+
* mountain. `warmPoses` jumps the camera through the flight's own viewports at the flight's own
|
|
367
|
+
* ZOOM, so the capture loop films loaded tiles rather than black ones. The first is about the
|
|
368
|
+
* plan; the second is about the picture.
|
|
369
|
+
*/
|
|
370
|
+
interface VideoFlightMap {
|
|
371
|
+
/**
|
|
372
|
+
* jumpToPose lands the camera on one full pose immediately, with no animation.
|
|
373
|
+
*
|
|
374
|
+
* The full pose and not a centre: a scrubbed frame has to match the pitch and bearing the flight
|
|
375
|
+
* would be at that fraction, or the scrubber shows a picture the video never contains.
|
|
376
|
+
*/
|
|
377
|
+
jumpToPose: (pose: RecordingCamera) => void;
|
|
378
|
+
/**
|
|
379
|
+
* prewarmTerrain frames the route's bounds and resolves once the DEM under them has settled.
|
|
380
|
+
*
|
|
381
|
+
* The box of a route across the antimeridian runs past 180 or below -180, the form a
|
|
382
|
+
* renderer frames across the line.
|
|
383
|
+
*/
|
|
384
|
+
prewarmTerrain: (bounds: BoundingBox) => Promise<void>;
|
|
385
|
+
previewPoses: (poses: RecordingCamera[], options: {
|
|
386
|
+
focusGlyphUrl?: string | undefined;
|
|
387
|
+
markers?: [number, number][] | undefined;
|
|
388
|
+
onProgress?: ((progress: VideoProgress) => void) | undefined;
|
|
389
|
+
planDurationMs?: number | undefined;
|
|
390
|
+
signal: AbortSignal;
|
|
391
|
+
}) => Promise<void>;
|
|
392
|
+
recordPoses: (poses: readonly RecordingCamera[], output: RecordOutput, options: {
|
|
393
|
+
focusGlyphUrl?: string | undefined;
|
|
394
|
+
markers?: [number, number][] | undefined;
|
|
395
|
+
onProgress?: ((progress: VideoProgress) => void) | undefined;
|
|
396
|
+
profile?: RecordProfile | undefined;
|
|
397
|
+
signal: AbortSignal;
|
|
398
|
+
/**
|
|
399
|
+
* Whether the caller has just warmed these very poses' viewports, every frame's zoom and
|
|
400
|
+
* pitch included, so the recorder captures without a warm pass of its own. Absent or
|
|
401
|
+
* false, the recorder warms them first.
|
|
402
|
+
*/
|
|
403
|
+
warmed?: boolean | undefined;
|
|
404
|
+
}) => Promise<VideoRecordingResult>;
|
|
405
|
+
sampleTerrainElevation: (lngLat: [number, number]) => number | null;
|
|
406
|
+
warmPoses: (poses: readonly RecordingCamera[], signal?: AbortSignal) => Promise<void>;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* The elevation overlay burnt into the frame, and the units it is written in.
|
|
410
|
+
*
|
|
411
|
+
* The units are the FLIGHT's rather than the surrounding application's, which is the whole reason
|
|
412
|
+
* they are here: a video is shared with people who are not the author, so a French creator
|
|
413
|
+
* exporting for an American audience states imperial on the export without touching what their own
|
|
414
|
+
* screen reads in. `language` doubles as the BCP 47 locale the numbers are formatted with.
|
|
415
|
+
*/
|
|
416
|
+
interface VideoFlightProfile {
|
|
417
|
+
readonly design: ProfileDesign;
|
|
418
|
+
readonly enabled: boolean;
|
|
419
|
+
readonly language: UnitFormatOptions["language"];
|
|
420
|
+
readonly length: UnitFormatOptions["length"];
|
|
421
|
+
readonly pace: UnitFormatOptions["pace"];
|
|
422
|
+
readonly slope: UnitFormatOptions["slope"];
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* The overlay a flight opens with: off, the graph design, metric, degrees and a speed
|
|
426
|
+
* stated per unit of time, in English.
|
|
427
|
+
*/
|
|
428
|
+
declare const defaultVideoFlightProfile: VideoFlightProfile;
|
|
429
|
+
/**
|
|
430
|
+
* What a flight is doing, as a subscriber reads it.
|
|
431
|
+
*
|
|
432
|
+
* A discriminated union rather than a pair of booleans and a number, because the states carry
|
|
433
|
+
* different payloads: idle carries none, a preview carries how far through it is, a parked camera
|
|
434
|
+
* carries where it rests, and a recording carries how far through it is plus which phase the
|
|
435
|
+
* work is in. A progress bar at 100% during `encoding` is a muxer finalising a long file, and a
|
|
436
|
+
* readout that could not say so reads as a hang.
|
|
437
|
+
*
|
|
438
|
+
* `parked` is the camera at rest on a frame of the flight, where a {@link VideoFlightEngine.seek}
|
|
439
|
+
* left it: `fraction` is how far through the flight that frame is, between 0 and 1. It is a kind
|
|
440
|
+
* of its own, apart from `previewing`, so a transport draws Play over a parked camera and Pause
|
|
441
|
+
* over a preview under way, and a scrubber reads its position off either.
|
|
442
|
+
*/
|
|
443
|
+
type VideoFlightStatus = {
|
|
444
|
+
readonly kind: "idle";
|
|
445
|
+
} | {
|
|
446
|
+
readonly fraction: number;
|
|
447
|
+
readonly kind: "parked";
|
|
448
|
+
} | {
|
|
449
|
+
readonly fraction: number;
|
|
450
|
+
readonly kind: "previewing";
|
|
451
|
+
} | {
|
|
452
|
+
readonly fraction: number;
|
|
453
|
+
readonly kind: "recording";
|
|
454
|
+
readonly phase: VideoRecordingPhase;
|
|
455
|
+
};
|
|
456
|
+
/** Everything a UI renders from, and the whole of what `subscribe` announces a change to. */
|
|
457
|
+
interface VideoFlight {
|
|
458
|
+
/**
|
|
459
|
+
* The activity silhouette the moving focus dot masks over its white disc, or null for a plain
|
|
460
|
+
* disc. A URL rather than a glyph name: what artwork an activity has is the caller's vocabulary.
|
|
461
|
+
*/
|
|
462
|
+
readonly activityGlyphUrl: string | null;
|
|
463
|
+
readonly plan: CameraPlan;
|
|
464
|
+
readonly profile: VideoFlightProfile;
|
|
465
|
+
/**
|
|
466
|
+
* Where the overlay's per-frame readouts are resolved from. Null leaves the overlay unpainted.
|
|
467
|
+
*/
|
|
468
|
+
readonly profileSource: ProfileSource | null;
|
|
469
|
+
/** The flattened route the plan is anchored to. Null until a caller supplies one. */
|
|
470
|
+
readonly route: RouteGeometry | null;
|
|
471
|
+
readonly status: VideoFlightStatus;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Why a flight did not run, as a value rather than a throw.
|
|
475
|
+
*
|
|
476
|
+
* `recordPoses` already resolves rather than rejecting, and a preview that was cancelled is the
|
|
477
|
+
* normal case rather than an error, so the whole surface answers the same way. `aborted` covers a
|
|
478
|
+
* caller's cancel, a newer run replacing this one and a dispose, whenever each lands, the terrain
|
|
479
|
+
* warm-up included: they are indistinguishable to the run that stopped, and a caller that needs
|
|
480
|
+
* to tell them apart knows which one it asked for.
|
|
481
|
+
*
|
|
482
|
+
* `failed` is the one refusal that carries a payload, the `error` the flight stopped on: a throw
|
|
483
|
+
* from the map or the planner, or a fraction that is no number. A thrown value that is no
|
|
484
|
+
* `Error` arrives wrapped in a `MountayaElementsRejectionError` that holds it as the cause. A
|
|
485
|
+
* subscriber that throws is no failure of the flight, and never arrives here.
|
|
486
|
+
*/
|
|
487
|
+
type VideoFlightOutcome = {
|
|
488
|
+
readonly ok: true;
|
|
489
|
+
} | {
|
|
490
|
+
readonly error: Error;
|
|
491
|
+
readonly ok: false;
|
|
492
|
+
readonly reason: "failed";
|
|
493
|
+
} | {
|
|
494
|
+
readonly ok: false;
|
|
495
|
+
readonly reason: "aborted" | "no-map" | "no-route";
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* A finished recording, or why there is not one.
|
|
499
|
+
*
|
|
500
|
+
* `failed` is the one refusal that carries a payload, the `error` the run stopped on, because a
|
|
501
|
+
* caller has something to tell its user there: the recorder's own (a missing `mediabunny`, a
|
|
502
|
+
* surface, frame capture or encoder that could not be built, a capture or encode that threw), or
|
|
503
|
+
* a throw from the map or the planner before the first frame. `aborted` is a cancel, as in
|
|
504
|
+
* {@link VideoFlightOutcome}. `unavailable` is a recording that could not start, which nobody
|
|
505
|
+
* cancelled: no recorder wired to the map, no drawing buffer to read, a canvas under the minimum
|
|
506
|
+
* size, no 2D context to composite in, a first frame that read black. `no-frames` is a result with
|
|
507
|
+
* no blob, no cancel and no error, which the shipped recorder never resolves and a map a host
|
|
508
|
+
* supplies may.
|
|
509
|
+
*/
|
|
510
|
+
type VideoFlightRecording = {
|
|
511
|
+
readonly blob: Blob;
|
|
512
|
+
readonly extension: string;
|
|
513
|
+
readonly ok: true;
|
|
514
|
+
} | {
|
|
515
|
+
readonly error: Error;
|
|
516
|
+
readonly ok: false;
|
|
517
|
+
readonly reason: "failed";
|
|
518
|
+
} | {
|
|
519
|
+
readonly ok: false;
|
|
520
|
+
readonly reason: "aborted" | "no-frames" | "no-map" | "no-route" | "unavailable";
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* VideoFlightOptions is what a {@link VideoFlightEngine} is built with: the plan it opens on, and
|
|
524
|
+
* optionally the map it drives, where the plan is resolved, how many resolved flights it keeps
|
|
525
|
+
* and whether a recording carries the brand mark.
|
|
526
|
+
*/
|
|
527
|
+
interface VideoFlightOptions {
|
|
528
|
+
/**
|
|
529
|
+
* The plan a flight opens on. Required, because there is no default worth inventing: a plan
|
|
530
|
+
* names a mode, an output and a keyframe list, and `cameraPlanGenerators` builds one from a
|
|
531
|
+
* route in a line.
|
|
532
|
+
*/
|
|
533
|
+
readonly plan: CameraPlan;
|
|
534
|
+
/**
|
|
535
|
+
* The map the flight drives. Omitted or null, every run answers `no-map` and the state still
|
|
536
|
+
* works, which is what lets a caller author a plan before a canvas exists.
|
|
537
|
+
*/
|
|
538
|
+
readonly map?: VideoFlightMap | null | undefined;
|
|
539
|
+
/**
|
|
540
|
+
* Where a plan is turned into per-frame poses. Defaults to resolving on the calling thread,
|
|
541
|
+
* which is what the studio does; `measuredCameraPlanner` answers whether anything else is
|
|
542
|
+
* warranted.
|
|
543
|
+
*/
|
|
544
|
+
readonly planner?: CameraPlanner | undefined;
|
|
545
|
+
/**
|
|
546
|
+
* How many resolved flights to memoize. Four covers a session's working set (the current
|
|
547
|
+
* preview, the record's full-density resolve, and a recent edit or two) while keeping the
|
|
548
|
+
* retained per-frame pose arrays to a handful.
|
|
549
|
+
*
|
|
550
|
+
* A whole number, 0 or more. At 0 no flight is kept and every run resolves again.
|
|
551
|
+
*
|
|
552
|
+
* @default 4
|
|
553
|
+
*/
|
|
554
|
+
readonly poseCacheSize?: number | undefined;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* VideoFlightEngine authors and runs one fly-through over a route a host holds: it holds the
|
|
558
|
+
* plan, the route and the overlay settings, previews the flight on the map, pauses and plays it
|
|
559
|
+
* on, records it to a video file, and parks the camera at any point of it.
|
|
560
|
+
*
|
|
561
|
+
* The contract a binding is written against is state, subscribe, commands, teardown.
|
|
562
|
+
* {@link getSnapshot} answers the state, the same object until something changes, and
|
|
563
|
+
* {@link subscribe} hears every change, so the two are `useSyncExternalStore`'s arguments as they
|
|
564
|
+
* are. The commands (`setPlan`, `setRoute`, `setProfile`, `preview`, `play`, `pause`, `seek`,
|
|
565
|
+
* `stop`, `record`, `abort`) write it, and a run answers an outcome rather than rejecting.
|
|
566
|
+
* {@link dispose} ends every run and lets go of the map, which the engine never owns.
|
|
567
|
+
*
|
|
568
|
+
* Recording needs a map built with `preserveDrawingBuffer` and the `mediabunny` peer, which
|
|
569
|
+
* `@mountaya/elements/video` loads only when a recording starts.
|
|
570
|
+
*
|
|
571
|
+
* @example
|
|
572
|
+
* ```ts
|
|
573
|
+
* import { MountayaMap } from "@mountaya/elements";
|
|
574
|
+
* import {
|
|
575
|
+
* cameraPlanGenerators,
|
|
576
|
+
* type RouteGeometry,
|
|
577
|
+
* VideoFlightEngine,
|
|
578
|
+
* } from "@mountaya/elements/camera";
|
|
579
|
+
* import { MapLibreViewClient, VideoRunEngine } from "@mountaya/elements/video";
|
|
580
|
+
*
|
|
581
|
+
* declare const map: MountayaMap;
|
|
582
|
+
* declare const route: RouteGeometry;
|
|
583
|
+
*
|
|
584
|
+
* const flight = new VideoFlightEngine({
|
|
585
|
+
* map: new MapLibreViewClient(map, {
|
|
586
|
+
* video: new VideoRunEngine(map.raw, map.events, () => map.loadOrganization()),
|
|
587
|
+
* }),
|
|
588
|
+
* plan: cameraPlanGenerators.overview(route, { targetDurationMs: 20_000 }),
|
|
589
|
+
* });
|
|
590
|
+
* flight.setRoute(route);
|
|
591
|
+
* flight.subscribe(() => console.log(flight.getSnapshot().status.kind));
|
|
592
|
+
*
|
|
593
|
+
* const result = await flight.record();
|
|
594
|
+
* if (result.ok) {
|
|
595
|
+
* console.log(`flight.${result.extension}`, result.blob.size);
|
|
596
|
+
* }
|
|
597
|
+
* flight.dispose();
|
|
598
|
+
* ```
|
|
599
|
+
*/
|
|
600
|
+
declare class VideoFlightEngine {
|
|
601
|
+
private flight;
|
|
602
|
+
private readonly listeners;
|
|
603
|
+
private readonly map;
|
|
604
|
+
private readonly planner;
|
|
605
|
+
private readonly poseCacheSize;
|
|
606
|
+
/**
|
|
607
|
+
* The run in flight. One at a time: every preview and record stops the run before it as it
|
|
608
|
+
* starts, because two flights over one map would fight for the camera.
|
|
609
|
+
*/
|
|
610
|
+
private run;
|
|
611
|
+
/**
|
|
612
|
+
* How far through the flight a preview that {@link pause} stopped in the air had flown, which
|
|
613
|
+
* {@link play} flies on from. Null when no flight is paused.
|
|
614
|
+
*/
|
|
615
|
+
private pausedAt;
|
|
616
|
+
/**
|
|
617
|
+
* The memoized flights, an insertion-ordered LRU. Keyed on the pose-affecting plan fields, the
|
|
618
|
+
* route's revision, whether this is the full-density record resolve or a decimated preview one,
|
|
619
|
+
* and the DEM epoch, so a format-only edit collapses onto the same key and reuses the flight,
|
|
620
|
+
* while a resolve cached against a cold DEM is dropped once the flight warm lands.
|
|
621
|
+
*/
|
|
622
|
+
private readonly poseCache;
|
|
623
|
+
/** Bumped when the flight terrain warms, which is what invalidates a cold-DEM resolve. */
|
|
624
|
+
private demEpoch;
|
|
625
|
+
/**
|
|
626
|
+
* Advanced each time the route's content is read and differs from {@link routeContent}: as
|
|
627
|
+
* {@link setRoute} is handed a route, and as a flight begins. The warm guards and the pose
|
|
628
|
+
* cache name a route by it, so telling two routes apart costs one walk per `setRoute` and one
|
|
629
|
+
* per flight, each ending at the first difference.
|
|
630
|
+
*/
|
|
631
|
+
private routeRevision;
|
|
632
|
+
/** What the held route held when it was last read, or null while no route is held. */
|
|
633
|
+
private routeContent;
|
|
634
|
+
/** The route revision each warm has already run for, so neither repeats. */
|
|
635
|
+
private terrainWarmedRevision;
|
|
636
|
+
private flightWarmedRevision;
|
|
637
|
+
/** The terrain warm in progress, which a flight asked for meanwhile over the same route joins. */
|
|
638
|
+
private terrainWarm;
|
|
639
|
+
/**
|
|
640
|
+
* The flight warm in progress, shared the same way. One sweep at a time moves the camera, and
|
|
641
|
+
* the engine holds the handle that ends it: {@link abort}, {@link dispose}, another route and
|
|
642
|
+
* a record, which sweeps for itself, each end it.
|
|
643
|
+
*/
|
|
644
|
+
private flightWarm;
|
|
645
|
+
/**
|
|
646
|
+
* The sweep a record makes for itself, while it is in progress. It is the flight's sweep over
|
|
647
|
+
* that route, so a flight asked for meanwhile joins it and starts none of its own. It ends on
|
|
648
|
+
* the record's run and on nothing else, which is why it is held apart from
|
|
649
|
+
* {@link flightWarm}: another route set meanwhile ends a shared sweep, and leaves a record on
|
|
650
|
+
* the route it began with.
|
|
651
|
+
*/
|
|
652
|
+
private recordWarm;
|
|
653
|
+
/**
|
|
654
|
+
* The settling of every map call that still holds the camera: the run in flight's, and that of
|
|
655
|
+
* each flight stopped since whose `previewPoses` or `recordPoses` has yet to settle. A seek
|
|
656
|
+
* parks the camera once all of them have let go of it.
|
|
657
|
+
*/
|
|
658
|
+
private readonly landings;
|
|
659
|
+
/**
|
|
660
|
+
* Whether a seek stopped a flight and no status has replaced the one that flight left. A
|
|
661
|
+
* stopped flight's own exit commits nothing, so its status is settled by the seek that
|
|
662
|
+
* stopped it or, when that seek was overtaken, by the one that parks or fails in its place.
|
|
663
|
+
* {@link commit} clears it on every status it states.
|
|
664
|
+
*/
|
|
665
|
+
private seekStoppedFlight;
|
|
666
|
+
/** The last encoded recording, so a save does not re-encode. */
|
|
667
|
+
private lastRecording;
|
|
668
|
+
/** Aborted by {@link dispose}, and the signal a seek resolves under, since it holds no run. */
|
|
669
|
+
private readonly disposal;
|
|
670
|
+
/** Whether {@link dispose} has run, read off the one signal it aborts. */
|
|
671
|
+
private get disposed();
|
|
672
|
+
/**
|
|
673
|
+
* Advanced by every flight asked for, a seek included, and by {@link abort}. A seek holds no
|
|
674
|
+
* run, so it reads this after each of its awaits to learn whether a newer preview, record or
|
|
675
|
+
* seek was asked for since it began, or an abort, and leaves the camera alone when one was.
|
|
676
|
+
*/
|
|
677
|
+
private flightSequence;
|
|
678
|
+
/**
|
|
679
|
+
* @throws {MountayaElementsError} When `poseCacheSize` is not a whole number, 0 or more, when
|
|
680
|
+
* the plan is no object, or when it holds a member no flight can be planned with.
|
|
681
|
+
* {@link setPlan} lists them.
|
|
682
|
+
*/
|
|
683
|
+
constructor(options: VideoFlightOptions);
|
|
684
|
+
/**
|
|
685
|
+
* getSnapshot returns the current flight, by reference.
|
|
686
|
+
*
|
|
687
|
+
* Stable between changes, deliberately: it is `useSyncExternalStore`'s second argument, and a
|
|
688
|
+
* fresh object per call makes React's own tearing check loop forever. Every command below
|
|
689
|
+
* replaces the object rather than mutating it, so identity IS the change signal.
|
|
690
|
+
*/
|
|
691
|
+
getSnapshot(): VideoFlight;
|
|
692
|
+
/**
|
|
693
|
+
* subscribe registers a listener for every change, and returns its own unsubscribe.
|
|
694
|
+
*
|
|
695
|
+
* A listener that throws keeps no other listener from being told and changes no command's
|
|
696
|
+
* answer: a setter, {@link abort} and {@link reset} throw nothing, and a preview, a record or
|
|
697
|
+
* a seek answers for the flight alone. What the listener threw is the subscribing program's
|
|
698
|
+
* own fault, and it reaches the runtime as an uncaught error on a microtask, once per change
|
|
699
|
+
* the listener threw at.
|
|
700
|
+
*/
|
|
701
|
+
subscribe(listener: () => void): () => void;
|
|
702
|
+
/** The last encoded recording, or null. Held so a save does not re-encode what was just made. */
|
|
703
|
+
get recording(): {
|
|
704
|
+
blob: Blob;
|
|
705
|
+
extension: string;
|
|
706
|
+
} | null;
|
|
707
|
+
/**
|
|
708
|
+
* setPlan replaces the plan. Does not abort a run: a plan edit mid-preview takes on the next.
|
|
709
|
+
*
|
|
710
|
+
* @throws {MountayaElementsError} Naming `plan`, when it is no object. Naming the member,
|
|
711
|
+
* when `output` is no object, `shots` no array or an entry of `shots` no object, when
|
|
712
|
+
* `version` is not 1, when `targetDurationMs` is
|
|
713
|
+
* not a finite number above 0, when `output.fps` is not 24, 30 or 60, when a stated
|
|
714
|
+
* `output.bitrateMbps` is not a finite number above 0, or when a shot holds a number that is
|
|
715
|
+
* not finite, a `holdMs` below 0 or a `speedScale` at or below 0: what `createCameraPlan`
|
|
716
|
+
* refuses, by the same rule. The plan the engine held stands.
|
|
717
|
+
*/
|
|
718
|
+
setPlan(plan: CameraPlan): void;
|
|
719
|
+
/**
|
|
720
|
+
* setRoute anchors the flight to a route, and resets both warm guards when it changes.
|
|
721
|
+
*
|
|
722
|
+
* Reset on CONTENT, so a re-supplied identical route keeps its warms. A different route has
|
|
723
|
+
* different terrain under it and different tiles to settle, so neither warm carries over, and
|
|
724
|
+
* a flight warm still sweeping the route before it ends at its next stop.
|
|
725
|
+
*
|
|
726
|
+
* The route is held as the object it is given, never copied for a reader, and its content is
|
|
727
|
+
* read here and again as each preview, record and seek begins. So a route edited in place (a
|
|
728
|
+
* track that grows by a push) is flown as it stands when the next flight is asked for, with
|
|
729
|
+
* its warms run again, whether or not it is handed over a second time.
|
|
730
|
+
*
|
|
731
|
+
* A line of fewer than two vertices is held as it is given and flown as no route: every run
|
|
732
|
+
* over it answers `no-route`.
|
|
733
|
+
*
|
|
734
|
+
* Another route stops a preview flying the one before it, and lands a `previewing` or a
|
|
735
|
+
* `parked` status on idle: the camera would fly, or rest on, a route the engine has let go
|
|
736
|
+
* of, under a status that says otherwise. It forgets a paused flight as well, so the next
|
|
737
|
+
* {@link play} flies the route that arrived from its first frame. A preview still in its
|
|
738
|
+
* warm-up flies the route that arrived, and a record flies the route it began with.
|
|
739
|
+
*/
|
|
740
|
+
setRoute(route: RouteGeometry | null): void;
|
|
741
|
+
/**
|
|
742
|
+
* setProfile merges a partial overlay update over the current one.
|
|
743
|
+
*
|
|
744
|
+
* A merge rather than a replacement, because every caller changes one field (the enable flag, a
|
|
745
|
+
* unit, the design), and a replacement would make each of those restate the others.
|
|
746
|
+
*/
|
|
747
|
+
setProfile(profile: Partial<VideoFlightProfile>): void;
|
|
748
|
+
/** setProfileSource sets where the overlay's per-frame readouts are resolved from. */
|
|
749
|
+
setProfileSource(profileSource: ProfileSource | null): void;
|
|
750
|
+
/** setActivityGlyph sets the silhouette the moving focus dot masks, or null for a plain disc. */
|
|
751
|
+
setActivityGlyph(activityGlyphUrl: string | null): void;
|
|
752
|
+
/**
|
|
753
|
+
* preview flies the plan live over the map from its first frame, encoding nothing, and reports
|
|
754
|
+
* progress. It forgets a flight {@link pause} stopped.
|
|
755
|
+
*
|
|
756
|
+
* Paced to the plan's own wall-clock so the rehearsal runs at the speed the recording will and
|
|
757
|
+
* dwells on holds: a preview that ran at frame rate would mislead about both.
|
|
758
|
+
*
|
|
759
|
+
* The run opens before the two warms rather than after them. Both warms move the camera and can
|
|
760
|
+
* take seconds on a cold cache, which is when a caller reaches for {@link pause}: a run opened
|
|
761
|
+
* after them would leave a pause, an abort, a dispose or a newer flight during the warm with
|
|
762
|
+
* nothing to stop, and the fly would start anyway. A stop there answers `aborted`, starts no
|
|
763
|
+
* further warm and flies no frame.
|
|
764
|
+
*
|
|
765
|
+
* The flight is of the plan and the route the engine holds once both warms have settled. A
|
|
766
|
+
* route set during a warm is warmed in turn, the DEM over its bounds and then its viewports,
|
|
767
|
+
* before any pose is resolved over it.
|
|
768
|
+
*
|
|
769
|
+
* It never rejects. A map or a planner that throws answers `failed` with the error it stopped
|
|
770
|
+
* on. A throw that follows a stop answers `aborted`, because the caller asked the run to
|
|
771
|
+
* stop. A subscriber that throws changes neither ({@link subscribe}). Every exit ends the run
|
|
772
|
+
* and lands on idle unless a newer one holds it by then.
|
|
773
|
+
*/
|
|
774
|
+
preview(): Promise<VideoFlightOutcome>;
|
|
775
|
+
/**
|
|
776
|
+
* play flies the plan on from where a flight was stopped, as {@link preview} flies it.
|
|
777
|
+
*
|
|
778
|
+
* It resumes a preview {@link pause} stopped in the air, from the frame nearest where it was and
|
|
779
|
+
* over the rest of the plan's wall-clock. Over a `parked` status it flies on from the frame
|
|
780
|
+
* {@link seek} parked the camera on, as a player plays on from where its reader put the head.
|
|
781
|
+
* It flies from the first frame when there is neither, and when nothing is left to fly past the
|
|
782
|
+
* frame it would start on. A play stopped in its warm-up flies nothing, and keeps where it was
|
|
783
|
+
* to fly on from for the next one.
|
|
784
|
+
*/
|
|
785
|
+
play(): Promise<VideoFlightOutcome>;
|
|
786
|
+
/**
|
|
787
|
+
* startPreview is {@link preview} and {@link play}: it opens the run, reads where the flight
|
|
788
|
+
* flies on from, and answers what the fly settled on.
|
|
789
|
+
*/
|
|
790
|
+
private startPreview;
|
|
791
|
+
/**
|
|
792
|
+
* flyPreview is {@link preview} and {@link play} from their first warm to the end of their
|
|
793
|
+
* fly, under the run they opened. It throws what the map or the planner threw, which they
|
|
794
|
+
* answer.
|
|
795
|
+
*/
|
|
796
|
+
private flyPreview;
|
|
797
|
+
/**
|
|
798
|
+
* record captures one frame per pose and encodes them, reporting progress with its phase.
|
|
799
|
+
*
|
|
800
|
+
* Resolved at full density (stride 1), where a preview resolves at the decimated clearance
|
|
801
|
+
* stride, so the artifact is what the plan describes rather than what was cheap to rehearse.
|
|
802
|
+
*
|
|
803
|
+
* The run opens before the terrain warm, for the reason {@link preview} gives, and the flight
|
|
804
|
+
* warm inside the resolve takes its signal: a stop, an abort or a dispose during either warm
|
|
805
|
+
* answers `aborted`, starts no further warm and captures no frame. Over a route a flight can
|
|
806
|
+
* follow, the status reads `recording` in its `preparing` phase from the moment the run opens,
|
|
807
|
+
* so a reader sees the press land while the terrain warms.
|
|
808
|
+
*
|
|
809
|
+
* A run stopped before the recorder answers keeps nothing: it answers `aborted`, whatever the
|
|
810
|
+
* map resolved, since a recorder a host supplies may finish a file after its signal aborted.
|
|
811
|
+
*
|
|
812
|
+
* It never rejects. A recorder that fails, or a map or planner that throws on the way to the
|
|
813
|
+
* first frame, answers `failed` with the error it stopped on, and a throw that follows an abort
|
|
814
|
+
* answers `aborted`, because the caller asked the run to stop. A subscriber that throws
|
|
815
|
+
* changes neither ({@link subscribe}). A recording
|
|
816
|
+
* the map could not start answers `unavailable`, which is no cancel: the result states
|
|
817
|
+
* `reason: "unavailable"` beside its `cancelled`. Every exit ends the run and lands on idle
|
|
818
|
+
* unless a newer run holds it by then, so a caller holding a recording state always has an
|
|
819
|
+
* outcome to settle it on.
|
|
820
|
+
*
|
|
821
|
+
* The record flies the plan and the route it began with. One set while it warms takes on the
|
|
822
|
+
* next flight, so the poses, the encoder's output and the overlay's samples stay those of one
|
|
823
|
+
* plan. Whether its frames carry the Mountaya watermark is the map's organization's to answer,
|
|
824
|
+
* read as the capture begins: no member of the engine takes the mark off.
|
|
825
|
+
*/
|
|
826
|
+
record(): Promise<VideoFlightRecording>;
|
|
827
|
+
/**
|
|
828
|
+
* flyRecording is {@link record} from its terrain warm to the recorder's answer, under the run
|
|
829
|
+
* it opened. It throws what the map or the planner threw, which `record` answers.
|
|
830
|
+
*/
|
|
831
|
+
private flyRecording;
|
|
832
|
+
/**
|
|
833
|
+
* seek parks the camera on the pose the flight is at, a fraction of the way through.
|
|
834
|
+
*
|
|
835
|
+
* It aborts any live fly first (a seek that did not would be overwritten by the next preview
|
|
836
|
+
* frame), resolves the flight, and jumps to the nearest frame's FULL pose. The status is left
|
|
837
|
+
* reading `parked` at the requested fraction rather than idle, because that is what a
|
|
838
|
+
* scrubber reads to position itself: the camera is parked mid-flight, not stopped.
|
|
839
|
+
*
|
|
840
|
+
* The pose is of the plan and the route the engine holds as the camera lands. One set while
|
|
841
|
+
* the seek waits, on a warm or on a stopped flight that still holds the camera, is warmed and
|
|
842
|
+
* resolved before the seek parks.
|
|
843
|
+
*
|
|
844
|
+
* The fraction is clamped rather than validated, so a scrubber dragged past its own track is a
|
|
845
|
+
* camera at an endpoint instead of a failure a UI has to render. A fraction that is no number
|
|
846
|
+
* (`NaN`, or a value of another type from a caller the compiler does not check) has no end to
|
|
847
|
+
* clamp to: the seek answers `failed` and touches nothing.
|
|
848
|
+
*
|
|
849
|
+
* A seek waits on the warms like any flight and starts neither twice: one asked for while a
|
|
850
|
+
* warm over the same route is in progress joins it, so a scrubber dragged on a cold route sweeps
|
|
851
|
+
* the camera once. A {@link pause} or a {@link stop} takes no camera, so a seek in its warm-up
|
|
852
|
+
* goes on to park, and the sweep it waits on goes on with it. A seek that parks forgets a
|
|
853
|
+
* paused flight: the next {@link play} flies on from the frame it parked on.
|
|
854
|
+
*
|
|
855
|
+
* A stopped flight lets go of the camera before the seek parks it, whoever stopped it: this
|
|
856
|
+
* seek, a seek before it, an {@link abort} or a newer flight. The seek waits for the map's
|
|
857
|
+
* `previewPoses` or `recordPoses` to settle on the aborted signal, because a run restores the
|
|
858
|
+
* camera it found as it settles, which for a record is once the frame in flight has ended, and
|
|
859
|
+
* that restore would land on top of the parked pose.
|
|
860
|
+
*
|
|
861
|
+
* A seek after {@link dispose}, or one whose warms a dispose overtook, answers `aborted` and
|
|
862
|
+
* leaves the camera where it is: a disposed engine does not move the map it let go of. A dispose
|
|
863
|
+
* during the terrain warm starts no flight warm, and one during the flight warm ends its sweep
|
|
864
|
+
* at the next stop, as an {@link abort} does. A seek a newer preview, record or seek overtook
|
|
865
|
+
* during its warms answers `aborted` as well and leaves the camera to the newer one, so a scrub
|
|
866
|
+
* that lands late never aborts a flight asked for after it, nor parks the camera over a later
|
|
867
|
+
* scrub.
|
|
868
|
+
*
|
|
869
|
+
* It never rejects. A map or a planner that throws answers `failed` with the error it stopped
|
|
870
|
+
* on and leaves the status as it was, or on idle when a seek had stopped a flight whose status
|
|
871
|
+
* nothing had replaced: this seek, or one it overtook before that one parked. A seek that
|
|
872
|
+
* answers `no-route` settles such a status the same way. A subscriber that throws changes
|
|
873
|
+
* none of it ({@link subscribe}).
|
|
874
|
+
*/
|
|
875
|
+
seek(fraction: number): Promise<VideoFlightOutcome>;
|
|
876
|
+
/**
|
|
877
|
+
* park is {@link seek} from its first warm to the pose it lands on. `overtaken` answers
|
|
878
|
+
* whether a dispose, an abort or a newer flight has taken the camera since the seek began. It
|
|
879
|
+
* throws what the map or the planner threw, which `seek` answers.
|
|
880
|
+
*/
|
|
881
|
+
private park;
|
|
882
|
+
/**
|
|
883
|
+
* invalidatePoses drops the memoized flights without touching the terrain warms.
|
|
884
|
+
*
|
|
885
|
+
* What a PLAN edit needs, and the distinction from {@link reset} is the expensive half: a new
|
|
886
|
+
* plan resolves to different poses over the same ground, so the pose cache is stale and the
|
|
887
|
+
* warms are not. Clearing both would re-run a visible multi-second camera sweep on every shot
|
|
888
|
+
* nudge.
|
|
889
|
+
*/
|
|
890
|
+
invalidatePoses(): void;
|
|
891
|
+
/**
|
|
892
|
+
* reset returns the engine to the state a fresh session starts in: no run, no caches, no
|
|
893
|
+
* warms, no recording, no paused flight, status idle. The plan and the route are left alone:
|
|
894
|
+
* a caller that wants those changed says so.
|
|
895
|
+
*
|
|
896
|
+
* It throws nothing, whatever a subscriber throws as the idle is announced
|
|
897
|
+
* ({@link subscribe}).
|
|
898
|
+
*/
|
|
899
|
+
reset(): void;
|
|
900
|
+
/**
|
|
901
|
+
* pause stops the run in flight and lands on idle, remembering how far a preview in the air
|
|
902
|
+
* had flown, which {@link play} flies on from.
|
|
903
|
+
*
|
|
904
|
+
* A preview stopped in its warm-up had flown nothing, so the flight paused before it stays
|
|
905
|
+
* paused. It takes no camera: a {@link seek} in its warm-up goes on to park, and a flight warm
|
|
906
|
+
* it waits on goes on sweeping. A sweep only stopped flights wait on ends at its next stop.
|
|
907
|
+
* With nothing running it lands a `parked` status on idle. Idempotent.
|
|
908
|
+
*/
|
|
909
|
+
pause(): void;
|
|
910
|
+
/**
|
|
911
|
+
* stop stops the run in flight, forgets a paused flight and lands on idle, and answers which
|
|
912
|
+
* run it stopped: `"preview"` for a preview or a play in the air or in its warm-up,
|
|
913
|
+
* `"record"` for a recording, and null when nothing was running.
|
|
914
|
+
*
|
|
915
|
+
* Like {@link pause} it takes no camera: a {@link seek} in its warm-up goes on to park. The run
|
|
916
|
+
* a stop ends answers `aborted`. Idempotent, and safe with nothing running.
|
|
917
|
+
*/
|
|
918
|
+
stop(): "preview" | "record" | null;
|
|
919
|
+
/**
|
|
920
|
+
* abort stops whatever is running, a seek in its warm-up included, forgets a paused flight and
|
|
921
|
+
* lands on idle.
|
|
922
|
+
*
|
|
923
|
+
* Idempotent, and safe with nothing running, which is what lets a UI wire it to a close button
|
|
924
|
+
* and an unmount without either of them checking first.
|
|
925
|
+
*
|
|
926
|
+
* A seek still in its warm-up holds no run, so the abort overtakes it the way a newer flight
|
|
927
|
+
* does: it answers `aborted` when its warm settles and parks no camera. A flight warm in
|
|
928
|
+
* progress ends its sweep at the next stop, whichever flight began it.
|
|
929
|
+
*/
|
|
930
|
+
abort(): void;
|
|
931
|
+
/**
|
|
932
|
+
* dispose aborts the run, drops every listener and forgets the caches.
|
|
933
|
+
*
|
|
934
|
+
* Idempotent. It does NOT dispose the map: the engine was handed one and does not own it,
|
|
935
|
+
* which is the same one-way dependency `VideoRunEngine` keeps. For the same reason it starts
|
|
936
|
+
* nothing on the map after it: a warm in progress holds a signal this aborts, which ends its
|
|
937
|
+
* sweep at the next stop, and a preview, record or seek still in its warm-up, or asked for
|
|
938
|
+
* later, answers `aborted` without warming again, flying, capturing or parking the camera.
|
|
939
|
+
*
|
|
940
|
+
* A disposed engine keeps the snapshot it showed. Nothing is announced after a dispose, so a
|
|
941
|
+
* reader that still holds the engine reads the status it last saw, a flight in progress
|
|
942
|
+
* included, and no later command changes it.
|
|
943
|
+
*/
|
|
944
|
+
dispose(): void;
|
|
945
|
+
/**
|
|
946
|
+
* commit replaces the snapshot and announces it. A no-op after dispose.
|
|
947
|
+
*
|
|
948
|
+
* It never throws. Every listener is told through {@link notifyListeners}, one that throws
|
|
949
|
+
* included, and the first thing a listener threw is surfaced once they all have been, so no
|
|
950
|
+
* command has to decide what a listener's exception does to a flight. The snapshot is replaced
|
|
951
|
+
* before anyone is told, so what a later reader holds is the change, whatever a listener did
|
|
952
|
+
* with it.
|
|
953
|
+
*/
|
|
954
|
+
private commit;
|
|
955
|
+
/**
|
|
956
|
+
* beginRun opens the one run a flight holds, aborting the one before it, and advances the
|
|
957
|
+
* {@link flightSequence} a seek in its warm-up reads.
|
|
958
|
+
*
|
|
959
|
+
* After {@link dispose} the run is born aborted and is not held, so every entry point answers
|
|
960
|
+
* `aborted` before it touches the map: a disposed engine was handed its map and let go of it.
|
|
961
|
+
*/
|
|
962
|
+
private beginRun;
|
|
963
|
+
/**
|
|
964
|
+
* stopRun is {@link pause} and {@link stop} past what each remembers: it stops the run in
|
|
965
|
+
* flight, ends a flight warm only stopped flights wait on, and lands on idle. It advances no
|
|
966
|
+
* {@link flightSequence}, so a seek in its warm-up goes on to park.
|
|
967
|
+
*/
|
|
968
|
+
private stopRun;
|
|
969
|
+
/**
|
|
970
|
+
* endRun lands on idle unless a newer run has already replaced this one, and answers the
|
|
971
|
+
* outcome the run settled on, as {@link land} reads it.
|
|
972
|
+
*/
|
|
973
|
+
private endRun;
|
|
974
|
+
/** land commits idle and answers the outcome the flight settled on. */
|
|
975
|
+
private land;
|
|
976
|
+
/**
|
|
977
|
+
* routeChanged names a route whose content differs from the one last read: it keeps the new
|
|
978
|
+
* content, advances the revision the warms and the pose cache are keyed on, ends a flight warm
|
|
979
|
+
* still sweeping the content before it, and forgets a flight paused over it.
|
|
980
|
+
*/
|
|
981
|
+
private routeChanged;
|
|
982
|
+
/**
|
|
983
|
+
* readRoute reads the held route against the content it held when it was last read, as a
|
|
984
|
+
* flight begins: the route is the caller's own object, and one edited in place since is
|
|
985
|
+
* another route. One walk that ends at the first difference, small beside a resolve.
|
|
986
|
+
*/
|
|
987
|
+
private readRoute;
|
|
988
|
+
/**
|
|
989
|
+
* endFlightWarm ends the flight warm in progress at its next stop, and lets go of it so a flight
|
|
990
|
+
* asked for afterwards sweeps for itself and does not wait on a sweep that is ending.
|
|
991
|
+
*/
|
|
992
|
+
private endFlightWarm;
|
|
993
|
+
/**
|
|
994
|
+
* fly awaits a map call that holds the camera, keeping its settling among the
|
|
995
|
+
* {@link landings} until it has settled, a stop of its run in between or not.
|
|
996
|
+
*/
|
|
997
|
+
private fly;
|
|
998
|
+
/**
|
|
999
|
+
* flyableRoute is the route a flight can follow, or null: no route, or a line of fewer than
|
|
1000
|
+
* {@link ROUTE_VERTICES_MIN} vertices, which has no direction to fly in and whose bounds frame
|
|
1001
|
+
* nothing.
|
|
1002
|
+
*/
|
|
1003
|
+
private flyableRoute;
|
|
1004
|
+
/**
|
|
1005
|
+
* prewarmRoute settles the DEM over the route's bounds, once per route.
|
|
1006
|
+
*
|
|
1007
|
+
* Before any resolve, because the clearance pass samples terrain through the live map: without
|
|
1008
|
+
* this it reads null and the flight plans a camera straight through a ridge. Once per route
|
|
1009
|
+
* because it is a visible camera move that can take seconds on a cold cache, and repeating it on
|
|
1010
|
+
* every play would make each transport action drag.
|
|
1011
|
+
*
|
|
1012
|
+
* A flight asked for while the warm is in progress awaits the one in progress. A warm that
|
|
1013
|
+
* rejects is not recorded as done, and rejects for every flight that waited on it.
|
|
1014
|
+
*/
|
|
1015
|
+
private prewarmRoute;
|
|
1016
|
+
/**
|
|
1017
|
+
* warmRoute warms the route the engine holds as a preview or a seek takes it: the DEM over its
|
|
1018
|
+
* bounds ({@link prewarmRoute}), then its flight's viewports ({@link warmFlight}), each once per
|
|
1019
|
+
* route.
|
|
1020
|
+
*
|
|
1021
|
+
* The route is read again after each warm. One set while a warm ran is the route the flight is
|
|
1022
|
+
* of, so it is warmed in turn, the DEM before the sweep, and no pose is resolved over terrain a
|
|
1023
|
+
* warm of another route settled. It settles once the route it last warmed is the one held, or
|
|
1024
|
+
* as soon as `stopped` answers true after a warm.
|
|
1025
|
+
*
|
|
1026
|
+
* @param stopped Whether the flight has let go of the camera: its run was stopped, or a newer
|
|
1027
|
+
* flight overtook it. The flight warm reads it to tell a sweep somebody still waits on from
|
|
1028
|
+
* one nobody does.
|
|
1029
|
+
*/
|
|
1030
|
+
private warmRoute;
|
|
1031
|
+
/**
|
|
1032
|
+
* warmFlight jumps the camera through the flight's own viewports, once per route.
|
|
1033
|
+
*
|
|
1034
|
+
* The sampler-free resolve is used for the warm pass (its centers and bearings match the final
|
|
1035
|
+
* poses, so warming against it loads exactly the tiles the flight crosses), and the DEM epoch is
|
|
1036
|
+
* bumped afterwards, which drops any resolve cached against the colder terrain.
|
|
1037
|
+
*
|
|
1038
|
+
* A flight asked for while the sweep is in progress awaits the one in progress, a record's own
|
|
1039
|
+
* sweep included ({@link sweepForRecord}): two sweeps over one route would fight for the
|
|
1040
|
+
* camera. The sweep takes a signal of its own, which {@link endFlightWarm} aborts. A warm cut
|
|
1041
|
+
* short covered part of the flight, so it is not recorded as done and the next flight warms
|
|
1042
|
+
* again.
|
|
1043
|
+
*
|
|
1044
|
+
* @param stopped Whether the waiting flight has let go of the camera, held among the sweep's
|
|
1045
|
+
* waiters while it waits.
|
|
1046
|
+
*/
|
|
1047
|
+
private warmFlight;
|
|
1048
|
+
/**
|
|
1049
|
+
* sweepForRecord jumps the camera through the sampler-free viewports of the flight a record is
|
|
1050
|
+
* about to capture, under the record's own run.
|
|
1051
|
+
*
|
|
1052
|
+
* It settles the DEM at flight zoom before the full-density resolve samples clearance. The
|
|
1053
|
+
* recorder skips its own warm pass only where the clearance pass moved no frame
|
|
1054
|
+
* ({@link capturesSweptViewports}): a frame it widened or tilted frames ground this sweep never
|
|
1055
|
+
* did.
|
|
1056
|
+
*
|
|
1057
|
+
* A record sweeps whenever its poses are not cached, whatever was warmed before, so the capture
|
|
1058
|
+
* never films a tile that has been let go since. The sweep is the flight's own over that
|
|
1059
|
+
* route, so it is held where {@link warmFlight} finds it: a seek asked for meanwhile waits on
|
|
1060
|
+
* it and starts no second sweep. One that runs to its end counts as the route's flight warm,
|
|
1061
|
+
* with the DEM epoch moved as `warmFlight` moves it. One its run cut short counts for nothing.
|
|
1062
|
+
*
|
|
1063
|
+
* @param track The sampler-free track of the plan and the route the record began with.
|
|
1064
|
+
* @param revision The route's revision as the record began.
|
|
1065
|
+
* @param signal The record's run.
|
|
1066
|
+
*/
|
|
1067
|
+
private sweepForRecord;
|
|
1068
|
+
/**
|
|
1069
|
+
* resolve turns the plan into poses, markers and a duration, memoized.
|
|
1070
|
+
*
|
|
1071
|
+
* Returns null when there is no route a flight can follow, which is the one input a flight
|
|
1072
|
+
* cannot be invented without. The record pass warms the flight-zoom tiles first so the capture
|
|
1073
|
+
* never films an unloaded tile and the clearance sampler reads real peak heights; the preview
|
|
1074
|
+
* pass skips that internal warm because `preview` already ran it once per route.
|
|
1075
|
+
*
|
|
1076
|
+
* It also returns null when `signal` aborted before or during that warm, which its caller reads
|
|
1077
|
+
* off the signal: a warm never starts on a dead signal, because the sweep moves the camera and a
|
|
1078
|
+
* map a host supplies need not honour one; and the full-density resolve after it is the costliest
|
|
1079
|
+
* step a record takes before its first frame, so poses sampled against a half-warmed DEM do not
|
|
1080
|
+
* belong in the cache.
|
|
1081
|
+
*
|
|
1082
|
+
* The plan and the route are read once, as the resolve begins, and the flight it answers names
|
|
1083
|
+
* both. A plan or a route set while the record pass warms takes on the next flight: the one in
|
|
1084
|
+
* progress is resolved, stored and recorded for what it began with.
|
|
1085
|
+
*/
|
|
1086
|
+
private resolve;
|
|
1087
|
+
/**
|
|
1088
|
+
* recordProfile builds the overlay's recording input for a resolved flight, or nothing.
|
|
1089
|
+
*
|
|
1090
|
+
* All three inputs or none: the overlay is composited only when a caller enabled it AND both the
|
|
1091
|
+
* route and the profile source are present. The samples are resolved through the same planner and
|
|
1092
|
+
* the same frame progression as the poses, over the plan and the route the poses were resolved
|
|
1093
|
+
* for, so the readout on frame N describes the place frame N is looking at: index alignment is
|
|
1094
|
+
* the whole correctness condition here.
|
|
1095
|
+
*/
|
|
1096
|
+
private recordProfile;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* The camera that frames a box, computed rather than asked of a renderer.
|
|
1101
|
+
*
|
|
1102
|
+
* MapLibre GL JS frames a box itself (`fitBounds`), facing north under the zoom ceiling it is
|
|
1103
|
+
* handed. A renderer whose own fit takes no ceiling, or keeps the bearing, would frame the same box
|
|
1104
|
+
* elsewhere, so the camera a fit lands on is stated here once, on the Web Mercator world of
|
|
1105
|
+
* 512-pixel tiles MapLibre measures it on, and a renderer is handed the camera rather than the box.
|
|
1106
|
+
*/
|
|
1107
|
+
|
|
1108
|
+
/** What a fit is framed in: the canvas, the inset kept clear, the ceiling and the zoom window. */
|
|
1109
|
+
interface BoundsCameraOptions {
|
|
1110
|
+
/** The canvas the camera frames, as `[width, height]` in CSS pixels. */
|
|
1111
|
+
readonly canvas: readonly [width: number, height: number];
|
|
1112
|
+
/**
|
|
1113
|
+
* The inset kept clear between the box and each edge of the canvas, in CSS pixels: one number
|
|
1114
|
+
* for every edge, or one per edge, as `FitBoundsPadding` writes it. None where it is left out.
|
|
1115
|
+
*
|
|
1116
|
+
* Stated by its shape rather than by that name: this entry promises no renderer, and naming
|
|
1117
|
+
* the type made the published declarations borrow it from a renderer-bearing entry.
|
|
1118
|
+
*/
|
|
1119
|
+
readonly padding?: number | {
|
|
1120
|
+
readonly bottom: number;
|
|
1121
|
+
readonly left: number;
|
|
1122
|
+
readonly right: number;
|
|
1123
|
+
readonly top: number;
|
|
1124
|
+
} | undefined;
|
|
1125
|
+
/** The highest zoom the fit lands at. The zoom window's ceiling where it is left out. */
|
|
1126
|
+
readonly maxZoom?: number | undefined;
|
|
1127
|
+
/** The zoom window the camera is held to, its lowest zoom and its highest. */
|
|
1128
|
+
readonly window: {
|
|
1129
|
+
readonly max: number;
|
|
1130
|
+
readonly min: number;
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
/** The camera a fit lands on. It faces north, and keeps the pitch the camera has. */
|
|
1134
|
+
interface BoundsCamera {
|
|
1135
|
+
/** Always 0: a fit faces north. */
|
|
1136
|
+
readonly bearing: number;
|
|
1137
|
+
/** The centre, `[longitude, latitude]`. */
|
|
1138
|
+
readonly center: LngLat;
|
|
1139
|
+
/** The zoom. */
|
|
1140
|
+
readonly zoom: number;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* cameraForBounds answers the camera that fits a box in a canvas: facing north, at the highest
|
|
1144
|
+
* zoom at which the box's Web Mercator projection on 512-pixel tiles fits the canvas less its
|
|
1145
|
+
* padding, held under the fit's ceiling and within the zoom window, and centred on the box's
|
|
1146
|
+
* projected middle moved by half the difference of opposite paddings at that zoom.
|
|
1147
|
+
*
|
|
1148
|
+
* The box is read in canonical form, as `normalizeBoundingBox` of `@mountaya/elements/geo` writes
|
|
1149
|
+
* one, the form a map's `fitBounds` reads any box in before it frames it: each axis ordered, one
|
|
1150
|
+
* across the antimeridian written with its east edge past 180, and its latitudes within the Web
|
|
1151
|
+
* Mercator limit. A box of one point fits at every zoom, so it is framed at the ceiling. The
|
|
1152
|
+
* centre of a box across the antimeridian may lie past 180, which a renderer reads as the same
|
|
1153
|
+
* meridian.
|
|
1154
|
+
*
|
|
1155
|
+
* @param bounds The box, `[west, south, east, north]` in canonical form.
|
|
1156
|
+
* @param options The canvas, the padding, the ceiling and the zoom window.
|
|
1157
|
+
* @returns The camera, or null where the padding leaves the canvas no room to frame anything in.
|
|
1158
|
+
*
|
|
1159
|
+
* @example
|
|
1160
|
+
* ```ts
|
|
1161
|
+
* import { cameraForBounds } from "@mountaya/elements/camera";
|
|
1162
|
+
*
|
|
1163
|
+
* // A valley on an 800 by 600 canvas, 48 pixels clear on every side, no closer than zoom 15.
|
|
1164
|
+
* cameraForBounds([6.8, 45.8, 6.95, 45.9], {
|
|
1165
|
+
* canvas: [800, 600],
|
|
1166
|
+
* maxZoom: 15,
|
|
1167
|
+
* padding: 48,
|
|
1168
|
+
* window: { max: 22, min: -2 },
|
|
1169
|
+
* }); // { bearing: 0, center: [6.875, 45.85…], zoom: 11.27… }
|
|
1170
|
+
* ```
|
|
1171
|
+
*/
|
|
1172
|
+
declare const cameraForBounds: (bounds: BoundingBox, options: BoundsCameraOptions) => BoundsCamera | null;
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* GeneratorParams are the inputs a preset generator reads beyond the itinerary: the
|
|
1176
|
+
* whole flight's `targetDurationMs`. Held as an interface so a later input (a
|
|
1177
|
+
* units or framing hint) is an additive field rather than a new positional
|
|
1178
|
+
* argument.
|
|
1179
|
+
*/
|
|
1180
|
+
interface GeneratorParams {
|
|
1181
|
+
targetDurationMs: number;
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* CameraPlanGenerator builds a deterministic {@link CameraPlan} from an itinerary and the
|
|
1185
|
+
* generator params. The same itinerary and params always yield the same plan, so a preset
|
|
1186
|
+
* is reproducible and testable without a map.
|
|
1187
|
+
*
|
|
1188
|
+
* An elevation that is no finite number is not refused: the route is framed as one without
|
|
1189
|
+
* elevations there.
|
|
1190
|
+
*
|
|
1191
|
+
* @throws {MountayaElementsError} When the route holds a vertex that names no place, one
|
|
1192
|
+
* whose longitude or latitude is no finite number. The error names the generator and the
|
|
1193
|
+
* vertex as `itinerary.line[index]`: such a vertex would turn the route's length, and with
|
|
1194
|
+
* it every pose of the flight, into `NaN`.
|
|
1195
|
+
*/
|
|
1196
|
+
type CameraPlanGenerator = (itinerary: RouteGeometry, params: GeneratorParams) => CameraPlan;
|
|
1197
|
+
/**
|
|
1198
|
+
* modeEyeHeightMeters is the camera's eye height above the itinerary-surface
|
|
1199
|
+
* elevation per mode, in meters: the altitude the zoom is derived from. Real
|
|
1200
|
+
* altitude, not just a zoom bias, is what separates the aerial modes' parallax from
|
|
1201
|
+
* the grounded ones: `chase` rides the lowest (a genuinely low behind-the-athlete
|
|
1202
|
+
* eye), `cinematic` grounded, `smart` and `overview` mid, `helicopter` high for
|
|
1203
|
+
* the broadcast lateral, `drone` the highest aerial. A consumer framing shots of its
|
|
1204
|
+
* own reads a preset's altitude here, the table the generators read.
|
|
1205
|
+
*/
|
|
1206
|
+
declare const modeEyeHeightMeters: Readonly<Record<Exclude<CameraMode, "director">, number>>;
|
|
1207
|
+
/**
|
|
1208
|
+
* generateSmartPlan lays an adaptive `smart` flight: its interior pitch is derived
|
|
1209
|
+
* per keyframe from the local slope (flatter ground tilts the camera up to read
|
|
1210
|
+
* the terrain ahead, a steep climb or descent lowers the pitch to keep the path in
|
|
1211
|
+
* frame), framed at a balanced baseline. The per-keyframe slopes are first
|
|
1212
|
+
* low-passed with a short 3-tap kernel and the resulting pitch is rate-limited
|
|
1213
|
+
* between adjacent interior keyframes (SMART_MAX_PITCH_STEP), so rolling terrain
|
|
1214
|
+
* whose grade flips leg to leg does not pump the pitch up and down (the horizon
|
|
1215
|
+
* breathing); a sustained grade is preserved because the smoothing and the rate
|
|
1216
|
+
* limit are both no-ops on a monotone slope. The same smoothed slopes drive two
|
|
1217
|
+
* more channels: interior legs SLOW toward the steeps (speedScale down to 0.7 at
|
|
1218
|
+
* full grade, so the steepest sections get up to ~40 % more screen time, duration
|
|
1219
|
+
* invariant through the timeline's normalization) and the framing WIDENS by up to
|
|
1220
|
+
* SMART_STEEP_WIDEN_ZOOM so a wall is read with its context. The zoom comes from
|
|
1221
|
+
* the itinerary-surface elevation plus the mode's eye height, so the camera holds a
|
|
1222
|
+
* consistent height above the path the viewer is watching. It opens and closes on
|
|
1223
|
+
* a gentle establishing beat (the itinerary's fit framing at a slightly raised pitch,
|
|
1224
|
+
* held for a short beat), so the flight settles in rather than cutting into the
|
|
1225
|
+
* middle of the travel. Centres are anchored on the itinerary at each keyframe
|
|
1226
|
+
* fraction.
|
|
1227
|
+
*
|
|
1228
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1229
|
+
* no finite number, as {@link CameraPlanGenerator} states.
|
|
1230
|
+
*/
|
|
1231
|
+
declare const generateSmartPlan: CameraPlanGenerator;
|
|
1232
|
+
/**
|
|
1233
|
+
* generateCinematicPlan lays a narrative, expressive `cinematic` flight: a tight,
|
|
1234
|
+
* grounded fixed pitch that fills the frame with the horizon, a positive zoom bias
|
|
1235
|
+
* that pulls in close to the trail, and (through the mode's short bearing
|
|
1236
|
+
* lookahead) a snappy heading that banks into corners. It opens on a dramatic
|
|
1237
|
+
* establishing reveal (the itinerary's fit framing at a raised, more level pitch,
|
|
1238
|
+
* held the longest of the presets), then the travel pulls in tight; it settles
|
|
1239
|
+
* back on the fit framing at a lower outro pitch. It also makes one directorial decision per
|
|
1240
|
+
* flight: the steepest interior keyframe (≥ CINEMATIC_HIGHLIGHT_MIN_SLOPE_DEG,
|
|
1241
|
+
* the first index winning a tie, so the choice is deterministic) becomes a mid-itinerary
|
|
1242
|
+
* highlight beat. The approach eases (speedScale 0.85), the camera re-frames onto the
|
|
1243
|
+
* terrain (pitch trimmed 6°), and the shot dwells 900 ms, which the mid-hold breathe
|
|
1244
|
+
* animates. A flat itinerary has no beat and travels straight through. Zoom tracks the
|
|
1245
|
+
* itinerary-surface elevation at the mode's eye height before the bias. Centres lie
|
|
1246
|
+
* on the itinerary.
|
|
1247
|
+
*
|
|
1248
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1249
|
+
* no finite number, as {@link CameraPlanGenerator} states.
|
|
1250
|
+
*/
|
|
1251
|
+
declare const generateCinematicPlan: CameraPlanGenerator;
|
|
1252
|
+
/**
|
|
1253
|
+
* generateDronePlan lays an aerial bird's-eye `drone` flight: the steepest fixed
|
|
1254
|
+
* pitch, a genuinely high eye (modeEyeHeightMeters.drone, real altitude with real
|
|
1255
|
+
* parallax rather than a zoom trick) with a mild wider bias on top, paired with the mode's
|
|
1256
|
+
* long, steady bearing lookahead for a floaty aerial glide. It opens on the itinerary's fit
|
|
1257
|
+
* framing at a pitch lifted to the tilt ceiling, held for a long reveal, and settles back
|
|
1258
|
+
* on it high. Zoom still tracks the itinerary-surface elevation so the camera stays a
|
|
1259
|
+
* sensible height above varied terrain. Centres lie on the itinerary.
|
|
1260
|
+
*
|
|
1261
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1262
|
+
* no finite number, as {@link CameraPlanGenerator} states.
|
|
1263
|
+
*/
|
|
1264
|
+
declare const generateDronePlan: CameraPlanGenerator;
|
|
1265
|
+
/**
|
|
1266
|
+
* generateHelicopterPlan lays the broadcast lateral `helicopter` flight: every
|
|
1267
|
+
* keyframe's bearing is pinned (`value`) to the itinerary tangent + 90°, so the eye
|
|
1268
|
+
* hangs off the itinerary's side looking ACROSS at the athlete and the trail crosses
|
|
1269
|
+
* the frame left-to-right: the TdF side-tracking grammar, expressed entirely
|
|
1270
|
+
* inside the centre-on-cursor pose model. The tangent is read over a long window
|
|
1271
|
+
* so the pan is steady through dense vertices, and the side is fixed (always +90°)
|
|
1272
|
+
* so the bearing unwrap never sees a 180° side-swap whip. It opens on a more
|
|
1273
|
+
* overhead establishing pass at the itinerary's fit framing and holds broadcast-steady speed
|
|
1274
|
+
* throughout; the eye rides high (modeEyeHeightMeters.helicopter). Because no
|
|
1275
|
+
* keyframe follows, the athlete stays dead-centre (correct for a lateral track),
|
|
1276
|
+
* and the preset hold beats still get their reveal/settle shaping.
|
|
1277
|
+
*
|
|
1278
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1279
|
+
* no finite number, as {@link CameraPlanGenerator} states.
|
|
1280
|
+
*/
|
|
1281
|
+
declare const generateHelicopterPlan: CameraPlanGenerator;
|
|
1282
|
+
/**
|
|
1283
|
+
* generateChasePlan lays the low behind-the-athlete `chase` flight: the highest
|
|
1284
|
+
* travelling pitch (nearly horizon-filled), a strong positive zoom bias over the
|
|
1285
|
+
* lowest eye of the presets (modeEyeHeightMeters.chase: the camera genuinely
|
|
1286
|
+
* rides just above and behind the athlete), and the tightest smoothing and
|
|
1287
|
+
* shortest lookahead so it banks hard into corners with action-cam energy. Its
|
|
1288
|
+
* pitch is slope-trimmed like smart's but gentler (half the slope, capped at
|
|
1289
|
+
* 12°), through the same de-pump smoothing and rate limit. Descents ACCELERATE:
|
|
1290
|
+
* a leg dropping at CHASE_DESCENT_FULL_SLOPE_DEG or steeper runs up to 1.5× while
|
|
1291
|
+
* climbs hold 1, with the flight duration invariant through the timeline's
|
|
1292
|
+
* normalization. It opens slightly elevated on the itinerary's fit framing, then dives
|
|
1293
|
+
* into the chase.
|
|
1294
|
+
*
|
|
1295
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1296
|
+
* no finite number, as {@link CameraPlanGenerator} states.
|
|
1297
|
+
*/
|
|
1298
|
+
declare const generateChasePlan: CameraPlanGenerator;
|
|
1299
|
+
/**
|
|
1300
|
+
* generateOverviewPlan lays the cartographic `overview` reveal. The endpoints are
|
|
1301
|
+
* explicit near-nadir whole-itinerary frames, each held long enough for the map to
|
|
1302
|
+
* read (the longest intro of any mode):
|
|
1303
|
+
*
|
|
1304
|
+
* - pitch OVERVIEW_ENDPOINT_PITCH;
|
|
1305
|
+
* - bearing along the itinerary's overall heading (the intro as a `locked` first shot,
|
|
1306
|
+
* which holds it; the outro as a `value` shot stating the same heading, since a
|
|
1307
|
+
* locked shot there would hold the heading of the travelling shot before it);
|
|
1308
|
+
* - zoom framing OVERVIEW_FRAME_FACTOR × the farthest-vertex radius around the frame's
|
|
1309
|
+
* own centre, the itinerary START for the intro and its END for the outro. That span
|
|
1310
|
+
* keeps every vertex in a frame centred there, so a switchbacking climb or a loop
|
|
1311
|
+
* opens at a readable map scale rather than the unrolled length's.
|
|
1312
|
+
*
|
|
1313
|
+
* The interior keyframes are a standard mid-tilt follow at the mode's eye height, so the
|
|
1314
|
+
* flight DIVES from the opening map into the trail over the first leg (the
|
|
1315
|
+
* Catmull-Rom pitch/zoom channels and the locked→follow bearing smoothstep
|
|
1316
|
+
* rotate it in), travels the itinerary, and pulls back out to the closing map. It is
|
|
1317
|
+
* the "here is the whole itinerary" bookend every itinerary-share video wants.
|
|
1318
|
+
*
|
|
1319
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1320
|
+
* no finite number, as {@link CameraPlanGenerator} states.
|
|
1321
|
+
*/
|
|
1322
|
+
declare const generateOverviewPlan: CameraPlanGenerator;
|
|
1323
|
+
/**
|
|
1324
|
+
* neutralDirectorPlan seeds an empty `director` plan: no shots, just the mode and
|
|
1325
|
+
* the target duration. An explicit shot sequence (a control or an agent's camera
|
|
1326
|
+
* edits) fills it; until then the resolver falls back to a full-itinerary follow shot
|
|
1327
|
+
* so a preview is never blank.
|
|
1328
|
+
*/
|
|
1329
|
+
declare const neutralDirectorPlan: (params: GeneratorParams) => CameraPlan;
|
|
1330
|
+
/**
|
|
1331
|
+
* cameraPlanGenerators dispatches a non-director mode to its deterministic
|
|
1332
|
+
* generator. `director` is excluded because it has no generator (its plan is
|
|
1333
|
+
* seeded empty by {@link neutralDirectorPlan} and filled by explicit shots), so a
|
|
1334
|
+
* caller picking a generator handles only the modes that produce one.
|
|
1335
|
+
*/
|
|
1336
|
+
declare const cameraPlanGenerators: Readonly<Record<Exclude<CameraMode, "director">, CameraPlanGenerator>>;
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* The encoder vocabulary, read from `./vocabulary` rather than restated: the vocabulary is a
|
|
1340
|
+
* leaf both this module and the plan import DOWNWARD, so there is nothing to keep in step by
|
|
1341
|
+
* hand.
|
|
1342
|
+
*/
|
|
1343
|
+
type VideoResolution = CameraResolution;
|
|
1344
|
+
type VideoFps = CameraFps;
|
|
1345
|
+
type VideoFormat = CameraOutputFormat;
|
|
1346
|
+
/**
|
|
1347
|
+
* VideoPresetTemplate is the encoder-output seed a ready-made preset stamps onto
|
|
1348
|
+
* a camera plan's output: the container `format`, the vertical `resolution`, the
|
|
1349
|
+
* frame `aspect`, the `fps`, and the `bitrateMbps` the preset hard-codes (a preset
|
|
1350
|
+
* is a fixed recipe, so its bitrate is fixed rather than derived from a quality
|
|
1351
|
+
* tier). The fields are exactly the `CameraOutput` fields a preset sets, so applying a
|
|
1352
|
+
* template is a single spread over the plan's output.
|
|
1353
|
+
*/
|
|
1354
|
+
interface VideoPresetTemplate {
|
|
1355
|
+
readonly aspect: CameraAspect;
|
|
1356
|
+
readonly bitrateMbps: number;
|
|
1357
|
+
readonly format: VideoFormat;
|
|
1358
|
+
readonly fps: VideoFps;
|
|
1359
|
+
readonly resolution: VideoResolution;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* videoPresets holds the ready-made templates for the platforms a video is posted to, keyed by
|
|
1363
|
+
* every member of {@link VideoPreset} but `custom`, so the keys follow the vocabulary. Every
|
|
1364
|
+
* template is the same broadcast-ready recipe (1080p H.264 at 30 fps, 12 Mbps: the
|
|
1365
|
+
* 1080p/30/high row of bitrateTableMbps), differing only in frame shape: `vertical` 9:16
|
|
1366
|
+
* (Stories, Reels, Shorts, TikTok), `widescreen` 16:9 (YouTube and the web), and `square` 1:1
|
|
1367
|
+
* (feed posts). `custom` carries no template (it reveals the full matrix instead), so only the
|
|
1368
|
+
* platform presets appear here. Applying one spreads its template over the plan's output and
|
|
1369
|
+
* names the preset.
|
|
1370
|
+
*/
|
|
1371
|
+
declare const videoPresets: Readonly<Record<Exclude<VideoPreset, "custom">, VideoPresetTemplate>>;
|
|
1372
|
+
/**
|
|
1373
|
+
* BITRATE_MBPS_MIN and BITRATE_MBPS_MAX bound an encoder bitrate override.
|
|
1374
|
+
*
|
|
1375
|
+
* Below ~1 Mbps the output looks muddy; above ~45 Mbps the file grows for negligible visual
|
|
1376
|
+
* gain. The ceiling is bitrateTableMbps's own top cell (2160p/60/high) rather than a
|
|
1377
|
+
* separate judgement, so a value the quality matrix offers is always one the bound accepts:
|
|
1378
|
+
* two numbers that agree by maintenance is how a UI comes to quote a bitrate a validator
|
|
1379
|
+
* then rejects. A validator of a plan's output reads them, and so does any encoder clamping a
|
|
1380
|
+
* caller-supplied override before handing it to the codec.
|
|
1381
|
+
*/
|
|
1382
|
+
declare const BITRATE_MBPS_MIN = 1;
|
|
1383
|
+
/** The highest encoder bitrate an override may state, in Mbps. */
|
|
1384
|
+
declare const BITRATE_MBPS_MAX: number;
|
|
1385
|
+
/**
|
|
1386
|
+
* bitrateForOutput returns the recommended encoder bitrate in Mbps for a
|
|
1387
|
+
* resolution + frame rate + quality tier, read straight from bitrateTableMbps.
|
|
1388
|
+
* A custom output shows this derived value (rather than letting the user type a
|
|
1389
|
+
* raw Mbps) so the bitrate always matches the chosen fidelity; 24 fps shares the
|
|
1390
|
+
* 30 fps row (the encoder treats the two as one rate tier). The returned value
|
|
1391
|
+
* stays within {@link BITRATE_MBPS_MIN} and {@link BITRATE_MBPS_MAX}, with 2160p/60/high at
|
|
1392
|
+
* the 45 Mbps ceiling.
|
|
1393
|
+
*
|
|
1394
|
+
* @param resolution The output's vertical resolution.
|
|
1395
|
+
* @param fps The output's frame rate; 24 fps takes the 30 fps figures.
|
|
1396
|
+
* @param quality The quality tier: the column of the row read.
|
|
1397
|
+
* @returns The bitrate, in Mbps.
|
|
1398
|
+
*/
|
|
1399
|
+
declare const bitrateForOutput: (resolution: VideoResolution, fps: VideoFps, quality: Quality) => number;
|
|
1400
|
+
/**
|
|
1401
|
+
* estimatedVideoSizeMb estimates the encoded file size in decimal megabytes for a
|
|
1402
|
+
* constant-bitrate recording: the megabits the bitrate carries over the flight's length, stated
|
|
1403
|
+
* in megabytes through {@link convertDataSize}, eight bits to a byte.
|
|
1404
|
+
*
|
|
1405
|
+
* It is the figure the review step shows beside the chosen encoder settings, a rough "this clip
|
|
1406
|
+
* is about N MB" rather than a byte-exact prediction: the variable-bitrate encoder lands close to
|
|
1407
|
+
* its target, not on it. Pure, so the review surface recomputes it from the plan alone.
|
|
1408
|
+
*
|
|
1409
|
+
* @param bitrateMbps The encoder's target bitrate, in Mbps.
|
|
1410
|
+
* @param durationMs The recording's length, in milliseconds.
|
|
1411
|
+
* @returns The size, in decimal megabytes.
|
|
1412
|
+
*/
|
|
1413
|
+
declare const estimatedVideoSizeMb: (bitrateMbps: number, durationMs: number) => number;
|
|
1414
|
+
/**
|
|
1415
|
+
* aspectRatio returns the numeric width/height ratio for a frame aspect (16:9
|
|
1416
|
+
* landscape, 9:16 portrait, or 1:1 square), so a preview surface can size its box to
|
|
1417
|
+
* whatever the plan's output targets (a portrait preset frames the map 9:16, not the
|
|
1418
|
+
* landscape default). A pure mapping with no encoder side, kept beside the presets that
|
|
1419
|
+
* set the aspect.
|
|
1420
|
+
*/
|
|
1421
|
+
declare const aspectRatio: (aspect: CameraAspect) => number;
|
|
1422
|
+
/**
|
|
1423
|
+
* suggestVideoLengthMs proposes a flight duration (ms) for an itinerary from its length:
|
|
1424
|
+
* roughly one second per kilometer plus a 10 s establishing cushion, rounded to
|
|
1425
|
+
* whole seconds, then clamped to the slider window [20 s, 120 s]. It is the
|
|
1426
|
+
* "Suggested" default the length control seeds: a 30 km itinerary lands near 40 s, a
|
|
1427
|
+
* 200 km itinerary saturates at the 120 s ceiling, and any sub-10 km itinerary floors at
|
|
1428
|
+
* 20 s. Pure, so the control and any preview can recompute it from the itinerary alone.
|
|
1429
|
+
*
|
|
1430
|
+
* @param routeLengthMeters The itinerary's length, in meters.
|
|
1431
|
+
*/
|
|
1432
|
+
declare const suggestVideoLengthMs: (routeLengthMeters: number) => number;
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* sameRouteContent answers whether two routes hold the same content: every vertex, every
|
|
1436
|
+
* elevation and every jump, in order, by the rule {@link holdsRouteContent} states.
|
|
1437
|
+
*
|
|
1438
|
+
* It is the rule {@link VideoFlightEngine.setRoute} reads to tell a route handed over again from
|
|
1439
|
+
* another one, published so a host that keeps its own copy of the route decides the same way.
|
|
1440
|
+
*
|
|
1441
|
+
* @example
|
|
1442
|
+
* ```ts
|
|
1443
|
+
* import { sameRouteContent, type RouteGeometry } from "@mountaya/elements/camera";
|
|
1444
|
+
*
|
|
1445
|
+
* declare const held: RouteGeometry;
|
|
1446
|
+
* declare const handed: RouteGeometry;
|
|
1447
|
+
*
|
|
1448
|
+
* if (!sameRouteContent(held, handed)) {
|
|
1449
|
+
* console.log("another route: its flights resolve again");
|
|
1450
|
+
* }
|
|
1451
|
+
* ```
|
|
1452
|
+
*/
|
|
1453
|
+
declare const sameRouteContent: (a: RouteGeometry, b: RouteGeometry) => boolean;
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* planDurationMs is the wall-clock length a plan plays for in milliseconds: its
|
|
1457
|
+
* base `targetDurationMs` plus the sum of every shot's `holdMs` (each hold pauses
|
|
1458
|
+
* the camera at its keyframe for that long on top of the travelling time). This
|
|
1459
|
+
* is the duration the track resolver sizes its per-frame grid from, so the frame
|
|
1460
|
+
* count reflects the holds the user added.
|
|
1461
|
+
*/
|
|
1462
|
+
declare const planDurationMs: (plan: CameraPlan) => number;
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* capturesSweptViewports answers whether a record captures exactly the viewports its sweep jumped
|
|
1466
|
+
* through, frame by frame, so the recorder needs no warm pass of its own.
|
|
1467
|
+
*
|
|
1468
|
+
* A record sweeps the sampler-free track, whose centers and bearings are the captured ones. The
|
|
1469
|
+
* clearance pass then lowers a frame's pitch over terrain and, as its fallback, its zoom, and a
|
|
1470
|
+
* frame it moved shows ground the sweep never framed, at a tile zoom nobody asked for. So any
|
|
1471
|
+
* difference in any field of any frame, or in the count of frames, answers false.
|
|
1472
|
+
*
|
|
1473
|
+
* A recorder told so (`warmed` on `MapClient.recordPoses`) skips its own warm pass, which a
|
|
1474
|
+
* caller that swept the map itself would otherwise pay twice.
|
|
1475
|
+
*
|
|
1476
|
+
* @param swept - The poses the sweep jumped through.
|
|
1477
|
+
* @param captured - The poses the recorder captures.
|
|
1478
|
+
* @returns True when both hold the same viewport at every frame.
|
|
1479
|
+
*/
|
|
1480
|
+
declare const capturesSweptViewports: (swept: readonly ShotCamera[], captured: readonly ShotCamera[]) => boolean;
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* resolveFrameProgressions is the per-frame itinerary-progress fraction sequence both
|
|
1484
|
+
* resolveCameraTrack and resolveRouteMarkers walk: for each of the
|
|
1485
|
+
* `frameCountFor(plan)` frames it maps the frame's wall-clock time
|
|
1486
|
+
* (`(frame / lastFrame) * planDurationMs`, honouring every shot's hold and speedScale
|
|
1487
|
+
* through buildTimeline and progressAtTime) to the itinerary fraction at that instant.
|
|
1488
|
+
* Held as one helper so every per-frame array a plan resolves (the pose track, the
|
|
1489
|
+
* moving marker, the profile samples) is the same length and aligns
|
|
1490
|
+
* frame-for-frame: `fractions[i]` is the progress the camera, the marker, and the
|
|
1491
|
+
* overlay all read at frame i. An empty-shots plan resolves through the same
|
|
1492
|
+
* full-itinerary follow shots, so the sequence sweeps 0→1 even on a freshly-seeded
|
|
1493
|
+
* director plan.
|
|
1494
|
+
*/
|
|
1495
|
+
declare const resolveFrameProgressions: (plan: CameraPlan) => number[];
|
|
1496
|
+
/**
|
|
1497
|
+
* resolveCameraTrack turns a camera plan and its itinerary into the render-free
|
|
1498
|
+
* per-frame pose array the map flies and records. The frame count is
|
|
1499
|
+
* `ceil(planDurationMs / 1000 * fps)` (the holds extend the count along with the
|
|
1500
|
+
* wall-clock), so an encoder stamping one frame per 1/fps reproduces the plan's
|
|
1501
|
+
* full duration: the exported file lasts exactly as long as the preview
|
|
1502
|
+
* rehearsal, holds dwelt at their real length. Each frame's wall-clock time
|
|
1503
|
+
* is mapped to an itinerary-progress fraction by a timeline that honours every shot's
|
|
1504
|
+
* `holdMs` (progress freezes at the shot while the camera dwells) and `speedScale`
|
|
1505
|
+
* (a leg's share of the travelling time scales inversely, so a >1 scale spends
|
|
1506
|
+
* that leg faster); the pose at that progress comes from the smoothed spline. An
|
|
1507
|
+
* empty-shots plan (a freshly-seeded `director` plan) resolves to a single
|
|
1508
|
+
* full-itinerary follow flight so a preview is never blank.
|
|
1509
|
+
*
|
|
1510
|
+
* Smoothing is distance-domain: each mode's σ is an itinerary DISTANCE (meters),
|
|
1511
|
+
* converted to frame samples per itinerary via sigmaFramesForMeters, so the window
|
|
1512
|
+
* covers the same fraction of the trail no matter the duration: a 10 s and a 60 s
|
|
1513
|
+
* flight over the same itinerary smooth the same itinerary distance and are equally
|
|
1514
|
+
* accurate, rather than a fixed-seconds window over-smoothing the short one.
|
|
1515
|
+
*
|
|
1516
|
+
* When a `sampler` is supplied (the tool layer injects the map's DEM readout), a
|
|
1517
|
+
* clearance pass runs over the smoothed framing channels: it derives the camera eye
|
|
1518
|
+
* per frame and, where the eye would sink into the terrain or the sightline to the
|
|
1519
|
+
* trail would clip a ridge, repositions the camera to clear it, tilting toward
|
|
1520
|
+
* top-down (lowering pitch, which slides the eye over the target) to clear an
|
|
1521
|
+
* occluder, and widening the view (lowering zoom) where a tilt alone cannot. It
|
|
1522
|
+
* returns a per-frame zoom AND pitch adjustment, each only ever lowering its
|
|
1523
|
+
* channel; the final framing is the min of the mode-smoothed value and the
|
|
1524
|
+
* clearance value on both channels. Both clearance channels are smoothed with the
|
|
1525
|
+
* same anticipation window, so the reframing leads the peak and never jolts the
|
|
1526
|
+
* motion. Without a sampler (a render-free test, no map, the embed) the output is
|
|
1527
|
+
* identical to the un-cleared track on every channel.
|
|
1528
|
+
*
|
|
1529
|
+
* `clearanceStride` decimates the clearance pass's per-frame frustum solve (see
|
|
1530
|
+
* ClearanceOptions.sampleStride): a preview passes a coarse stride so a long flight
|
|
1531
|
+
* resolves without stalling, while a record passes 1 (or omits it) to solve every
|
|
1532
|
+
* frame so the exported artifact is byte-unchanged. Omitted, the clearance runs at
|
|
1533
|
+
* full density.
|
|
1534
|
+
*
|
|
1535
|
+
* A route that crosses the antimeridian is flown along it. The route is read with its
|
|
1536
|
+
* longitudes continuous ({@link continuousLine}), so each centre runs on from the one before
|
|
1537
|
+
* it and is answered past 180, or below -180, on the far side of the line: a renderer reads a
|
|
1538
|
+
* longitude a turn away as the same place, and a consumer that needs the wire's range wraps it.
|
|
1539
|
+
*
|
|
1540
|
+
* **The sampler-free call is memoized**, and only that one. Without a sampler the result is a
|
|
1541
|
+
* pure function of the plan and the itinerary (the clearance pass is the only thing either
|
|
1542
|
+
* remaining parameter reaches, and it does not run), so the same pair can answer from a cache.
|
|
1543
|
+
* With a sampler it cannot: the DEM the sampler reads is whatever tiles happen to be loaded,
|
|
1544
|
+
* which changes under the same arguments and is the whole reason the record path resolves a
|
|
1545
|
+
* second time after warming.
|
|
1546
|
+
*
|
|
1547
|
+
* The memoized call is the one made for TILE WARMING, and it is made twice on the record path
|
|
1548
|
+
* for one flight: once to warm and once again before the prewarm. Each resolves a spline, a
|
|
1549
|
+
* timeline and a Gaussian over every frame of the flight (thousands of frames for a minute at
|
|
1550
|
+
* 60 fps) to produce poses nobody looks at, only flies over to load tiles.
|
|
1551
|
+
*
|
|
1552
|
+
* **The memoized array is SHARED with the next caller, so it is typed read-only.** Copying it
|
|
1553
|
+
* per call would allocate a pose object per frame and give back most of what the memo saves. A
|
|
1554
|
+
* caller flies a resolved pose, warms against it, or reads a frame out of it, and
|
|
1555
|
+
* `resolveCameraTrack` is where a pose is made, not where one is edited.
|
|
1556
|
+
*
|
|
1557
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1558
|
+
* no finite number, naming it as `itinerary.line[index]`: such a vertex would turn every pose
|
|
1559
|
+
* of the flight into `NaN`.
|
|
1560
|
+
*/
|
|
1561
|
+
declare const resolveCameraTrack: (plan: CameraPlan, itinerary: RouteGeometry, sampler?: TerrainSampler, clearanceStride?: number) => readonly ShotCamera[];
|
|
1562
|
+
/**
|
|
1563
|
+
* resolveRouteMarkers is the public per-frame moving-marker path, a thin wrapper
|
|
1564
|
+
* over resolveMarkerSeries. Every returned point lies exactly on the itinerary polyline
|
|
1565
|
+
* (the marker is sampled, not smoothed), so the map's "you are here" dot sits on the
|
|
1566
|
+
* trail on every frame including bends and hairpins. It is a function of its own so
|
|
1567
|
+
* resolveCameraTrack answers ShotCamera[] alone, and the map reads the dot positions
|
|
1568
|
+
* through one stable seam.
|
|
1569
|
+
*
|
|
1570
|
+
* The markers are written in the same run of longitudes as the poses: continuous along the
|
|
1571
|
+
* route, so past 180 or below -180 on the far side of an antimeridian crossing.
|
|
1572
|
+
*
|
|
1573
|
+
* @throws {MountayaElementsError} When the route holds a vertex whose longitude or latitude is
|
|
1574
|
+
* no finite number, naming it as `itinerary.line[index]`, as {@link resolveCameraTrack} does.
|
|
1575
|
+
*/
|
|
1576
|
+
declare const resolveRouteMarkers: (plan: CameraPlan, itinerary: RouteGeometry) => LngLat[];
|
|
1577
|
+
/**
|
|
1578
|
+
* clearanceStrideFor is the plan-level convenience the preview resolve uses to pick
|
|
1579
|
+
* the clearance sample stride, mirroring resolveFrameProgressions in taking a whole
|
|
1580
|
+
* (plan, itinerary) and deriving the per-frame quantity from it. It forwards the plan's
|
|
1581
|
+
* frame count, the itinerary length, and the mode (which sizes the anticipation
|
|
1582
|
+
* window) to clearanceSampleStride, so a preview resolves the clearance at the coarse
|
|
1583
|
+
* stride that keeps the solve a sub-100 ms task while a record passes 1 for full
|
|
1584
|
+
* density and a byte-unchanged artifact.
|
|
1585
|
+
*/
|
|
1586
|
+
declare const clearanceStrideFor: (plan: CameraPlan, itinerary: RouteGeometry) => number;
|
|
1587
|
+
/**
|
|
1588
|
+
* posePlanSignature is a compact, stable string of ONLY the plan fields that change
|
|
1589
|
+
* the resolved poses: the `mode`, the whole-flight `targetDurationMs`, and the output
|
|
1590
|
+
* `fps` (all three size or shape the per-frame grid), plus each shot's pose-affecting
|
|
1591
|
+
* fields (`at`, `bearingDeg`, `bearingMode`, `holdMs`, `pitchDeg`, `speedScale`,
|
|
1592
|
+
* `zoom`). It deliberately EXCLUDES the encoder-only output fields
|
|
1593
|
+
* (`resolution`/`aspect`/`bitrateMbps`/`quality`/`format`/`preset`) and the shot `id`,
|
|
1594
|
+
* so a format-only edit produces the SAME signature: the memo key the tool layer
|
|
1595
|
+
* caches resolved poses under, which is what lets a preset or resolution change reuse
|
|
1596
|
+
* the cached flight instead of re-resolving it. Shot order is the plan's own
|
|
1597
|
+
* sorted-by-`at` order, so two plans with identical framing hash identically.
|
|
1598
|
+
*/
|
|
1599
|
+
declare const posePlanSignature: (plan: CameraPlan) => string;
|
|
1600
|
+
/**
|
|
1601
|
+
* representativeStillFraction is the flight-fraction (0..1 over the frame grid) a
|
|
1602
|
+
* parked preview should sit at so it shows the mode's TRAVELLING framing immediately
|
|
1603
|
+
* rather than the wide establishing reveal of the intro hold. It parks just past the
|
|
1604
|
+
* intro establishing beat (the first shot's hold, as its share of the wall-clock)
|
|
1605
|
+
* plus a fraction of the flight remaining after it, so the framing is engaged in
|
|
1606
|
+
* travel whatever the intro dwell. A director or empty-shots plan has no preset style
|
|
1607
|
+
* to show and is still being authored, so it parks at the start (0). previewSeek maps
|
|
1608
|
+
* this fraction to the pose at `round(fraction * lastFrame)`, so on a hold-warped grid
|
|
1609
|
+
* it still lands past the frozen intro frames.
|
|
1610
|
+
*/
|
|
1611
|
+
declare const representativeStillFraction: (plan: CameraPlan) => number;
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* groundMetersPerPixel returns the Web Mercator ground resolution at a zoom and latitude: how many
|
|
1615
|
+
* ground meters one screen pixel spans, `(circumference * cos(lat)) / (tileSize * 2^zoom)`.
|
|
1616
|
+
*
|
|
1617
|
+
* It is the resolution a camera's zoom inverts, so a framing (how far off-centre a marker sits as
|
|
1618
|
+
* a fraction of the frame, how wide a padding is on the ground) reasons in ground meters without
|
|
1619
|
+
* deriving the projection again.
|
|
1620
|
+
*
|
|
1621
|
+
* @param zoom The renderer's zoom.
|
|
1622
|
+
* @param latitude The latitude the pixel stands at, in degrees.
|
|
1623
|
+
* @returns Ground meters per CSS pixel, or 0 for a zoom that is no finite number (a degenerate
|
|
1624
|
+
* span the caller reads as no budget).
|
|
1625
|
+
*/
|
|
1626
|
+
declare const groundMetersPerPixel: (zoom: number, latitude: number) => number;
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* CINEMATIC_EYE_HEIGHT_METERS is the height, in meters, the `cinematic` preset's eye flies above
|
|
1630
|
+
* the route's surface elevation.
|
|
1631
|
+
*
|
|
1632
|
+
* Grounded: high enough to read the terrain around the path, low enough that the trail does not
|
|
1633
|
+
* shrink to a thread. `generateCinematicPlan` adds it to the surface elevation at each travelling
|
|
1634
|
+
* keyframe before it derives the zoom, and `modeEyeHeightMeters.cinematic` is this constant, so a
|
|
1635
|
+
* consumer reproducing the preset's framing reads the height the preset flies at.
|
|
1636
|
+
*/
|
|
1637
|
+
declare const CINEMATIC_EYE_HEIGHT_METERS = 260;
|
|
1638
|
+
/**
|
|
1639
|
+
* POINT_ZOOM is the zoom a camera lands at on a point that names no extent, when the caller
|
|
1640
|
+
* names no zoom either: close enough to read the place, wide enough to keep its surroundings.
|
|
1641
|
+
*
|
|
1642
|
+
* One declaration for every surface that flies to a point: a search result with no bounds, a
|
|
1643
|
+
* zone opened on its anchor, a tool call that states a point and no zoom.
|
|
1644
|
+
*
|
|
1645
|
+
* @example
|
|
1646
|
+
* ```ts
|
|
1647
|
+
* import { POINT_ZOOM } from "@mountaya/elements/camera";
|
|
1648
|
+
*
|
|
1649
|
+
* declare const map: { flyTo(target: { center: [number, number]; zoom: number }): void };
|
|
1650
|
+
* declare const point: [number, number];
|
|
1651
|
+
*
|
|
1652
|
+
* map.flyTo({ center: point, zoom: POINT_ZOOM });
|
|
1653
|
+
* ```
|
|
1654
|
+
*/
|
|
1655
|
+
declare const POINT_ZOOM = 13;
|
|
1656
|
+
/**
|
|
1657
|
+
* DEFAULT_VIEWPORT_HEIGHT_PX is the canvas height, in CSS pixels, altitudeToZoom and
|
|
1658
|
+
* viewportGroundSpanMeters calibrate against when a caller does not pass the live
|
|
1659
|
+
* viewport. The perspective model scales zoom with the actual canvas height; this
|
|
1660
|
+
* nominal value keeps the model usable in a render-free context (a generator
|
|
1661
|
+
* running without a map). The track resolver's framing budget reads the same
|
|
1662
|
+
* nominal height, and so does a consumer that frames shots of its own with no canvas.
|
|
1663
|
+
*/
|
|
1664
|
+
declare const DEFAULT_VIEWPORT_HEIGHT_PX = 800;
|
|
1665
|
+
/**
|
|
1666
|
+
* altitudeToZoom converts a camera eye altitude in meters to a MapLibre zoom
|
|
1667
|
+
* level, from MapLibre's perspective model: the camera's altitude projects to a
|
|
1668
|
+
* screen-pixel distance (viewport height times the FOV factor), and screen pixels
|
|
1669
|
+
* map to ground meters by the Web Mercator ground resolution
|
|
1670
|
+
* `metersPerPixel = (circumference * cos(lat)) / (tileSize * 2^zoom)`. Solving for
|
|
1671
|
+
* zoom gives `2^zoom = (altitudePx * circumference) / (tileSize * altitude)`.
|
|
1672
|
+
* `viewportHeightPx` is the live canvas height, so passing the real value yields
|
|
1673
|
+
* a zoom that matches what is on screen. A non-positive or non-finite altitude
|
|
1674
|
+
* returns a safe mid zoom; the result is clamped to a flight-appropriate [4, 16].
|
|
1675
|
+
*
|
|
1676
|
+
* @param altitudeMeters The eye's altitude above the ground it looks at, in meters.
|
|
1677
|
+
* @param latitude The latitude the ground resolution is read at, in degrees.
|
|
1678
|
+
* @param viewportHeightPx The canvas height in CSS pixels. Defaults to
|
|
1679
|
+
* {@link DEFAULT_VIEWPORT_HEIGHT_PX}.
|
|
1680
|
+
*/
|
|
1681
|
+
declare const altitudeToZoom: (altitudeMeters: number, latitude: number, viewportHeightPx?: number) => number;
|
|
1682
|
+
/**
|
|
1683
|
+
* zoomToAltitude is the inverse of altitudeToZoom: it converts a MapLibre zoom
|
|
1684
|
+
* level back to the camera eye altitude in meters the perspective model places
|
|
1685
|
+
* the camera at. Solving the same relation for altitude gives
|
|
1686
|
+
* `altitude = (altitudePx * circumference) / (tileSize * 2^zoom)`, where
|
|
1687
|
+
* `altitudePx` is the viewport height in CSS pixels times the FOV factor and the
|
|
1688
|
+
* circumference is scaled by `cos(lat)` for the Web Mercator ground resolution.
|
|
1689
|
+
* `viewportHeightPx` is the live canvas height, so passing the real value yields
|
|
1690
|
+
* the altitude that matches what is on screen. A non-finite zoom returns a safe
|
|
1691
|
+
* mid altitude; the altitude is the clearance pass's working unit (it compares
|
|
1692
|
+
* eye heights against terrain), and altitudeToZoom clamps the value on the way
|
|
1693
|
+
* back to a zoom, so this returns the raw meters without its own clamp.
|
|
1694
|
+
*
|
|
1695
|
+
* @param zoom The MapLibre zoom level.
|
|
1696
|
+
* @param latitude The latitude the ground resolution is read at, in degrees.
|
|
1697
|
+
* @param viewportHeightPx The canvas height in CSS pixels. Defaults to
|
|
1698
|
+
* {@link DEFAULT_VIEWPORT_HEIGHT_PX}.
|
|
1699
|
+
*/
|
|
1700
|
+
declare const zoomToAltitude: (zoom: number, latitude: number, viewportHeightPx?: number) => number;
|
|
1701
|
+
/**
|
|
1702
|
+
* viewportGroundSpanMeters returns the ground distance in meters the full
|
|
1703
|
+
* viewport height covers at a zoom and latitude: the viewport height in pixels
|
|
1704
|
+
* times the per-pixel ground resolution. It is the scale the athlete-framing
|
|
1705
|
+
* budget is expressed against (a lead or an off-centre offset is a fraction of
|
|
1706
|
+
* this span), so the framing reads the same on screen regardless of the zoom the
|
|
1707
|
+
* flight is at. A non-positive or non-finite height falls back to the nominal.
|
|
1708
|
+
*
|
|
1709
|
+
* @param viewportHeightPx The canvas height in CSS pixels. Defaults to
|
|
1710
|
+
* {@link DEFAULT_VIEWPORT_HEIGHT_PX}, the render-free nominal height, so the value is
|
|
1711
|
+
* usable without a live canvas.
|
|
1712
|
+
*/
|
|
1713
|
+
declare const viewportGroundSpanMeters: (zoom: number, latitude: number, viewportHeightPx?: number) => number;
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* ZoomLimitReached is which end of its zoom window a camera stands at: the ceiling, the floor, both
|
|
1717
|
+
* (a window of one zoom), or neither.
|
|
1718
|
+
*/
|
|
1719
|
+
type ZoomLimitReached = "both" | "ceiling" | "floor" | "none";
|
|
1720
|
+
/**
|
|
1721
|
+
* zoomLimitReached answers which end of its zoom window a camera stands at.
|
|
1722
|
+
*
|
|
1723
|
+
* The camera stands at the ceiling at it or above it and at the floor at it or below it, the zoom
|
|
1724
|
+
* read unrounded, so a camera a fraction under the ceiling stands at neither end. A renderer holds
|
|
1725
|
+
* its camera within the window, and a camera found past an end stands at that end.
|
|
1726
|
+
*
|
|
1727
|
+
* @param zoom The camera's zoom.
|
|
1728
|
+
* @param window The zoom window the camera is held to, its lowest zoom and its highest.
|
|
1729
|
+
*
|
|
1730
|
+
* @example
|
|
1731
|
+
* ```ts
|
|
1732
|
+
* import { zoomLimitReached } from "@mountaya/elements/camera";
|
|
1733
|
+
*
|
|
1734
|
+
* zoomLimitReached(14, { max: 14, min: 10 }); // "ceiling"
|
|
1735
|
+
* zoomLimitReached(12, { max: 12, min: 12 }); // "both"
|
|
1736
|
+
* ```
|
|
1737
|
+
*/
|
|
1738
|
+
declare const zoomLimitReached: (zoom: number, window: {
|
|
1739
|
+
readonly max: number;
|
|
1740
|
+
readonly min: number;
|
|
1741
|
+
}) => ZoomLimitReached;
|
|
1742
|
+
/**
|
|
1743
|
+
* zoomControlsDisabled names the zoom controls disabled at each end a camera stands at: zoom in at
|
|
1744
|
+
* the ceiling, zoom out at the floor, and both in a window of one zoom. A control is disabled there
|
|
1745
|
+
* whoever answers its press, the map or a handler that takes the press over, since either would
|
|
1746
|
+
* move the camera nowhere.
|
|
1747
|
+
*/
|
|
1748
|
+
declare const zoomControlsDisabled: Readonly<Record<ZoomLimitReached, readonly ("zoom-in" | "zoom-out")[]>>;
|
|
1749
|
+
|
|
1750
|
+
export { BITRATE_MBPS_MAX, BITRATE_MBPS_MIN, BoundingBox, CINEMATIC_EYE_HEIGHT_METERS, CameraAspect, CameraFps, CameraMode, CameraOutputFormat, CameraPlan, CameraResolution, DEFAULT_VIEWPORT_HEIGHT_PX, LngLat, POINT_ZOOM, ProfileDesign, ProfileSample, ProfileSource, Quality, RecordOutput, RecordProfile, RecordingCamera, RouteGeometry, ShotCamera, UnitFormatOptions, VideoFlightEngine, VideoPreset, VideoProgress, VideoRecordingPhase, VideoRecordingResult, altitudeToZoom, aspectRatio, bearingDegBetween, bitrateForOutput, cameraForBounds, cameraPlanGenerators, capturesSweptViewports, clearanceStrideFor, cursorAtFraction, defaultVideoFlightProfile, elevationAtFraction, estimatedVideoSizeMb, generateChasePlan, generateCinematicPlan, generateDronePlan, generateHelicopterPlan, generateOverviewPlan, generateSmartPlan, groundMetersPerPixel, itineraryToRouteGeometry, measuredCameraPlanner, modeEyeHeightMeters, neutralDirectorPlan, planDurationMs, pointAtMeters, posePlanSignature, representativeStillFraction, resolveCameraTrack, resolveClearanceAdjustments, resolveFrameProgressions, resolveRouteMarkers, sameRouteContent, slopeDegAtFraction, suggestVideoLengthMs, synchronousCameraPlanner, tangentBearingAtMeters, videoPresets, viewportGroundSpanMeters, zoomControlsDisabled, zoomLimitReached, zoomToAltitude };
|
|
1751
|
+
export type { BoundsCamera, BoundsCameraOptions, CameraPlanGenerator, CameraPlanner, ClearanceAdjustment, ClearanceFrame, ClearanceOptions, GeneratorParams, RouteCursor, TerrainSampler, VideoFlight, VideoFlightMap, VideoFlightOptions, VideoFlightOutcome, VideoFlightProfile, VideoFlightRecording, VideoFlightStatus, VideoPresetTemplate, ZoomLimitReached };
|