@monkvision/inspection-capture-web 4.5.6 → 4.6.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/README.md +134 -19
- package/lib/DamageDisclosure/DamageDisclosure.d.ts +44 -0
- package/lib/DamageDisclosure/DamageDisclosure.js +114 -0
- package/lib/DamageDisclosure/DamageDisclosure.styles.js +33 -0
- package/lib/DamageDisclosure/DamageDisclosureHOC.d.ts +27 -0
- package/lib/DamageDisclosure/DamageDisclosureHOC.js +45 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.d.ts +73 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.js +49 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.styles.js +24 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/DamageDisclosureHUDElements.d.ts +52 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/DamageDisclosureHUDElements.js +22 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/index.d.ts +1 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUDElements/index.js +5 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/index.d.ts +2 -0
- package/lib/DamageDisclosure/DamageDisclosureHUD/index.js +20 -0
- package/lib/DamageDisclosure/hooks/index.d.ts +1 -0
- package/lib/DamageDisclosure/hooks/index.js +17 -0
- package/lib/DamageDisclosure/hooks/useDamageDisclosureState.d.ts +30 -0
- package/lib/DamageDisclosure/hooks/useDamageDisclosureState.js +55 -0
- package/lib/DamageDisclosure/index.d.ts +3 -0
- package/lib/DamageDisclosure/index.js +20 -0
- package/lib/PhotoCapture/PhotoCapture.d.ts +7 -5
- package/lib/PhotoCapture/PhotoCapture.js +27 -21
- package/lib/PhotoCapture/PhotoCapture.styles.js +0 -24
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.d.ts +24 -7
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.js +4 -4
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/PhotoCaptureHUDElements.d.ts +21 -4
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElements/PhotoCaptureHUDElements.js +10 -8
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/AddDamageButton.d.ts +3 -4
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/AddDamageButton/AddDamageButton.js +5 -4
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.d.ts +1 -1
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/PhotoCaptureHUDElementsSight.js +4 -3
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.d.ts +3 -3
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.js +5 -4
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightGuideline/SightGuideline.styles.js +2 -2
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.styles.js +2 -2
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/hooks.d.ts +2 -2
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.d.ts +3 -3
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.js +4 -4
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.styles.js +3 -3
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.d.ts +0 -1
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/index.js +0 -1
- package/lib/PhotoCapture/PhotoCaptureHUD/index.d.ts +0 -6
- package/lib/PhotoCapture/PhotoCaptureHUD/index.js +0 -6
- package/lib/PhotoCapture/hooks/index.d.ts +0 -8
- package/lib/PhotoCapture/hooks/index.js +0 -8
- package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.d.ts +3 -0
- package/lib/PhotoCapture/hooks/usePhotoCaptureSightState.js +1 -1
- package/lib/PhotoCapture/hooks/usePhotoCaptureTutorial.d.ts +2 -2
- package/lib/VideoCapture/VideoCapture.d.ts +28 -0
- package/lib/VideoCapture/VideoCapture.js +81 -0
- package/lib/VideoCapture/VideoCapture.styles.js +9 -0
- package/lib/VideoCapture/VideoCaptureHOC.d.ts +27 -0
- package/lib/VideoCapture/VideoCaptureHOC.js +45 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.d.ts +44 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.js +158 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureHUD.styles.js +14 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.d.ts +6 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.js +38 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.types.d.ts +33 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecording.types.js +2 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecordingStyles.d.ts +4873 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/VideoCaptureRecordingStyles.js +105 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/index.d.ts +2 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureRecording/index.js +5 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/VideoCaptureTutorial.d.ts +14 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/VideoCaptureTutorial.js +30 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/index.d.ts +1 -0
- package/lib/VideoCapture/VideoCaptureHUD/VideoCaptureTutorial/index.js +5 -0
- package/lib/VideoCapture/VideoCaptureHUD/index.d.ts +1 -0
- package/lib/VideoCapture/VideoCaptureHUD/index.js +5 -0
- package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.d.ts +23 -0
- package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.js +26 -0
- package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.styles.d.ts +12 -0
- package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/PageLayoutItem.styles.js +72 -0
- package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/index.d.ts +1 -0
- package/lib/VideoCapture/VideoCapturePageLayout/PageLayoutItem/index.js +5 -0
- package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.d.ts +7 -0
- package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.js +32 -0
- package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.styles.d.ts +12 -0
- package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.styles.js +87 -0
- package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.types.d.ts +22 -0
- package/lib/VideoCapture/VideoCapturePageLayout/VideoCapturePageLayout.types.js +2 -0
- package/lib/VideoCapture/VideoCapturePageLayout/index.d.ts +3 -0
- package/lib/VideoCapture/VideoCapturePageLayout/index.js +7 -0
- package/lib/VideoCapture/VideoCapturePermissions/VideoCapturePermissions.d.ts +19 -0
- package/lib/VideoCapture/VideoCapturePermissions/VideoCapturePermissions.js +107 -0
- package/lib/VideoCapture/VideoCapturePermissions/index.d.ts +1 -0
- package/lib/VideoCapture/VideoCapturePermissions/index.js +5 -0
- package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.d.ts +7 -0
- package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.js +44 -0
- package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.styles.d.ts +2437 -0
- package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.styles.js +60 -0
- package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.types.d.ts +34 -0
- package/lib/VideoCapture/VideoCaptureProcessing/VideoCaptureProcessing.types.js +2 -0
- package/lib/VideoCapture/VideoCaptureProcessing/index.d.ts +2 -0
- package/lib/VideoCapture/VideoCaptureProcessing/index.js +5 -0
- package/lib/VideoCapture/hooks/index.d.ts +5 -0
- package/lib/VideoCapture/hooks/index.js +21 -0
- package/lib/VideoCapture/hooks/useFastMovementsDetection/fastMovementsDetection.d.ts +18 -0
- package/lib/VideoCapture/hooks/useFastMovementsDetection/fastMovementsDetection.js +45 -0
- package/lib/VideoCapture/hooks/useFastMovementsDetection/index.d.ts +2 -0
- package/lib/VideoCapture/hooks/useFastMovementsDetection/index.js +20 -0
- package/lib/VideoCapture/hooks/useFastMovementsDetection/useFastMovementsDetection.d.ts +34 -0
- package/lib/VideoCapture/hooks/useFastMovementsDetection/useFastMovementsDetection.js +64 -0
- package/lib/VideoCapture/hooks/useFrameSelection/index.d.ts +1 -0
- package/lib/VideoCapture/hooks/useFrameSelection/index.js +17 -0
- package/lib/VideoCapture/hooks/useFrameSelection/laplaceScores.d.ts +16 -0
- package/lib/VideoCapture/hooks/useFrameSelection/laplaceScores.js +62 -0
- package/lib/VideoCapture/hooks/useFrameSelection/useFrameSelection.d.ts +43 -0
- package/lib/VideoCapture/hooks/useFrameSelection/useFrameSelection.js +50 -0
- package/lib/VideoCapture/hooks/useVehicleWalkaround.d.ts +26 -0
- package/lib/VideoCapture/hooks/useVehicleWalkaround.js +39 -0
- package/lib/VideoCapture/hooks/useVideoRecording.d.ts +97 -0
- package/lib/VideoCapture/hooks/useVideoRecording.js +140 -0
- package/lib/VideoCapture/hooks/useVideoUploadQueue.d.ts +40 -0
- package/lib/VideoCapture/hooks/useVideoUploadQueue.js +51 -0
- package/lib/VideoCapture/index.d.ts +2 -0
- package/lib/VideoCapture/index.js +5 -0
- package/lib/assets/logos.asset.d.ts +1 -0
- package/lib/assets/logos.asset.js +4 -0
- package/lib/components/CancelButton/CancelButton.d.ts +14 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.js → components/CancelButton/CancelButton.js} +6 -6
- package/lib/components/CancelButton/index.d.ts +1 -0
- package/lib/components/CancelButton/index.js +5 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.d.ts → components/CloseUpShot/CloseUpShot.d.ts} +10 -4
- package/lib/components/CloseUpShot/CloseUpShot.js +34 -0
- package/lib/components/CloseUpShot/CloseUpShot.styles.d.ts +2 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.js → components/CloseUpShot/CloseUpShot.styles.js} +4 -3
- package/lib/components/CloseUpShot/hooks.d.ts +7 -0
- package/lib/components/CloseUpShot/hooks.js +25 -0
- package/lib/components/CloseUpShot/index.d.ts +1 -0
- package/lib/components/CloseUpShot/index.js +5 -0
- package/lib/components/Counter/Counter.d.ts +6 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.js → components/Counter/Counter.js} +9 -9
- package/lib/components/Counter/Counter.styles.d.ts +2 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter → components/Counter}/hooks.d.ts +6 -6
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter → components/Counter}/hooks.js +6 -6
- package/lib/components/Counter/index.d.ts +2 -0
- package/lib/components/Counter/index.js +5 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.d.ts → components/HUDButtons/HUDButtons.d.ts} +4 -4
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.js → components/HUDButtons/HUDButtons.js} +5 -5
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons → components/HUDButtons}/hooks.d.ts +3 -3
- package/lib/components/HUDButtons/hooks.js +44 -0
- package/lib/components/HUDButtons/index.d.ts +1 -0
- package/lib/components/HUDButtons/index.js +5 -0
- package/lib/components/HUDOverlay/HUDOverlay.d.ts +7 -0
- package/lib/components/HUDOverlay/HUDOverlay.js +36 -0
- package/lib/components/HUDOverlay/HUDOverlay.styles.d.ts +2 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay → components/HUDOverlay}/hooks.d.ts +4 -4
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay → components/HUDOverlay}/hooks.js +3 -3
- package/lib/components/HUDOverlay/index.d.ts +2 -0
- package/lib/components/HUDOverlay/index.js +5 -0
- package/lib/components/OrientationEnforcer/OrientationEnforcer.d.ts +16 -0
- package/lib/components/OrientationEnforcer/OrientationEnforcer.js +34 -0
- package/lib/components/OrientationEnforcer/OrientationEnforcer.styles.d.ts +815 -0
- package/lib/components/OrientationEnforcer/OrientationEnforcer.styles.js +49 -0
- package/lib/components/OrientationEnforcer/index.d.ts +1 -0
- package/lib/components/OrientationEnforcer/index.js +5 -0
- package/lib/components/PartSelection/PartSelection.d.ts +40 -0
- package/lib/components/PartSelection/PartSelection.js +39 -0
- package/lib/components/PartSelection/PartSelection.styles.d.ts +2 -0
- package/lib/components/PartSelection/PartSelection.styles.js +54 -0
- package/lib/components/PartSelection/index.d.ts +2 -0
- package/lib/components/PartSelection/index.js +5 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.d.ts → components/ZoomOutShot/ZoomOutShot.d.ts} +3 -3
- package/lib/components/ZoomOutShot/ZoomOutShot.js +38 -0
- package/lib/components/ZoomOutShot/ZoomOutShot.styles.d.ts +2 -0
- package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.js → components/ZoomOutShot/ZoomOutShot.styles.js} +3 -3
- package/lib/components/ZoomOutShot/hooks.d.ts +6 -0
- package/lib/components/ZoomOutShot/hooks.js +24 -0
- package/lib/components/ZoomOutShot/index.d.ts +1 -0
- package/lib/components/ZoomOutShot/index.js +5 -0
- package/lib/components/index.d.ts +8 -0
- package/lib/components/index.js +24 -0
- package/lib/errors.d.ts +3 -0
- package/lib/errors.js +7 -0
- package/lib/hooks/index.d.ts +10 -0
- package/lib/hooks/index.js +26 -0
- package/lib/{PhotoCapture/hooks → hooks}/useAdaptiveCameraConfig.d.ts +2 -2
- package/lib/hooks/useAddDamageMode.d.ts +56 -0
- package/lib/hooks/useAddDamageMode.js +76 -0
- package/lib/{PhotoCapture/hooks → hooks}/useBadConnectionWarning.d.ts +2 -2
- package/lib/hooks/useColorBackground.d.ts +4 -0
- package/lib/hooks/useColorBackground.js +15 -0
- package/lib/hooks/useEnforceOrientation.d.ts +6 -0
- package/lib/hooks/useEnforceOrientation.js +14 -0
- package/lib/{PhotoCapture/hooks → hooks}/usePhotoCaptureImages.js +1 -1
- package/lib/{PhotoCapture/hooks → hooks}/usePictureTaken.d.ts +4 -4
- package/lib/hooks/usePictureTaken.js +58 -0
- package/lib/{PhotoCapture/hooks → hooks}/useStartTasksOnComplete.d.ts +6 -6
- package/lib/{PhotoCapture/hooks → hooks}/useStartTasksOnComplete.js +3 -1
- package/lib/{PhotoCapture/hooks → hooks}/useUploadQueue.d.ts +24 -7
- package/lib/{PhotoCapture/hooks → hooks}/useUploadQueue.js +14 -4
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/translations/de.json +64 -5
- package/lib/translations/en.json +64 -5
- package/lib/translations/fr.json +64 -5
- package/lib/translations/nl.json +64 -5
- package/lib/types.d.ts +102 -0
- package/lib/types.js +43 -0
- package/package.json +15 -15
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/hooks.js +0 -44
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.d.ts +0 -1
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/index.js +0 -5
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/PhotoCaptureHUDCancelButton.d.ts +0 -14
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.d.ts +0 -1
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCancelButton/index.js +0 -5
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.d.ts +0 -6
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.d.ts +0 -2
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/index.js +0 -5
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.js +0 -38
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.d.ts +0 -6
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/hooks.js +0 -24
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.d.ts +0 -1
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/index.js +0 -5
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.js +0 -40
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.d.ts +0 -7
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/hooks.js +0 -25
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.d.ts +0 -1
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/index.js +0 -5
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.d.ts +0 -7
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.js +0 -36
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.d.ts +0 -2
- package/lib/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/index.js +0 -5
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.d.ts +0 -4
- package/lib/PhotoCapture/PhotoCaptureHUD/hooks/usePhotoCaptureHUDButtonBackground.js +0 -13
- package/lib/PhotoCapture/hooks/useAddDamageMode.d.ts +0 -42
- package/lib/PhotoCapture/hooks/useAddDamageMode.js +0 -57
- package/lib/PhotoCapture/hooks/usePictureTaken.js +0 -46
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.d.ts → DamageDisclosure/DamageDisclosure.styles.d.ts} +0 -0
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage1stShot/PhotoCaptureHUDElementsAddDamage1stShot.styles.d.ts → DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.styles.d.ts} +0 -0
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddDamage2ndShot/PhotoCaptureHUDElementsAddDamage2ndShot.styles.d.ts → VideoCapture/VideoCapture.styles.d.ts} +0 -0
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.d.ts → VideoCapture/VideoCaptureHUD/VideoCaptureHUD.styles.d.ts} +0 -0
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDCounter/PhotoCaptureHUDCounter.styles.js → components/Counter/Counter.styles.js} +0 -0
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.d.ts → components/HUDButtons/HUDButtons.styles.d.ts} +0 -0
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDButtons/PhotoCaptureHUDButtons.styles.js → components/HUDButtons/HUDButtons.styles.js} +0 -0
- /package/lib/{PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDOverlay/PhotoCaptureHUDOverlay.styles.js → components/HUDOverlay/HUDOverlay.styles.js} +0 -0
- /package/lib/{PhotoCapture/hooks → hooks}/useAdaptiveCameraConfig.js +0 -0
- /package/lib/{PhotoCapture/hooks → hooks}/useBadConnectionWarning.js +0 -0
- /package/lib/{PhotoCapture/hooks → hooks}/usePhotoCaptureImages.d.ts +0 -0
- /package/lib/{PhotoCapture/hooks → hooks}/useTracking.d.ts +0 -0
- /package/lib/{PhotoCapture/hooks → hooks}/useTracking.js +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useVideoCaptureProcessingStyles = exports.styles = void 0;
|
|
15
|
+
var common_1 = require("@monkvision/common");
|
|
16
|
+
exports.styles = {
|
|
17
|
+
container: {
|
|
18
|
+
width: '100%',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignSelf: 'stretch',
|
|
21
|
+
flex: 1,
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
},
|
|
26
|
+
labelContainer: {
|
|
27
|
+
width: '80%',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'space-between',
|
|
31
|
+
padding: '0 8px 8px 8px',
|
|
32
|
+
fontSize: 14,
|
|
33
|
+
},
|
|
34
|
+
percentage: {
|
|
35
|
+
fontFamily: 'monospace',
|
|
36
|
+
},
|
|
37
|
+
progressBarContainer: {
|
|
38
|
+
width: '80%',
|
|
39
|
+
borderRadius: 9999,
|
|
40
|
+
borderStyle: 'solid',
|
|
41
|
+
borderWidth: 1,
|
|
42
|
+
},
|
|
43
|
+
progressBar: {
|
|
44
|
+
height: 10,
|
|
45
|
+
borderRadius: 9999,
|
|
46
|
+
},
|
|
47
|
+
errorMessage: {
|
|
48
|
+
padding: '0 16px',
|
|
49
|
+
textAlign: 'center',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
function useVideoCaptureProcessingStyles(progress) {
|
|
53
|
+
var palette = (0, common_1.useMonkTheme)().palette;
|
|
54
|
+
return {
|
|
55
|
+
containerStyle: __assign(__assign({}, exports.styles['container']), { color: palette.text.primary }),
|
|
56
|
+
progressBarContainerStyle: __assign(__assign({}, exports.styles['progressBarContainer']), { borderColor: palette.primary.dark }),
|
|
57
|
+
progressBarStyle: __assign(__assign({}, exports.styles['progressBar']), { backgroundColor: palette.primary.dark, width: "".concat(progress * 100, "%") }),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
exports.useVideoCaptureProcessingStyles = useVideoCaptureProcessingStyles;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LoadingState } from '@monkvision/common';
|
|
2
|
+
/**
|
|
3
|
+
* Props accepted by the VideoCaptureProcessing component.
|
|
4
|
+
*/
|
|
5
|
+
export interface VideoCaptureProcessingProps {
|
|
6
|
+
/**
|
|
7
|
+
* The inspection ID.
|
|
8
|
+
*/
|
|
9
|
+
inspectionId: string;
|
|
10
|
+
/**
|
|
11
|
+
* The number of frames that have successfully been processed and added to the upload queue.
|
|
12
|
+
*/
|
|
13
|
+
processedFrames: number;
|
|
14
|
+
/**
|
|
15
|
+
* The total number of frames added to the processing queue.
|
|
16
|
+
*/
|
|
17
|
+
totalProcessingFrames: number;
|
|
18
|
+
/**
|
|
19
|
+
* The number of frames that have successfully been uploaded to the API.
|
|
20
|
+
*/
|
|
21
|
+
uploadedFrames: number;
|
|
22
|
+
/**
|
|
23
|
+
* The total number of frames added to the uploading queue.
|
|
24
|
+
*/
|
|
25
|
+
totalUploadingFrames: number;
|
|
26
|
+
/**
|
|
27
|
+
* Loading state for the done button.
|
|
28
|
+
*/
|
|
29
|
+
loading: LoadingState;
|
|
30
|
+
/**
|
|
31
|
+
* Callback called when the user presses the confirm button.
|
|
32
|
+
*/
|
|
33
|
+
onComplete?: () => void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoCaptureProcessing = void 0;
|
|
4
|
+
var VideoCaptureProcessing_1 = require("./VideoCaptureProcessing");
|
|
5
|
+
Object.defineProperty(exports, "VideoCaptureProcessing", { enumerable: true, get: function () { return VideoCaptureProcessing_1.VideoCaptureProcessing; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useVehicleWalkaround"), exports);
|
|
18
|
+
__exportStar(require("./useVideoRecording"), exports);
|
|
19
|
+
__exportStar(require("./useFrameSelection"), exports);
|
|
20
|
+
__exportStar(require("./useVideoUploadQueue"), exports);
|
|
21
|
+
__exportStar(require("./useFastMovementsDetection"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DeviceRotation } from '@monkvision/types';
|
|
2
|
+
/**
|
|
3
|
+
* Enumeration of the different fast movements that can be detected.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum FastMovementType {
|
|
6
|
+
/**
|
|
7
|
+
* The user is walking too fast around the vehicle.
|
|
8
|
+
*/
|
|
9
|
+
WALKING_TOO_FAST = "walking_too_fast",
|
|
10
|
+
/**
|
|
11
|
+
* The user is shaking their phone too much.
|
|
12
|
+
*/
|
|
13
|
+
PHONE_SHAKING = "phone_shaking"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Function used to detect fast user movements between DeviceOrientationEvent emissions.
|
|
17
|
+
*/
|
|
18
|
+
export declare function detectFastMovements(rotation: DeviceRotation, previousRotation: DeviceRotation): FastMovementType | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectFastMovements = exports.FastMovementType = void 0;
|
|
4
|
+
var SMOOTH_MOVEMENT_FACTOR = 0.98;
|
|
5
|
+
var ALPHA_DETECTION_MIN = 2.5;
|
|
6
|
+
var ALPHA_DETECTION_MAX = 179;
|
|
7
|
+
var BETA_DETECTION_MIN = 4;
|
|
8
|
+
var BETA_DETECTION_MAX = 89;
|
|
9
|
+
var GAMMA_DETECTION_MIN = 4;
|
|
10
|
+
var GAMMA_DETECTION_MAX = 89;
|
|
11
|
+
/**
|
|
12
|
+
* Enumeration of the different fast movements that can be detected.
|
|
13
|
+
*/
|
|
14
|
+
var FastMovementType;
|
|
15
|
+
(function (FastMovementType) {
|
|
16
|
+
/**
|
|
17
|
+
* The user is walking too fast around the vehicle.
|
|
18
|
+
*/
|
|
19
|
+
FastMovementType["WALKING_TOO_FAST"] = "walking_too_fast";
|
|
20
|
+
/**
|
|
21
|
+
* The user is shaking their phone too much.
|
|
22
|
+
*/
|
|
23
|
+
FastMovementType["PHONE_SHAKING"] = "phone_shaking";
|
|
24
|
+
})(FastMovementType = exports.FastMovementType || (exports.FastMovementType = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Function used to detect fast user movements between DeviceOrientationEvent emissions.
|
|
27
|
+
*/
|
|
28
|
+
function detectFastMovements(rotation, previousRotation) {
|
|
29
|
+
var alpha = rotation.alpha, beta = rotation.beta, gamma = rotation.gamma;
|
|
30
|
+
var prevAlpha = previousRotation.alpha, prevBeta = previousRotation.beta, prevGamma = previousRotation.gamma;
|
|
31
|
+
var alphaSpeed = Math.abs(alpha - prevAlpha) * SMOOTH_MOVEMENT_FACTOR;
|
|
32
|
+
var betaSpeed = Math.abs(beta - prevBeta) * SMOOTH_MOVEMENT_FACTOR;
|
|
33
|
+
var gammaSpeed = Math.abs(gamma - prevGamma) * SMOOTH_MOVEMENT_FACTOR;
|
|
34
|
+
if (prevBeta !== 0 && betaSpeed > BETA_DETECTION_MIN && betaSpeed < BETA_DETECTION_MAX) {
|
|
35
|
+
return FastMovementType.PHONE_SHAKING;
|
|
36
|
+
}
|
|
37
|
+
if (prevGamma !== 0 && gammaSpeed > GAMMA_DETECTION_MIN && gammaSpeed < GAMMA_DETECTION_MAX) {
|
|
38
|
+
return FastMovementType.PHONE_SHAKING;
|
|
39
|
+
}
|
|
40
|
+
if (prevAlpha !== 0 && alphaSpeed > ALPHA_DETECTION_MIN && alphaSpeed < ALPHA_DETECTION_MAX) {
|
|
41
|
+
return FastMovementType.WALKING_TOO_FAST;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
exports.detectFastMovements = detectFastMovements;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.FastMovementType = void 0;
|
|
18
|
+
var fastMovementsDetection_1 = require("./fastMovementsDetection");
|
|
19
|
+
Object.defineProperty(exports, "FastMovementType", { enumerable: true, get: function () { return fastMovementsDetection_1.FastMovementType; } });
|
|
20
|
+
__exportStar(require("./useFastMovementsDetection"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VideoCaptureAppConfig } from '@monkvision/types';
|
|
2
|
+
import { FastMovementType } from './fastMovementsDetection';
|
|
3
|
+
/**
|
|
4
|
+
* Params accepted by the useFastMovementsDetection hook.
|
|
5
|
+
*/
|
|
6
|
+
export interface UseFastMovementsDetectionParams extends Required<Pick<VideoCaptureAppConfig, 'enableFastWalkingWarning' | 'enablePhoneShakingWarning' | 'fastWalkingWarningCooldown' | 'phoneShakingWarningCooldown'>> {
|
|
7
|
+
/**
|
|
8
|
+
* Boolean indicating if the video is currently recording or not.
|
|
9
|
+
*/
|
|
10
|
+
isRecording: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Handle used to manage the fast movements warning displayed on the screen to the user.
|
|
14
|
+
*/
|
|
15
|
+
export interface FastMovementsDetectionHandle {
|
|
16
|
+
/**
|
|
17
|
+
* Event listener for DeviceOrientationEvents.
|
|
18
|
+
*/
|
|
19
|
+
onDeviceOrientationEvent: (event: DeviceOrientationEvent) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The type of fast movements warning that should be displayed to the user. If this value is null, no warning should
|
|
22
|
+
* be displayed.
|
|
23
|
+
*/
|
|
24
|
+
fastMovementsWarning: FastMovementType | null;
|
|
25
|
+
/**
|
|
26
|
+
* Callback called when the user dismisses the currently displayed fast movements warning.
|
|
27
|
+
*/
|
|
28
|
+
onWarningDismiss: () => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Custom hook used to display warnings to the user when they walk too fast around the car or shake their phone too
|
|
32
|
+
* much.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useFastMovementsDetection({ isRecording, enableFastWalkingWarning, enablePhoneShakingWarning, fastWalkingWarningCooldown, phoneShakingWarningCooldown, }: UseFastMovementsDetectionParams): FastMovementsDetectionHandle;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFastMovementsDetection = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var common_1 = require("@monkvision/common");
|
|
6
|
+
var fastMovementsDetection_1 = require("./fastMovementsDetection");
|
|
7
|
+
/**
|
|
8
|
+
* Custom hook used to display warnings to the user when they walk too fast around the car or shake their phone too
|
|
9
|
+
* much.
|
|
10
|
+
*/
|
|
11
|
+
function useFastMovementsDetection(_a) {
|
|
12
|
+
var _b;
|
|
13
|
+
var isRecording = _a.isRecording, enableFastWalkingWarning = _a.enableFastWalkingWarning, enablePhoneShakingWarning = _a.enablePhoneShakingWarning, fastWalkingWarningCooldown = _a.fastWalkingWarningCooldown, phoneShakingWarningCooldown = _a.phoneShakingWarningCooldown;
|
|
14
|
+
var _c = (0, react_1.useState)(null), fastMovementsWarning = _c[0], setFastMovementsWarning = _c[1];
|
|
15
|
+
var lastRotation = (0, react_1.useRef)({ alpha: 0, beta: 0, gamma: 0 });
|
|
16
|
+
var warningTimestamps = (0, react_1.useRef)((_b = {},
|
|
17
|
+
_b[fastMovementsDetection_1.FastMovementType.WALKING_TOO_FAST] = 0,
|
|
18
|
+
_b[fastMovementsDetection_1.FastMovementType.PHONE_SHAKING] = 0,
|
|
19
|
+
_b));
|
|
20
|
+
var isWarningEnabled = (0, react_1.useCallback)(function (type) {
|
|
21
|
+
switch (type) {
|
|
22
|
+
case fastMovementsDetection_1.FastMovementType.WALKING_TOO_FAST:
|
|
23
|
+
return enableFastWalkingWarning;
|
|
24
|
+
case fastMovementsDetection_1.FastMovementType.PHONE_SHAKING:
|
|
25
|
+
return enablePhoneShakingWarning;
|
|
26
|
+
default:
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}, [enableFastWalkingWarning, enablePhoneShakingWarning]);
|
|
30
|
+
var getWarningCooldown = (0, react_1.useCallback)(function (type) {
|
|
31
|
+
switch (type) {
|
|
32
|
+
case fastMovementsDetection_1.FastMovementType.WALKING_TOO_FAST:
|
|
33
|
+
return fastWalkingWarningCooldown;
|
|
34
|
+
case fastMovementsDetection_1.FastMovementType.PHONE_SHAKING:
|
|
35
|
+
return phoneShakingWarningCooldown;
|
|
36
|
+
default:
|
|
37
|
+
return Infinity;
|
|
38
|
+
}
|
|
39
|
+
}, [fastWalkingWarningCooldown, phoneShakingWarningCooldown]);
|
|
40
|
+
var onDeviceOrientationEvent = (0, react_1.useCallback)(function (event) {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
var alpha = (_a = event.alpha) !== null && _a !== void 0 ? _a : 0;
|
|
43
|
+
var beta = (_b = event.beta) !== null && _b !== void 0 ? _b : 0;
|
|
44
|
+
var gamma = (_c = event.gamma) !== null && _c !== void 0 ? _c : 0;
|
|
45
|
+
if (isRecording) {
|
|
46
|
+
var now = Date.now();
|
|
47
|
+
var type = (0, fastMovementsDetection_1.detectFastMovements)({ alpha: alpha, beta: beta, gamma: gamma }, lastRotation.current);
|
|
48
|
+
if (type &&
|
|
49
|
+
isWarningEnabled(type) &&
|
|
50
|
+
Date.now() - warningTimestamps.current[type] > getWarningCooldown(type)) {
|
|
51
|
+
setFastMovementsWarning(type);
|
|
52
|
+
warningTimestamps.current[type] = now;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
lastRotation.current = { alpha: alpha, beta: beta, gamma: gamma };
|
|
56
|
+
}, [isRecording, isWarningEnabled, getWarningCooldown]);
|
|
57
|
+
var onWarningDismiss = (0, react_1.useCallback)(function () { return setFastMovementsWarning(null); }, []);
|
|
58
|
+
return (0, common_1.useObjectMemo)({
|
|
59
|
+
onDeviceOrientationEvent: onDeviceOrientationEvent,
|
|
60
|
+
fastMovementsWarning: fastMovementsWarning,
|
|
61
|
+
onWarningDismiss: onWarningDismiss,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
exports.useFastMovementsDetection = useFastMovementsDetection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useFrameSelection';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useFrameSelection"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface LaplaceScores {
|
|
2
|
+
mean: number;
|
|
3
|
+
std: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* This function calculates the Laplace Scores for a given pixel array. This score can be used to get a rough estimate
|
|
7
|
+
* of the blurriness of the picture.
|
|
8
|
+
*
|
|
9
|
+
* Picture A is less blurry than picture B if :
|
|
10
|
+
* calculateLaplaceScores(A).std > calculateLaplaceScores(B).std
|
|
11
|
+
*
|
|
12
|
+
* ***WARNING : To save up memory space, the pixels of the array are modified in place!! Before using this function, be
|
|
13
|
+
* sure to make a copy of the array using the `array.slice()` method (you might have performance issues if you use any
|
|
14
|
+
* other method for the duplication of the array).***
|
|
15
|
+
*/
|
|
16
|
+
export declare function calculateLaplaceScores(pixels: Uint8ClampedArray, width: number, height: number): LaplaceScores;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable no-param-reassign */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.calculateLaplaceScores = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* This function calculates the Laplace Scores for a given pixel array. This score can be used to get a rough estimate
|
|
7
|
+
* of the blurriness of the picture.
|
|
8
|
+
*
|
|
9
|
+
* Picture A is less blurry than picture B if :
|
|
10
|
+
* calculateLaplaceScores(A).std > calculateLaplaceScores(B).std
|
|
11
|
+
*
|
|
12
|
+
* ***WARNING : To save up memory space, the pixels of the array are modified in place!! Before using this function, be
|
|
13
|
+
* sure to make a copy of the array using the `array.slice()` method (you might have performance issues if you use any
|
|
14
|
+
* other method for the duplication of the array).***
|
|
15
|
+
*/
|
|
16
|
+
function calculateLaplaceScores(pixels, width, height) {
|
|
17
|
+
for (var i = 0; i < pixels.length; i += 4) {
|
|
18
|
+
pixels[i] = 127;
|
|
19
|
+
pixels[i + 2] = 0;
|
|
20
|
+
}
|
|
21
|
+
var kernel = [
|
|
22
|
+
[0, 1, 0],
|
|
23
|
+
[1, -4, 1],
|
|
24
|
+
[0, 1, 0],
|
|
25
|
+
];
|
|
26
|
+
var squareSize = Math.round((0.8 * Math.min(height, width)) / 2) * 2;
|
|
27
|
+
var yMin = (height - squareSize) / 2;
|
|
28
|
+
var xMin = (width - squareSize) / 2;
|
|
29
|
+
for (var y = yMin + 1; y < yMin + squareSize - 1; y++) {
|
|
30
|
+
for (var x = xMin + 1; x < xMin + squareSize - 1; x++) {
|
|
31
|
+
var sum = 127;
|
|
32
|
+
var i = (y * width + x) * 4;
|
|
33
|
+
for (var ky = -1; ky <= 1; ky++) {
|
|
34
|
+
for (var kx = -1; kx <= 1; kx++) {
|
|
35
|
+
var neighborIndex = ((y + ky) * width + (x + kx)) * 4;
|
|
36
|
+
var neighborGreen = pixels[neighborIndex + 1];
|
|
37
|
+
sum += kernel[ky + 1][kx + 1] * neighborGreen;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
pixels[i] = sum;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
var laplaceSum = 0;
|
|
44
|
+
for (var y = yMin + 1; y < yMin + squareSize - 1; y++) {
|
|
45
|
+
for (var x = xMin + 1; x < xMin + squareSize - 1; x++) {
|
|
46
|
+
var i = (y * width + x) * 4;
|
|
47
|
+
laplaceSum += pixels[i];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
var laplaceMean = laplaceSum / ((squareSize - 2) * (squareSize - 2));
|
|
51
|
+
var se = 0;
|
|
52
|
+
for (var y = yMin + 1; y < yMin + squareSize - 1; y++) {
|
|
53
|
+
for (var x = xMin + 1; x < xMin + squareSize - 1; x++) {
|
|
54
|
+
var i = (y * width + x) * 4;
|
|
55
|
+
var diff = pixels[i] - laplaceMean;
|
|
56
|
+
se += diff * diff;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
var laplaceStd = Math.sqrt(se / ((squareSize - 2) * (squareSize - 2)));
|
|
60
|
+
return { mean: laplaceMean, std: laplaceStd };
|
|
61
|
+
}
|
|
62
|
+
exports.calculateLaplaceScores = calculateLaplaceScores;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { MonkPicture } from '@monkvision/types';
|
|
2
|
+
import { CameraHandle } from '@monkvision/camera-web';
|
|
3
|
+
/**
|
|
4
|
+
* Params accepted by the useFrameSelection hook.
|
|
5
|
+
*/
|
|
6
|
+
export interface UseFrameSelectionParams {
|
|
7
|
+
/**
|
|
8
|
+
* The camera handle.
|
|
9
|
+
*/
|
|
10
|
+
handle: CameraHandle;
|
|
11
|
+
/**
|
|
12
|
+
* Interval (in milliseconds) at which camera frames should be taken.
|
|
13
|
+
*/
|
|
14
|
+
frameSelectionInterval: number;
|
|
15
|
+
/**
|
|
16
|
+
* Callback called when a frame has been selected and should be uploaded to the API.
|
|
17
|
+
*/
|
|
18
|
+
onFrameSelected?: (picture: MonkPicture) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Handle used to manage the frame selection feature.
|
|
22
|
+
*/
|
|
23
|
+
export interface FrameSelectionHandle {
|
|
24
|
+
/**
|
|
25
|
+
* The number of frames that have successfully been processed and added to the upload queue.
|
|
26
|
+
*/
|
|
27
|
+
processedFrames: number;
|
|
28
|
+
/**
|
|
29
|
+
* The total number of frames added to the processing queue.
|
|
30
|
+
*/
|
|
31
|
+
totalProcessingFrames: number;
|
|
32
|
+
/**
|
|
33
|
+
* Callback called when a video frame should be captured.
|
|
34
|
+
*/
|
|
35
|
+
onCaptureVideoFrame: () => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Custom hook used to manage the video frame selection. Basically, every time a camera screenshot is taken, it is added
|
|
39
|
+
* to the frame selection processing queue. The blurriness score of the screenshot is calculated, and the best video
|
|
40
|
+
* frame (the less blurry one) is always stored in memory. Finally, every `frameSelectionInterval` milliseconds, the
|
|
41
|
+
* best video frame is "selected" (to be uploaded to the API) and the process resets.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useFrameSelection({ handle, frameSelectionInterval, onFrameSelected, }: UseFrameSelectionParams): FrameSelectionHandle;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFrameSelection = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var common_1 = require("@monkvision/common");
|
|
6
|
+
var monitoring_1 = require("@monkvision/monitoring");
|
|
7
|
+
var laplaceScores_1 = require("./laplaceScores");
|
|
8
|
+
/**
|
|
9
|
+
* Custom hook used to manage the video frame selection. Basically, every time a camera screenshot is taken, it is added
|
|
10
|
+
* to the frame selection processing queue. The blurriness score of the screenshot is calculated, and the best video
|
|
11
|
+
* frame (the less blurry one) is always stored in memory. Finally, every `frameSelectionInterval` milliseconds, the
|
|
12
|
+
* best video frame is "selected" (to be uploaded to the API) and the process resets.
|
|
13
|
+
*/
|
|
14
|
+
function useFrameSelection(_a) {
|
|
15
|
+
var handle = _a.handle, frameSelectionInterval = _a.frameSelectionInterval, onFrameSelected = _a.onFrameSelected;
|
|
16
|
+
var bestScore = (0, react_1.useRef)(null);
|
|
17
|
+
var bestFrame = (0, react_1.useRef)(null);
|
|
18
|
+
var handleError = (0, monitoring_1.useMonitoring)().handleError;
|
|
19
|
+
var processingQueue = (0, common_1.useQueue)(function (image) {
|
|
20
|
+
return new Promise(function (resolve) {
|
|
21
|
+
// Note : Other array-copying methods might result in performance issues
|
|
22
|
+
var imagePixelsCopy = image.data.slice();
|
|
23
|
+
var laplaceScores = (0, laplaceScores_1.calculateLaplaceScores)(imagePixelsCopy, image.width, image.height);
|
|
24
|
+
if (bestScore.current === null || laplaceScores.std > bestScore.current) {
|
|
25
|
+
bestScore.current = laplaceScores.std;
|
|
26
|
+
bestFrame.current = image;
|
|
27
|
+
}
|
|
28
|
+
resolve();
|
|
29
|
+
});
|
|
30
|
+
}, { storeFailedItems: false });
|
|
31
|
+
var onCaptureVideoFrame = (0, react_1.useCallback)(function () {
|
|
32
|
+
processingQueue.push(handle.getImageData());
|
|
33
|
+
}, [processingQueue.push]);
|
|
34
|
+
(0, common_1.useInterval)(function () {
|
|
35
|
+
if (bestFrame.current !== null) {
|
|
36
|
+
handle
|
|
37
|
+
.compressImage(bestFrame.current)
|
|
38
|
+
.then(function (picture) { return onFrameSelected === null || onFrameSelected === void 0 ? void 0 : onFrameSelected(picture); })
|
|
39
|
+
.catch(handleError);
|
|
40
|
+
}
|
|
41
|
+
bestScore.current = null;
|
|
42
|
+
bestFrame.current = null;
|
|
43
|
+
}, frameSelectionInterval);
|
|
44
|
+
return (0, common_1.useObjectMemo)({
|
|
45
|
+
processedFrames: processingQueue.totalItems - processingQueue.processingCount,
|
|
46
|
+
totalProcessingFrames: processingQueue.totalItems,
|
|
47
|
+
onCaptureVideoFrame: onCaptureVideoFrame,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
exports.useFrameSelection = useFrameSelection;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Params passed to the useVehicleWalkaround hook.
|
|
3
|
+
*/
|
|
4
|
+
export interface UseVehicleWalkaroundParams {
|
|
5
|
+
/**
|
|
6
|
+
* The alpha value of the device orientation.
|
|
7
|
+
*/
|
|
8
|
+
alpha: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Handle returned by the useVehicleWalkaround hook to manage the VehicleWalkaround feature.
|
|
12
|
+
*/
|
|
13
|
+
export interface VehicleWalkaroundHandle {
|
|
14
|
+
/**
|
|
15
|
+
* Callback called at the start of the recording, to set the initial alpha position of the user.
|
|
16
|
+
*/
|
|
17
|
+
startWalkaround: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* The current position of the user around the vehicle (between 0 and 360).
|
|
20
|
+
*/
|
|
21
|
+
walkaroundPosition: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Custom hook used to manage the vehicle walkaround tracking.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useVehicleWalkaround({ alpha, }: UseVehicleWalkaroundParams): VehicleWalkaroundHandle;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useVehicleWalkaround = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var common_1 = require("@monkvision/common");
|
|
6
|
+
/**
|
|
7
|
+
* Custom hook used to manage the vehicle walkaround tracking.
|
|
8
|
+
*/
|
|
9
|
+
function useVehicleWalkaround(_a) {
|
|
10
|
+
var alpha = _a.alpha;
|
|
11
|
+
var _b = (0, react_1.useState)(null), startingAlpha = _b[0], setStartingAlpha = _b[1];
|
|
12
|
+
var _c = (0, react_1.useState)(45), checkpoint = _c[0], setCheckpoint = _c[1];
|
|
13
|
+
var _d = (0, react_1.useState)(90), nextCheckpoint = _d[0], setNextCheckpoint = _d[1];
|
|
14
|
+
var walkaroundPosition = (0, react_1.useMemo)(function () {
|
|
15
|
+
if (!startingAlpha) {
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
var diff = startingAlpha - alpha;
|
|
19
|
+
var position = diff < 0 ? 360 + diff : diff;
|
|
20
|
+
var newWalkaroundPosition = position <= nextCheckpoint ? position : 0;
|
|
21
|
+
if (nextCheckpoint === 405 && newWalkaroundPosition < 180) {
|
|
22
|
+
return 359;
|
|
23
|
+
}
|
|
24
|
+
return newWalkaroundPosition;
|
|
25
|
+
}, [startingAlpha, alpha, nextCheckpoint]);
|
|
26
|
+
var startWalkaround = (0, react_1.useCallback)(function () {
|
|
27
|
+
setStartingAlpha(alpha);
|
|
28
|
+
setCheckpoint(45);
|
|
29
|
+
setNextCheckpoint(90);
|
|
30
|
+
}, [alpha]);
|
|
31
|
+
(0, react_1.useEffect)(function () {
|
|
32
|
+
if (walkaroundPosition >= checkpoint) {
|
|
33
|
+
setCheckpoint(nextCheckpoint);
|
|
34
|
+
setNextCheckpoint(function (value) { return value + 45; });
|
|
35
|
+
}
|
|
36
|
+
}, [walkaroundPosition, checkpoint, nextCheckpoint]);
|
|
37
|
+
return (0, common_1.useObjectMemo)({ startWalkaround: startWalkaround, walkaroundPosition: walkaroundPosition });
|
|
38
|
+
}
|
|
39
|
+
exports.useVehicleWalkaround = useVehicleWalkaround;
|