parent
5c9cc50b60
commit
9ea158ad8f
2
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
2
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
@ -12,7 +12,7 @@ assignees: ''
|
||||
Remember that you can use this project FOR FREE.
|
||||
Badly written issues are less likely to be picked up than well written ones.
|
||||
BEFORE creating an issue, make sure you tried everything in the TROUBLESHOOTING guide:
|
||||
https://cuvent.github.io/react-native-vision-camera/docs/guides/troubleshooting
|
||||
https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting
|
||||
-->
|
||||
|
||||
## What
|
||||
|
@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at support@cuvent.com. All
|
||||
reported by creating an issue on the GitHub repository. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
Read the READMEs in [`android/`](android/README.md), [`ios/`](ios/README.md), and [`cpp/`](cpp/README.md) for a quick overview of the development workflow.
|
||||
|
||||
> You can also open VisionCamera in [a quick online editor (github1s)](https://github1s.com/cuvent/react-native-vision-camera)
|
||||
> You can also open VisionCamera in [a quick online editor (github1s)](https://github1s.com/mrousavy/react-native-vision-camera)
|
||||
|
||||
### iOS
|
||||
|
||||
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright 2021 Cuvent Technologies UG (haftungsbeschränkt)
|
||||
Copyright 2021 Marc Rousavy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
10
README.md
10
README.md
@ -6,10 +6,6 @@
|
||||
<br />
|
||||
<blockquote><b>📸 The Camera library that sees the vision.</b></blockquote>
|
||||
<pre align="center">npm i <a href="https://www.npmjs.com/package/react-native-vision-camera">react-native-vision-camera</a><br/>npx pod-install </pre>
|
||||
<a href="https://cuvent.com">
|
||||
<img height="40" src="docs/static/img/cuvent-logo-text.svg" />
|
||||
</a>
|
||||
<br/>
|
||||
<span>
|
||||
<a align="center" href="https://github.com/mrousavy?tab=followers">
|
||||
<img src="https://img.shields.io/github/followers/mrousavy?label=Follow%20%40mrousavy&style=social" />
|
||||
@ -32,8 +28,8 @@
|
||||
|
||||
### Documentation
|
||||
|
||||
* [Guides](https://cuvent.github.io/react-native-vision-camera/docs/guides)
|
||||
* [API](https://cuvent.github.io/react-native-vision-camera/docs/api)
|
||||
* [Guides](https://mrousavy.github.io/react-native-vision-camera/docs/guides)
|
||||
* [API](https://mrousavy.github.io/react-native-vision-camera/docs/api)
|
||||
* [Example](./example/)
|
||||
|
||||
### Features
|
||||
@ -69,4 +65,4 @@ function App() {
|
||||
|
||||
<br />
|
||||
|
||||
#### 🚀 Get started by [setting up permissions](https://cuvent.github.io/react-native-vision-camera/docs/guides/)!
|
||||
#### 🚀 Get started by [setting up permissions](https://mrousavy.github.io/react-native-vision-camera/docs/guides/)!
|
||||
|
@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
||||
s.authors = package["author"]
|
||||
|
||||
s.platforms = { :ios => "11.0" }
|
||||
s.source = { :git => "https://github.com/cuvent/react-native-vision-camera.git", :tag => "#{s.version}" }
|
||||
s.source = { :git => "https://github.com/mrousavy/react-native-vision-camera.git", :tag => "#{s.version}" }
|
||||
|
||||
s.pod_target_xcconfig = {
|
||||
"DEFINES_MODULE" => "YES",
|
||||
|
@ -47,7 +47,7 @@ suspend fun CameraView.startRecording(options: ReadableMap, onRecordCallback: Ca
|
||||
override fun onVideoSaved(outputFileResults: VideoCapture.OutputFileResults) {
|
||||
val map = Arguments.createMap()
|
||||
map.putString("path", videoFile.absolutePath)
|
||||
// TODO: duration and size - see https://github.com/cuvent/react-native-vision-camera/issues/77
|
||||
// TODO: duration and size - see https://github.com/mrousavy/react-native-vision-camera/issues/77
|
||||
onRecordCallback(map, null)
|
||||
|
||||
// reset the torch mode
|
||||
|
@ -36,7 +36,7 @@ suspend fun CameraView.takePhoto(options: ReadableMap): WritableMap = coroutineS
|
||||
else -> throw InvalidTypeScriptUnionError("flash", flashMode ?: "(null)")
|
||||
}
|
||||
}
|
||||
// All those options are not yet implemented - see https://github.com/cuvent/react-native-vision-camera/issues/75
|
||||
// All those options are not yet implemented - see https://github.com/mrousavy/react-native-vision-camera/issues/75
|
||||
if (options.hasKey("photoCodec")) {
|
||||
// TODO photoCodec
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ const devices = await Camera.getAvailableCameraDevices()
|
||||
```
|
||||
|
||||
:::note
|
||||
See the [`CameraDevice` type](https://github.com/cuvent/react-native-vision-camera/blob/main/src/CameraDevice.ts) for more information about a Camera Device
|
||||
See the [`CameraDevice` type](https://github.com/mrousavy/react-native-vision-camera/blob/main/src/CameraDevice.ts) for more information about a Camera Device
|
||||
:::
|
||||
|
||||
A camera device (`CameraDevice`) contains a list of physical device types this camera device consists of.
|
||||
|
@ -50,7 +50,7 @@ The `CameraError` type is a baseclass type for all other errors and provides the
|
||||
* `cause.cause?`: The cause that caused this cause. (Recursive) (Optional)
|
||||
|
||||
:::note
|
||||
See [the `CameraError.ts` file](https://github.com/cuvent/react-native-vision-camera/blob/main/src/CameraError.ts) for a list of all possible error codes
|
||||
See [the `CameraError.ts` file](https://github.com/mrousavy/react-native-vision-camera/blob/main/src/CameraError.ts) for a list of all possible error codes
|
||||
:::
|
||||
|
||||
### Runtime Errors
|
||||
|
@ -39,7 +39,7 @@ function App() {
|
||||
```
|
||||
|
||||
:::note
|
||||
See the [CameraPreset.ts](https://github.com/cuvent/react-native-vision-camera/blob/main/src/CameraPreset.ts) type for more information about presets
|
||||
See the [CameraPreset.ts](https://github.com/mrousavy/react-native-vision-camera/blob/main/src/CameraPreset.ts) type for more information about presets
|
||||
:::
|
||||
|
||||
:::warning
|
||||
@ -61,7 +61,7 @@ Each application has different needs, so the format filtering is up to you.
|
||||
To get all available formats, simply use the `CameraDevice`'s `.formats` property. See how to get a camera device in the [Camera Devices guide](devices).
|
||||
|
||||
:::note
|
||||
You can also manually get all camera devices and decide which device to use based on the available `formats`. In fact, this is how we do it in the [Cuvent](https://cuvent.com) app.
|
||||
You can also manually get all camera devices and decide which device to use based on the available `formats`.
|
||||
:::
|
||||
|
||||
This example shows how you would pick the format with the _highest frame rate_:
|
||||
|
@ -63,19 +63,19 @@ export function detectObject(frame: Frame): string {
|
||||
}
|
||||
```
|
||||
|
||||
You can also manipulate the buffer and return it (or a copy of it) by using the [`Frame` class](https://github.com/cuvent/react-native-vision-camera/blob/main/ios/Frame%20Processor/Frame.h):
|
||||
You can also manipulate the buffer and return it (or a copy of it) by using the [`Frame` class](https://github.com/mrousavy/react-native-vision-camera/blob/main/ios/Frame%20Processor/Frame.h):
|
||||
|
||||
```objc
|
||||
#import <VisionCamera/Frame.h>
|
||||
|
||||
static inline id resize(Frame* frame, NSArray args) {
|
||||
CMSampleBufferRef resizedBuffer = // ...
|
||||
|
||||
|
||||
return [[Frame alloc] initWithBuffer:resizedBuffer orientation:frame.orientation];
|
||||
}
|
||||
```
|
||||
|
||||
Which returns a [`Frame`](https://github.com/cuvent/react-native-vision-camera/blob/main/src/Frame.ts) in JS:
|
||||
Which returns a [`Frame`](https://github.com/mrousavy/react-native-vision-camera/blob/main/src/Frame.ts) in JS:
|
||||
|
||||
```js
|
||||
const frameProcessor = useFrameProcessor((frame) => {
|
||||
@ -172,7 +172,7 @@ Your Frame Processor Plugins have to be fast. VisionCamera automatically detects
|
||||
|
||||
#### 🚀 Create your first Frame Processor Plugin for [iOS](frame-processors-plugins-ios) or [Android](frame-processors-plugins-android)!
|
||||
|
||||
[1]: https://github.com/cuvent/react-native-vision-camera/blob/main/src/Frame.ts
|
||||
[2]: https://github.com/cuvent/react-native-vision-camera/blob/main/ios/Frame%20Processor/Frame.h
|
||||
[1]: https://github.com/mrousavy/react-native-vision-camera/blob/main/src/Frame.ts
|
||||
[2]: https://github.com/mrousavy/react-native-vision-camera/blob/main/ios/Frame%20Processor/Frame.h
|
||||
[3]: https://developer.android.com/reference/androidx/camera/core/ImageProxy
|
||||
[4]: https://github.com/facebook/react-native/blob/9a43eac7a32a6ba3164a048960101022a92fcd5a/React/Base/RCTBridgeModule.h#L20-L24
|
||||
|
@ -67,7 +67,7 @@ If you want to distribute your Frame Processor Plugin, simply use npm.
|
||||
4. Implement the Frame Processor Plugin in the iOS, Android and JS/TS Codebase using the guides above
|
||||
5. Add installation instructions to let users know they have to add your frame processor in the `babel.config.js` configuration.
|
||||
6. Publish the plugin to npm. Users will only have to install the plugin using `npm i vision-camera-plugin-xxxxx` and add it to their `babel.config.js` file.
|
||||
7. [Add the plugin to the **official VisionCamera plugin list**](https://github.com/cuvent/react-native-vision-camera/edit/main/docs/docs/guides/FRAME_PROCESSOR_PLUGIN_LIST.mdx) for more visibility
|
||||
7. [Add the plugin to the **official VisionCamera plugin list**](https://github.com/mrousavy/react-native-vision-camera/edit/main/docs/docs/guides/FRAME_PROCESSOR_PLUGIN_LIST.mdx) for more visibility
|
||||
|
||||
<br />
|
||||
|
||||
|
@ -48,7 +48,7 @@ VISION_EXPORT_FRAME_PROCESSOR(scanQRCodes)
|
||||
@end
|
||||
```
|
||||
|
||||
4. **Implement your Frame Processing.** See the [QR Code Plugin (Objective-C)](https://github.com/cuvent/react-native-vision-camera/blob/main/example/ios/Frame%20Processor%20Plugins/QR%20Code%20Plugin%20%28Objective%2DC%29) for reference.
|
||||
4. **Implement your Frame Processing.** See the [QR Code Plugin (Objective-C)](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/ios/Frame%20Processor%20Plugins/QR%20Code%20Plugin%20%28Objective%2DC%29) for reference.
|
||||
|
||||
:::note
|
||||
The JS function name will be equal to the Objective-C function name you choose (with a `__` prefix). Make sure it is unique across other Frame Processor Plugins, and doesn't shadow a JS runtime variable.
|
||||
@ -97,7 +97,7 @@ public class QRCodeFrameProcessorPlugin: NSObject, FrameProcessorPluginBase {
|
||||
}
|
||||
```
|
||||
|
||||
5. **Implement your frame processing.** See [QR Code Plugin (Swift)](https://github.com/cuvent/react-native-vision-camera/blob/main/example/ios/Frame%20Processor%20Plugins/QR%20Code%20Plugin%20%28Swift%29) for reference.
|
||||
5. **Implement your frame processing.** See [QR Code Plugin (Swift)](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/ios/Frame%20Processor%20Plugins/QR%20Code%20Plugin%20%28Swift%29) for reference.
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
@ -41,7 +41,7 @@ You have to restart metro-bundler for changes in the `babel.config.js` file to t
|
||||
<br />
|
||||
<p align="center">
|
||||
<b>
|
||||
<a href="https://github.com/cuvent/react-native-vision-camera/edit/main/docs/docs/guides/FRAME_PROCESSOR_PLUGIN_LIST.mdx">Click here</a> to add your Frame Processor Plugin to this list!
|
||||
<a href="https://github.com/mrousavy/react-native-vision-camera/edit/main/docs/docs/guides/FRAME_PROCESSOR_PLUGIN_LIST.mdx">Click here</a> to add your Frame Processor Plugin to this list!
|
||||
</b>
|
||||
</p>
|
||||
<br />
|
||||
|
@ -16,7 +16,7 @@ The Camera's `isActive` property can be used to _pause_ the session (`isActive={
|
||||
|
||||
For example, you want to **pause the camera** when the user **navigates to another page** or **minimizes the app** since otherwise the camera continues to run in the background without the user seeing it, causing **siginificant battery drain**. Also, on iOS a green dot indicates the user that the camera is still active, possibly causing the user to raise privacy concerns. (🔗 See ["About the orange and green indicators in your iPhone status bar"](https://support.apple.com/en-us/HT211876))
|
||||
|
||||
This example demonstrates how you could pause the camera stream once the app goes into background using a [custom `useIsAppForeground` hook](https://github.com/cuvent/react-native-vision-camera/blob/main/example/src/hooks/useIsForeground.ts):
|
||||
This example demonstrates how you could pause the camera stream once the app goes into background using a [custom `useIsAppForeground` hook](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/src/hooks/useIsForeground.ts):
|
||||
|
||||
```tsx
|
||||
function App() {
|
||||
|
@ -46,7 +46,7 @@ Before opening an issue, make sure you try the following:
|
||||
npm i # or "yarn"
|
||||
```
|
||||
2. Since the Android implementation uses the not-yet fully stable **CameraX** API, make sure you've browsed the [CameraX issue tracker](https://issuetracker.google.com/issues?q=componentid:618491%20status:open) to find out if your issue is a limitation by the **CameraX** library even I cannot get around.
|
||||
3. Make sure your minimum SDK version is **21 or higher**, and target SDK version is **30 or higher**. See [the example's `build.gradle`](https://github.com/cuvent/react-native-vision-camera/blob/main/example/android/build.gradle#L5-L9) for reference.
|
||||
3. Make sure your minimum SDK version is **21 or higher**, and target SDK version is **30 or higher**. See [the example's `build.gradle`](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/android/build.gradle#L5-L9) for reference.
|
||||
1. Open your `build.gradle`
|
||||
2. Set `buildToolsVersion` to `30.0.0` or higher
|
||||
3. Set `compileSdkVersion` to `30` or higher
|
||||
@ -65,4 +65,4 @@ Before opening an issue, make sure you try the following:
|
||||
|
||||
## Issues
|
||||
|
||||
If nothing has helped so far, try browsing the [GitHub issues](https://github.com/cuvent/react-native-vision-camera/issues?q=is%3Aissue). If your issue doesn't exist, [create a new one](https://github.com/cuvent/react-native-vision-camera/issues/new/choose). Make sure to fill out the template and include as many details as possible. Also try to reproduce the issue in the [example app](https://github.com/cuvent/react-native-vision-camera/blob/main/example).
|
||||
If nothing has helped so far, try browsing the [GitHub issues](https://github.com/mrousavy/react-native-vision-camera/issues?q=is%3Aissue). If your issue doesn't exist, [create a new one](https://github.com/mrousavy/react-native-vision-camera/issues/new/choose). Make sure to fill out the template and include as many details as possible. Also try to reproduce the issue in the [example app](https://github.com/mrousavy/react-native-vision-camera/blob/main/example).
|
||||
|
@ -96,7 +96,7 @@ A Camera's `zoom` property is represented in a **logarithmic scale**. That means
|
||||
|
||||
### Pinch-to-zoom
|
||||
|
||||
The above example only demonstrates how to animate the `zoom` property. To actually implement pinch-to-zoom or pan-to-zoom, take a look at the [VisionCamera example app](https://github.com/cuvent/react-native-vision-camera/tree/main/example), the pinch-to-zoom gesture can be found [here](https://github.com/cuvent/react-native-vision-camera/blob/d8551792e97eaa6fa768f54059ffce054bf748d9/example/src/CameraPage.tsx#L162-L176), and the pan-to-zoom gesture can be found [here](https://github.com/cuvent/react-native-vision-camera/blob/d8551792e97eaa6fa768f54059ffce054bf748d9/example/src/views/CaptureButton.tsx#L185-L205). They implement a real world use-case, where the maximum zoom value is clamped to a realistic value, and the zoom responds very gracefully by using a logarithmic scale.
|
||||
The above example only demonstrates how to animate the `zoom` property. To actually implement pinch-to-zoom or pan-to-zoom, take a look at the [VisionCamera example app](https://github.com/mrousavy/react-native-vision-camera/tree/main/example), the pinch-to-zoom gesture can be found [here](https://github.com/mrousavy/react-native-vision-camera/blob/d8551792e97eaa6fa768f54059ffce054bf748d9/example/src/CameraPage.tsx#L162-L176), and the pan-to-zoom gesture can be found [here](https://github.com/mrousavy/react-native-vision-camera/blob/d8551792e97eaa6fa768f54059ffce054bf748d9/example/src/views/CaptureButton.tsx#L185-L205). They implement a real world use-case, where the maximum zoom value is clamped to a realistic value, and the zoom responds very gracefully by using a logarithmic scale.
|
||||
|
||||
<br />
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
module.exports = {
|
||||
title: 'VisionCamera',
|
||||
tagline: '📸 The Camera library that sees the vision.',
|
||||
url: 'https://cuvent.github.io',
|
||||
url: 'https://mrousavy.github.io',
|
||||
baseUrl: '/react-native-vision-camera/',
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'throw',
|
||||
favicon: './favicon.ico',
|
||||
organizationName: 'cuvent',
|
||||
organizationName: 'mrousavy',
|
||||
projectName: 'react-native-vision-camera',
|
||||
themeConfig: {
|
||||
algolia: {
|
||||
@ -34,12 +34,12 @@ module.exports = {
|
||||
position: 'left'
|
||||
},
|
||||
{
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera/tree/main/example',
|
||||
href: 'https://github.com/mrousavy/react-native-vision-camera/tree/main/example',
|
||||
label: 'Example App',
|
||||
position: 'left'
|
||||
},
|
||||
{
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera',
|
||||
href: 'https://github.com/mrousavy/react-native-vision-camera',
|
||||
label: 'GitHub',
|
||||
position: 'right',
|
||||
},
|
||||
@ -61,7 +61,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
label: 'Example App',
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera/tree/main/example',
|
||||
href: 'https://github.com/mrousavy/react-native-vision-camera/tree/main/example',
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -70,16 +70,12 @@ module.exports = {
|
||||
items: [
|
||||
{
|
||||
label: 'GitHub discussions',
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera/discussions',
|
||||
href: 'https://github.com/mrousavy/react-native-vision-camera/discussions',
|
||||
},
|
||||
{
|
||||
label: 'Twitter (@mrousavy)',
|
||||
href: 'https://twitter.com/mrousavy',
|
||||
},
|
||||
{
|
||||
label: 'Twitter (@CuventTech)',
|
||||
href: 'https://twitter.com/CuventTech',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -87,16 +83,16 @@ module.exports = {
|
||||
items: [
|
||||
{
|
||||
label: 'GitHub',
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera',
|
||||
href: 'https://github.com/mrousavy/react-native-vision-camera',
|
||||
},
|
||||
{
|
||||
label: 'Cuvent',
|
||||
href: 'https://cuvent.com',
|
||||
label: 'Marc\'s Portfolio',
|
||||
href: 'https://mrousavy.github.io',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Copyright © ${new Date().getFullYear()} Cuvent`,
|
||||
copyright: `Copyright © ${new Date().getFullYear()} Marc Rousavy`,
|
||||
},
|
||||
},
|
||||
presets: [
|
||||
@ -107,7 +103,7 @@ module.exports = {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
// Please change this to your repo.
|
||||
editUrl:
|
||||
'https://github.com/cuvent/react-native-vision-camera/edit/main/docs/',
|
||||
'https://github.com/mrousavy/react-native-vision-camera/edit/main/docs/',
|
||||
},
|
||||
theme: {
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
|
@ -28,7 +28,7 @@
|
||||
To try the playground out for yourself, run the following commands:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/cuvent/react-native-vision-camera
|
||||
git clone https://github.com/mrousavy/react-native-vision-camera
|
||||
cd react-native-vision-camera
|
||||
yarn bootstrap
|
||||
```
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraBridge.h
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 09.11.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraError.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 14.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
@ -139,7 +139,8 @@ enum FormatError {
|
||||
case .invalidHdr:
|
||||
return "The currently selected format does not support HDR capture! Make sure you select a format which `frameRateRanges` includes `supportsPhotoHDR`!"
|
||||
case let .invalidColorSpace(colorSpace):
|
||||
return "The currently selected format does not support the colorSpace \"\(colorSpace)\"! Make sure you select a format which `colorSpaces` includes \"\(colorSpace)\"!"
|
||||
return "The currently selected format does not support the colorSpace \"\(colorSpace)\"! " +
|
||||
"Make sure you select a format which `colorSpaces` includes \"\(colorSpace)\"!"
|
||||
case let .invalidPreset(preset):
|
||||
return "The preset \"\(preset)\" is not available for the current camera device."
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraView+focus.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 19.02.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraView+RecordVideo.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 16.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraView+TakePhoto.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 16.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraView+Zoom.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 18.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraView.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 09.11.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraViewManager.m
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 09.11.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// CameraViewManager.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 09.11.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice+isMultiCam.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 07.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice+neutralZoom.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 10.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice+physicalDevices.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 10.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.Format+isBetterThan.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 19.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.Format+matchesFilter.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.Format+toDictionary.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCapturePhotoOutput+mirror.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 18.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureVideoDataOutput+setOrientation.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 18.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVFrameRateRange+includes.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// Collection+safe.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 10.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVAuthorizationStatus+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 29.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureColorSpace+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 19.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.DeviceType+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.FlashMode+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.Format.AutoFocusSystem+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 29.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.Position+String.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureDevice.TorchMode+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 18.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCapturePhotoOutput.QualityPrioritization+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureSession.Preset+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVCaptureVideoStabilizationMode+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 29.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// AVVideoCodecType+descriptor.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// EnumParserError.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 18.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// PhotoCaptureDelegate.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// MakeReactError.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// Promise.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 14.01.21.
|
||||
// Copyright © 2021 mrousavy. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// ReactLogger.swift
|
||||
// Cuvent
|
||||
// mrousavy
|
||||
//
|
||||
// Created by Marc Rousavy on 15.12.20.
|
||||
// Copyright © 2020 mrousavy. All rights reserved.
|
||||
|
@ -50,7 +50,6 @@
|
||||
"vision",
|
||||
"native",
|
||||
"module",
|
||||
"cuvent",
|
||||
"react",
|
||||
"ai",
|
||||
"ar",
|
||||
@ -58,13 +57,13 @@
|
||||
"qr-code",
|
||||
"scanner"
|
||||
],
|
||||
"repository": "https://github.com/cuvent/react-native-vision-camera",
|
||||
"repository": "https://github.com/mrousavy/react-native-vision-camera",
|
||||
"author": "Marc Rousavy <marcrousavy@hotmail.com> (https://github.com/mrousavy)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cuvent/react-native-vision-camera/issues"
|
||||
"url": "https://github.com/mrousavy/react-native-vision-camera/issues"
|
||||
},
|
||||
"homepage": "https://cuvent.github.io/react-native-vision-camera/",
|
||||
"homepage": "https://mrousavy.github.io/react-native-vision-camera/",
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
|
@ -36,7 +36,7 @@ if (CameraModule == null) console.error("Camera: Native Module 'CameraView' was
|
||||
/**
|
||||
* ### A powerful `<Camera>` component.
|
||||
*
|
||||
* Read the [VisionCamera documentation](https://cuvent.github.io/react-native-vision-camera/) for more information.
|
||||
* Read the [VisionCamera documentation](https://mrousavy.github.io/react-native-vision-camera/) for more information.
|
||||
*
|
||||
* The `<Camera>` component's most important (and therefore _required_) properties are:
|
||||
*
|
||||
|
@ -60,7 +60,7 @@ export const parsePhysicalDeviceTypes = (
|
||||
* * `"heic"`: The compressed HEIC color space.
|
||||
* * `"private"`: The Android private opaque image format. (The choices of the actual format and pixel data layout are entirely up to the device-specific and framework internal implementations, and may vary depending on use cases even for the same device. These buffers are not directly accessible to the application)
|
||||
* * `"depth-16"`: The Android dense depth image format (16 bit)
|
||||
* * `"unknown"`: Placeholder for an unknown image/pixel format. [Edit this file](https://github.com/cuvent/react-native-vision-camera/edit/main/android/src/main/java/com/mrousavy/camera/parsers/ImageFormat+String.kt) to add a name for the unknown format.
|
||||
* * `"unknown"`: Placeholder for an unknown image/pixel format. [Edit this file](https://github.com/mrousavy/react-native-vision-camera/edit/main/android/src/main/java/com/mrousavy/camera/parsers/ImageFormat+String.kt) to add a name for the unknown format.
|
||||
*
|
||||
* > See ["Android Color Formats"](https://jbit.net/Android_Colors/) for more information.
|
||||
*/
|
||||
@ -247,7 +247,7 @@ export interface CameraDevice {
|
||||
/**
|
||||
* 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 {@linkcode CameraProps.format | Camera's .format} property.
|
||||
*
|
||||
* See [the Camera Formats documentation](https://cuvent.github.io/react-native-vision-camera/docs/guides/formats) for more information about Camera Formats.
|
||||
* See [the Camera Formats documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/formats) for more information about Camera Formats.
|
||||
*/
|
||||
formats: CameraDeviceFormat[];
|
||||
/**
|
||||
@ -257,7 +257,7 @@ export interface CameraDevice {
|
||||
* * On newer **Android** devices this value is always `true`.
|
||||
* * On older **Android** devices this value is `true` if the device's hardware level is `LIMITED` or above, `false` otherwise. (`LEGACY`) (See [this table](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#regular-capture))
|
||||
*
|
||||
* If the device does not allow enabling `photo` and `video` capture at the same time, you might want to fall back to **snapshot capture** (See [**"Taking Snapshots"**](https://cuvent.github.io/react-native-vision-camera/docs/guides/capturing#taking-snapshots)) instead:
|
||||
* If the device does not allow enabling `photo` and `video` capture at the same time, you might want to fall back to **snapshot capture** (See [**"Taking Snapshots"**](https://mrousavy.github.io/react-native-vision-camera/docs/guides/capturing#taking-snapshots)) instead:
|
||||
*
|
||||
* @example
|
||||
* ```tsx
|
||||
|
@ -141,14 +141,14 @@ class CameraError<TCode extends CameraErrorCode> extends Error {
|
||||
/**
|
||||
* Represents any kind of error that occured while trying to capture a video or photo.
|
||||
*
|
||||
* See the ["Camera Errors" documentation](https://cuvent.github.io/react-native-vision-camera/docs/guides/errors) for more information about Camera Errors.
|
||||
* See the ["Camera Errors" documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/errors) for more information about Camera Errors.
|
||||
*/
|
||||
export class CameraCaptureError extends CameraError<CaptureError> {}
|
||||
|
||||
/**
|
||||
* Represents any kind of error that occured in the Camera View Module.
|
||||
*
|
||||
* See the ["Camera Errors" documentation](https://cuvent.github.io/react-native-vision-camera/docs/guides/errors) for more information about Camera Errors.
|
||||
* See the ["Camera Errors" documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/errors) for more information about Camera Errors.
|
||||
*/
|
||||
export class CameraRuntimeError extends CameraError<
|
||||
PermissionError | ParameterError | DeviceError | FormatError | SessionError | SystemError | UnknownError
|
||||
|
@ -8,7 +8,7 @@ export interface CameraProps extends ViewProps {
|
||||
/**
|
||||
* The Camera Device to use.
|
||||
*
|
||||
* See the [Camera Devices](https://cuvent.github.io/react-native-vision-camera/docs/guides/devices) section in the documentation for more information about Camera Devices.
|
||||
* See the [Camera Devices](https://mrousavy.github.io/react-native-vision-camera/docs/guides/devices) section in the documentation for more information about Camera Devices.
|
||||
*
|
||||
* @example
|
||||
* ```tsx
|
||||
@ -26,7 +26,7 @@ export interface CameraProps extends ViewProps {
|
||||
*/
|
||||
device: CameraDevice;
|
||||
/**
|
||||
* Whether the Camera should actively stream video frames, or not. See the [documentation about the `isActive` prop](https://cuvent.github.io/react-native-vision-camera/docs/guides/lifecycle#the-isactive-prop) for more information.
|
||||
* Whether the Camera should actively stream video frames, or not. See the [documentation about the `isActive` prop](https://mrousavy.github.io/react-native-vision-camera/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.
|
||||
*
|
||||
@ -36,16 +36,16 @@ export interface CameraProps extends ViewProps {
|
||||
|
||||
//#region Use-cases
|
||||
/**
|
||||
* * Enables **photo capture** with the `takePhoto` function (see ["Taking Photos"](https://cuvent.github.io/react-native-vision-camera/docs/guides/capturing#taking-photos))
|
||||
* * Enables **photo capture** with the `takePhoto` function (see ["Taking Photos"](https://mrousavy.github.io/react-native-vision-camera/docs/guides/capturing#taking-photos))
|
||||
*/
|
||||
photo?: boolean;
|
||||
/**
|
||||
* * Enables **video capture** with the `startRecording` function (see ["Recording Videos"](https://cuvent.github.io/react-native-vision-camera/docs/guides/capturing/#recording-videos))
|
||||
* * Enables **frame processing** (see ["Frame Processors"](https://cuvent.github.io/react-native-vision-camera/docs/guides/frame-processors))
|
||||
* * Enables **video capture** with the `startRecording` function (see ["Recording Videos"](https://mrousavy.github.io/react-native-vision-camera/docs/guides/capturing/#recording-videos))
|
||||
* * Enables **frame processing** (see ["Frame Processors"](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors))
|
||||
*/
|
||||
video?: boolean;
|
||||
/**
|
||||
* * Enables **audio capture** for video recordings (see ["Recording Videos"](https://cuvent.github.io/react-native-vision-camera/docs/guides/capturing/#recording-videos))
|
||||
* * Enables **audio capture** for video recordings (see ["Recording Videos"](https://mrousavy.github.io/react-native-vision-camera/docs/guides/capturing/#recording-videos))
|
||||
*/
|
||||
audio?: boolean;
|
||||
//#endregion
|
||||
@ -70,7 +70,7 @@ export interface CameraProps extends ViewProps {
|
||||
/**
|
||||
* 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://cuvent.github.io/react-native-vision-camera/docs/guides/animated).
|
||||
* If you want to implement a custom zoom gesture, see [the Zooming with Reanimated documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/animated).
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
@ -159,7 +159,7 @@ export interface CameraProps extends ViewProps {
|
||||
/**
|
||||
* A worklet which will be called for every frame the Camera "sees". Throttle the Frame Processor's frame rate with {@linkcode frameProcessorFps}.
|
||||
*
|
||||
* > See [the Frame Processors documentation](https://cuvent.github.io/react-native-vision-camera/docs/guides/frame-processors) for more information
|
||||
* > See [the Frame Processors documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors) for more information
|
||||
*
|
||||
* @example
|
||||
* ```tsx
|
||||
|
@ -32,7 +32,7 @@ export interface VideoFile extends TemporaryFile {
|
||||
/**
|
||||
* Represents the duration of the video, in seconds.
|
||||
*
|
||||
* This is `undefined` on Android, see [issue #77](https://github.com/cuvent/react-native-vision-camera/issues/77)
|
||||
* This is `undefined` on Android, see [issue #77](https://github.com/mrousavy/react-native-vision-camera/issues/77)
|
||||
*
|
||||
* @platform iOS
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@ import type { Frame } from 'src/Frame';
|
||||
type FrameProcessor = (frame: Frame) => void;
|
||||
|
||||
/**
|
||||
* Returns a memoized Frame Processor function wich you can pass to the `<Camera>`. (See ["Frame Processors"](https://cuvent.github.io/react-native-vision-camera/docs/guides/frame-processors))
|
||||
* 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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user