@capgo/camera-preview 7.23.10 → 7.23.12
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 +18 -18
- package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +6 -6
- package/android/src/main/java/app/capgo/capacitor/camera/preview/CameraPreview.java +1838 -2291
- package/android/src/main/java/app/capgo/capacitor/camera/preview/CameraXView.java +3153 -3948
- package/android/src/main/java/app/capgo/capacitor/camera/preview/GridOverlayView.java +86 -97
- package/android/src/main/java/app/capgo/capacitor/camera/preview/model/CameraDevice.java +53 -53
- package/android/src/main/java/app/capgo/capacitor/camera/preview/model/CameraSessionConfiguration.java +166 -166
- package/android/src/main/java/app/capgo/capacitor/camera/preview/model/LensInfo.java +22 -27
- package/android/src/main/java/app/capgo/capacitor/camera/preview/model/ZoomFactors.java +22 -22
- package/android/src/test/java/com/getcapacitor/ExampleUnitTest.java +4 -4
- package/dist/docs.json +34 -34
- package/dist/esm/definitions.d.ts +15 -15
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +4 -4
- package/dist/esm/web.js +201 -216
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +201 -216
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +201 -216
- package/dist/plugin.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -442,7 +442,7 @@ Gets the flash modes supported by the active camera.
|
|
|
442
442
|
### setAspectRatio(...)
|
|
443
443
|
|
|
444
444
|
```typescript
|
|
445
|
-
setAspectRatio(options: { aspectRatio:
|
|
445
|
+
setAspectRatio(options: { aspectRatio: '4:3' | '16:9'; x?: number; y?: number; }) => Promise<{ width: number; height: number; x: number; y: number; }>
|
|
446
446
|
```
|
|
447
447
|
|
|
448
448
|
Set the aspect ratio of the camera preview.
|
|
@@ -461,7 +461,7 @@ Set the aspect ratio of the camera preview.
|
|
|
461
461
|
### getAspectRatio()
|
|
462
462
|
|
|
463
463
|
```typescript
|
|
464
|
-
getAspectRatio() => Promise<{ aspectRatio:
|
|
464
|
+
getAspectRatio() => Promise<{ aspectRatio: '4:3' | '16:9'; }>
|
|
465
465
|
```
|
|
466
466
|
|
|
467
467
|
Gets the current aspect ratio of the camera preview.
|
|
@@ -851,7 +851,7 @@ your HTML/JS (e.g., on the overlaying UI), then pass normalized coordinates here
|
|
|
851
851
|
### addListener('screenResize', ...)
|
|
852
852
|
|
|
853
853
|
```typescript
|
|
854
|
-
addListener(eventName:
|
|
854
|
+
addListener(eventName: 'screenResize', listenerFunc: (data: { width: number; height: number; x: number; y: number; }) => void) => Promise<PluginListenerHandle>
|
|
855
855
|
```
|
|
856
856
|
|
|
857
857
|
Adds a listener for screen resize events.
|
|
@@ -871,7 +871,7 @@ Adds a listener for screen resize events.
|
|
|
871
871
|
### addListener('orientationChange', ...)
|
|
872
872
|
|
|
873
873
|
```typescript
|
|
874
|
-
addListener(eventName:
|
|
874
|
+
addListener(eventName: 'orientationChange', listenerFunc: (data: { orientation: DeviceOrientation; }) => void) => Promise<PluginListenerHandle>
|
|
875
875
|
```
|
|
876
876
|
|
|
877
877
|
Adds a listener for orientation change events.
|
|
@@ -1206,22 +1206,22 @@ iOS: Values are expressed in physical pixels and exclude status bar.
|
|
|
1206
1206
|
|
|
1207
1207
|
#### GridMode
|
|
1208
1208
|
|
|
1209
|
-
<code>
|
|
1209
|
+
<code>'none' | '3x3' | '4x4'</code>
|
|
1210
1210
|
|
|
1211
1211
|
|
|
1212
1212
|
#### CameraPosition
|
|
1213
1213
|
|
|
1214
|
-
<code>
|
|
1214
|
+
<code>'rear' | 'front'</code>
|
|
1215
1215
|
|
|
1216
1216
|
|
|
1217
1217
|
#### CameraPositioning
|
|
1218
1218
|
|
|
1219
|
-
<code>
|
|
1219
|
+
<code>'center' | 'top' | 'bottom'</code>
|
|
1220
1220
|
|
|
1221
1221
|
|
|
1222
1222
|
#### PictureFormat
|
|
1223
1223
|
|
|
1224
|
-
<code>
|
|
1224
|
+
<code>'jpeg' | 'png'</code>
|
|
1225
1225
|
|
|
1226
1226
|
|
|
1227
1227
|
#### CameraPreviewFlashMode
|
|
@@ -1229,7 +1229,7 @@ iOS: Values are expressed in physical pixels and exclude status bar.
|
|
|
1229
1229
|
The available flash modes for the camera.
|
|
1230
1230
|
'torch' is a continuous light mode.
|
|
1231
1231
|
|
|
1232
|
-
<code>
|
|
1232
|
+
<code>'off' | 'on' | 'auto' | 'torch'</code>
|
|
1233
1233
|
|
|
1234
1234
|
|
|
1235
1235
|
#### PermissionState
|
|
@@ -1253,14 +1253,14 @@ From T, pick a set of properties whose keys are in the union K
|
|
|
1253
1253
|
|
|
1254
1254
|
Canonical device orientation values across platforms.
|
|
1255
1255
|
|
|
1256
|
-
<code>
|
|
1256
|
+
<code>'portrait' | 'landscape-left' | 'landscape-right' | 'portrait-upside-down' | 'unknown'</code>
|
|
1257
1257
|
|
|
1258
1258
|
|
|
1259
1259
|
#### ExposureMode
|
|
1260
1260
|
|
|
1261
1261
|
Reusable exposure mode type for cross-platform support.
|
|
1262
1262
|
|
|
1263
|
-
<code>
|
|
1263
|
+
<code>'AUTO' | 'LOCK' | 'CONTINUOUS' | 'CUSTOM'</code>
|
|
1264
1264
|
|
|
1265
1265
|
|
|
1266
1266
|
### Enums
|
|
@@ -1270,12 +1270,12 @@ Reusable exposure mode type for cross-platform support.
|
|
|
1270
1270
|
|
|
1271
1271
|
| Members | Value |
|
|
1272
1272
|
| ---------------- | ------------------------ |
|
|
1273
|
-
| **`ULTRA_WIDE`** | <code>
|
|
1274
|
-
| **`WIDE_ANGLE`** | <code>
|
|
1275
|
-
| **`TELEPHOTO`** | <code>
|
|
1276
|
-
| **`TRUE_DEPTH`** | <code>
|
|
1277
|
-
| **`DUAL`** | <code>
|
|
1278
|
-
| **`DUAL_WIDE`** | <code>
|
|
1279
|
-
| **`TRIPLE`** | <code>
|
|
1273
|
+
| **`ULTRA_WIDE`** | <code>'ultraWide'</code> |
|
|
1274
|
+
| **`WIDE_ANGLE`** | <code>'wideAngle'</code> |
|
|
1275
|
+
| **`TELEPHOTO`** | <code>'telephoto'</code> |
|
|
1276
|
+
| **`TRUE_DEPTH`** | <code>'trueDepth'</code> |
|
|
1277
|
+
| **`DUAL`** | <code>'dual'</code> |
|
|
1278
|
+
| **`DUAL_WIDE`** | <code>'dualWide'</code> |
|
|
1279
|
+
| **`TRIPLE`** | <code>'triple'</code> |
|
|
1280
1280
|
|
|
1281
1281
|
</docgen-api>
|
|
@@ -16,11 +16,11 @@ import org.junit.runner.RunWith;
|
|
|
16
16
|
@RunWith(AndroidJUnit4.class)
|
|
17
17
|
public class ExampleInstrumentedTest {
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
@Test
|
|
20
|
+
public void useAppContext() throws Exception {
|
|
21
|
+
// Context of the app under test.
|
|
22
|
+
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
assertEquals("com.getcapacitor.android", appContext.getPackageName());
|
|
25
|
+
}
|
|
26
26
|
}
|