Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ VisionCamera V4 ✨ #2623

Merged
merged 206 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
dd4c8fb
feat: Give V4 🫴
mrousavy Feb 23, 2024
3618fa0
Update to compile SDK 34
mrousavy Feb 23, 2024
295d914
fix kotlin error
mrousavy Feb 23, 2024
bf0e411
fix ui thread
mrousavy Feb 23, 2024
1031be3
Run all on Main Thread
mrousavy Feb 23, 2024
d87c8b5
Update lifecycle
mrousavy Feb 23, 2024
afae30d
Take Photo?
mrousavy Feb 23, 2024
045162f
Type Camera Errors
mrousavy Feb 23, 2024
23a334d
Unbind before starting bind
mrousavy Feb 23, 2024
5b60fc4
Create Recording base?
mrousavy Feb 23, 2024
532837d
Add `photoQualityBalance` to iOS
mrousavy Feb 26, 2024
e17eb50
feat: Add `takeSnapshot()` to `PreviewView`
mrousavy Feb 26, 2024
f0fb942
Add new API
mrousavy Feb 26, 2024
a89f72b
Low Light Boost throttles
mrousavy Feb 26, 2024
08d86d4
feat: Add CodeScanner pipeline (`ImageAnalysis`)
mrousavy Feb 26, 2024
e889192
Format
mrousavy Feb 26, 2024
49e2620
Remove outputs
mrousavy Feb 26, 2024
b57ac46
Update CameraSession.kt
mrousavy Feb 26, 2024
5b63ac4
Call back with Video result
mrousavy Feb 26, 2024
2db5c99
Delete `RecordingSession`
mrousavy Feb 26, 2024
00d4479
Configure zoom and torch
mrousavy Feb 26, 2024
a880ab0
Only update torch, zoom or exposure if needed
mrousavy Feb 26, 2024
d4275ca
Create `takeSnapshot()`
mrousavy Feb 26, 2024
6b33339
Use `compressionQuality`
mrousavy Feb 26, 2024
c5d3688
Format
mrousavy Feb 26, 2024
708d95d
Catch CameraErrors directly
mrousavy Feb 26, 2024
b752e5b
Use new API for Snapshot
mrousavy Feb 26, 2024
0c53379
Throw `.fileError`
mrousavy Feb 26, 2024
fb4628a
fix temp filename
mrousavy Feb 26, 2024
a638b66
fix: Implement `takeSnaphot` on iOS
mrousavy Feb 26, 2024
82a70f0
Update Camera.tsx
mrousavy Feb 26, 2024
f770e11
Don't re-initialize outputs if only inputId changes
mrousavy Feb 26, 2024
e39fc25
Update CameraSession.kt
mrousavy Feb 26, 2024
2a2d2db
Update CameraSession.kt
mrousavy Feb 26, 2024
4404455
Use photo/video size selectors
mrousavy Feb 26, 2024
d8dbd53
fix: Use runOnUiThread only if needed
mrousavy Feb 26, 2024
202e8ec
Code org
mrousavy Feb 26, 2024
e5e4d39
Update CameraSession.kt
mrousavy Feb 26, 2024
b9a0434
feat: Use HDR or NIGHT extensions if available
mrousavy Feb 26, 2024
cb2f1c3
fix: Check for ImageAnalysis support
mrousavy Feb 26, 2024
7b46390
feat: Shutter sound and stabilization
mrousavy Feb 26, 2024
372f922
Update CameraSession.kt
mrousavy Feb 26, 2024
71b6de3
restructure Threading a bit
mrousavy Feb 27, 2024
ec8e080
Restructure Threading in CameraSession, configure is UI Thread
mrousavy Feb 27, 2024
fbf843e
Update CameraSession.kt
mrousavy Feb 27, 2024
6a1e146
Update CameraSession.kt
mrousavy Feb 27, 2024
6e22a02
Better `mainExecutor`
mrousavy Feb 27, 2024
6d2952b
Implement `focus()`
mrousavy Feb 27, 2024
adead1c
Use file type
mrousavy Feb 27, 2024
0aeec61
Make `VideoPipeline` a CameraX use-case
mrousavy Feb 27, 2024
310d52b
Update CameraQueues.kt
mrousavy Feb 27, 2024
668dbf4
Update VideoPipeline.kt
mrousavy Feb 27, 2024
00155c9
feat: Implement native HardwareBuffer rendering for `VideoPipeline`
mrousavy Feb 27, 2024
4530f58
Try use VideoPipeline
mrousavy Feb 27, 2024
52fa376
Try extending ImageAnalysis
mrousavy Feb 27, 2024
747c588
Create `FrameProcessorEffect` as camera middleman
mrousavy Feb 28, 2024
62ccd25
Use PREVIEW output
mrousavy Feb 28, 2024
dd895a7
fix not running FP for PREVIEW
mrousavy Feb 28, 2024
8bb8e12
Update FrameProcessorEffect.kt
mrousavy Feb 28, 2024
d0eb702
feat: Allow setting custom format in ImageWriter
mrousavy Feb 28, 2024
9f8ec73
Restructure code a bit
mrousavy Feb 28, 2024
d18e8ee
Make everything synchronized
mrousavy Feb 28, 2024
b923f81
Make `FrameProcessorEffect` closeable
mrousavy Feb 28, 2024
185265b
chore: Clean up Codebase
mrousavy Feb 28, 2024
93527a2
Don't re-create Recorder if actively recording
mrousavy Feb 28, 2024
158de70
docs: Update docs for `qualityBalance`
mrousavy Feb 28, 2024
b64204e
Update CameraProps.ts
mrousavy Feb 28, 2024
b63d9c7
Remove OpenGL VideoPipeline (now CameraX does that)
mrousavy Feb 28, 2024
4f95d20
Properly disable CameraSession when `isActive=false`
mrousavy Feb 28, 2024
15504af
Remove a few Errors
mrousavy Feb 28, 2024
d08c0b0
chore: release 4.0.0-beta.0
mrousavy Feb 29, 2024
f88d8f8
chore: release 4.0.0-beta.1
mrousavy Feb 29, 2024
e135b3b
fix: Rename to `qualityBalance`
mrousavy Feb 29, 2024
b578e52
Update package.json
mrousavy Feb 29, 2024
660ea6d
Small changes
mrousavy Feb 29, 2024
4325d14
Update CameraView.kt
mrousavy Feb 29, 2024
c75494a
Throw focus-canceled
mrousavy Feb 29, 2024
7edd2a2
Implement `onStarted` and `onStopped` for Android again
mrousavy Feb 29, 2024
7e96fec
Always activate Camera lifecycle, ignore `isAttachedToWindow`
mrousavy Feb 29, 2024
dd49365
feat: Add `onShutter` event
mrousavy Feb 29, 2024
e855706
chore: release 4.0.0-beta.2
mrousavy Feb 29, 2024
c6e55ac
fix: Fix optional delegate
mrousavy Feb 29, 2024
ac0f457
Update CameraError.kt
mrousavy Feb 29, 2024
f51921b
feat: Add `cancelRecording`
mrousavy Feb 29, 2024
6be6784
chore: release 4.0.0-beta.3
mrousavy Feb 29, 2024
ec6026e
Add `Preview` docs
mrousavy Feb 29, 2024
dd56925
feat: Add `androidPreviewViewType` prop
mrousavy Feb 29, 2024
54997a2
feat: Use CameraX for device details (#2624)
mrousavy Mar 1, 2024
4016d53
Update CameraDeviceDetails.kt
mrousavy Mar 1, 2024
a4a78e9
feat: Properly get orientation and isMirrored in FP
mrousavy Mar 1, 2024
f36d304
fix: Properly close `ImageWriter`
mrousavy Mar 1, 2024
fd1b118
fix: Fix transform matrix
mrousavy Mar 1, 2024
0a415f3
fix: Use image transformation info from input surface
mrousavy Mar 1, 2024
c741c90
fix: Capture directly in lambda
mrousavy Mar 1, 2024
e4a5fe3
fix: Fix focus not running on UI Thread
mrousavy Mar 1, 2024
28be6c7
chore: release 4.0.0-beta.4
mrousavy Mar 1, 2024
b4a9086
fix: Fix calling `sendAvailableDevicesChangedEvent` before module is …
mrousavy Mar 4, 2024
17feff3
fix: Allow re-creating if session changed from outside
mrousavy Mar 4, 2024
f5c0131
fix: Don't play shutter sound unless explicitly enabled
mrousavy Mar 4, 2024
7ec53f7
fix: Allow catching errors in `.await()`
mrousavy Mar 4, 2024
72c8c1b
feat: Remove `enableAutoStabilization` prop as this was deprecated in…
mrousavy Mar 6, 2024
6be93af
fix: Export `Snapshot.ts`
mrousavy Mar 7, 2024
f721d97
feat: Add `type` to `onShutter` (`photo` or `snapshot`)
mrousavy Mar 7, 2024
50f47c5
fix: Only unbind current outputs, not all
mrousavy Mar 8, 2024
5daf70e
chore: Lint/Fix
mrousavy Mar 8, 2024
9cd9b90
chore: release 4.0.0-beta.5
mrousavy Mar 8, 2024
a57d640
fix: Use dummy metering factory instead of display-oriented
mrousavy Mar 11, 2024
aac2162
fix: Remove unneeded context
mrousavy Mar 11, 2024
a9093cf
fix: Fix rotation getting
mrousavy Mar 11, 2024
43cb8d5
Update Podfile.lock
mrousavy Mar 11, 2024
79d4554
fix: Check format requirements in outputs
mrousavy Mar 12, 2024
8ad08f3
fix: Remove `not-compatible-with-outputs` error on Android since Came…
mrousavy Mar 13, 2024
5119639
fix: Remove `didSessionChangeFromOutside`
mrousavy Mar 13, 2024
c1f274f
fix: Catch Objective-C errors in iOS Frame Processor Plugins
mrousavy Mar 13, 2024
fa21983
feat: Catch Objective-C init errors on plugin init
mrousavy Mar 13, 2024
5283020
fix: Fix `TimeoutException` by using `STARTED` lifecycle
mrousavy Mar 14, 2024
e293605
chore: release 4.0.0-beta.6
mrousavy Mar 14, 2024
462fb6e
add todo about hdr extension bug
mrousavy Mar 18, 2024
2611625
fix: Remove focus listeners after resetting
mrousavy Mar 18, 2024
3d68d74
fix: Fix capture session configuration error by manually layouting Pr…
mrousavy Mar 18, 2024
babed3c
feat: Write proper photo metadata (orientation & isMirrored) (#2660)
mrousavy Mar 18, 2024
ad746d5
fix: Fix Camera not starting because PreviewView isn't laid out
mrousavy Mar 18, 2024
1682bb2
fix: Use `CREATED` as default lifecycle state
mrousavy Mar 18, 2024
19a7b0c
fix: Fix 10-bit HDR in combination with HDR Extension
mrousavy Mar 18, 2024
be251f5
Update CameraSession.kt
mrousavy Mar 18, 2024
5fe7608
fix: Throw correct errors
mrousavy Mar 18, 2024
211783a
fix: Properly check SDR
mrousavy Mar 18, 2024
27a4f85
fix: Update outputs if video stabilization or low-light-boost changes
mrousavy Mar 18, 2024
5525f2b
fix: Also dont enable if other extension is enabled
mrousavy Mar 18, 2024
89aef72
chore: release 4.0.0-beta.7
mrousavy Mar 18, 2024
12d72c9
Update package.json
mrousavy Mar 19, 2024
ca6518f
feat: Basic read-only Frame Processors (`ImageAnalysis` Use-Case) (#2…
mrousavy Mar 19, 2024
7f14f25
fix: Properly set `maxPhotoDimensions` on PhotoOutput (#2659)
mrousavy Mar 19, 2024
6418cdd
chore: release 4.0.0-beta.8
mrousavy Mar 19, 2024
3e8a1b7
Update CameraSession+Photo.swift
mrousavy Mar 19, 2024
f794d48
fix: Fix focus on Android by using PX instead of DP (#2666)
kirillzyusko Mar 20, 2024
7f57a2f
Merge branch 'main' into v4
mrousavy Mar 21, 2024
1e01f43
Optimised images with calibre/image-actions
github-actions[bot] Mar 21, 2024
c8033dd
feat: Add GPS Location EXIF tagging for photos and videos (`enableLoc…
mrousavy Mar 21, 2024
4c0fa92
Optimised images with calibre/image-actions
github-actions[bot] Mar 21, 2024
3f113e8
fix: Remove HardwareBufferUtils
mrousavy Mar 21, 2024
e434696
Merge branch 'v4' of https://github.com/mrousavy/react-native-vision-…
mrousavy Mar 21, 2024
c0e3a14
fix: Fix CodeScanner not working
mrousavy Mar 21, 2024
73e3c44
chore: release 4.0.0-beta.9
mrousavy Mar 21, 2024
a255c24
fix: Fix location permission not resolving on iOS (#2672)
mrousavy Mar 21, 2024
51106d3
chore: Remove RN Fast Image (we dont have web images anyways)
mrousavy Mar 21, 2024
f8a16d6
Update package.json
mrousavy Mar 21, 2024
ce23932
chore: release 4.0.0-beta.10
mrousavy Mar 21, 2024
4c00ffd
fix: Fix wrong orientation enum being send to ImageCapture (#2683)
rodgomesc Mar 25, 2024
ff2005b
perf: Add `@FastNative` flags to critical Frame Processor methods
mrousavy Mar 26, 2024
318f22b
Merge branch 'main' into v4
mrousavy Mar 27, 2024
8a95414
fix: Fix `RCTDeviceEventEmitter` import for RN 0.71.X (#2692)
rodgomesc Mar 27, 2024
7d8d2b7
chore: release 4.0.0-beta.11
mrousavy Mar 27, 2024
86c0f86
feat: Disable shutter sound if in silent
mrousavy Apr 2, 2024
688acd8
fix: Remove `enablePrecapture`
mrousavy Apr 2, 2024
b401ae2
Merge branch 'main' into v4
mrousavy Apr 2, 2024
f7b5428
chore: release 4.0.0-beta.12
mrousavy Apr 2, 2024
a6323cf
fix: Remove `mustPlayShutterSound()` check
mrousavy Apr 3, 2024
6e2e011
Update Podfile.lock
mrousavy Apr 4, 2024
b5bbcad
chore: release 4.0.0-beta.13
mrousavy Apr 4, 2024
cd9b84d
fix: Always support `rgb` and `yuv`, remove `native`
mrousavy Apr 6, 2024
adcca77
fix: Use `ResolutionSelector`s with fallback values
mrousavy Apr 10, 2024
4595b4f
fix: Fall-back to H.264 if custom codec is not supported
mrousavy Apr 16, 2024
28f0fb7
Update Camera.tsx
mrousavy Apr 16, 2024
56a5c8d
feat: Add `hardware-cost-too-high` error for iOS 16
mrousavy Apr 16, 2024
68d01cc
chore: release 4.0.0-beta.14
mrousavy Apr 16, 2024
ca2995d
fix: Use 1280x720 for QR scanner
mrousavy Apr 16, 2024
be9b4d3
feat: Skia for V4! 🥳 (#2727)
mrousavy Apr 17, 2024
b89df9a
fix: Rename `ReactLogger` to `VisionLogger`
mrousavy Apr 17, 2024
992275f
chore: Format
mrousavy Apr 17, 2024
1b73b69
fix: Fix ResolutionSelector `difference` abs (#2746)
versusvoid Apr 17, 2024
a3358ed
chore: release 4.0.0-beta.15
mrousavy Apr 17, 2024
a1fb8fe
Update CameraPage.tsx
mrousavy Apr 17, 2024
5ba004e
chore: Fix `type` imports in TS
mrousavy Apr 17, 2024
b751f2d
fix: Remove `enableGpuBuffers`
mrousavy Apr 17, 2024
c3098db
fix: Make dependencies (`ModuleProxy`) actually optional (#2750)
mrousavy Apr 18, 2024
9b901df
feat: Optionally compile out Location APIs (#2751)
mrousavy Apr 18, 2024
16ccfdf
fix: Fix `minFps` being larger in `Range` than `maxFps` (#2755)
mrousavy Apr 18, 2024
b0a5585
fix: Also override `onProviderDisabled` to prevent abstract method crash
mrousavy Apr 18, 2024
5a350c6
Merge branch 'v4' of https://github.com/mrousavy/react-native-vision-…
mrousavy Apr 18, 2024
b8e44ab
fix: Clean up Skia resources on Worklet context to avoid race conditi…
mrousavy Apr 19, 2024
28db499
docs: Update docs for V4 (#2747)
mrousavy Apr 19, 2024
4227040
chore: release 4.0.0-beta.16
mrousavy Apr 19, 2024
e124c00
fix: Fix `Promise` resolve wrong name
mrousavy Apr 20, 2024
9fcb61a
fix: Fix build for Android because of Worklet usage
mrousavy Apr 20, 2024
f7dbb24
feat: Separate VisionCamera into two subspecs (#2761)
mrousavy Apr 21, 2024
464ea94
feat: Separate VisionCamera into `React`, `Core` and `FrameProcessors…
mrousavy Apr 21, 2024
991dc79
fix: Refactor Android codebase into `core`, `react` and `frameproces…
mrousavy Apr 21, 2024
6cdf1ef
chore: release 4.0.0-beta.17
mrousavy Apr 21, 2024
d575008
chore: Cleanup C++
mrousavy Apr 21, 2024
64ef743
chore: Cleanup TS codebase and fix Skia Preview View style/layout iss…
mrousavy Apr 21, 2024
056755b
chore: Update to RN Skia 1.2.3
mrousavy Apr 21, 2024
1f4381a
fix: Simplify `cpp/` codebase into `android`/`ios` folders (#2766)
mrousavy Apr 21, 2024
a1b7602
fix: Fix `already bound to a different lifecycle` error when flipping…
mrousavy Apr 21, 2024
4163007
feat: Rebuild FPS Graph as JS component (#2769)
mrousavy Apr 21, 2024
fc6a19f
chore: release 4.0.0-beta.18
mrousavy Apr 21, 2024
aec14b2
fix: Fix `ImageAnalysis is not supported when Extension is enabled` e…
mrousavy Apr 21, 2024
5169271
feat: Upgrade to CameraX alpha5 (#2771)
mrousavy Apr 21, 2024
73cf3c5
Merge branch 'main' into v4
mrousavy Apr 21, 2024
83cac76
fix: Separate `FpsSampleCollectorDelegate`
mrousavy Apr 22, 2024
a8d5eba
Downgrade to CameraX alpha04 because 05 fails to build
mrousavy Apr 22, 2024
e93c522
fix: Make `FpsSampleCollectorDelegate` weak
mrousavy Apr 22, 2024
884b89d
fix: Fix `delegate` guard
mrousavy Apr 22, 2024
406b741
fix: Fix Android import path due to new subfolder
mrousavy Apr 22, 2024
c0f3ee0
fix: Fix `Timer is already canceled`
mrousavy Apr 22, 2024
443e47d
chore: release 4.0.0-beta.19
mrousavy Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/BUILD_ERROR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ body:
render: json
placeholder: >
"dependencies": {
"react-native": "^0.72.3",
"react-native-reanimated": "^3.4.2",
"react-native-vision-camera": "^3.0.0",
"react-native-worklets-core": "^0.2.0",
"react-native": "^0.73.4",
"react-native-reanimated": "^3.9.0",
"react-native-vision-camera": "^4.0.0",
"react-native-worklets-core": "^1.0.0",
...
},
validations:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ on:
- main
paths:
- '.github/workflows/build-android.yml'
- 'package/cpp/**'
- 'package/android/**'
- 'package/example/android/**'
- 'package/yarn.lock'
- 'package/example/yarn.lock'
pull_request:
paths:
- '.github/workflows/build-android.yml'
- 'package/cpp/**'
- 'package/android/**'
- 'package/example/android/**'
- 'package/yarn.lock'
Expand Down Expand Up @@ -96,8 +94,8 @@ jobs:
run: yarn install --frozen-lockfile
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd example
- name: Remove react-native-worklets-core
run: yarn remove react-native-worklets-core --cwd example
- name: Remove worklets, skia and reanimated
run: yarn remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated --cwd ..

- name: Restore Gradle cache
uses: actions/cache@v4
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ on:
- main
paths:
- '.github/workflows/build-ios.yml'
- 'package/cpp/**'
- 'package/ios/**'
- 'package/*.podspec'
- 'package/example/ios/**'
pull_request:
paths:
- '.github/workflows/build-ios.yml'
- 'package/cpp/**'
- 'package/ios/**'
- 'package/*.podspec'
- 'package/example/ios/**'
Expand Down Expand Up @@ -98,8 +96,8 @@ jobs:
${{ runner.os }}-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..
- name: Remove react-native-worklets-core
run: yarn remove react-native-worklets-core --cwd ..
- name: Remove worklets, skia and reanimated
run: yarn remove react-native-worklets-core @shopify/react-native-skia react-native-reanimated --cwd ..

- name: Restore buildcache
uses: mikehardy/buildcache-action@v2
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/validate-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
- main
paths:
- '.github/workflows/validate-cpp.yml'
- 'package/cpp/**'
- 'package/android/src/main/cpp/**'
- 'package/ios/**'
pull_request:
paths:
- '.github/workflows/validate-cpp.yml'
- 'package/cpp/**'
- 'package/android/src/main/cpp/**'
- 'package/ios/**'

Expand All @@ -23,7 +21,6 @@ jobs:
strategy:
matrix:
path:
- 'package/cpp'
- 'package/android/src/main/cpp'
- 'package/ios'
steps:
Expand All @@ -33,5 +30,5 @@ jobs:
with:
clang-format-version: '16'
check-path: ${{ matrix.path }}
clang-format-style-path: package/cpp/.clang-format
clang-format-style-path: package/.clang-format

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cd ios && pod install
* [Guides](https://react-native-vision-camera.com/docs/guides)
* [API](https://react-native-vision-camera.com/docs/api)
* [Example](./package/example/)
* [Frame Processor Plugins](https://react-native-vision-camera.com/docs/guides/frame-processor-plugins)
* [Frame Processor Plugins](https://react-native-vision-camera.com/docs/guides/frame-processor-plugins-community)

### ShadowLens

Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern

## Installation

```console
```sh
yarn install
```

## Local Development

```console
```sh
yarn start
```

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

## Build

```console
```sh
yarn build
```

Expand Down
9 changes: 1 addition & 8 deletions docs/docs/guides/CODE_SCANNING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,9 @@ render() {
</TabItem>
</Tabs>

## Separate Output

Since the Code Scanner is a separate camera output (just like photo or video), it cannot be attached simultaneously with photo and video enabled.
You need to disable either `photo`, `video`, or the `codeScanner`.

## Code result

The Code Scanner will call your [`onCodeScanned`](/docs/api/interfaces/CodeScanner#oncodescanned) callback with all detected codes ([`Code`](/docs/api/interfaces/Code)), including their decoded string value, and their coordinates on the screen relative to the Preview.

<br />
The Code Scanner will call your [`onCodeScanned`](/docs/api/interfaces/CodeScanner#oncodescanned) callback with all detected codes ([`Code`](/docs/api/interfaces/Code)), including their decoded string value, and their coordinates on the screen relative to subject area of the Code Scanner (the [`frame`](/docs/api/interfaces/Code#frame)).

## UPC-A vs EAN-13 codes

Expand Down
31 changes: 17 additions & 14 deletions docs/docs/guides/DEVICES.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ import useBaseUrl from '@docusaurus/useBaseUrl'
Camera Devices are the physical (or "virtual") devices that can be used to record videos or capture photos.

* **Physical**: A physical Camera Device is a **camera lens on your phone**. Different physical Camera Devices have different specifications, such as different capture formats, resolutions, zoom levels, and more. Some phones have multiple physical Camera Devices.

> Examples: _"Backside Wide-Angle Camera"_, _"Frontside Wide-Angle Camera (FaceTime HD)"_, _"Ultra-Wide-Angle back camera"_
Examples:
- "Backside Wide-Angle Camera"
- "Frontside Wide-Angle Camera (FaceTime HD)"
- "Ultra-Wide-Angle back camera"
* **Virtual**: A virtual camera device is a **combination of one or more physical camera devices**, and provides features such as _virtual-device-switchover_ while zooming (see video on the right) or _combined photo delivery_ from all physical cameras to produce higher quality images.

> Examples: _"Triple-Camera"_, _"Dual-Wide-Angle Camera"_
Examples:
- "Triple-Camera"
- "Dual-Wide-Angle Camera"

## Select the default Camera

Expand All @@ -48,7 +51,7 @@ const device = useCameraDevice('back')

```ts
const devices = Camera.getAvailableCameraDevices()
const device = devices.find((d) => d.position === 'back')
const device = getCameraDevice(devices, 'back')
```

</TabItem>
Expand Down Expand Up @@ -91,15 +94,15 @@ A [`CameraDevice`](/docs/api/interfaces/CameraDevice) consists of the following

Here's a list of some Camera Devices an iPhone 13 Pro has:

- Back Wide Angle Camera (`['wide-angle-camera']`)
- Back Ultra-Wide Angle Camera (`['ultra-wide-angle-camera']`)
- Back Telephoto Camera (`['telephoto-camera']`)
- Back Dual Camera (Wide + Telephoto)
- Back Dual-Wide Camera (Ultra-Wide + Wide)
- Back Triple Camera (Ultra-Wide + Wide + Telephoto)
- Back LiDAR Camera (Wide + LiDAR-Depth)
- Front Wide Angle (`['wide-angle-camera']`)
- Front True-Depth (Wide + Depth)
- Back Wide Angle Camera **1x** (`['wide-angle-camera']`)
- Back Ultra-Wide Angle Camera **0.5x** (`['ultra-wide-angle-camera']`)
- Back Telephoto Camera **3x** (`['telephoto-camera']`)
- Back Dual Camera **1x** + **3x** (`['wide-angle-camera', 'telephoto-camera']`)
- Back Dual-Wide Camera **0.5x** + **1x** (`['ultra-wide-angle-camera', 'wide-angle-camera']`)
- Back Triple Camera **0.5x** + **1x** + **3x** (`['ultra-wide-angle-camera', 'wide-angle-camera', 'telephoto-camera']`)
- Back LiDAR Camera **1x** (`['wide-angle-camera']` + depth)
- Front Wide Angle **1x** (`['wide-angle-camera']`)
- Front True-Depth **1x** (`['wide-angle-camera']` + depth)

### Selecting Multi-Cams

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/ERRORS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The `CameraError` type is a baseclass type for all other errors and provides the
* `cause.stacktrace?`: A native Java stacktrace for the cause. (Android only)
* `cause.cause?`: The cause that caused this cause. (Recursive) (Optional)

:::note
:::info
See [the `CameraError.ts` file](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/src/CameraError.ts) for a list of all possible error codes
:::

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/EXPOSURE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Values for the `exposure` prop range from [`device.minExposure`](/docs/api/inter

Instead of manually adjusting ISO and Exposure-Duration, this acts as an "exposure compensation bias", meaning the Camera will still continuously automatically adjust exposure as it goes, but premultiplies the given exposure value to it's ISO and Exposure Duration settings.

### Examples

![Exposure Example (-2, 0, 2)](/img/exposure.jpg)
| `exposure={-2}` | `exposure={0}` | `exposure={2}` |
|--------------------------------------------|-------------------------------------------------|--------------------------------------------|
| ![Exposure -2](/img/exposure-negative.jpg) | ![Exposure Neutral](/img/exposure-neutral.jpg) | ![Exposure +2](/img/exposure-plus.jpg) |

### Animating

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/FOCUSING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ So for example, `{ x: 0, y: 0 }` will focus to the upper left corner, while `{ x

Focussing adjusts auto-focus (AF) and auto-exposure (AE).

:::note
:::warning
`focus(...)` will fail if the selected Camera device does not support focusing (see [`CameraDevice.supportsFocus`](/docs/api/interfaces/CameraDevice#supportsfocus))
:::

Expand Down
3 changes: 1 addition & 2 deletions docs/docs/guides/FORMATS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ To get all available formats, simply use the `CameraDevice`'s [`formats` propert
- [`videoHeight`](/docs/api/interfaces/CameraDeviceFormat#videoheight)/[`videoWidth`](/docs/api/interfaces/CameraDeviceFormat#videoWidth): The resolution that will be used for recording videos and streaming into frame processors. This also affects the preview's aspect ratio. Choose a format with your desired resolution.
- [`minFps`](/docs/api/interfaces/CameraDeviceFormat#minfps)/[`maxFps`](/docs/api/interfaces/CameraDeviceFormat#maxfps): A range of possible values for the `fps` property. For example, if your format has `minFps: 1` and `maxFps: 60`, you can either use `fps={30}`, `fps={60}` or any other value in between for recording videos and streaming into frame processors.
- [`videoStabilizationModes`](/docs/api/interfaces/CameraDeviceFormat#videostabilizationmodes): All supported Video Stabilization Modes, digital and optical. If this specific format contains your desired [`VideoStabilizationMode`](/docs/api/#videostabilizationmode), you can pass it to your `<Camera>` via the [`videoStabilizationMode` property](/docs/api/interfaces/CameraProps#videoStabilizationMode).
- [`pixelFormats`](/docs/api/interfaces/CameraDeviceFormat#pixelformats): All supported Pixel Formats. If this specific format contains your desired [`PixelFormat`](/docs/api/#PixelFormat), you can pass it to your `<Camera>` via the [`pixelFormat` property](/docs/api/interfaces/CameraProps#pixelFormat).
- [`supportsVideoHdr`](/docs/api/interfaces/CameraDeviceFormat#supportsvideohdr): Whether this specific format supports true 10-bit HDR for video capture. If this is `true`, you can enable `videoHdr` on your `<Camera>`.
- [`supportsPhotoHdr`](/docs/api/interfaces/CameraDeviceFormat#supportsphotohdr): Whether this specific format supports HDR for photo capture. It will use multiple captures to fuse over-exposed and under-exposed Images together to form one HDR photo. If this is `true`, you can enable `photoHdr` on your `<Camera>`.
- [`supportsDepthCapture`](/docs/api/interfaces/CameraDeviceFormat#supportsdepthcapture): Whether this specific format supports depth data capture. For devices like the TrueDepth/LiDAR cameras, this will always be true.
Expand Down Expand Up @@ -213,4 +212,4 @@ Other props that depend on the `format`:

<br />

#### 🚀 Next section: [Taking Photos](./taking-photos)
#### 🚀 Next section: [Preview](./preview)
Loading
Loading