@arfuhad/react-native-smart-camera 0.1.2 → 0.1.5

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.
Files changed (265) hide show
  1. package/CHANGELOG.md +75 -3
  2. package/README.md +259 -206
  3. package/android/build.gradle +14 -39
  4. package/android/src/main/java/com/smartcamera/FaceDetectorFrameProcessorPlugin.kt +324 -0
  5. package/android/src/main/java/com/smartcamera/SmartCameraPackage.kt +28 -0
  6. package/build/detection/blinkProcessor.js +2 -1
  7. package/build/detection/blinkProcessor.js.map +1 -1
  8. package/build/detection/faceDetector.d.ts +4 -4
  9. package/build/detection/faceDetector.d.ts.map +1 -1
  10. package/build/detection/faceDetector.js +31 -11
  11. package/build/detection/faceDetector.js.map +1 -1
  12. package/build/detection/index.d.ts +1 -1
  13. package/build/detection/index.d.ts.map +1 -1
  14. package/build/detection/index.js +1 -1
  15. package/build/detection/index.js.map +1 -1
  16. package/build/detection/staticImageDetector.d.ts +11 -11
  17. package/build/detection/staticImageDetector.d.ts.map +1 -1
  18. package/build/detection/staticImageDetector.js +19 -23
  19. package/build/detection/staticImageDetector.js.map +1 -1
  20. package/build/hooks/index.d.ts +6 -0
  21. package/build/hooks/index.d.ts.map +1 -1
  22. package/build/hooks/index.js +8 -0
  23. package/build/hooks/index.js.map +1 -1
  24. package/build/hooks/useBlinkDetection.d.ts +27 -16
  25. package/build/hooks/useBlinkDetection.d.ts.map +1 -1
  26. package/build/hooks/useBlinkDetection.js +63 -37
  27. package/build/hooks/useBlinkDetection.js.map +1 -1
  28. package/build/hooks/useFaceDetection.js +3 -2
  29. package/build/hooks/useFaceDetection.js.map +1 -1
  30. package/build/hooks/useFaceDetector.d.ts +123 -0
  31. package/build/hooks/useFaceDetector.d.ts.map +1 -0
  32. package/build/hooks/useFaceDetector.js +133 -0
  33. package/build/hooks/useFaceDetector.js.map +1 -0
  34. package/build/hooks/useSmartCamera.js.map +1 -1
  35. package/build/hooks/useSmartCameraWebRTC.d.ts +3 -5
  36. package/build/hooks/useSmartCameraWebRTC.d.ts.map +1 -1
  37. package/build/hooks/useSmartCameraWebRTC.js +19 -87
  38. package/build/hooks/useSmartCameraWebRTC.js.map +1 -1
  39. package/build/hooks/useWebRTC.d.ts +88 -0
  40. package/build/hooks/useWebRTC.d.ts.map +1 -0
  41. package/build/hooks/useWebRTC.js +394 -0
  42. package/build/hooks/useWebRTC.js.map +1 -0
  43. package/build/hooks/useWebRTCWithDetection.d.ts +89 -0
  44. package/build/hooks/useWebRTCWithDetection.d.ts.map +1 -0
  45. package/build/hooks/useWebRTCWithDetection.js +131 -0
  46. package/build/hooks/useWebRTCWithDetection.js.map +1 -0
  47. package/build/index.d.ts +24 -10
  48. package/build/index.d.ts.map +1 -1
  49. package/build/index.js +38 -13
  50. package/build/index.js.map +1 -1
  51. package/build/types.d.ts +28 -12
  52. package/build/types.d.ts.map +1 -1
  53. package/build/types.js.map +1 -1
  54. package/build/utils/index.js.map +1 -1
  55. package/build/webrtc/WebRTCBridge.d.ts +3 -0
  56. package/build/webrtc/WebRTCBridge.d.ts.map +1 -1
  57. package/build/webrtc/WebRTCBridge.js +12 -15
  58. package/build/webrtc/WebRTCBridge.js.map +1 -1
  59. package/build/webrtc/WebRTCManager.d.ts +148 -0
  60. package/build/webrtc/WebRTCManager.d.ts.map +1 -0
  61. package/build/webrtc/WebRTCManager.js +383 -0
  62. package/build/webrtc/WebRTCManager.js.map +1 -0
  63. package/build/webrtc/index.d.ts +3 -1
  64. package/build/webrtc/index.d.ts.map +1 -1
  65. package/build/webrtc/index.js +5 -0
  66. package/build/webrtc/index.js.map +1 -1
  67. package/build/webrtc/types.d.ts +212 -4
  68. package/build/webrtc/types.d.ts.map +1 -1
  69. package/build/webrtc/types.js +34 -1
  70. package/build/webrtc/types.js.map +1 -1
  71. package/ios/FaceDetectorFrameProcessorPlugin.m +11 -0
  72. package/ios/FaceDetectorFrameProcessorPlugin.swift +304 -0
  73. package/package.json +11 -11
  74. package/react-native-smart-camera.podspec +32 -0
  75. package/src/detection/blinkProcessor.ts +127 -0
  76. package/src/detection/faceDetector.ts +78 -0
  77. package/src/detection/index.ts +3 -0
  78. package/src/detection/staticImageDetector.ts +53 -0
  79. package/src/hooks/index.ts +26 -0
  80. package/src/hooks/useBlinkDetection.ts +127 -0
  81. package/src/hooks/useFaceDetection.ts +105 -0
  82. package/src/hooks/useFaceDetector.ts +191 -0
  83. package/src/hooks/useSmartCamera.ts +83 -0
  84. package/src/hooks/useSmartCameraWebRTC.ts +120 -0
  85. package/src/hooks/useWebRTC.ts +453 -0
  86. package/src/hooks/useWebRTCWithDetection.ts +181 -0
  87. package/src/index.ts +170 -0
  88. package/src/types.ts +636 -0
  89. package/src/utils/index.ts +355 -0
  90. package/src/webrtc/WebRTCBridge.ts +127 -0
  91. package/src/webrtc/WebRTCManager.ts +453 -0
  92. package/src/webrtc/index.ts +50 -0
  93. package/src/webrtc/types.ts +361 -0
  94. package/android/build/.transforms/e0a0b120a9ccc3a8de4f5784bc36b161/results.bin +0 -1
  95. package/android/build/.transforms/e0a0b120a9ccc3a8de4f5784bc36b161/transformed/classes/classes_dex/classes.dex +0 -0
  96. package/android/build/generated/source/buildConfig/debug/expo/modules/smartcamera/BuildConfig.java +0 -10
  97. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -7
  98. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
  99. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -6
  100. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  101. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  102. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  103. package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -0
  104. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  105. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  106. package/android/build/intermediates/java_res/debug/out/META-INF/arfuhad-react-native-smart-camera_debug.kotlin_module +0 -0
  107. package/android/build/intermediates/javac/debug/classes/expo/modules/smartcamera/BuildConfig.class +0 -0
  108. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
  109. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -7
  110. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -7
  111. package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
  112. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  113. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  128. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  135. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  158. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  159. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  160. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  161. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  162. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  163. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  164. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  165. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  166. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  167. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  168. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  169. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  170. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  171. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  172. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  173. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  174. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  175. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  176. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  177. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  178. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  179. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  180. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  181. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  182. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  183. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  184. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  185. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  186. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  187. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  188. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  189. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  190. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  191. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  192. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  193. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  194. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  195. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  196. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  197. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  198. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  199. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  200. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  201. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  202. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
  203. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  204. package/android/build/tmp/kotlin-classes/debug/META-INF/arfuhad-react-native-smart-camera_debug.kotlin_module +0 -0
  205. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/DetectedFace.class +0 -0
  206. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceBounds.class +0 -0
  207. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceContoursData.class +0 -0
  208. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceDetectionOptions.class +0 -0
  209. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceLandmarksData.class +0 -0
  210. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader$Companion.class +0 -0
  211. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader$loadImage$2.class +0 -0
  212. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader.class +0 -0
  213. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector$detectFaces$2$1.class +0 -0
  214. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector$detectFaces$2$2.class +0 -0
  215. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector.class +0 -0
  216. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetectorKt$sam$com_google_android_gms_tasks_OnSuccessListener$0.class +0 -0
  217. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetectorKt.class +0 -0
  218. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/PointData.class +0 -0
  219. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$Companion.class +0 -0
  220. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$1$1.class +0 -0
  221. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$3$1.class +0 -0
  222. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$4$1.class +0 -0
  223. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$1.class +0 -0
  224. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$2.class +0 -0
  225. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$3.class +0 -0
  226. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$1.class +0 -0
  227. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$2.class +0 -0
  228. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$3.class +0 -0
  229. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$4.class +0 -0
  230. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$1.class +0 -0
  231. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$2.class +0 -0
  232. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$3.class +0 -0
  233. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$4.class +0 -0
  234. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$FunctionWithoutArgs$1.class +0 -0
  235. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$FunctionWithoutArgs$2.class +0 -0
  236. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnActivityEntersBackground$1.class +0 -0
  237. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnActivityEntersForeground$1.class +0 -0
  238. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnDestroy$1.class +0 -0
  239. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule.class +0 -0
  240. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraView.class +0 -0
  241. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/WebRTCFrameBridge$Companion.class +0 -0
  242. package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/WebRTCFrameBridge.class +0 -0
  243. package/android/src/main/java/expo/modules/smartcamera/ImageLoader.kt +0 -106
  244. package/android/src/main/java/expo/modules/smartcamera/MLKitFaceDetector.kt +0 -273
  245. package/android/src/main/java/expo/modules/smartcamera/SmartCameraModule.kt +0 -205
  246. package/android/src/main/java/expo/modules/smartcamera/SmartCameraView.kt +0 -153
  247. package/android/src/main/java/expo/modules/smartcamera/WebRTCFrameBridge.kt +0 -184
  248. package/build/SmartCamera.d.ts +0 -17
  249. package/build/SmartCamera.d.ts.map +0 -1
  250. package/build/SmartCamera.js +0 -270
  251. package/build/SmartCamera.js.map +0 -1
  252. package/build/SmartCameraModule.d.ts +0 -112
  253. package/build/SmartCameraModule.d.ts.map +0 -1
  254. package/build/SmartCameraModule.js +0 -121
  255. package/build/SmartCameraModule.js.map +0 -1
  256. package/build/SmartCameraView.d.ts +0 -8
  257. package/build/SmartCameraView.d.ts.map +0 -1
  258. package/build/SmartCameraView.js +0 -7
  259. package/build/SmartCameraView.js.map +0 -1
  260. package/expo-module.config.json +0 -9
  261. package/ios/MLKitFaceDetector.swift +0 -310
  262. package/ios/SmartCamera.podspec +0 -33
  263. package/ios/SmartCameraModule.swift +0 -225
  264. package/ios/SmartCameraView.swift +0 -146
  265. package/ios/WebRTCFrameBridge.swift +0 -150
@@ -1,18 +1,10 @@
1
1
  apply plugin: 'com.android.library'
2
2
  apply plugin: 'kotlin-android'
3
- apply plugin: 'maven-publish'
4
3
 
5
- group = 'expo.modules.smartcamera'
6
- version = '0.1.2'
4
+ group = 'com.smartcamera'
5
+ version = '0.1.4'
7
6
 
8
7
  buildscript {
9
- def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
- if (expoModulesCorePlugin.exists()) {
11
- apply from: expoModulesCorePlugin
12
- applyKotlinExpoModulesCorePlugin()
13
- }
14
-
15
- // Simple fallback that allows building without expo-modules-core for lint
16
8
  repositories {
17
9
  mavenCentral()
18
10
  google()
@@ -23,23 +15,8 @@ buildscript {
23
15
  }
24
16
  }
25
17
 
26
- afterEvaluate {
27
- publishing {
28
- publications {
29
- release(MavenPublication) {
30
- from components.release
31
- }
32
- }
33
- repositories {
34
- maven {
35
- url = mavenLocal().url
36
- }
37
- }
38
- }
39
- }
40
-
41
18
  android {
42
- namespace "expo.modules.smartcamera"
19
+ namespace "com.smartcamera"
43
20
  compileSdkVersion safeExtGet("compileSdkVersion", 34)
44
21
 
45
22
  defaultConfig {
@@ -47,12 +24,6 @@ android {
47
24
  targetSdkVersion safeExtGet("targetSdkVersion", 34)
48
25
  }
49
26
 
50
- publishing {
51
- singleVariant("release") {
52
- withSourcesJar()
53
- }
54
- }
55
-
56
27
  lintOptions {
57
28
  abortOnError false
58
29
  }
@@ -65,6 +36,12 @@ android {
65
36
  kotlinOptions {
66
37
  jvmTarget = JavaVersion.VERSION_17.majorVersion
67
38
  }
39
+
40
+ sourceSets {
41
+ main {
42
+ java.srcDirs = ['src/main/java']
43
+ }
44
+ }
68
45
  }
69
46
 
70
47
  repositories {
@@ -73,7 +50,6 @@ repositories {
73
50
  }
74
51
 
75
52
  dependencies {
76
- implementation project(':expo-modules-core')
77
53
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.22"
78
54
 
79
55
  // Kotlin Coroutines
@@ -83,12 +59,11 @@ dependencies {
83
59
  // Google ML Kit Face Detection
84
60
  implementation 'com.google.mlkit:face-detection:16.1.6'
85
61
 
86
- // CameraX dependencies
87
- def camerax_version = "1.3.0"
88
- implementation "androidx.camera:camera-core:$camerax_version"
89
- implementation "androidx.camera:camera-camera2:$camerax_version"
90
- implementation "androidx.camera:camera-lifecycle:$camerax_version"
91
- implementation "androidx.camera:camera-view:$camerax_version"
62
+ // VisionCamera Frame Processor API (compileOnly - provided by peer dependency)
63
+ compileOnly project(':react-native-vision-camera')
64
+
65
+ // React Native
66
+ compileOnly "com.facebook.react:react-android:+"
92
67
  }
93
68
 
94
69
  def safeExtGet(prop, fallback) {
@@ -0,0 +1,324 @@
1
+ package com.smartcamera
2
+
3
+ import android.util.Log
4
+ import com.google.android.gms.tasks.Tasks
5
+ import com.google.mlkit.vision.common.InputImage
6
+ import com.google.mlkit.vision.face.Face
7
+ import com.google.mlkit.vision.face.FaceContour
8
+ import com.google.mlkit.vision.face.FaceDetection
9
+ import com.google.mlkit.vision.face.FaceDetector
10
+ import com.google.mlkit.vision.face.FaceDetectorOptions
11
+ import com.google.mlkit.vision.face.FaceLandmark
12
+ import com.mrousavy.camera.frameprocessors.Frame
13
+ import com.mrousavy.camera.frameprocessors.FrameProcessorPlugin
14
+ import com.mrousavy.camera.frameprocessors.VisionCameraProxy
15
+
16
+ // Data class to track current options for comparison
17
+ private data class DetectorConfig(
18
+ val performanceMode: String,
19
+ val landmarkMode: String,
20
+ val contourMode: String,
21
+ val classificationMode: String,
22
+ val minFaceSize: Float,
23
+ val trackingEnabled: Boolean,
24
+ val autoMode: Boolean,
25
+ val windowWidth: Float,
26
+ val windowHeight: Float,
27
+ val cameraFacing: String
28
+ )
29
+
30
+ class FaceDetectorFrameProcessorPlugin(proxy: VisionCameraProxy, options: Map<String, Any>?) : FrameProcessorPlugin() {
31
+
32
+ companion object {
33
+ private const val TAG = "FaceDetectorPlugin"
34
+ }
35
+
36
+ private var faceDetector: FaceDetector? = null
37
+ private var currentConfig: DetectorConfig? = null
38
+
39
+ init {
40
+ Log.d(TAG, "FaceDetectorFrameProcessorPlugin initialized")
41
+ updateDetectorOptions(options ?: emptyMap())
42
+ }
43
+
44
+ private fun updateDetectorOptions(options: Map<String, Any>) {
45
+ val performanceMode = options["performanceMode"] as? String ?: "fast"
46
+ val landmarkMode = options["landmarkMode"] as? String ?: "none"
47
+ val contourMode = options["contourMode"] as? String ?: "none"
48
+ val classificationMode = options["classificationMode"] as? String ?: "none"
49
+ val minFaceSize = (options["minFaceSize"] as? Number)?.toFloat() ?: 0.15f
50
+ val trackingEnabled = options["trackingEnabled"] as? Boolean ?: false
51
+ val autoMode = options["autoMode"] as? Boolean ?: false
52
+ val windowWidth = (options["windowWidth"] as? Number)?.toFloat() ?: 1.0f
53
+ val windowHeight = (options["windowHeight"] as? Number)?.toFloat() ?: 1.0f
54
+ val cameraFacing = options["cameraFacing"] as? String ?: "front"
55
+
56
+ val newConfig = DetectorConfig(
57
+ performanceMode = performanceMode,
58
+ landmarkMode = landmarkMode,
59
+ contourMode = contourMode,
60
+ classificationMode = classificationMode,
61
+ minFaceSize = minFaceSize,
62
+ trackingEnabled = trackingEnabled,
63
+ autoMode = autoMode,
64
+ windowWidth = windowWidth,
65
+ windowHeight = windowHeight,
66
+ cameraFacing = cameraFacing
67
+ )
68
+
69
+ // Only recreate detector if core options changed
70
+ if (currentConfig != null &&
71
+ currentConfig!!.performanceMode == newConfig.performanceMode &&
72
+ currentConfig!!.landmarkMode == newConfig.landmarkMode &&
73
+ currentConfig!!.contourMode == newConfig.contourMode &&
74
+ currentConfig!!.classificationMode == newConfig.classificationMode &&
75
+ currentConfig!!.minFaceSize == newConfig.minFaceSize &&
76
+ currentConfig!!.trackingEnabled == newConfig.trackingEnabled) {
77
+ // Only update non-detector options
78
+ currentConfig = newConfig
79
+ return
80
+ }
81
+
82
+ val optionsBuilder = FaceDetectorOptions.Builder()
83
+
84
+ when (performanceMode) {
85
+ "accurate" -> optionsBuilder.setPerformanceMode(FaceDetectorOptions.PERFORMANCE_MODE_ACCURATE)
86
+ else -> optionsBuilder.setPerformanceMode(FaceDetectorOptions.PERFORMANCE_MODE_FAST)
87
+ }
88
+
89
+ when (landmarkMode) {
90
+ "all" -> optionsBuilder.setLandmarkMode(FaceDetectorOptions.LANDMARK_MODE_ALL)
91
+ else -> optionsBuilder.setLandmarkMode(FaceDetectorOptions.LANDMARK_MODE_NONE)
92
+ }
93
+
94
+ when (contourMode) {
95
+ "all" -> optionsBuilder.setContourMode(FaceDetectorOptions.CONTOUR_MODE_ALL)
96
+ else -> optionsBuilder.setContourMode(FaceDetectorOptions.CONTOUR_MODE_NONE)
97
+ }
98
+
99
+ when (classificationMode) {
100
+ "all" -> optionsBuilder.setClassificationMode(FaceDetectorOptions.CLASSIFICATION_MODE_ALL)
101
+ else -> optionsBuilder.setClassificationMode(FaceDetectorOptions.CLASSIFICATION_MODE_NONE)
102
+ }
103
+
104
+ optionsBuilder.setMinFaceSize(minFaceSize)
105
+
106
+ if (trackingEnabled) {
107
+ optionsBuilder.enableTracking()
108
+ }
109
+
110
+ faceDetector?.close()
111
+ faceDetector = FaceDetection.getClient(optionsBuilder.build())
112
+ currentConfig = newConfig
113
+ Log.d(TAG, "Face detector updated with new options")
114
+ }
115
+
116
+ override fun callback(frame: Frame, arguments: Map<String, Any>?): Any {
117
+ if (arguments != null && arguments.isNotEmpty()) {
118
+ updateDetectorOptions(arguments)
119
+ }
120
+
121
+ val detector = faceDetector ?: run {
122
+ Log.e(TAG, "Face detector not initialized")
123
+ return emptyList<Map<String, Any>>()
124
+ }
125
+
126
+ val config = currentConfig ?: return emptyList<Map<String, Any>>()
127
+
128
+ try {
129
+ val mediaImage = frame.image
130
+ val inputImage = InputImage.fromMediaImage(
131
+ mediaImage,
132
+ frame.orientation.toDegrees()
133
+ )
134
+
135
+ val faces = Tasks.await(detector.process(inputImage))
136
+
137
+ return faces.map { face ->
138
+ faceToMap(
139
+ face,
140
+ frame.width,
141
+ frame.height,
142
+ config.autoMode,
143
+ config.windowWidth,
144
+ config.windowHeight,
145
+ config.cameraFacing
146
+ )
147
+ }
148
+ } catch (e: Exception) {
149
+ Log.e(TAG, "Face detection error: ${e.message}")
150
+ return emptyList<Map<String, Any>>()
151
+ }
152
+ }
153
+
154
+ private fun faceToMap(
155
+ face: Face,
156
+ frameWidth: Int,
157
+ frameHeight: Int,
158
+ autoMode: Boolean,
159
+ windowWidth: Float,
160
+ windowHeight: Float,
161
+ cameraFacing: String
162
+ ): Map<String, Any> {
163
+ val result = mutableMapOf<String, Any>()
164
+
165
+ // Calculate scale factors for autoMode
166
+ val scaleX = if (autoMode) windowWidth / frameWidth else 1.0f / frameWidth
167
+ val scaleY = if (autoMode) windowHeight / frameHeight else 1.0f / frameHeight
168
+ val mirrorX = autoMode && cameraFacing == "front"
169
+
170
+ // Bounding box
171
+ val bounds = face.boundingBox
172
+ val x = if (mirrorX) {
173
+ windowWidth - (bounds.right * scaleX)
174
+ } else {
175
+ bounds.left * scaleX
176
+ }
177
+
178
+ result["bounds"] = mapOf(
179
+ "x" to x.toDouble(),
180
+ "y" to (bounds.top * scaleY).toDouble(),
181
+ "width" to (bounds.width() * scaleX).toDouble(),
182
+ "height" to (bounds.height() * scaleY).toDouble()
183
+ )
184
+
185
+ // Roll, pitch, yaw angles
186
+ result["rollAngle"] = face.headEulerAngleZ.toDouble()
187
+ result["pitchAngle"] = face.headEulerAngleX.toDouble()
188
+ result["yawAngle"] = face.headEulerAngleY.toDouble()
189
+
190
+ // Classification probabilities
191
+ face.smilingProbability?.let { result["smilingProbability"] = it.toDouble() }
192
+ face.leftEyeOpenProbability?.let { result["leftEyeOpenProbability"] = it.toDouble() }
193
+ face.rightEyeOpenProbability?.let { result["rightEyeOpenProbability"] = it.toDouble() }
194
+
195
+ // Tracking ID
196
+ face.trackingId?.let { result["trackingId"] = it }
197
+
198
+ // Landmarks
199
+ val landmarks = mutableMapOf<String, Any>()
200
+
201
+ face.getLandmark(FaceLandmark.LEFT_EYE)?.let {
202
+ landmarks["leftEye"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
203
+ }
204
+ face.getLandmark(FaceLandmark.RIGHT_EYE)?.let {
205
+ landmarks["rightEye"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
206
+ }
207
+ face.getLandmark(FaceLandmark.NOSE_BASE)?.let {
208
+ landmarks["noseBase"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
209
+ }
210
+ face.getLandmark(FaceLandmark.LEFT_CHEEK)?.let {
211
+ landmarks["leftCheek"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
212
+ }
213
+ face.getLandmark(FaceLandmark.RIGHT_CHEEK)?.let {
214
+ landmarks["rightCheek"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
215
+ }
216
+ face.getLandmark(FaceLandmark.MOUTH_LEFT)?.let {
217
+ landmarks["mouthLeft"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
218
+ }
219
+ face.getLandmark(FaceLandmark.MOUTH_RIGHT)?.let {
220
+ landmarks["mouthRight"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
221
+ }
222
+ face.getLandmark(FaceLandmark.MOUTH_BOTTOM)?.let {
223
+ landmarks["mouthBottom"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
224
+ }
225
+ face.getLandmark(FaceLandmark.LEFT_EAR)?.let {
226
+ landmarks["leftEar"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
227
+ }
228
+ face.getLandmark(FaceLandmark.RIGHT_EAR)?.let {
229
+ landmarks["rightEar"] = pointToMap(it.position.x, it.position.y, scaleX, scaleY, mirrorX, windowWidth)
230
+ }
231
+
232
+ if (landmarks.isNotEmpty()) {
233
+ result["landmarks"] = landmarks
234
+ }
235
+
236
+ // All contours (like reference package)
237
+ val contours = mutableMapOf<String, Any>()
238
+
239
+ face.getContour(FaceContour.FACE)?.let { contour ->
240
+ contours["face"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
241
+ }
242
+ face.getContour(FaceContour.LEFT_EYEBROW_TOP)?.let { contour ->
243
+ contours["leftEyebrowTop"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
244
+ }
245
+ face.getContour(FaceContour.LEFT_EYEBROW_BOTTOM)?.let { contour ->
246
+ contours["leftEyebrowBottom"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
247
+ }
248
+ face.getContour(FaceContour.RIGHT_EYEBROW_TOP)?.let { contour ->
249
+ contours["rightEyebrowTop"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
250
+ }
251
+ face.getContour(FaceContour.RIGHT_EYEBROW_BOTTOM)?.let { contour ->
252
+ contours["rightEyebrowBottom"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
253
+ }
254
+ face.getContour(FaceContour.LEFT_EYE)?.let { contour ->
255
+ contours["leftEye"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
256
+ }
257
+ face.getContour(FaceContour.RIGHT_EYE)?.let { contour ->
258
+ contours["rightEye"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
259
+ }
260
+ face.getContour(FaceContour.UPPER_LIP_TOP)?.let { contour ->
261
+ contours["upperLipTop"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
262
+ }
263
+ face.getContour(FaceContour.UPPER_LIP_BOTTOM)?.let { contour ->
264
+ contours["upperLipBottom"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
265
+ }
266
+ face.getContour(FaceContour.LOWER_LIP_TOP)?.let { contour ->
267
+ contours["lowerLipTop"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
268
+ }
269
+ face.getContour(FaceContour.LOWER_LIP_BOTTOM)?.let { contour ->
270
+ contours["lowerLipBottom"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
271
+ }
272
+ face.getContour(FaceContour.NOSE_BRIDGE)?.let { contour ->
273
+ contours["noseBridge"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
274
+ }
275
+ face.getContour(FaceContour.NOSE_BOTTOM)?.let { contour ->
276
+ contours["noseBottom"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
277
+ }
278
+ face.getContour(FaceContour.LEFT_CHEEK)?.let { contour ->
279
+ contours["leftCheek"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
280
+ }
281
+ face.getContour(FaceContour.RIGHT_CHEEK)?.let { contour ->
282
+ contours["rightCheek"] = contour.points.map { p -> pointToMap(p.x, p.y, scaleX, scaleY, mirrorX, windowWidth) }
283
+ }
284
+
285
+ if (contours.isNotEmpty()) {
286
+ result["contours"] = contours
287
+ }
288
+
289
+ return result
290
+ }
291
+
292
+ private fun pointToMap(
293
+ x: Float,
294
+ y: Float,
295
+ scaleX: Float,
296
+ scaleY: Float,
297
+ mirrorX: Boolean,
298
+ windowWidth: Float
299
+ ): Map<String, Double> {
300
+ val scaledX = if (mirrorX) {
301
+ windowWidth - (x * scaleX)
302
+ } else {
303
+ x * scaleX
304
+ }
305
+ return mapOf(
306
+ "x" to scaledX.toDouble(),
307
+ "y" to (y * scaleY).toDouble()
308
+ )
309
+ }
310
+
311
+ private fun com.mrousavy.camera.core.types.Orientation.toDegrees(): Int {
312
+ return when (this) {
313
+ com.mrousavy.camera.core.types.Orientation.PORTRAIT -> 0
314
+ com.mrousavy.camera.core.types.Orientation.LANDSCAPE_LEFT -> 90
315
+ com.mrousavy.camera.core.types.Orientation.PORTRAIT_UPSIDE_DOWN -> 180
316
+ com.mrousavy.camera.core.types.Orientation.LANDSCAPE_RIGHT -> 270
317
+ }
318
+ }
319
+
320
+ protected fun finalize() {
321
+ faceDetector?.close()
322
+ }
323
+ }
324
+
@@ -0,0 +1,28 @@
1
+ package com.smartcamera
2
+
3
+ import com.facebook.react.ReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.uimanager.ViewManager
7
+ import com.mrousavy.camera.frameprocessors.FrameProcessorPluginRegistry
8
+
9
+ class SmartCameraPackage : ReactPackage {
10
+
11
+ companion object {
12
+ init {
13
+ // Register the frame processor plugin with VisionCamera
14
+ FrameProcessorPluginRegistry.addFrameProcessorPlugin("detectFaces") { proxy, options ->
15
+ FaceDetectorFrameProcessorPlugin(proxy, options)
16
+ }
17
+ }
18
+ }
19
+
20
+ override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
21
+ return emptyList()
22
+ }
23
+
24
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
25
+ return emptyList()
26
+ }
27
+ }
28
+
@@ -18,6 +18,7 @@ const blinkStates = new Map();
18
18
  */
19
19
  export function processBlinkFromFaces(faces, lastBlinkTimestamp, debounceMs = 300) {
20
20
  'worklet';
21
+ var _a;
21
22
  if (faces.length === 0) {
22
23
  return null;
23
24
  }
@@ -32,7 +33,7 @@ export function processBlinkFromFaces(faces, lastBlinkTimestamp, debounceMs = 30
32
33
  const rightEyeOpen = face.rightEyeOpenProbability;
33
34
  const now = Date.now();
34
35
  // Get or create blink state for this face
35
- const faceId = face.trackingId ?? 0;
36
+ const faceId = (_a = face.trackingId) !== null && _a !== void 0 ? _a : 0;
36
37
  let state = blinkStates.get(faceId);
37
38
  if (!state) {
38
39
  state = {
@@ -1 +1 @@
1
- {"version":3,"file":"blinkProcessor.js","sourceRoot":"","sources":["../../src/detection/blinkProcessor.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC;;GAEG;AACH,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAU/B,0CAA0C;AAC1C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAsB,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAa,EACb,kBAA0B,EAC1B,aAAqB,GAAG;IAExB,SAAS,CAAC;IAEV,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sCAAsC;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtB,yCAAyC;IACzC,IACE,IAAI,CAAC,sBAAsB,KAAK,SAAS;QACzC,IAAI,CAAC,uBAAuB,KAAK,SAAS,EAC1C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC;IAChD,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvB,0CAA0C;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;IACpC,IAAI,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG;YACN,aAAa,EAAE,KAAK;YACpB,kBAAkB,EAAE,CAAC;SACtB,CAAC;QACF,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,qCAAqC;IACrC,MAAM,UAAU,GAAG,WAAW,GAAG,oBAAoB,IAAI,YAAY,GAAG,oBAAoB,CAAC;IAE7F,mCAAmC;IACnC,MAAM,QAAQ,GAAG,WAAW,GAAG,kBAAkB,IAAI,YAAY,GAAG,kBAAkB,CAAC;IAEvF,+CAA+C;IAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,IAAI,QAAQ,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC;IAEjG,eAAe;IACf,IAAI,UAAU,EAAE,CAAC;QACf,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IAC7B,CAAC;SAAM,IAAI,QAAQ,EAAE,CAAC;QACpB,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,KAAK,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE/B,OAAO;YACL,SAAS,EAAE,GAAG;YACd,WAAW;YACX,YAAY;YACZ,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,IAAI,CAAC,UAAU;SACxB,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,WAAW,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU;IACpC,SAAS,CAAC;IAEV,IACE,IAAI,CAAC,sBAAsB,KAAK,SAAS;QACzC,IAAI,CAAC,uBAAuB,KAAK,SAAS,EAC1C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,sBAAsB;QACrC,SAAS,EAAE,IAAI,CAAC,uBAAuB;KACxC,CAAC;AACJ,CAAC","sourcesContent":["import type { Face, BlinkEvent } from '../types';\n\n/**\n * Threshold for considering an eye as closed\n */\nconst EYE_CLOSED_THRESHOLD = 0.4;\n\n/**\n * Threshold for considering an eye as open\n */\nconst EYE_OPEN_THRESHOLD = 0.6;\n\n/**\n * State for tracking blink across frames\n */\ninterface BlinkState {\n wasEyesClosed: boolean;\n lastBlinkTimestamp: number;\n}\n\n// Global blink state per face tracking ID\nconst blinkStates = new Map<number, BlinkState>();\n\n/**\n * Process faces to detect blinks\n * \n * @param faces - Array of detected faces\n * @param lastBlinkTimestamp - Timestamp of the last detected blink\n * @param debounceMs - Minimum time between blinks in milliseconds\n * @returns BlinkEvent if a blink was detected, null otherwise\n */\nexport function processBlinkFromFaces(\n faces: Face[],\n lastBlinkTimestamp: number,\n debounceMs: number = 300\n): BlinkEvent | null {\n 'worklet';\n\n if (faces.length === 0) {\n return null;\n }\n\n // Use the first face (most prominent)\n const face = faces[0];\n\n // Ensure we have eye classification data\n if (\n face.leftEyeOpenProbability === undefined ||\n face.rightEyeOpenProbability === undefined\n ) {\n return null;\n }\n\n const leftEyeOpen = face.leftEyeOpenProbability;\n const rightEyeOpen = face.rightEyeOpenProbability;\n const now = Date.now();\n\n // Get or create blink state for this face\n const faceId = face.trackingId ?? 0;\n let state = blinkStates.get(faceId);\n\n if (!state) {\n state = {\n wasEyesClosed: false,\n lastBlinkTimestamp: 0,\n };\n blinkStates.set(faceId, state);\n }\n\n // Check if eyes are currently closed\n const eyesClosed = leftEyeOpen < EYE_CLOSED_THRESHOLD && rightEyeOpen < EYE_CLOSED_THRESHOLD;\n\n // Check if eyes are currently open\n const eyesOpen = leftEyeOpen > EYE_OPEN_THRESHOLD && rightEyeOpen > EYE_OPEN_THRESHOLD;\n\n // Detect blink: transition from closed to open\n const isBlink = state.wasEyesClosed && eyesOpen && (now - state.lastBlinkTimestamp) > debounceMs;\n\n // Update state\n if (eyesClosed) {\n state.wasEyesClosed = true;\n } else if (eyesOpen) {\n state.wasEyesClosed = false;\n }\n\n if (isBlink) {\n state.lastBlinkTimestamp = now;\n\n return {\n timestamp: now,\n leftEyeOpen,\n rightEyeOpen,\n isBlink: true,\n faceId: face.trackingId,\n };\n }\n\n return null;\n}\n\n/**\n * Reset blink state for all faces\n */\nexport function resetBlinkStates(): void {\n blinkStates.clear();\n}\n\n/**\n * Get current eye state without blink detection\n * Useful for real-time eye tracking UI\n */\nexport function getEyeState(face: Face): { leftOpen: number; rightOpen: number } | null {\n 'worklet';\n\n if (\n face.leftEyeOpenProbability === undefined ||\n face.rightEyeOpenProbability === undefined\n ) {\n return null;\n }\n\n return {\n leftOpen: face.leftEyeOpenProbability,\n rightOpen: face.rightEyeOpenProbability,\n };\n}\n\n"]}
1
+ {"version":3,"file":"blinkProcessor.js","sourceRoot":"","sources":["../../src/detection/blinkProcessor.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC;;GAEG;AACH,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAU/B,0CAA0C;AAC1C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAsB,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAa,EACb,kBAA0B,EAC1B,aAAqB,GAAG;IAExB,SAAS,CAAC;;IAEV,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sCAAsC;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtB,yCAAyC;IACzC,IACE,IAAI,CAAC,sBAAsB,KAAK,SAAS;QACzC,IAAI,CAAC,uBAAuB,KAAK,SAAS,EAC1C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC;IAChD,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvB,0CAA0C;IAC1C,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,UAAU,mCAAI,CAAC,CAAC;IACpC,IAAI,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG;YACN,aAAa,EAAE,KAAK;YACpB,kBAAkB,EAAE,CAAC;SACtB,CAAC;QACF,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,qCAAqC;IACrC,MAAM,UAAU,GAAG,WAAW,GAAG,oBAAoB,IAAI,YAAY,GAAG,oBAAoB,CAAC;IAE7F,mCAAmC;IACnC,MAAM,QAAQ,GAAG,WAAW,GAAG,kBAAkB,IAAI,YAAY,GAAG,kBAAkB,CAAC;IAEvF,+CAA+C;IAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,IAAI,QAAQ,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC;IAEjG,eAAe;IACf,IAAI,UAAU,EAAE,CAAC;QACf,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IAC7B,CAAC;SAAM,IAAI,QAAQ,EAAE,CAAC;QACpB,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,KAAK,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAE/B,OAAO;YACL,SAAS,EAAE,GAAG;YACd,WAAW;YACX,YAAY;YACZ,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,IAAI,CAAC,UAAU;SACxB,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,WAAW,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU;IACpC,SAAS,CAAC;IAEV,IACE,IAAI,CAAC,sBAAsB,KAAK,SAAS;QACzC,IAAI,CAAC,uBAAuB,KAAK,SAAS,EAC1C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,sBAAsB;QACrC,SAAS,EAAE,IAAI,CAAC,uBAAuB;KACxC,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Frame } from 'react-native-vision-camera';
1
+ import { type Frame } from 'react-native-vision-camera';
2
2
  import type { Face, FrameProcessorOptions } from '../types';
3
3
  /**
4
4
  * Detect faces in a camera frame
@@ -9,8 +9,8 @@ import type { Face, FrameProcessorOptions } from '../types';
9
9
  */
10
10
  export declare function detectFaces(frame: Frame, options?: Partial<FrameProcessorOptions>): Face[];
11
11
  /**
12
- * Register the face detection frame processor plugin
13
- * This is called during module initialization
12
+ * Check if the face detector plugin is available
13
+ * @returns true if the plugin is registered and available
14
14
  */
15
- export declare function registerFaceDetectorPlugin(): void;
15
+ export declare function isFaceDetectorAvailable(): boolean;
16
16
  //# sourceMappingURL=faceDetector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"faceDetector.d.ts","sourceRoot":"","sources":["../../src/detection/faceDetector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAwB5D;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,EAAE,CAc1F;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAIjD"}
1
+ {"version":3,"file":"faceDetector.d.ts","sourceRoot":"","sources":["../../src/detection/faceDetector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAwB5D;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,EAAE,CAmC1F;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD"}
@@ -1,3 +1,9 @@
1
+ import { VisionCameraProxy } from 'react-native-vision-camera';
2
+ /**
3
+ * Initialize the face detector frame processor plugin
4
+ * This registers the native plugin with VisionCamera
5
+ */
6
+ const plugin = VisionCameraProxy.initFrameProcessorPlugin('detectFaces', {});
1
7
  /**
2
8
  * Default face detection options
3
9
  */
@@ -22,12 +28,28 @@ const DEFAULT_OPTIONS = {
22
28
  */
23
29
  export function detectFaces(frame, options) {
24
30
  'worklet';
25
- const mergedOptions = {
26
- ...DEFAULT_OPTIONS,
27
- ...options,
28
- };
31
+ if (plugin == null) {
32
+ // Plugin not available - return empty array
33
+ // This can happen if the native module is not properly linked
34
+ return [];
35
+ }
36
+ const mergedOptions = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options);
29
37
  try {
30
- return __detectFaces(frame, mergedOptions);
38
+ // Convert options to a format compatible with VisionCamera plugin API
39
+ const pluginOptions = {
40
+ performanceMode: mergedOptions.performanceMode,
41
+ landmarkMode: mergedOptions.landmarkMode,
42
+ contourMode: mergedOptions.contourMode,
43
+ classificationMode: mergedOptions.classificationMode,
44
+ minFaceSize: mergedOptions.minFaceSize,
45
+ trackingEnabled: mergedOptions.trackingEnabled,
46
+ cameraFacing: mergedOptions.cameraFacing,
47
+ autoMode: mergedOptions.autoMode,
48
+ windowWidth: mergedOptions.windowWidth,
49
+ windowHeight: mergedOptions.windowHeight,
50
+ };
51
+ const result = plugin.call(frame, pluginOptions);
52
+ return result !== null && result !== void 0 ? result : [];
31
53
  }
32
54
  catch (error) {
33
55
  // Return empty array on error in worklet context
@@ -35,12 +57,10 @@ export function detectFaces(frame, options) {
35
57
  }
36
58
  }
37
59
  /**
38
- * Register the face detection frame processor plugin
39
- * This is called during module initialization
60
+ * Check if the face detector plugin is available
61
+ * @returns true if the plugin is registered and available
40
62
  */
41
- export function registerFaceDetectorPlugin() {
42
- // The native plugin registration happens automatically
43
- // through the Expo module system
44
- console.log('[SmartCamera] Face detector plugin registered');
63
+ export function isFaceDetectorAvailable() {
64
+ return plugin != null;
45
65
  }
46
66
  //# sourceMappingURL=faceDetector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"faceDetector.js","sourceRoot":"","sources":["../../src/detection/faceDetector.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,eAAe,GAA0B;IAC7C,eAAe,EAAE,MAAM;IACvB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,MAAM;IACnB,kBAAkB,EAAE,MAAM;IAC1B,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,KAAK;IACtB,YAAY,EAAE,OAAO;IACrB,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,GAAG;IAChB,YAAY,EAAE,GAAG;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY,EAAE,OAAwC;IAChF,SAAS,CAAC;IAEV,MAAM,aAAa,GAA0B;QAC3C,GAAG,eAAe;QAClB,GAAG,OAAO;KACX,CAAC;IAEF,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iDAAiD;QACjD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACxC,uDAAuD;IACvD,iCAAiC;IACjC,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import type { Frame } from 'react-native-vision-camera';\nimport type { Face, FrameProcessorOptions } from '../types';\n\n/**\n * Native face detection function placeholder\n * This will be implemented as a VisionCamera frame processor plugin\n */\ndeclare function __detectFaces(frame: Frame, options: FrameProcessorOptions): Face[];\n\n/**\n * Default face detection options\n */\nconst DEFAULT_OPTIONS: FrameProcessorOptions = {\n performanceMode: 'fast',\n landmarkMode: 'none',\n contourMode: 'none',\n classificationMode: 'none',\n minFaceSize: 0.15,\n trackingEnabled: false,\n cameraFacing: 'front',\n autoMode: false,\n windowWidth: 1.0,\n windowHeight: 1.0,\n};\n\n/**\n * Detect faces in a camera frame\n * \n * @param frame - The camera frame from VisionCamera\n * @param options - Face detection options\n * @returns Array of detected faces\n */\nexport function detectFaces(frame: Frame, options?: Partial<FrameProcessorOptions>): Face[] {\n 'worklet';\n\n const mergedOptions: FrameProcessorOptions = {\n ...DEFAULT_OPTIONS,\n ...options,\n };\n\n try {\n return __detectFaces(frame, mergedOptions);\n } catch (error) {\n // Return empty array on error in worklet context\n return [];\n }\n}\n\n/**\n * Register the face detection frame processor plugin\n * This is called during module initialization\n */\nexport function registerFaceDetectorPlugin(): void {\n // The native plugin registration happens automatically\n // through the Expo module system\n console.log('[SmartCamera] Face detector plugin registered');\n}\n\n"]}
1
+ {"version":3,"file":"faceDetector.js","sourceRoot":"","sources":["../../src/detection/faceDetector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAc,MAAM,4BAA4B,CAAC;AAG3E;;;GAGG;AACH,MAAM,MAAM,GAAG,iBAAiB,CAAC,wBAAwB,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,eAAe,GAA0B;IAC7C,eAAe,EAAE,MAAM;IACvB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,MAAM;IACnB,kBAAkB,EAAE,MAAM;IAC1B,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,KAAK;IACtB,YAAY,EAAE,OAAO;IACrB,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,GAAG;IAChB,YAAY,EAAE,GAAG;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY,EAAE,OAAwC;IAChF,SAAS,CAAC;IAEV,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,4CAA4C;QAC5C,8DAA8D;QAC9D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,aAAa,mCACd,eAAe,GACf,OAAO,CACX,CAAC;IAEF,IAAI,CAAC;QACH,sEAAsE;QACtE,MAAM,aAAa,GAA0D;YAC3E,eAAe,EAAE,aAAa,CAAC,eAAe;YAC9C,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,kBAAkB,EAAE,aAAa,CAAC,kBAAkB;YACpD,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,eAAe,EAAE,aAAa,CAAC,eAAe;YAC9C,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,QAAQ,EAAE,aAAa,CAAC,QAAQ;YAChC,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,YAAY,EAAE,aAAa,CAAC,YAAY;SACzC,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAA8B,CAAC;QAC9E,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iDAAiD;QACjD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,IAAI,IAAI,CAAC;AACxB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { detectFaces, registerFaceDetectorPlugin } from './faceDetector';
1
+ export { detectFaces, isFaceDetectorAvailable } from './faceDetector';
2
2
  export { processBlinkFromFaces, resetBlinkStates, getEyeState } from './blinkProcessor';
3
3
  export { detectFacesInImage } from './staticImageDetector';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { detectFaces, registerFaceDetectorPlugin } from './faceDetector';
1
+ export { detectFaces, isFaceDetectorAvailable } from './faceDetector';
2
2
  export { processBlinkFromFaces, resetBlinkStates, getEyeState } from './blinkProcessor';
3
3
  export { detectFacesInImage } from './staticImageDetector';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { detectFaces, registerFaceDetectorPlugin } from './faceDetector';\nexport { processBlinkFromFaces, resetBlinkStates, getEyeState } from './blinkProcessor';\nexport { detectFacesInImage } from './staticImageDetector';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -2,23 +2,23 @@ import type { Face, StaticImageOptions } from '../types';
2
2
  /**
3
3
  * Detect faces in a static image
4
4
  *
5
+ * NOTE: Static image detection is currently not supported in the frame processor-only version.
6
+ * This feature requires native module implementation.
7
+ * For real-time face detection, use the `detectFaces` function with VisionCamera frame processor.
8
+ *
5
9
  * @param options - Image source and detection options
6
10
  * @returns Promise resolving to array of detected faces
7
11
  *
8
12
  * @example
9
13
  * ```tsx
10
- * // Using require
11
- * const faces = await detectFacesInImage({
12
- * image: require('./photo.jpg'),
13
- * performanceMode: 'accurate',
14
- * landmarkMode: 'all',
15
- * });
14
+ * // This feature is not yet implemented
15
+ * // For real-time detection, use:
16
+ * import { detectFaces } from '@arfuhad/react-native-smart-camera';
16
17
  *
17
- * // Using URI
18
- * const faces = await detectFacesInImage({
19
- * image: { uri: 'https://example.com/photo.jpg' },
20
- * classificationMode: 'all',
21
- * });
18
+ * const frameProcessor = useFrameProcessor((frame) => {
19
+ * 'worklet';
20
+ * const faces = detectFaces(frame);
21
+ * }, []);
22
22
  * ```
23
23
  */
24
24
  export declare function detectFacesInImage(options: StaticImageOptions): Promise<Face[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"staticImageDetector.d.ts","sourceRoot":"","sources":["../../src/detection/staticImageDetector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAczD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAYrF"}
1
+ {"version":3,"file":"staticImageDetector.d.ts","sourceRoot":"","sources":["../../src/detection/staticImageDetector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAczD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAgBrF"}