Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/docs/tap-to-focus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const meteringPoint = preview.createMeteringPoint(viewX, viewY)

..or from normalized Camera Coordinates (`0.0` to `1.0`) via [`createNormalizedMeteringPoint(...)`](/api/react-native-vision-camera/hybrid-objects/CameraFactory#createnormalizedmeteringpoint):
```ts
const meteringPoint = VisionCamera.createMeteringPoint(0.5, 0.5)
const meteringPoint = VisionCamera.createNormalizedMeteringPoint(0.5, 0.5)
```

Then, start a Focus Metering Action to the specific [`MeteringPoint`](/api/react-native-vision-camera/hybrid-objects/MeteringPoint) via [`CameraController.focusTo(...)`](/api/react-native-vision-camera/hybrid-objects/CameraController#focusto)):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
type CameraSession,
type CameraSessionConfig,
type CameraVideoOutput,
createNormalizedMeteringPoint,
type FocusOptions,
type Frame,
type MeteringMode,
Expand All @@ -34,6 +33,7 @@ import {
useFrameOutput,
useOrientation,
type VideoPixelFormat,
VisionCamera,
} from 'react-native-vision-camera'
import { createSynchronizable, scheduleOnRN } from 'react-native-worklets'
import { renderToTexture, type SkiaOnFrameState } from '../render'
Expand Down Expand Up @@ -355,7 +355,7 @@ function SkiaCameraImpl({
throw new Error(`Cannot focus - Camera is null!`)
}
const transformedPoint = this.convertViewPointToNormalizedPoint(viewPoint)
const meteringPoint = createNormalizedMeteringPoint(
const meteringPoint = VisionCamera.createNormalizedMeteringPoint(
transformedPoint.x,
transformedPoint.y,
)
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native-vision-camera/src/VisionCamera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { CameraFactory } from './specs/CameraFactory.nitro'

/**
* The native VisionCamera module.
*
* This is the entry point for the entire VisionCamera imperative API.
*/
export const VisionCamera =
NitroModules.createHybridObject<CameraFactory>('CameraFactory')

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-native-vision-camera/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Devices API
export * from './CameraDevices'
export * from './createNormalizedMeteringPoint'
export * from './devices/getCameraDevice'
// Hooks
export * from './hooks/useAsyncRunner'
Expand Down
Loading