react-native-vision-camera/docs/docs/api/modules/hooks_usecameraformat.md
Marc Rousavy 0b7b4d50b5
Automatically build API documentation (#11)
* Automatically build API documentation using Typedoc and Docusaurus
* Move MD and move to MDX for Docusaurus Guides
2021-03-03 12:37:43 +01:00

1.3 KiB

id title sidebar_label custom_edit_url hide_title
hooks_usecameraformat Module: hooks/useCameraFormat hooks/useCameraFormat null true

Module: hooks/useCameraFormat

Functions

useCameraFormat

useCameraFormat(device?: CameraDevice, cameraViewSize?: Size): CameraDeviceFormat | 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 The Camera Device
cameraViewSize? Size The Camera View's size. This can be an approximation and must be memoized! Default: SCREEN_SIZE

Returns: CameraDeviceFormat | undefined

The best matching format for the given camera device, or undefined if the camera device is undefined.

Defined in: src/hooks/useCameraFormat.ts:16