docs: Upgrade to Docusaurus 3 (#1783)
* docs: Upgrade to latest Docusaurus/Typedoc * chore: Re-run typedoc * docs: Upgrade to Docusaurus 3 * Add `docs/api/` to gitignore * Remove `docs` from git * Remove V3 banner * fix: Export `PixelFormat`
This commit is contained in:
parent
a4ace351fa
commit
297abae6bb
4
docs/.gitignore
vendored
4
docs/.gitignore
vendored
@ -18,3 +18,7 @@
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
|
||||
# TypeDoc/Docusaurus stuff
|
||||
docs/api
|
||||
|
@ -1 +0,0 @@
|
||||
label: "API"
|
@ -1,383 +0,0 @@
|
||||
---
|
||||
id: "Camera"
|
||||
title: "Camera"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
### A powerful `<Camera>` component.
|
||||
|
||||
Read the [VisionCamera documentation](https://react-native-vision-camera.com/) for more information.
|
||||
|
||||
The `<Camera>` component's most important (and therefore _required_) properties are:
|
||||
|
||||
* [`device`](../interfaces/CameraProps.md#device): Specifies the [`CameraDevice`](../interfaces/CameraDevice.md) to use. Get a [`CameraDevice`](../interfaces/CameraDevice.md) by using the [`useCameraDevices()`](../#usecameradevices) hook, or manually by using the [`Camera.getAvailableCameraDevices()`](Camera.md#getavailablecameradevices) function.
|
||||
* [`isActive`](../interfaces/CameraProps.md#isactive): A boolean value that specifies whether the Camera should actively stream video frames or not. This can be compared to a Video component, where `isActive` specifies whether the video is paused or not. If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```tsx
|
||||
function App() {
|
||||
const devices = useCameraDevices('wide-angle-camera')
|
||||
const device = devices.back
|
||||
|
||||
if (device == null) return <LoadingView />
|
||||
return (
|
||||
<Camera
|
||||
style={StyleSheet.absoluteFill}
|
||||
device={device}
|
||||
isActive={true}
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
**`Component`**
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `PureComponent`<[`CameraProps`](../interfaces/CameraProps.md)\>
|
||||
|
||||
↳ **`Camera`**
|
||||
|
||||
## Methods
|
||||
|
||||
### focus
|
||||
|
||||
▸ **focus**(`point`): `Promise`<`void`\>
|
||||
|
||||
Focus the camera to a specific point in the coordinate system.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](CameraRuntimeError.md) When any kind of error occured while focussing. Use the [`code`](CameraRuntimeError.md#code) property to get the actual error
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
await camera.current.focus({
|
||||
x: tapEvent.x,
|
||||
y: tapEvent.y
|
||||
})
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `point` | [`Point`](../interfaces/Point.md) | The point to focus to. This should be relative to the Camera view's coordinate system, and expressed in Pixel on iOS and Points on Android. * `(0, 0)` means **top left**. * `(CameraView.width, CameraView.height)` means **bottom right**. Make sure the value doesn't exceed the CameraView's dimensions. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:250](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L250)
|
||||
|
||||
___
|
||||
|
||||
### pauseRecording
|
||||
|
||||
▸ **pauseRecording**(): `Promise`<`void`\>
|
||||
|
||||
Pauses the current video recording.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraCaptureError`](CameraCaptureError.md) When any kind of error occured while pausing the video recording. Use the [`code`](CameraCaptureError.md#code) property to get the actual error
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
// Start
|
||||
await camera.current.startRecording()
|
||||
await timeout(1000)
|
||||
// Pause
|
||||
await camera.current.pauseRecording()
|
||||
await timeout(500)
|
||||
// Resume
|
||||
await camera.current.resumeRecording()
|
||||
await timeout(2000)
|
||||
// Stop
|
||||
const video = await camera.current.stopRecording()
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:175](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L175)
|
||||
|
||||
___
|
||||
|
||||
### resumeRecording
|
||||
|
||||
▸ **resumeRecording**(): `Promise`<`void`\>
|
||||
|
||||
Resumes a currently paused video recording.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraCaptureError`](CameraCaptureError.md) When any kind of error occured while resuming the video recording. Use the [`code`](CameraCaptureError.md#code) property to get the actual error
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
// Start
|
||||
await camera.current.startRecording()
|
||||
await timeout(1000)
|
||||
// Pause
|
||||
await camera.current.pauseRecording()
|
||||
await timeout(500)
|
||||
// Resume
|
||||
await camera.current.resumeRecording()
|
||||
await timeout(2000)
|
||||
// Stop
|
||||
const video = await camera.current.stopRecording()
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:203](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L203)
|
||||
|
||||
___
|
||||
|
||||
### startRecording
|
||||
|
||||
▸ **startRecording**(`options`): `void`
|
||||
|
||||
Start a new video recording.
|
||||
|
||||
Records in the following formats:
|
||||
* **iOS**: QuickTime (`.mov`)
|
||||
* **Android**: MPEG4 (`.mp4`)
|
||||
|
||||
**`Blocking`**
|
||||
|
||||
This function is synchronized/blocking.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraCaptureError`](CameraCaptureError.md) When any kind of error occured while starting the video recording. Use the [`code`](CameraCaptureError.md#code) property to get the actual error
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
camera.current.startRecording({
|
||||
onRecordingFinished: (video) => console.log(video),
|
||||
onRecordingError: (error) => console.error(error),
|
||||
})
|
||||
setTimeout(() => {
|
||||
camera.current.stopRecording()
|
||||
}, 5000)
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options` | [`RecordVideoOptions`](../interfaces/RecordVideoOptions.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:138](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L138)
|
||||
|
||||
___
|
||||
|
||||
### stopRecording
|
||||
|
||||
▸ **stopRecording**(): `Promise`<`void`\>
|
||||
|
||||
Stop the current video recording.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraCaptureError`](CameraCaptureError.md) When any kind of error occured while stopping the video recording. Use the [`code`](CameraCaptureError.md#code) property to get the actual error
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
await camera.current.startRecording()
|
||||
setTimeout(async () => {
|
||||
const video = await camera.current.stopRecording()
|
||||
}, 5000)
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:224](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L224)
|
||||
|
||||
___
|
||||
|
||||
### takePhoto
|
||||
|
||||
▸ **takePhoto**(`options?`): `Promise`<[`PhotoFile`](../interfaces/PhotoFile.md)\>
|
||||
|
||||
Take a single photo and write it's content to a temporary file.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraCaptureError`](CameraCaptureError.md) When any kind of error occured while capturing the photo. Use the [`code`](CameraCaptureError.md#code) property to get the actual error
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const photo = await camera.current.takePhoto({
|
||||
qualityPrioritization: 'quality',
|
||||
flash: 'on',
|
||||
enableAutoRedEyeReduction: true
|
||||
})
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options?` | [`TakePhotoOptions`](../interfaces/TakePhotoOptions.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`PhotoFile`](../interfaces/PhotoFile.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:108](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L108)
|
||||
|
||||
___
|
||||
|
||||
### getAvailableCameraDevices
|
||||
|
||||
▸ `Static` **getAvailableCameraDevices**(): `Promise`<[`CameraDevice`](../interfaces/CameraDevice.md)[]\>
|
||||
|
||||
Get a list of all available camera devices on the current phone.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](CameraRuntimeError.md) When any kind of error occured while getting all available camera devices. Use the [`code`](CameraRuntimeError.md#code) property to get the actual error
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const devices = await Camera.getAvailableCameraDevices()
|
||||
const filtered = devices.filter((d) => matchesMyExpectations(d))
|
||||
const sorted = devices.sort(sortDevicesByAmountOfCameras)
|
||||
return {
|
||||
back: sorted.find((d) => d.position === "back"),
|
||||
front: sorted.find((d) => d.position === "front")
|
||||
}
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`CameraDevice`](../interfaces/CameraDevice.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:276](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L276)
|
||||
|
||||
___
|
||||
|
||||
### getCameraPermissionStatus
|
||||
|
||||
▸ `Static` **getCameraPermissionStatus**(): `Promise`<[`CameraPermissionStatus`](../#camerapermissionstatus)\>
|
||||
|
||||
Gets the current Camera Permission Status. Check this before mounting the Camera to ensure
|
||||
the user has permitted the app to use the camera.
|
||||
|
||||
To actually prompt the user for camera permission, use [`requestCameraPermission()`](Camera.md#requestcamerapermission).
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](CameraRuntimeError.md) When any kind of error occured while getting the current permission status. Use the [`code`](CameraRuntimeError.md#code) property to get the actual error
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`CameraPermissionStatus`](../#camerapermissionstatus)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:291](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L291)
|
||||
|
||||
___
|
||||
|
||||
### getMicrophonePermissionStatus
|
||||
|
||||
▸ `Static` **getMicrophonePermissionStatus**(): `Promise`<[`CameraPermissionStatus`](../#camerapermissionstatus)\>
|
||||
|
||||
Gets the current Microphone-Recording Permission Status. Check this before mounting the Camera to ensure
|
||||
the user has permitted the app to use the microphone.
|
||||
|
||||
To actually prompt the user for microphone permission, use [`requestMicrophonePermission()`](Camera.md#requestmicrophonepermission).
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](CameraRuntimeError.md) When any kind of error occured while getting the current permission status. Use the [`code`](CameraRuntimeError.md#code) property to get the actual error
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`CameraPermissionStatus`](../#camerapermissionstatus)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:306](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L306)
|
||||
|
||||
___
|
||||
|
||||
### requestCameraPermission
|
||||
|
||||
▸ `Static` **requestCameraPermission**(): `Promise`<[`CameraPermissionRequestResult`](../#camerapermissionrequestresult)\>
|
||||
|
||||
Shows a "request permission" alert to the user, and resolves with the new camera permission status.
|
||||
|
||||
If the user has previously blocked the app from using the camera, the alert will not be shown
|
||||
and `"denied"` will be returned.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](CameraRuntimeError.md) When any kind of error occured while requesting permission. Use the [`code`](CameraRuntimeError.md#code) property to get the actual error
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`CameraPermissionRequestResult`](../#camerapermissionrequestresult)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:321](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L321)
|
||||
|
||||
___
|
||||
|
||||
### requestMicrophonePermission
|
||||
|
||||
▸ `Static` **requestMicrophonePermission**(): `Promise`<[`CameraPermissionRequestResult`](../#camerapermissionrequestresult)\>
|
||||
|
||||
Shows a "request permission" alert to the user, and resolves with the new microphone permission status.
|
||||
|
||||
If the user has previously blocked the app from using the microphone, the alert will not be shown
|
||||
and `"denied"` will be returned.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](CameraRuntimeError.md) When any kind of error occured while requesting permission. Use the [`code`](CameraRuntimeError.md#code) property to get the actual error
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`CameraPermissionRequestResult`](../#camerapermissionrequestresult)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:336](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L336)
|
@ -1,88 +0,0 @@
|
||||
---
|
||||
id: "CameraCaptureError"
|
||||
title: "CameraCaptureError"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents any kind of error that occured while trying to capture a video or photo.
|
||||
|
||||
See the ["Camera Errors" documentation](https://react-native-vision-camera.com/docs/guides/errors) for more information about Camera Errors.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `CameraError`<[`CaptureError`](../#captureerror)\>
|
||||
|
||||
↳ **`CameraCaptureError`**
|
||||
|
||||
## Accessors
|
||||
|
||||
### cause
|
||||
|
||||
• `get` **cause**(): `undefined` \| `Error`
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Error`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.cause
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:132](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L132)
|
||||
|
||||
___
|
||||
|
||||
### code
|
||||
|
||||
• `get` **code**(): `TCode`
|
||||
|
||||
#### Returns
|
||||
|
||||
`TCode`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.code
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:126](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L126)
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
|
||||
• `get` **message**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.message
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:129](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L129)
|
||||
|
||||
## Methods
|
||||
|
||||
### toString
|
||||
|
||||
▸ **toString**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.toString
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:150](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L150)
|
@ -1,88 +0,0 @@
|
||||
---
|
||||
id: "CameraRuntimeError"
|
||||
title: "CameraRuntimeError"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents any kind of error that occured in the Camera View Module.
|
||||
|
||||
See the ["Camera Errors" documentation](https://react-native-vision-camera.com/docs/guides/errors) for more information about Camera Errors.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `CameraError`<[`PermissionError`](../#permissionerror) \| [`ParameterError`](../#parametererror) \| [`DeviceError`](../#deviceerror) \| [`FormatError`](../#formaterror) \| [`SessionError`](../#sessionerror) \| [`SystemError`](../#systemerror) \| [`UnknownError`](../#unknownerror)\>
|
||||
|
||||
↳ **`CameraRuntimeError`**
|
||||
|
||||
## Accessors
|
||||
|
||||
### cause
|
||||
|
||||
• `get` **cause**(): `undefined` \| `Error`
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Error`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.cause
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:132](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L132)
|
||||
|
||||
___
|
||||
|
||||
### code
|
||||
|
||||
• `get` **code**(): `TCode`
|
||||
|
||||
#### Returns
|
||||
|
||||
`TCode`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.code
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:126](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L126)
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
|
||||
• `get` **message**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.message
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:129](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L129)
|
||||
|
||||
## Methods
|
||||
|
||||
### toString
|
||||
|
||||
▸ **toString**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
CameraError.toString
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:150](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L150)
|
@ -1,2 +0,0 @@
|
||||
label: "Classes"
|
||||
position: 3
|
@ -1,636 +0,0 @@
|
||||
---
|
||||
id: "index"
|
||||
title: "VisionCamera"
|
||||
sidebar_label: "Overview"
|
||||
sidebar_position: 0.5
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Classes
|
||||
|
||||
- [Camera](classes/Camera.md)
|
||||
- [CameraCaptureError](classes/CameraCaptureError.md)
|
||||
- [CameraRuntimeError](classes/CameraRuntimeError.md)
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [CameraDevice](interfaces/CameraDevice.md)
|
||||
- [CameraDeviceFormat](interfaces/CameraDeviceFormat.md)
|
||||
- [CameraProps](interfaces/CameraProps.md)
|
||||
- [ErrorWithCause](interfaces/ErrorWithCause.md)
|
||||
- [PhotoFile](interfaces/PhotoFile.md)
|
||||
- [Point](interfaces/Point.md)
|
||||
- [RecordVideoOptions](interfaces/RecordVideoOptions.md)
|
||||
- [TakePhotoOptions](interfaces/TakePhotoOptions.md)
|
||||
- [TemporaryFile](interfaces/TemporaryFile.md)
|
||||
- [VideoFile](interfaces/VideoFile.md)
|
||||
|
||||
## Type Aliases
|
||||
|
||||
### AutoFocusSystem
|
||||
|
||||
Ƭ **AutoFocusSystem**: ``"contrast-detection"`` \| ``"phase-detection"`` \| ``"none"``
|
||||
|
||||
Indicates a format's autofocus system.
|
||||
|
||||
* `"none"`: Indicates that autofocus is not available
|
||||
* `"contrast-detection"`: Indicates that autofocus is achieved by contrast detection. Contrast detection performs a focus scan to find the optimal position
|
||||
* `"phase-detection"`: Indicates that autofocus is achieved by phase detection. Phase detection has the ability to achieve focus in many cases without a focus scan. Phase detection autofocus is typically less visually intrusive than contrast detection autofocus
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:53](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### CameraDevices
|
||||
|
||||
Ƭ **CameraDevices**: { [key in CameraPosition]: CameraDevice \| undefined }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[hooks/useCameraDevices.ts:7](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/hooks/useCameraDevices.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### CameraPermissionRequestResult
|
||||
|
||||
Ƭ **CameraPermissionRequestResult**: ``"granted"`` \| ``"denied"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:15](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L15)
|
||||
|
||||
___
|
||||
|
||||
### CameraPermissionStatus
|
||||
|
||||
Ƭ **CameraPermissionStatus**: ``"granted"`` \| ``"not-determined"`` \| ``"denied"`` \| ``"restricted"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Camera.tsx:14](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Camera.tsx#L14)
|
||||
|
||||
___
|
||||
|
||||
### CameraPosition
|
||||
|
||||
Ƭ **CameraPosition**: ``"front"`` \| ``"back"`` \| ``"unspecified"`` \| ``"external"``
|
||||
|
||||
Represents the camera device position.
|
||||
|
||||
* `"back"`: Indicates that the device is physically located on the back of the system hardware
|
||||
* `"front"`: Indicates that the device is physically located on the front of the system hardware
|
||||
|
||||
#### iOS only
|
||||
* `"unspecified"`: Indicates that the device's position relative to the system hardware is unspecified
|
||||
|
||||
#### Android only
|
||||
* `"external"`: The camera device is an external camera, and has no fixed facing relative to the device's screen. (Android only)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraPosition.ts:13](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraPosition.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### CaptureError
|
||||
|
||||
Ƭ **CaptureError**: ``"capture/invalid-photo-format"`` \| ``"capture/encoder-error"`` \| ``"capture/muxer-error"`` \| ``"capture/recording-in-progress"`` \| ``"capture/no-recording-in-progress"`` \| ``"capture/file-io-error"`` \| ``"capture/create-temp-file-error"`` \| ``"capture/invalid-video-options"`` \| ``"capture/create-recorder-error"`` \| ``"capture/recorder-error"`` \| ``"capture/no-valid-data"`` \| ``"capture/inactive-source"`` \| ``"capture/insufficient-storage"`` \| ``"capture/file-size-limit-reached"`` \| ``"capture/invalid-photo-codec"`` \| ``"capture/not-bound-error"`` \| ``"capture/capture-type-not-supported"`` \| ``"capture/video-not-enabled"`` \| ``"capture/photo-not-enabled"`` \| ``"capture/aborted"`` \| ``"capture/unknown"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:31](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### DeviceError
|
||||
|
||||
Ƭ **DeviceError**: ``"device/configuration-error"`` \| ``"device/no-device"`` \| ``"device/invalid-device"`` \| ``"device/torch-unavailable"`` \| ``"device/microphone-unavailable"`` \| ``"device/pixel-format-not-supported"`` \| ``"device/low-light-boost-not-supported"`` \| ``"device/focus-not-supported"`` \| ``"device/camera-not-available-on-simulator"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:8](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
### FormatError
|
||||
|
||||
Ƭ **FormatError**: ``"format/invalid-fps"`` \| ``"format/invalid-hdr"`` \| ``"format/invalid-low-light-boost"`` \| ``"format/invalid-format"`` \| ``"format/invalid-color-space"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:18](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### FrameProcessor
|
||||
|
||||
Ƭ **FrameProcessor**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `frameProcessor` | (`frame`: `Frame`) => `void` |
|
||||
| `type` | ``"frame-processor"`` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:7](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### LogicalCameraDeviceType
|
||||
|
||||
Ƭ **LogicalCameraDeviceType**: ``"dual-camera"`` \| ``"dual-wide-camera"`` \| ``"triple-camera"``
|
||||
|
||||
Indentifiers for a logical camera (Combinations of multiple physical cameras to create a single logical camera).
|
||||
|
||||
* `"dual-camera"`: A combination of wide-angle and telephoto cameras that creates a capture device.
|
||||
* `"dual-wide-camera"`: A device that consists of two cameras of fixed focal length, one ultrawide angle and one wide angle.
|
||||
* `"triple-camera"`: A device that consists of three cameras of fixed focal length, one ultrawide angle, one wide angle, and one telephoto.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:21](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### ParameterError
|
||||
|
||||
Ƭ **ParameterError**: ``"parameter/invalid-parameter"`` \| ``"parameter/unsupported-os"`` \| ``"parameter/unsupported-output"`` \| ``"parameter/unsupported-input"`` \| ``"parameter/invalid-combination"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:2](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L2)
|
||||
|
||||
___
|
||||
|
||||
### PermissionError
|
||||
|
||||
Ƭ **PermissionError**: ``"permission/microphone-permission-denied"`` \| ``"permission/camera-permission-denied"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:1](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L1)
|
||||
|
||||
___
|
||||
|
||||
### PhysicalCameraDeviceType
|
||||
|
||||
Ƭ **PhysicalCameraDeviceType**: ``"ultra-wide-angle-camera"`` \| ``"wide-angle-camera"`` \| ``"telephoto-camera"``
|
||||
|
||||
Indentifiers for a physical camera (one that actually exists on the back/front of the device)
|
||||
|
||||
* `"ultra-wide-angle-camera"`: A built-in camera with a shorter focal length than that of a wide-angle camera. (focal length between below 24mm)
|
||||
* `"wide-angle-camera"`: A built-in wide-angle camera. (focal length between 24mm and 35mm)
|
||||
* `"telephoto-camera"`: A built-in camera device with a longer focal length than a wide-angle camera. (focal length between above 85mm)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:12](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### SessionError
|
||||
|
||||
Ƭ **SessionError**: ``"session/camera-not-ready"`` \| ``"session/camera-cannot-be-opened"`` \| ``"session/camera-has-been-disconnected"`` \| ``"session/audio-session-setup-failed"`` \| ``"session/audio-in-use-by-other-app"`` \| ``"session/audio-session-failed-to-activate"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:24](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### SystemError
|
||||
|
||||
Ƭ **SystemError**: ``"system/camera-module-not-found"`` \| ``"system/no-camera-manager"`` \| ``"system/frame-processors-unavailable"`` \| ``"system/view-not-found"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:53](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### UnknownError
|
||||
|
||||
Ƭ **UnknownError**: ``"unknown/unknown"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:58](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### VideoStabilizationMode
|
||||
|
||||
Ƭ **VideoStabilizationMode**: ``"off"`` \| ``"standard"`` \| ``"cinematic"`` \| ``"cinematic-extended"`` \| ``"auto"``
|
||||
|
||||
Indicates a format's supported video stabilization mode. Enabling video stabilization may introduce additional latency into the video capture pipeline.
|
||||
|
||||
* `"off"`: No video stabilization. Indicates that video should not be stabilized
|
||||
* `"standard"`: Standard software-based video stabilization. Standard video stabilization reduces the field of view by about 10%.
|
||||
* `"cinematic"`: Advanced software-based video stabilization. This applies more aggressive cropping or transformations than standard.
|
||||
* `"cinematic-extended"`: Extended software- and hardware-based stabilization that aggressively crops and transforms the video to apply a smooth cinematic stabilization.
|
||||
* `"auto"`: Indicates that the most appropriate video stabilization mode for the device and format should be chosen automatically
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:64](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L64)
|
||||
|
||||
## Variables
|
||||
|
||||
### VisionCameraProxy
|
||||
|
||||
• `Const` **VisionCameraProxy**: `TVisionCameraProxy` = `proxy`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[FrameProcessorPlugins.ts:95](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/FrameProcessorPlugins.ts#L95)
|
||||
|
||||
## Functions
|
||||
|
||||
### createFrameProcessor
|
||||
|
||||
▸ **createFrameProcessor**(`frameProcessor`, `type`): [`FrameProcessor`](#frameprocessor)
|
||||
|
||||
Create a new Frame Processor function which you can pass to the `<Camera>`.
|
||||
(See ["Frame Processors"](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors))
|
||||
|
||||
Make sure to add the `'worklet'` directive to the top of the Frame Processor function, otherwise it will not get compiled into a worklet.
|
||||
|
||||
Also make sure to memoize the returned object, so that the Camera doesn't reset the Frame Processor Context each time.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `frameProcessor` | (`frame`: `Frame`) => `void` |
|
||||
| `type` | ``"frame-processor"`` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`FrameProcessor`](#frameprocessor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[hooks/useFrameProcessor.ts:13](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/hooks/useFrameProcessor.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### isErrorWithCause
|
||||
|
||||
▸ **isErrorWithCause**(`error`): error is ErrorWithCause
|
||||
|
||||
Checks if the given `error` is of type [`ErrorWithCause`](interfaces/ErrorWithCause.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `error` | `unknown` | Any unknown object to validate |
|
||||
|
||||
#### Returns
|
||||
|
||||
error is ErrorWithCause
|
||||
|
||||
`true` if the given `error` is of type [`ErrorWithCause`](interfaces/ErrorWithCause.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:176](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L176)
|
||||
|
||||
___
|
||||
|
||||
### parsePhysicalDeviceTypes
|
||||
|
||||
▸ **parsePhysicalDeviceTypes**(`physicalDeviceTypes`): [`PhysicalCameraDeviceType`](#physicalcameradevicetype) \| [`LogicalCameraDeviceType`](#logicalcameradevicetype)
|
||||
|
||||
Parses an array of physical device types into a single [`PhysicalCameraDeviceType`](#physicalcameradevicetype) or [`LogicalCameraDeviceType`](#logicalcameradevicetype), depending what matches.
|
||||
|
||||
**`Method`**
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `physicalDeviceTypes` | [`PhysicalCameraDeviceType`](#physicalcameradevicetype)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`PhysicalCameraDeviceType`](#physicalcameradevicetype) \| [`LogicalCameraDeviceType`](#logicalcameradevicetype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:27](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### runAsync
|
||||
|
||||
▸ **runAsync**(`frame`, `func`): `void`
|
||||
|
||||
Runs the given function asynchronously, while keeping a strong reference to the Frame.
|
||||
|
||||
For example, if you want to run a heavy face detection algorithm
|
||||
while still drawing to the screen at 60 FPS, you can use `runAsync(...)`
|
||||
to offload the face detection algorithm to a separate thread.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const frameProcessor = useFrameProcessor((frame) => {
|
||||
'worklet'
|
||||
console.log('New Frame')
|
||||
runAsync(frame, () => {
|
||||
'worklet'
|
||||
const faces = detectFaces(frame)
|
||||
const face = [faces0]
|
||||
console.log(`Detected a new face: ${face}`)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `frame` | `Frame` | The current Frame of the Frame Processor. |
|
||||
| `func` | () => `void` | The function to execute. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[FrameProcessorPlugins.ts:177](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/FrameProcessorPlugins.ts#L177)
|
||||
|
||||
___
|
||||
|
||||
### runAtTargetFps
|
||||
|
||||
▸ **runAtTargetFps**<`T`\>(`fps`, `func`): `T` \| `undefined`
|
||||
|
||||
Runs the given function at the given target FPS rate.
|
||||
|
||||
For example, if you want to run a heavy face detection algorithm
|
||||
only once per second, you can use `runAtTargetFps(1, ...)` to
|
||||
throttle it to 1 FPS.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const frameProcessor = useFrameProcessor((frame) => {
|
||||
'worklet'
|
||||
console.log('New Frame')
|
||||
runAtTargetFps(5, () => {
|
||||
'worklet'
|
||||
const faces = detectFaces(frame)
|
||||
console.log(`Detected a new face: ${faces[0]}`)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fps` | `number` | The target FPS rate at which the given function should be executed |
|
||||
| `func` | () => `T` | The function to execute. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`T` \| `undefined`
|
||||
|
||||
The result of the function if it was executed, or `undefined` otherwise.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[FrameProcessorPlugins.ts:136](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/FrameProcessorPlugins.ts#L136)
|
||||
|
||||
___
|
||||
|
||||
### sortDevices
|
||||
|
||||
▸ **sortDevices**(`left`, `right`): `number`
|
||||
|
||||
Compares two devices by the following criteria:
|
||||
* `wide-angle-camera`s are ranked higher than others
|
||||
* Devices with more physical cameras are ranked higher than ones with less. (e.g. "Triple Camera" > "Wide-Angle Camera")
|
||||
|
||||
> Note that this makes the `sort()` function descending, so the first element (`[0]`) is the "best" device.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const devices = camera.devices.sort(sortDevices)
|
||||
const bestDevice = devices[0]
|
||||
```
|
||||
|
||||
**`Method`**
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `left` | [`CameraDevice`](interfaces/CameraDevice.md) |
|
||||
| `right` | [`CameraDevice`](interfaces/CameraDevice.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[utils/FormatFilter.ts:18](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/utils/FormatFilter.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### sortFormats
|
||||
|
||||
▸ **sortFormats**(`left`, `right`): `number`
|
||||
|
||||
Sort formats by resolution and aspect ratio difference (to the Screen size).
|
||||
|
||||
> Note that this makes the `sort()` function descending, so the first element (`[0]`) is the "best" device.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `left` | [`CameraDeviceFormat`](interfaces/CameraDeviceFormat.md) |
|
||||
| `right` | [`CameraDeviceFormat`](interfaces/CameraDeviceFormat.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[utils/FormatFilter.ts:72](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/utils/FormatFilter.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### tryParseNativeCameraError
|
||||
|
||||
▸ **tryParseNativeCameraError**<`T`\>(`nativeError`): [`CameraCaptureError`](classes/CameraCaptureError.md) \| [`CameraRuntimeError`](classes/CameraRuntimeError.md) \| `T`
|
||||
|
||||
Tries to parse an error coming from native to a typed JS camera error.
|
||||
|
||||
**`Method`**
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `nativeError` | `T` | The native error instance. This is a JSON in the legacy native module architecture. |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CameraCaptureError`](classes/CameraCaptureError.md) \| [`CameraRuntimeError`](classes/CameraRuntimeError.md) \| `T`
|
||||
|
||||
A [`CameraRuntimeError`](classes/CameraRuntimeError.md) or [`CameraCaptureError`](classes/CameraCaptureError.md), or the `nativeError` itself if it's not parsable
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:202](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L202)
|
||||
|
||||
___
|
||||
|
||||
### useCameraDevices
|
||||
|
||||
▸ **useCameraDevices**(): [`CameraDevices`](#cameradevices)
|
||||
|
||||
Gets the best available [`CameraDevice`](interfaces/CameraDevice.md). Devices with more cameras are preferred.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](classes/CameraRuntimeError.md) if no device was found.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```tsx
|
||||
const device = useCameraDevice()
|
||||
// ...
|
||||
return <Camera device={device} />
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CameraDevices`](#cameradevices)
|
||||
|
||||
The best matching [`CameraDevice`](interfaces/CameraDevice.md).
|
||||
|
||||
#### Defined in
|
||||
|
||||
[hooks/useCameraDevices.ts:29](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/hooks/useCameraDevices.ts#L29)
|
||||
|
||||
▸ **useCameraDevices**(`deviceType`): [`CameraDevices`](#cameradevices)
|
||||
|
||||
Gets a [`CameraDevice`](interfaces/CameraDevice.md) for the requested device type.
|
||||
|
||||
**`Throws`**
|
||||
|
||||
[`CameraRuntimeError`](classes/CameraRuntimeError.md) if no device was found.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```tsx
|
||||
const device = useCameraDevice('wide-angle-camera')
|
||||
// ...
|
||||
return <Camera device={device} />
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `deviceType` | [`PhysicalCameraDeviceType`](#physicalcameradevicetype) \| [`LogicalCameraDeviceType`](#logicalcameradevicetype) | Specifies a device type which will be used as a device filter. |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CameraDevices`](#cameradevices)
|
||||
|
||||
A [`CameraDevice`](interfaces/CameraDevice.md) for the requested device type.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[hooks/useCameraDevices.ts:44](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/hooks/useCameraDevices.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### useCameraFormat
|
||||
|
||||
▸ **useCameraFormat**(`device?`): [`CameraDeviceFormat`](interfaces/CameraDeviceFormat.md) \| `undefined`
|
||||
|
||||
Returns the best format for the given camera device.
|
||||
|
||||
This function tries to choose a format with the highest possible photo-capture resolution and best matching aspect ratio.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `device?` | [`CameraDevice`](interfaces/CameraDevice.md) | The Camera Device |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CameraDeviceFormat`](interfaces/CameraDeviceFormat.md) \| `undefined`
|
||||
|
||||
The best matching format for the given camera device, or `undefined` if the camera device is `undefined`.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[hooks/useCameraFormat.ts:14](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/hooks/useCameraFormat.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### useFrameProcessor
|
||||
|
||||
▸ **useFrameProcessor**(`frameProcessor`, `dependencies`): [`FrameProcessor`](#frameprocessor)
|
||||
|
||||
Returns a memoized Frame Processor function wich you can pass to the `<Camera>`.
|
||||
(See ["Frame Processors"](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors))
|
||||
|
||||
Make sure to add the `'worklet'` directive to the top of the Frame Processor function, otherwise it will not get compiled into a worklet.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const frameProcessor = useFrameProcessor((frame) => {
|
||||
'worklet'
|
||||
const qrCodes = scanQRCodes(frame)
|
||||
console.log(`QR Codes: ${qrCodes}`)
|
||||
}, [])
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `frameProcessor` | (`frame`: `Frame`) => `void` | The Frame Processor |
|
||||
| `dependencies` | `DependencyList` | The React dependencies which will be copied into the VisionCamera JS-Runtime. |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`FrameProcessor`](#frameprocessor)
|
||||
|
||||
The memoized Frame Processor.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[hooks/useFrameProcessor.ts:49](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/hooks/useFrameProcessor.ts#L49)
|
@ -1,246 +0,0 @@
|
||||
---
|
||||
id: "CameraDevice"
|
||||
title: "CameraDevice"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents a camera device discovered by the [`Camera.getAvailableCameraDevices()`](../classes/Camera.md#getavailablecameradevices) function
|
||||
|
||||
## Properties
|
||||
|
||||
### devices
|
||||
|
||||
• **devices**: [`PhysicalCameraDeviceType`](../#physicalcameradevicetype)[]
|
||||
|
||||
The physical devices this `CameraDevice` contains.
|
||||
|
||||
* If this camera device is a **logical camera** (combination of multiple physical cameras), there are multiple cameras in this array.
|
||||
* If this camera device is a **physical camera**, there is only a single element in this array.
|
||||
|
||||
You can check if the camera is a logical multi-camera by using the `isMultiCam` property.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:149](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
### formats
|
||||
|
||||
• **formats**: [`CameraDeviceFormat`](CameraDeviceFormat.md)[]
|
||||
|
||||
All available formats for this camera device. Use this to find the best format for your use case and set it to the Camera's [`Camera's .format`](CameraProps.md#format) property.
|
||||
|
||||
See [the Camera Formats documentation](https://react-native-vision-camera.com/docs/guides/formats) for more information about Camera Formats.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:203](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L203)
|
||||
|
||||
___
|
||||
|
||||
### hardwareLevel
|
||||
|
||||
• **hardwareLevel**: ``"legacy"`` \| ``"limited"`` \| ``"full"``
|
||||
|
||||
The hardware level of the Camera.
|
||||
- On Android, some older devices are running at a `legacy` or `limited` level which means they are running in a backwards compatible mode.
|
||||
- On iOS, all devices are `full`.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:229](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L229)
|
||||
|
||||
___
|
||||
|
||||
### hasFlash
|
||||
|
||||
• **hasFlash**: `boolean`
|
||||
|
||||
Specifies whether this camera supports enabling flash for photo capture.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:161](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L161)
|
||||
|
||||
___
|
||||
|
||||
### hasTorch
|
||||
|
||||
• **hasTorch**: `boolean`
|
||||
|
||||
Specifies whether this camera supports continuously enabling the flash to act like a torch (flash with video capture)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:165](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L165)
|
||||
|
||||
___
|
||||
|
||||
### id
|
||||
|
||||
• **id**: `string`
|
||||
|
||||
The native ID of the camera device instance.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:140](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L140)
|
||||
|
||||
___
|
||||
|
||||
### isMultiCam
|
||||
|
||||
• **isMultiCam**: `boolean`
|
||||
|
||||
A property indicating whether the device is a virtual multi-camera consisting of multiple combined physical cameras.
|
||||
|
||||
Examples:
|
||||
* The Dual Camera, which supports seamlessly switching between a wide and telephoto camera while zooming and generating depth data from the disparities between the different points of view of the physical cameras.
|
||||
* The TrueDepth Camera, which generates depth data from disparities between a YUV camera and an Infrared camera pointed in the same direction.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:173](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
### maxZoom
|
||||
|
||||
• **maxZoom**: `number`
|
||||
|
||||
Maximum available zoom factor (e.g. `128`)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:181](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L181)
|
||||
|
||||
___
|
||||
|
||||
### minZoom
|
||||
|
||||
• **minZoom**: `number`
|
||||
|
||||
Minimum available zoom factor (e.g. `1`)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:177](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L177)
|
||||
|
||||
___
|
||||
|
||||
### name
|
||||
|
||||
• **name**: `string`
|
||||
|
||||
A friendly localized name describing the camera.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:157](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
### neutralZoom
|
||||
|
||||
• **neutralZoom**: `number`
|
||||
|
||||
The zoom factor where the camera is "neutral".
|
||||
|
||||
* For single-physical cameras this property is always `1.0`.
|
||||
* For multi cameras this property is a value between `minZoom` and `maxZoom`, where the camera is in _wide-angle_ mode and hasn't switched to the _ultra-wide-angle_ ("fish-eye") or telephoto camera yet.
|
||||
|
||||
Use this value as an initial value for the zoom property if you implement custom zoom. (e.g. reanimated shared value should be initially set to this value)
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const device = ...
|
||||
|
||||
const zoom = useSharedValue(device.neutralZoom) // <-- initial value so it doesn't start at ultra-wide
|
||||
const cameraProps = useAnimatedProps(() => ({
|
||||
zoom: zoom.value
|
||||
}))
|
||||
```
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:197](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
### position
|
||||
|
||||
• **position**: [`CameraPosition`](../#cameraposition)
|
||||
|
||||
Specifies the physical position of this camera. (back or front)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:153](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### sensorOrientation
|
||||
|
||||
• **sensorOrientation**: `Orientation`
|
||||
|
||||
Represents the sensor's orientation relative to the phone.
|
||||
For most phones this will be landscape, as Camera sensors are usually always rotated by 90 degrees (i.e. width and height are flipped).
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:234](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L234)
|
||||
|
||||
___
|
||||
|
||||
### supportsDepthCapture
|
||||
|
||||
• **supportsDepthCapture**: `boolean`
|
||||
|
||||
Whether this camera supports taking photos with depth data.
|
||||
|
||||
**! Work in Progress !**
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:213](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L213)
|
||||
|
||||
___
|
||||
|
||||
### supportsFocus
|
||||
|
||||
• **supportsFocus**: `boolean`
|
||||
|
||||
Specifies whether this device supports focusing ([`Camera.focus(...)`](../classes/Camera.md#focus))
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:223](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
### supportsLowLightBoost
|
||||
|
||||
• **supportsLowLightBoost**: `boolean`
|
||||
|
||||
Whether this camera device supports low light boost.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:207](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L207)
|
||||
|
||||
___
|
||||
|
||||
### supportsRawCapture
|
||||
|
||||
• **supportsRawCapture**: `boolean`
|
||||
|
||||
Whether this camera supports taking photos in RAW format
|
||||
|
||||
**! Work in Progress !**
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:219](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L219)
|
@ -1,189 +0,0 @@
|
||||
---
|
||||
id: "CameraDeviceFormat"
|
||||
title: "CameraDeviceFormat"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A Camera Device's video format. Do not create instances of this type yourself, only use [`Camera.getAvailableCameraDevices()`](../classes/Camera.md#getavailablecameradevices).
|
||||
|
||||
## Properties
|
||||
|
||||
### autoFocusSystem
|
||||
|
||||
• **autoFocusSystem**: [`AutoFocusSystem`](../#autofocussystem)
|
||||
|
||||
Specifies this format's auto focus system.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:121](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
### fieldOfView
|
||||
|
||||
• **fieldOfView**: `number`
|
||||
|
||||
The video field of view in degrees
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:97](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
### maxFps
|
||||
|
||||
• **maxFps**: `number`
|
||||
|
||||
The maximum frame rate this Format is able to run at. High resolution formats often run at lower frame rates.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:117](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L117)
|
||||
|
||||
___
|
||||
|
||||
### maxISO
|
||||
|
||||
• **maxISO**: `number`
|
||||
|
||||
Maximum supported ISO value
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:89](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
### maxZoom
|
||||
|
||||
• **maxZoom**: `number`
|
||||
|
||||
The maximum zoom factor (e.g. `128`)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:101](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
### minFps
|
||||
|
||||
• **minFps**: `number`
|
||||
|
||||
The minum frame rate this Format needs to run at. High resolution formats often run at lower frame rates.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:113](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L113)
|
||||
|
||||
___
|
||||
|
||||
### minISO
|
||||
|
||||
• **minISO**: `number`
|
||||
|
||||
Minimum supported ISO value
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:93](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L93)
|
||||
|
||||
___
|
||||
|
||||
### photoHeight
|
||||
|
||||
• **photoHeight**: `number`
|
||||
|
||||
The height of the highest resolution a still image (photo) can be produced in
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:73](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### photoWidth
|
||||
|
||||
• **photoWidth**: `number`
|
||||
|
||||
The width of the highest resolution a still image (photo) can be produced in
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:77](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### pixelFormats
|
||||
|
||||
• **pixelFormats**: `PixelFormat`[]
|
||||
|
||||
Specifies this format's supported pixel-formats.
|
||||
In most cases, this is `['native', 'yuv']`.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:130](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L130)
|
||||
|
||||
___
|
||||
|
||||
### supportsPhotoHDR
|
||||
|
||||
• **supportsPhotoHDR**: `boolean`
|
||||
|
||||
Specifies whether this format supports HDR mode for photo capture
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:109](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L109)
|
||||
|
||||
___
|
||||
|
||||
### supportsVideoHDR
|
||||
|
||||
• **supportsVideoHDR**: `boolean`
|
||||
|
||||
Specifies whether this format supports HDR mode for video capture
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:105](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L105)
|
||||
|
||||
___
|
||||
|
||||
### videoHeight
|
||||
|
||||
• **videoHeight**: `number`
|
||||
|
||||
The video resolutions's height
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:81](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L81)
|
||||
|
||||
___
|
||||
|
||||
### videoStabilizationModes
|
||||
|
||||
• **videoStabilizationModes**: [`VideoStabilizationMode`](../#videostabilizationmode)[]
|
||||
|
||||
All supported video stabilization modes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:125](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
### videoWidth
|
||||
|
||||
• **videoWidth**: `number`
|
||||
|
||||
The video resolution's width
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:85](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraDevice.ts#L85)
|
@ -1,406 +0,0 @@
|
||||
---
|
||||
id: "CameraProps"
|
||||
title: "CameraProps"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `ViewProps`
|
||||
|
||||
↳ **`CameraProps`**
|
||||
|
||||
## Properties
|
||||
|
||||
### audio
|
||||
|
||||
• `Optional` **audio**: `boolean`
|
||||
|
||||
Enables **audio capture** for video recordings (see ["Recording Videos"](https://react-native-vision-camera.com/docs/guides/capturing/#recording-videos))
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:61](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
### device
|
||||
|
||||
• **device**: [`CameraDevice`](CameraDevice.md)
|
||||
|
||||
The Camera Device to use.
|
||||
|
||||
See the [Camera Devices](https://react-native-vision-camera.com/docs/guides/devices) section in the documentation for more information about Camera Devices.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```tsx
|
||||
const devices = useCameraDevices('wide-angle-camera')
|
||||
const device = devices.back
|
||||
|
||||
return (
|
||||
<Camera
|
||||
device={device}
|
||||
isActive={true}
|
||||
style={StyleSheet.absoluteFill}
|
||||
/>
|
||||
)
|
||||
```
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:37](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### enableDepthData
|
||||
|
||||
• `Optional` **enableDepthData**: `boolean`
|
||||
|
||||
Also captures data from depth-perception sensors. (e.g. disparity maps)
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:145](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L145)
|
||||
|
||||
___
|
||||
|
||||
### enableFpsGraph
|
||||
|
||||
• `Optional` **enableFpsGraph**: `boolean`
|
||||
|
||||
If `true`, show a debug view to display the FPS of the Camera session.
|
||||
This is useful for debugging your Frame Processor's speed.
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:173](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
### enableHighQualityPhotos
|
||||
|
||||
• `Optional` **enableHighQualityPhotos**: `boolean`
|
||||
|
||||
Indicates whether the Camera should prepare the photo pipeline to provide maximum quality photos.
|
||||
|
||||
This enables:
|
||||
* High Resolution Capture ([`isHighResolutionCaptureEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1648721-ishighresolutioncaptureenabled))
|
||||
* Virtual Device fusion for greater detail ([`isVirtualDeviceConstituentPhotoDeliveryEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/3192189-isvirtualdeviceconstituentphotod))
|
||||
* Dual Device fusion for greater detail ([`isDualCameraDualPhotoDeliveryEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/2873917-isdualcameradualphotodeliveryena))
|
||||
* Sets the maximum quality prioritization to `.quality` ([`maxPhotoQualityPrioritization`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/3182995-maxphotoqualityprioritization))
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:166](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L166)
|
||||
|
||||
___
|
||||
|
||||
### enablePortraitEffectsMatteDelivery
|
||||
|
||||
• `Optional` **enablePortraitEffectsMatteDelivery**: `boolean`
|
||||
|
||||
A boolean specifying whether the photo render pipeline is prepared for portrait effects matte delivery.
|
||||
|
||||
When enabling this, you must also set `enableDepthData` to `true`.
|
||||
|
||||
**`Platform`**
|
||||
|
||||
iOS 12.0+
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:154](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L154)
|
||||
|
||||
___
|
||||
|
||||
### enableZoomGesture
|
||||
|
||||
• `Optional` **enableZoomGesture**: `boolean`
|
||||
|
||||
Enables or disables the native pinch to zoom gesture.
|
||||
|
||||
If you want to implement a custom zoom gesture, see [the Zooming with Reanimated documentation](https://react-native-vision-camera.com/docs/guides/animated).
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:106](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L106)
|
||||
|
||||
___
|
||||
|
||||
### format
|
||||
|
||||
• `Optional` **format**: [`CameraDeviceFormat`](CameraDeviceFormat.md)
|
||||
|
||||
Selects a given format. By default, the best matching format is chosen.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:113](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L113)
|
||||
|
||||
___
|
||||
|
||||
### fps
|
||||
|
||||
• `Optional` **fps**: `number`
|
||||
|
||||
Specify the frames per second this camera should use. Make sure the given `format` includes a frame rate range with the given `fps`.
|
||||
|
||||
Requires `format` to be set.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:119](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
### frameProcessor
|
||||
|
||||
• `Optional` **frameProcessor**: [`FrameProcessor`](../#frameprocessor)
|
||||
|
||||
A worklet which will be called for every frame the Camera "sees".
|
||||
|
||||
> See [the Frame Processors documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors) for more information
|
||||
|
||||
**`Example`**
|
||||
|
||||
```tsx
|
||||
const frameProcessor = useFrameProcessor((frame) => {
|
||||
'worklet'
|
||||
const qrCodes = scanQRCodes(frame)
|
||||
console.log(`Detected QR Codes: ${qrCodes}`)
|
||||
}, [])
|
||||
|
||||
return <Camera {...cameraProps} frameProcessor={frameProcessor} />
|
||||
```
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:204](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L204)
|
||||
|
||||
___
|
||||
|
||||
### hdr
|
||||
|
||||
• `Optional` **hdr**: `boolean`
|
||||
|
||||
Enables or disables HDR on this camera device. Make sure the given `format` supports HDR mode.
|
||||
|
||||
Requires `format` to be set.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:125](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L125)
|
||||
|
||||
___
|
||||
|
||||
### isActive
|
||||
|
||||
• **isActive**: `boolean`
|
||||
|
||||
Whether the Camera should actively stream video frames, or not. See the [documentation about the `isActive` prop](https://react-native-vision-camera.com/docs/guides/lifecycle#the-isactive-prop) for more information.
|
||||
|
||||
This can be compared to a Video component, where `isActive` specifies whether the video is paused or not.
|
||||
|
||||
> Note: If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again. In return, it will use less resources since the Camera will be completely destroyed when unmounted.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:45](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### lowLightBoost
|
||||
|
||||
• `Optional` **lowLightBoost**: `boolean`
|
||||
|
||||
Enables or disables low-light boost on this camera device. Make sure the given `format` supports low-light boost.
|
||||
|
||||
Requires `format` to be set.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:131](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
### onError
|
||||
|
||||
• `Optional` **onError**: (`error`: [`CameraRuntimeError`](../classes/CameraRuntimeError.md)) => `void`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`error`): `void`
|
||||
|
||||
Called when any kind of runtime error occured.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `error` | [`CameraRuntimeError`](../classes/CameraRuntimeError.md) |
|
||||
|
||||
##### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:183](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L183)
|
||||
|
||||
___
|
||||
|
||||
### onInitialized
|
||||
|
||||
• `Optional` **onInitialized**: () => `void`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (): `void`
|
||||
|
||||
Called when the camera was successfully initialized.
|
||||
|
||||
##### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:187](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
### orientation
|
||||
|
||||
• `Optional` **orientation**: `Orientation`
|
||||
|
||||
Represents the orientation of all Camera Outputs (Photo, Video, and Frame Processor). If this value is not set, the device orientation is used.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:177](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L177)
|
||||
|
||||
___
|
||||
|
||||
### photo
|
||||
|
||||
• `Optional` **photo**: `boolean`
|
||||
|
||||
Enables **photo capture** with the `takePhoto` function (see ["Taking Photos"](https://react-native-vision-camera.com/docs/guides/capturing#taking-photos))
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:51](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### pixelFormat
|
||||
|
||||
• `Optional` **pixelFormat**: ``"yuv"`` \| ``"rgb"`` \| ``"native"``
|
||||
|
||||
Specifies the pixel format for the video pipeline.
|
||||
|
||||
Frames from a [Frame Processor](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors) will be streamed in the pixel format specified here.
|
||||
|
||||
While `native` and `yuv` are the most efficient formats, some ML models (such as MLKit Barcode detection) require input Frames to be in RGB colorspace, otherwise they just output nonsense.
|
||||
|
||||
- `native`: The hardware native GPU buffer format. This is the most efficient format. (`PRIVATE` on Android, sometimes YUV on iOS)
|
||||
- `yuv`: The YUV (Y'CbCr 4:2:0 or NV21, 8-bit) format, either video- or full-range, depending on hardware capabilities. This is the second most efficient format.
|
||||
- `rgb`: The RGB (RGB, RGBA or ABGRA, 8-bit) format. This is least efficient and requires explicit conversion.
|
||||
|
||||
**`Default`**
|
||||
|
||||
`native`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:75](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
### torch
|
||||
|
||||
• `Optional` **torch**: ``"off"`` \| ``"on"``
|
||||
|
||||
Set the current torch mode.
|
||||
|
||||
Note: The torch is only available on `"back"` cameras, and isn't supported by every phone.
|
||||
|
||||
**`Default`**
|
||||
|
||||
"off"
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:86](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L86)
|
||||
|
||||
___
|
||||
|
||||
### video
|
||||
|
||||
• `Optional` **video**: `boolean`
|
||||
|
||||
Enables **video capture** with the `startRecording` function (see ["Recording Videos"](https://react-native-vision-camera.com/docs/guides/capturing/#recording-videos))
|
||||
|
||||
Note: If both the `photo` and `video` properties are enabled at the same time and the device is running at a `hardwareLevel` of `'legacy'` or `'limited'`, VisionCamera _might_ use a lower resolution for video capture due to hardware constraints.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:57](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
### videoStabilizationMode
|
||||
|
||||
• `Optional` **videoStabilizationMode**: [`VideoStabilizationMode`](../#videostabilizationmode)
|
||||
|
||||
Specifies the video stabilization mode to use.
|
||||
|
||||
Requires a `format` to be set that contains the given `videoStabilizationMode`.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:137](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L137)
|
||||
|
||||
___
|
||||
|
||||
### zoom
|
||||
|
||||
• `Optional` **zoom**: `number`
|
||||
|
||||
Specifies the zoom factor of the current camera, in "factor"/scale.
|
||||
|
||||
This value ranges from `minZoom` (e.g. `1`) to `maxZoom` (e.g. `128`). It is recommended to set this value
|
||||
to the CameraDevice's `neutralZoom` per default and let the user zoom out to the fish-eye (ultra-wide) camera
|
||||
on demand (if available)
|
||||
|
||||
**Note:** Linearly increasing this value always appears logarithmic to the user.
|
||||
|
||||
**`Default`**
|
||||
|
||||
1.0
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:98](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraProps.ts#L98)
|
@ -1,98 +0,0 @@
|
||||
---
|
||||
id: "ErrorWithCause"
|
||||
title: "ErrorWithCause"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents a JSON-style error cause. This contains native `NSError`/`Throwable` information, and can have recursive [`.cause`](ErrorWithCause.md#cause) properties until the ultimate cause has been found.
|
||||
|
||||
## Properties
|
||||
|
||||
### cause
|
||||
|
||||
• `Optional` **cause**: [`ErrorWithCause`](ErrorWithCause.md)
|
||||
|
||||
Optional additional cause for nested errors
|
||||
|
||||
* iOS: N/A
|
||||
* Android: `Throwable.cause`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:105](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L105)
|
||||
|
||||
___
|
||||
|
||||
### code
|
||||
|
||||
• `Optional` **code**: `number`
|
||||
|
||||
The native error's code.
|
||||
|
||||
* iOS: `NSError.code`
|
||||
* Android: N/A
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:70](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
### details
|
||||
|
||||
• `Optional` **details**: `Record`<`string`, `unknown`\>
|
||||
|
||||
Optional additional details
|
||||
|
||||
* iOS: `NSError.userInfo`
|
||||
* Android: N/A
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:91](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
### domain
|
||||
|
||||
• `Optional` **domain**: `string`
|
||||
|
||||
The native error's domain.
|
||||
|
||||
* iOS: `NSError.domain`
|
||||
* Android: N/A
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:77](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
|
||||
• **message**: `string`
|
||||
|
||||
The native error description
|
||||
|
||||
* iOS: `NSError.message`
|
||||
* Android: `Throwable.message`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:84](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### stacktrace
|
||||
|
||||
• `Optional` **stacktrace**: `string`
|
||||
|
||||
Optional Java stacktrace
|
||||
|
||||
* iOS: N/A
|
||||
* Android: `Throwable.stacktrace.toString()`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraError.ts:98](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/CameraError.ts#L98)
|
@ -1,118 +0,0 @@
|
||||
---
|
||||
id: "Frame"
|
||||
title: "Frame"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A single frame, as seen by the camera.
|
||||
|
||||
## Properties
|
||||
|
||||
### bytesPerRow
|
||||
|
||||
• **bytesPerRow**: `number`
|
||||
|
||||
Returns the amount of bytes per row.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Frame.ts:20](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Frame.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### height
|
||||
|
||||
• **height**: `number`
|
||||
|
||||
Returns the height of the frame, in pixels.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Frame.ts:16](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Frame.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### isValid
|
||||
|
||||
• **isValid**: `boolean`
|
||||
|
||||
Whether the underlying buffer is still valid or not. The buffer will be released after the frame processor returns, or `close()` is called.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Frame.ts:8](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Frame.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
### planesCount
|
||||
|
||||
• **planesCount**: `number`
|
||||
|
||||
Returns the number of planes this frame contains.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Frame.ts:24](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Frame.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### width
|
||||
|
||||
• **width**: `number`
|
||||
|
||||
Returns the width of the frame, in pixels.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Frame.ts:12](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Frame.ts#L12)
|
||||
|
||||
## Methods
|
||||
|
||||
### close
|
||||
|
||||
▸ **close**(): `void`
|
||||
|
||||
Closes and disposes the Frame.
|
||||
Only close frames that you have created yourself, e.g. by copying the frame you receive in a frame processor.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
const frameProcessor = useFrameProcessor((frame) => {
|
||||
const smallerCopy = resize(frame, 480, 270)
|
||||
// run AI ...
|
||||
smallerCopy.close()
|
||||
// don't close `frame`!
|
||||
})
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Frame.ts:48](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Frame.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### toString
|
||||
|
||||
▸ **toString**(): `string`
|
||||
|
||||
Returns a string representation of the frame.
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
console.log(frame.toString()) // -> "3840 x 2160 Frame"
|
||||
```
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Frame.ts:33](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Frame.ts#L33)
|
@ -1,26 +0,0 @@
|
||||
---
|
||||
id: "FrameProcessorPerformanceSuggestion"
|
||||
title: "FrameProcessorPerformanceSuggestion"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### suggestedFrameProcessorFps
|
||||
|
||||
• **suggestedFrameProcessorFps**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:9](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/CameraProps.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: ``"can-use-higher-fps"`` \| ``"should-use-lower-fps"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraProps.ts:8](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/CameraProps.ts#L8)
|
@ -1,26 +0,0 @@
|
||||
---
|
||||
id: "FrameRateRange"
|
||||
title: "FrameRateRange"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### maxFrameRate
|
||||
|
||||
• **maxFrameRate**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:104](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/CameraDevice.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### minFrameRate
|
||||
|
||||
• **minFrameRate**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[CameraDevice.ts:103](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/CameraDevice.ts#L103)
|
@ -1,178 +0,0 @@
|
||||
---
|
||||
id: "PhotoFile"
|
||||
title: "PhotoFile"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents a Photo taken by the Camera written to the local filesystem.
|
||||
|
||||
See [`Camera.takePhoto()`](../classes/Camera.md#takephoto)
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`TemporaryFile`](TemporaryFile.md)
|
||||
|
||||
↳ **`PhotoFile`**
|
||||
|
||||
## Properties
|
||||
|
||||
### height
|
||||
|
||||
• **height**: `number`
|
||||
|
||||
The height of the photo, in pixels.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:62](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### isMirrored
|
||||
|
||||
• **isMirrored**: `boolean`
|
||||
|
||||
Whether this photo is mirrored (selfies) or not.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:76](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
### isRawPhoto
|
||||
|
||||
• **isRawPhoto**: `boolean`
|
||||
|
||||
Whether this photo is in RAW format or not.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:66](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L66)
|
||||
|
||||
___
|
||||
|
||||
### metadata
|
||||
|
||||
• `Optional` **metadata**: `Object`
|
||||
|
||||
Metadata information describing the captured image. (iOS only)
|
||||
|
||||
**`See`**
|
||||
|
||||
[AVCapturePhoto.metadata](https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873982-metadata)
|
||||
|
||||
**`Platform`**
|
||||
|
||||
iOS
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `DPIHeight` | `number` | **`Platform`** iOS |
|
||||
| `DPIWidth` | `number` | **`Platform`** iOS |
|
||||
| `Orientation` | `number` | Orientation of the EXIF Image. * 1 = 0 degrees: the correct orientation, no adjustment is required. * 2 = 0 degrees, mirrored: image has been flipped back-to-front. * 3 = 180 degrees: image is upside down. * 4 = 180 degrees, mirrored: image has been flipped back-to-front and is upside down. * 5 = 90 degrees: image has been flipped back-to-front and is on its side. * 6 = 90 degrees, mirrored: image is on its side. * 7 = 270 degrees: image has been flipped back-to-front and is on its far side. * 8 = 270 degrees, mirrored: image is on its far side. |
|
||||
| `{Exif}` | { `ApertureValue`: `number` ; `BrightnessValue`: `number` ; `ColorSpace`: `number` ; `DateTimeDigitized`: `string` ; `DateTimeOriginal`: `string` ; `ExifVersion`: `string` ; `ExposureBiasValue`: `number` ; `ExposureMode`: `number` ; `ExposureProgram`: `number` ; `ExposureTime`: `number` ; `FNumber`: `number` ; `Flash`: `number` ; `FocalLenIn35mmFilm`: `number` ; `FocalLength`: `number` ; `ISOSpeedRatings`: `number`[] ; `LensMake`: `string` ; `LensModel`: `string` ; `LensSpecification`: `number`[] ; `MeteringMode`: `number` ; `OffsetTime`: `string` ; `OffsetTimeDigitized`: `string` ; `OffsetTimeOriginal`: `string` ; `PixelXDimension`: `number` ; `PixelYDimension`: `number` ; `SceneType`: `number` ; `SensingMethod`: `number` ; `ShutterSpeedValue`: `number` ; `SubjectArea`: `number`[] ; `SubsecTimeDigitized`: `string` ; `SubsecTimeOriginal`: `string` ; `WhiteBalance`: `number` } | - |
|
||||
| `{Exif}.ApertureValue` | `number` | - |
|
||||
| `{Exif}.BrightnessValue` | `number` | - |
|
||||
| `{Exif}.ColorSpace` | `number` | - |
|
||||
| `{Exif}.DateTimeDigitized` | `string` | - |
|
||||
| `{Exif}.DateTimeOriginal` | `string` | - |
|
||||
| `{Exif}.ExifVersion` | `string` | - |
|
||||
| `{Exif}.ExposureBiasValue` | `number` | - |
|
||||
| `{Exif}.ExposureMode` | `number` | - |
|
||||
| `{Exif}.ExposureProgram` | `number` | - |
|
||||
| `{Exif}.ExposureTime` | `number` | - |
|
||||
| `{Exif}.FNumber` | `number` | - |
|
||||
| `{Exif}.Flash` | `number` | - |
|
||||
| `{Exif}.FocalLenIn35mmFilm` | `number` | - |
|
||||
| `{Exif}.FocalLength` | `number` | - |
|
||||
| `{Exif}.ISOSpeedRatings` | `number`[] | - |
|
||||
| `{Exif}.LensMake` | `string` | - |
|
||||
| `{Exif}.LensModel` | `string` | - |
|
||||
| `{Exif}.LensSpecification` | `number`[] | - |
|
||||
| `{Exif}.MeteringMode` | `number` | - |
|
||||
| `{Exif}.OffsetTime` | `string` | - |
|
||||
| `{Exif}.OffsetTimeDigitized` | `string` | - |
|
||||
| `{Exif}.OffsetTimeOriginal` | `string` | - |
|
||||
| `{Exif}.PixelXDimension` | `number` | - |
|
||||
| `{Exif}.PixelYDimension` | `number` | - |
|
||||
| `{Exif}.SceneType` | `number` | - |
|
||||
| `{Exif}.SensingMethod` | `number` | - |
|
||||
| `{Exif}.ShutterSpeedValue` | `number` | - |
|
||||
| `{Exif}.SubjectArea` | `number`[] | - |
|
||||
| `{Exif}.SubsecTimeDigitized` | `string` | - |
|
||||
| `{Exif}.SubsecTimeOriginal` | `string` | - |
|
||||
| `{Exif}.WhiteBalance` | `number` | - |
|
||||
| `{MakerApple}?` | `Record`<`string`, `unknown`\> | Represents any data Apple cameras write to the metadata **`Platform`** iOS |
|
||||
| `{TIFF}` | { `DateTime`: `string` ; `HostComputer?`: `string` ; `Make`: `string` ; `Model`: `string` ; `ResolutionUnit`: `number` ; `Software`: `string` ; `XResolution`: `number` ; `YResolution`: `number` } | - |
|
||||
| `{TIFF}.DateTime` | `string` | - |
|
||||
| `{TIFF}.HostComputer?` | `string` | **`Platform`** iOS |
|
||||
| `{TIFF}.Make` | `string` | - |
|
||||
| `{TIFF}.Model` | `string` | - |
|
||||
| `{TIFF}.ResolutionUnit` | `number` | - |
|
||||
| `{TIFF}.Software` | `string` | - |
|
||||
| `{TIFF}.XResolution` | `number` | - |
|
||||
| `{TIFF}.YResolution` | `number` | - |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:85](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L85)
|
||||
|
||||
___
|
||||
|
||||
### orientation
|
||||
|
||||
• **orientation**: `Orientation`
|
||||
|
||||
Display orientation of the photo, relative to the Camera's sensor orientation.
|
||||
|
||||
Note that Camera sensors are landscape, so e.g. "portrait" photos will have a value of "landscape-left", etc.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:72](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### path
|
||||
|
||||
• **path**: `string`
|
||||
|
||||
The path of the file.
|
||||
|
||||
* **Note:** If you want to consume this file (e.g. for displaying it in an `<Image>` component), you might have to add the `file://` prefix.
|
||||
|
||||
* **Note:** This file might get deleted once the app closes because it lives in the temp directory.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TemporaryFile](TemporaryFile.md).[path](TemporaryFile.md#path)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TemporaryFile.ts:12](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/TemporaryFile.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### thumbnail
|
||||
|
||||
• `Optional` **thumbnail**: `Record`<`string`, `unknown`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:77](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### width
|
||||
|
||||
• **width**: `number`
|
||||
|
||||
The width of the photo, in pixels.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:58](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L58)
|
@ -1,32 +0,0 @@
|
||||
---
|
||||
id: "Point"
|
||||
title: "Point"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents a Point in a 2 dimensional coordinate system.
|
||||
|
||||
## Properties
|
||||
|
||||
### x
|
||||
|
||||
• **x**: `number`
|
||||
|
||||
The X coordinate of this Point. (double)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Point.ts:8](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Point.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
### y
|
||||
|
||||
• **y**: `number`
|
||||
|
||||
The Y coordinate of this Point. (double)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Point.ts:12](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/Point.ts#L12)
|
@ -1,96 +0,0 @@
|
||||
---
|
||||
id: "RecordVideoOptions"
|
||||
title: "RecordVideoOptions"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### fileType
|
||||
|
||||
• `Optional` **fileType**: ``"mov"`` \| ``"mp4"``
|
||||
|
||||
Specifies the output file type to record videos into.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[VideoFile.ts:12](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/VideoFile.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### flash
|
||||
|
||||
• `Optional` **flash**: ``"off"`` \| ``"auto"`` \| ``"on"``
|
||||
|
||||
Set the video flash mode. Natively, this just enables the torch while recording.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[VideoFile.ts:8](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/VideoFile.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
### onRecordingError
|
||||
|
||||
• **onRecordingError**: (`error`: [`CameraCaptureError`](../classes/CameraCaptureError.md)) => `void`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`error`): `void`
|
||||
|
||||
Called when there was an unexpected runtime error while recording the video.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `error` | [`CameraCaptureError`](../classes/CameraCaptureError.md) |
|
||||
|
||||
##### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[VideoFile.ts:16](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/VideoFile.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### onRecordingFinished
|
||||
|
||||
• **onRecordingFinished**: (`video`: [`VideoFile`](VideoFile.md)) => `void`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`video`): `void`
|
||||
|
||||
Called when the recording has been successfully saved to file.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `video` | [`VideoFile`](VideoFile.md) |
|
||||
|
||||
##### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[VideoFile.ts:20](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/VideoFile.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### videoCodec
|
||||
|
||||
• `Optional` **videoCodec**: ``"h265"``
|
||||
|
||||
The Video Codec to record in.
|
||||
- `h264`: Widely supported, but might be less efficient, especially with larger sizes or framerates.
|
||||
- `h265`: The HEVC (High-Efficient-Video-Codec) for higher efficient video recordings.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[VideoFile.ts:26](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/VideoFile.ts#L26)
|
@ -1,111 +0,0 @@
|
||||
---
|
||||
id: "TakePhotoOptions"
|
||||
title: "TakePhotoOptions"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### enableAutoDistortionCorrection
|
||||
|
||||
• `Optional` **enableAutoDistortionCorrection**: `boolean`
|
||||
|
||||
Specifies whether the photo output should use content aware distortion correction on this photo request.
|
||||
For example, the algorithm may not apply correction to faces in the center of a photo, but may apply it to faces near the photo’s edges.
|
||||
|
||||
**`Platform`**
|
||||
|
||||
iOS
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:40](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
### enableAutoRedEyeReduction
|
||||
|
||||
• `Optional` **enableAutoRedEyeReduction**: `boolean`
|
||||
|
||||
Specifies whether red-eye reduction should be applied automatically on flash captures.
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:26](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### enableAutoStabilization
|
||||
|
||||
• `Optional` **enableAutoStabilization**: `boolean`
|
||||
|
||||
Indicates whether still image stabilization will be employed when capturing the photo
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:32](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### enableShutterSound
|
||||
|
||||
• `Optional` **enableShutterSound**: `boolean`
|
||||
|
||||
Whether to play the default shutter "click" sound when taking a picture or not.
|
||||
|
||||
**`Default`**
|
||||
|
||||
true
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:46](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### flash
|
||||
|
||||
• `Optional` **flash**: ``"off"`` \| ``"auto"`` \| ``"on"``
|
||||
|
||||
Whether the Flash should be enabled or disabled
|
||||
|
||||
**`Default`**
|
||||
|
||||
"auto"
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:20](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### qualityPrioritization
|
||||
|
||||
• `Optional` **qualityPrioritization**: ``"quality"`` \| ``"balanced"`` \| ``"speed"``
|
||||
|
||||
Indicates how photo quality should be prioritized against speed.
|
||||
|
||||
* `"quality"` Indicates that photo quality is paramount, even at the expense of shot-to-shot time
|
||||
* `"balanced"` Indicates that photo quality and speed of delivery are balanced in priority
|
||||
* `"speed"` Indicates that speed of photo delivery is most important, even at the expense of quality
|
||||
|
||||
**`Default`**
|
||||
|
||||
"balanced"
|
||||
|
||||
#### Defined in
|
||||
|
||||
[PhotoFile.ts:14](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/PhotoFile.ts#L14)
|
@ -1,62 +0,0 @@
|
||||
---
|
||||
id: "TakeSnapshotOptions"
|
||||
title: "TakeSnapshotOptions"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### flash
|
||||
|
||||
• `Optional` **flash**: ``"off"`` \| ``"on"``
|
||||
|
||||
Whether the Flash should be enabled or disabled
|
||||
|
||||
**`Default`**
|
||||
|
||||
"off"
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Snapshot.ts:16](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Snapshot.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### quality
|
||||
|
||||
• `Optional` **quality**: `number`
|
||||
|
||||
Specifies the quality of the JPEG. (0-100, where 100 means best quality (no compression))
|
||||
|
||||
It is recommended to set this to `90` or even `80`, since the user probably won't notice a difference between `90`/`80` and `100`.
|
||||
|
||||
**`Default`**
|
||||
|
||||
100
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Snapshot.ts:9](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Snapshot.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### skipMetadata
|
||||
|
||||
• `Optional` **skipMetadata**: `boolean`
|
||||
|
||||
When set to `true`, metadata reading and mapping will be skipped. ([`metadata`](PhotoFile.md#metadata) will be `null`)
|
||||
|
||||
This might result in a faster capture, as metadata reading and mapping requires File IO.
|
||||
|
||||
**`Default`**
|
||||
|
||||
false
|
||||
|
||||
**`Platform`**
|
||||
|
||||
Android
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Snapshot.ts:27](https://github.com/mrousavy/react-native-vision-camera/blob/c2fb5bf1/src/Snapshot.ts#L27)
|
@ -1,32 +0,0 @@
|
||||
---
|
||||
id: "TemporaryFile"
|
||||
title: "TemporaryFile"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents a temporary file in the local filesystem.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`TemporaryFile`**
|
||||
|
||||
↳ [`PhotoFile`](PhotoFile.md)
|
||||
|
||||
↳ [`VideoFile`](VideoFile.md)
|
||||
|
||||
## Properties
|
||||
|
||||
### path
|
||||
|
||||
• **path**: `string`
|
||||
|
||||
The path of the file.
|
||||
|
||||
* **Note:** If you want to consume this file (e.g. for displaying it in an `<Image>` component), you might have to add the `file://` prefix.
|
||||
|
||||
* **Note:** This file might get deleted once the app closes because it lives in the temp directory.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TemporaryFile.ts:12](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/TemporaryFile.ts#L12)
|
@ -1,48 +0,0 @@
|
||||
---
|
||||
id: "VideoFile"
|
||||
title: "VideoFile"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Represents a Video taken by the Camera written to the local filesystem.
|
||||
|
||||
Related: [`Camera.startRecording()`](../classes/Camera.md#startrecording), [`Camera.stopRecording()`](../classes/Camera.md#stoprecording)
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`TemporaryFile`](TemporaryFile.md)
|
||||
|
||||
↳ **`VideoFile`**
|
||||
|
||||
## Properties
|
||||
|
||||
### duration
|
||||
|
||||
• **duration**: `number`
|
||||
|
||||
Represents the duration of the video, in seconds.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[VideoFile.ts:38](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/VideoFile.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### path
|
||||
|
||||
• **path**: `string`
|
||||
|
||||
The path of the file.
|
||||
|
||||
* **Note:** If you want to consume this file (e.g. for displaying it in an `<Image>` component), you might have to add the `file://` prefix.
|
||||
|
||||
* **Note:** This file might get deleted once the app closes because it lives in the temp directory.
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TemporaryFile](TemporaryFile.md).[path](TemporaryFile.md#path)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TemporaryFile.ts:12](https://github.com/mrousavy/react-native-vision-camera/blob/c66550ed/package/src/TemporaryFile.ts#L12)
|
@ -1,2 +0,0 @@
|
||||
label: "Interfaces"
|
||||
position: 4
|
@ -32,7 +32,7 @@ To achieve **maximum performance**, the `detectFaces` function is written in a n
|
||||
|
||||
### Types
|
||||
|
||||
Similar to a TurboModule, the Frame Processor Plugin Registry API automatically manages type conversion from JS <-> native. They are converted into the most efficient data-structures, as seen here:
|
||||
Similar to a TurboModule, the Frame Processor Plugin Registry API automatically manages type conversion from JS to native. They are converted into the most efficient data-structures, as seen here:
|
||||
|
||||
| JS Type | Objective-C/Swift Type | Java/Kotlin Type |
|
||||
|----------------------|-------------------------------|----------------------------|
|
||||
|
@ -118,14 +118,6 @@ module.exports = {
|
||||
content: '/img/11.png'
|
||||
},
|
||||
],
|
||||
announcementBar: {
|
||||
id: 'support_us',
|
||||
content:
|
||||
'<b>I am currently working on <a target="_blank" href="https://github.com/mrousavy/react-native-vision-camera/issues/1376">VisionCamera V3 ✨</a> which brings a lot of new features and a full rewrite on Android. Please consider <a target="_blank" href="https://github.com/sponsors/mrousavy">sponsoring me on GitHub</a> so I can work on this.</b>',
|
||||
backgroundColor: '#ff5c5c',
|
||||
textColor: '#ffffff',
|
||||
isCloseable: false,
|
||||
},
|
||||
},
|
||||
presets: [
|
||||
[
|
||||
|
@ -12,13 +12,13 @@
|
||||
"clear": "docusaurus clear"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "^2.3.1",
|
||||
"@docusaurus/plugin-google-gtag": "^2.3.1",
|
||||
"@docusaurus/plugin-sitemap": "^2.3.1",
|
||||
"@docusaurus/preset-classic": "^2.3.1",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@vercel/analytics": "^0.1.11",
|
||||
"clsx": "^1.2.1",
|
||||
"@docusaurus/core": "^3.0.0-alpha.0",
|
||||
"@docusaurus/plugin-google-gtag": "^3.0.0-alpha.0",
|
||||
"@docusaurus/plugin-sitemap": "^3.0.0-alpha.0",
|
||||
"@docusaurus/preset-classic": "^3.0.0-alpha.0",
|
||||
"@mdx-js/react": "^2.3.0",
|
||||
"@vercel/analytics": "^1.0.2",
|
||||
"clsx": "^2.0.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
@ -35,9 +35,9 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"docusaurus-plugin-typedoc": "^0.18.0",
|
||||
"typedoc": "^0.24.0-beta.2",
|
||||
"typedoc-plugin-markdown": "^3.14.0",
|
||||
"typescript": "^4.9.5"
|
||||
"docusaurus-plugin-typedoc": "^0.20.1",
|
||||
"typedoc": "^0.25.1",
|
||||
"typedoc-plugin-markdown": "^3.16.0",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
5152
docs/yarn.lock
5152
docs/yarn.lock
File diff suppressed because it is too large
Load Diff
3
package/.gitignore
vendored
3
package/.gitignore
vendored
@ -62,9 +62,6 @@ lib/
|
||||
# we only use yarn
|
||||
package-lock.json
|
||||
|
||||
# TypeDoc/Docusaurus stuff
|
||||
docs/docs/api
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
.cxx/
|
||||
|
@ -7,6 +7,7 @@ export { Frame } from './Frame';
|
||||
export * from './FrameProcessorPlugins';
|
||||
export * from './CameraProps';
|
||||
export * from './PhotoFile';
|
||||
export * from './PixelFormat';
|
||||
export * from './Point';
|
||||
export * from './TemporaryFile';
|
||||
export * from './VideoFile';
|
||||
|
Loading…
Reference in New Issue
Block a user