The Photo Output

Capturing Photos using the Photo Output

The CameraPhotoOutput allows capturing processed- and RAW-Photos.

Creating a Photo Output

function App() {
  const device = useCameraDevice('back')
  const photoOutput = usePhotoOutput({ /* options */ })

  return (
    <Camera
      style={StyleSheet.absoluteFill}
      isActive={true}
      device={device}
      outputs={[photoOutput]}
    />
  )
}
function App() {
  const device = useCameraDevice('back')
  const photoOutput = usePhotoOutput({ /* options */ })

  const camera = useCamera({
    isActive: true,
    device: device,
    outputs: [photoOutput],
  })
}
const session = await HybridCameraFactory.createCameraSession(false)
const device = await getDefaultCameraDevice('back')
const photoOutput = HybridCameraFactory.createPhotoOutput({ /* options */ })

await session.configure([
  {
    input: device,
    outputs: [
      { output: photoOutput, mirrorMode: 'auto' }
    ],
    config: {}
  }
], {})
await session.start()

See PhotoOutputOptions for a full list of configuration options for the Photo Output.

Capturing Photos

To capture a Photo, use capturePhoto(...):

const photo = await photoOutput.capturePhoto(
  { /* options */ },
  { /* callbacks */}
)

See CapturePhotoSettings for a full list of configuration options, and CapturePhotoCallbacks for a full list of callbacks for the capture method.

Tip

See "A Photo" to understand how the Photo type works, and how to use it.