@capgo/camera-preview 7.3.9 → 7.4.0-beta.2

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 (56) hide show
  1. package/CapgoCameraPreview.podspec +16 -13
  2. package/README.md +306 -70
  3. package/android/.gradle/8.14.2/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.14.2/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/8.14.2/executionHistory/executionHistory.bin +0 -0
  6. package/android/.gradle/8.14.2/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/8.14.2/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.14.2/fileHashes/fileHashes.bin +0 -0
  9. package/android/.gradle/8.14.2/fileHashes/fileHashes.lock +0 -0
  10. package/android/.gradle/8.14.2/fileHashes/resourceHashesCache.bin +0 -0
  11. package/android/.gradle/8.14.2/gc.properties +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  14. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  15. package/android/.gradle/file-system.probe +0 -0
  16. package/android/.gradle/vcs-1/gc.properties +0 -0
  17. package/android/build.gradle +9 -0
  18. package/android/src/main/AndroidManifest.xml +5 -0
  19. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +260 -551
  20. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraXView.java +968 -0
  21. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraDevice.java +54 -0
  22. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraLens.java +70 -0
  23. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraSessionConfiguration.java +65 -0
  24. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/LensInfo.java +34 -0
  25. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/ZoomFactors.java +34 -0
  26. package/dist/docs.json +729 -153
  27. package/dist/esm/definitions.d.ts +337 -80
  28. package/dist/esm/definitions.js +10 -1
  29. package/dist/esm/definitions.js.map +1 -1
  30. package/dist/esm/web.d.ts +27 -1
  31. package/dist/esm/web.js +248 -4
  32. package/dist/esm/web.js.map +1 -1
  33. package/dist/plugin.cjs.js +256 -4
  34. package/dist/plugin.cjs.js.map +1 -1
  35. package/dist/plugin.js +256 -4
  36. package/dist/plugin.js.map +1 -1
  37. package/ios/{Plugin → Sources/CapgoCameraPreview}/CameraController.swift +359 -34
  38. package/ios/{Plugin → Sources/CapgoCameraPreview}/Plugin.swift +348 -42
  39. package/ios/Tests/CameraPreviewPluginTests/CameraPreviewPluginTests.swift +15 -0
  40. package/package.json +1 -1
  41. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +0 -1279
  42. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomSurfaceView.java +0 -29
  43. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomTextureView.java +0 -39
  44. package/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java +0 -461
  45. package/android/src/main/java/com/ahm/capacitor/camera/preview/TapGestureDetector.java +0 -24
  46. package/ios/Plugin/Info.plist +0 -24
  47. package/ios/Plugin/Plugin.h +0 -10
  48. package/ios/Plugin/Plugin.m +0 -18
  49. package/ios/Plugin.xcodeproj/project.pbxproj +0 -593
  50. package/ios/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  51. package/ios/Plugin.xcworkspace/contents.xcworkspacedata +0 -10
  52. package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  53. package/ios/PluginTests/Info.plist +0 -22
  54. package/ios/PluginTests/PluginTests.swift +0 -83
  55. package/ios/Podfile +0 -13
  56. package/ios/Podfile.lock +0 -23
@@ -0,0 +1,54 @@
1
+ package com.ahm.capacitor.camera.preview.model;
2
+
3
+ import java.util.List;
4
+
5
+ /**
6
+ * Represents a camera device available on the Android device.
7
+ */
8
+ public class CameraDevice {
9
+ private final String deviceId;
10
+ private final String label;
11
+ private final String position;
12
+ private final List<LensInfo> lenses;
13
+ private final float minZoom;
14
+ private final float maxZoom;
15
+ private final boolean isLogical;
16
+
17
+ public CameraDevice(String deviceId, String label, String position, List<LensInfo> lenses, float minZoom, float maxZoom, boolean isLogical) {
18
+ this.deviceId = deviceId;
19
+ this.label = label;
20
+ this.position = position;
21
+ this.lenses = lenses;
22
+ this.minZoom = minZoom;
23
+ this.maxZoom = maxZoom;
24
+ this.isLogical = isLogical;
25
+ }
26
+
27
+ public String getDeviceId() {
28
+ return deviceId;
29
+ }
30
+
31
+ public String getLabel() {
32
+ return label;
33
+ }
34
+
35
+ public String getPosition() {
36
+ return position;
37
+ }
38
+
39
+ public List<LensInfo> getLenses() {
40
+ return lenses;
41
+ }
42
+
43
+ public float getMinZoom() {
44
+ return minZoom;
45
+ }
46
+
47
+ public float getMaxZoom() {
48
+ return maxZoom;
49
+ }
50
+
51
+ public boolean isLogical() {
52
+ return isLogical;
53
+ }
54
+ }
@@ -0,0 +1,70 @@
1
+ package com.ahm.capacitor.camera.preview.model;
2
+
3
+ /**
4
+ * Represents a camera lens available on the Android device.
5
+ */
6
+ public class CameraLens {
7
+ private final String id;
8
+ private final String label;
9
+ private final String position;
10
+ private final String deviceType;
11
+ private final float focalLength;
12
+ private final float minZoom;
13
+ private final float maxZoom;
14
+ private final float baseZoomRatio;
15
+ public boolean isActive;
16
+
17
+ public CameraLens(String id, String label, String position, String deviceType,
18
+ float focalLength, float minZoom, float maxZoom,
19
+ float baseZoomRatio, boolean isActive) {
20
+ this.id = id;
21
+ this.label = label;
22
+ this.position = position;
23
+ this.deviceType = deviceType;
24
+ this.focalLength = Math.round(focalLength * 100.0f) / 100.0f;
25
+ this.minZoom = minZoom;
26
+ this.maxZoom = maxZoom;
27
+ this.baseZoomRatio = Math.round(baseZoomRatio);
28
+ this.isActive = isActive;
29
+ }
30
+
31
+ public String getId() {
32
+ return id;
33
+ }
34
+
35
+ public String getLabel() {
36
+ return label;
37
+ }
38
+
39
+ public String getPosition() {
40
+ return position;
41
+ }
42
+
43
+ public String getDeviceType() {
44
+ return deviceType;
45
+ }
46
+
47
+ public float getFocalLength() {
48
+ return focalLength;
49
+ }
50
+
51
+ public float getMinZoom() {
52
+ return minZoom;
53
+ }
54
+
55
+ public float getMaxZoom() {
56
+ return maxZoom;
57
+ }
58
+
59
+ public float getBaseZoomRatio() {
60
+ return baseZoomRatio;
61
+ }
62
+
63
+ public boolean isActive() {
64
+ return isActive;
65
+ }
66
+
67
+ public void setIsActive(boolean isActive) {
68
+ this.isActive = isActive;
69
+ }
70
+ }
@@ -0,0 +1,65 @@
1
+ package com.ahm.capacitor.camera.preview.model;
2
+
3
+ /**
4
+ * Configuration for a camera session.
5
+ */
6
+ public class CameraSessionConfiguration {
7
+ private final String deviceId;
8
+ private final String position;
9
+ private final int x;
10
+ private final int y;
11
+ private final int width;
12
+ private final int height;
13
+ private final int paddingBottom;
14
+ private final boolean toBack;
15
+ private final boolean storeToFile;
16
+ private final boolean enableOpacity;
17
+ private final boolean enableZoom;
18
+ private final boolean disableExifHeaderStripping;
19
+ private final boolean disableAudio;
20
+ private final float zoomFactor;
21
+ private float targetZoom = 1.0f;
22
+
23
+ public CameraSessionConfiguration(String deviceId, String position, int x, int y, int width, int height,
24
+ int paddingBottom, boolean toBack, boolean storeToFile, boolean enableOpacity,
25
+ boolean enableZoom, boolean disableExifHeaderStripping, boolean disableAudio,
26
+ float zoomFactor) {
27
+ this.deviceId = deviceId;
28
+ this.position = position;
29
+ this.x = x;
30
+ this.y = y;
31
+ this.width = width;
32
+ this.height = height;
33
+ this.paddingBottom = paddingBottom;
34
+ this.toBack = toBack;
35
+ this.storeToFile = storeToFile;
36
+ this.enableOpacity = enableOpacity;
37
+ this.enableZoom = enableZoom;
38
+ this.disableExifHeaderStripping = disableExifHeaderStripping;
39
+ this.disableAudio = disableAudio;
40
+ this.zoomFactor = zoomFactor;
41
+ }
42
+
43
+ public void setTargetZoom(float zoom) {
44
+ this.targetZoom = zoom;
45
+ }
46
+
47
+ public float getTargetZoom() {
48
+ return this.targetZoom;
49
+ }
50
+
51
+ public String getDeviceId() { return deviceId; }
52
+ public String getPosition() { return position; }
53
+ public int getX() { return x; }
54
+ public int getY() { return y; }
55
+ public int getWidth() { return width; }
56
+ public int getHeight() { return height; }
57
+ public int getPaddingBottom() { return paddingBottom; }
58
+ public boolean isToBack() { return toBack; }
59
+ public boolean isStoreToFile() { return storeToFile; }
60
+ public boolean isEnableOpacity() { return enableOpacity; }
61
+ public boolean isEnableZoom() { return enableZoom; }
62
+ public boolean isDisableExifHeaderStripping() { return disableExifHeaderStripping; }
63
+ public boolean isDisableAudio() { return disableAudio; }
64
+ public float getZoomFactor() { return zoomFactor; }
65
+ }
@@ -0,0 +1,34 @@
1
+ package com.ahm.capacitor.camera.preview.model;
2
+
3
+ /**
4
+ * Represents lens information for a camera device.
5
+ */
6
+ public class LensInfo {
7
+ private final float focalLength;
8
+ private final String deviceType;
9
+ private final float baseZoomRatio;
10
+ private final float digitalZoom;
11
+
12
+ public LensInfo(float focalLength, String deviceType, float baseZoomRatio, float digitalZoom) {
13
+ this.focalLength = Math.round(focalLength * 100.0f) / 100.0f;
14
+ this.deviceType = deviceType;
15
+ this.baseZoomRatio = baseZoomRatio;
16
+ this.digitalZoom = digitalZoom;
17
+ }
18
+
19
+ public float getFocalLength() {
20
+ return focalLength;
21
+ }
22
+
23
+ public String getDeviceType() {
24
+ return deviceType;
25
+ }
26
+
27
+ public float getBaseZoomRatio() {
28
+ return baseZoomRatio;
29
+ }
30
+
31
+ public float getDigitalZoom() {
32
+ return digitalZoom;
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ package com.ahm.capacitor.camera.preview.model;
2
+
3
+ /**
4
+ * Represents zoom factor information for a camera with current lens details.
5
+ */
6
+ public class ZoomFactors {
7
+ private final float min;
8
+ private final float max;
9
+ private final float current;
10
+ private final LensInfo lens;
11
+
12
+ public ZoomFactors(float min, float max, float current, LensInfo lens) {
13
+ this.min = min;
14
+ this.max = max;
15
+ this.current = current;
16
+ this.lens = lens;
17
+ }
18
+
19
+ public float getMin() {
20
+ return min;
21
+ }
22
+
23
+ public float getMax() {
24
+ return max;
25
+ }
26
+
27
+ public float getCurrent() {
28
+ return current;
29
+ }
30
+
31
+ public LensInfo getLens() {
32
+ return lens;
33
+ }
34
+ }