+ * * `"none"`: Indicates that autofocus is not available
+ * * `"contrast-detection"`: Indicates that autofocus is achieved by contrast detection. Contrast detection performs a focus scan to find the optimal position
+ * * `"phase-detection"`: Indicates that autofocus is achieved by phase detection. Phase detection has the ability to achieve focus in many cases without a focus scan. Phase detection autofocus is typically less visually intrusive than contrast detection autofocus
+ * Indicates a format's supported video stabilization mode. Enabling video stabilization may introduce additional latency into the video capture pipeline.
+ *
+ * * `"off"`: No video stabilization. Indicates that video should not be stabilized
+ * * `"standard"`: Standard software-based video stabilization. Standard video stabilization reduces the field of view by about 10%.
+ * * `"cinematic"`: Advanced software-based video stabilization. This applies more aggressive cropping or transformations than standard.
+ * * `"cinematic-extended"`: Extended software- and hardware-based stabilization that aggressively crops and transforms the video to apply a smooth cinematic stabilization.
+ * * `"auto"`: Indicates that the most appropriate video stabilization mode for the device and format should be chosen automatically
+ * Specifies this format's pixel format. The pixel format specifies how the individual pixels are interpreted as a visual image.
+ *
+ * The most common format is `420v`. Some formats (like `x420`) are not compatible with some frame processor plugins (e.g. MLKit)
+ */
+ pixelFormats: PixelFormat[];
+ }
+
+ /**
+ * Represents a camera device discovered by the {@linkcode Camera.getAvailableCameraDevices | Camera.getAvailableCameraDevices()} function
+ */
+ declare export interface CameraDevice {
+ /**
+ * The native ID of the camera device instance.
+ */
+ id: string;
+
+ /**
+ * The physical devices this `CameraDevice` consists of.
+ *
+ * * If this camera device is a **logical camera** (combination of multiple physical cameras, e.g. "Triple Camera"), there are multiple cameras in this array.
+ * * If this camera device is a **physical camera** (e.g. "wide-angle-camera"), there is only a single element in this array.
+ *
+ * You can check if the camera is a logical multi-camera by using the `isMultiCam` property.
+ */
+ physicalDevices: PhysicalCameraDeviceType[];
+
+ /**
+ * Specifies the physical position of this camera.
+ * - `back`: The Camera Device is located on the back of the phone. These devices can be used for capturing what's in front of the user.
+ * - `front`: The Camera Device is located on the front of the phone. These devices can be used for selfies or FaceTime.
+ * - `external`: The Camera Device is an external device. These devices can be either:
+ * - USB Camera Devices (if they support the [USB Video Class (UVC) Specification](https://en.wikipedia.org/wiki/List_of_USB_video_class_devices))
+ * - [Continuity Camera Devices](https://support.apple.com/en-us/HT213244) (e.g. your iPhone's or Mac's Camera connected through WiFi/Continuity)
+ * - Bluetooth/WiFi Camera Devices (if they are supported in the platform-native Camera APIs; Camera2 and AVFoundation)
+ */
+ position: CameraPosition;
+
+ /**
+ * A friendly localized name describing the camera.
+ */
+ name: string;
+
+ /**
+ * Specifies whether this camera supports enabling flash for photo capture.
+ */
+ hasFlash: boolean;
+
+ /**
+ * Specifies whether this camera supports continuously enabling the flash to act like a torch (flash with video capture)
+ */
+ hasTorch: boolean;
+
+ /**
+ * A property indicating whether the device is a virtual multi-camera consisting of multiple combined physical cameras.
+ *
+ * Examples:
+ * * The Dual Camera, which supports seamlessly switching between a wide and telephoto camera while zooming and generating depth data from the disparities between the different points of view of the physical cameras.
+ * * The TrueDepth Camera, which generates depth data from disparities between a YUV camera and an Infrared camera pointed in the same direction.
+ */
+ isMultiCam: boolean;
+
+ /**
+ * Minimum available zoom factor (e.g. `1`)
+ */
+ minZoom: number;
+
+ /**
+ * Maximum available zoom factor (e.g. `128`)
+ */
+ maxZoom: number;
+
+ /**
+ * The zoom factor where the camera is "neutral".
+ *
+ * * For single-physical cameras this property is always `1.0`.
+ * * For multi cameras this property is a value between `minZoom` and `maxZoom`, where the camera is in _wide-angle_ mode and hasn't switched to the _ultra-wide-angle_ ("fish-eye") or telephoto camera yet.
+ *
+ * Use this value as an initial value for the zoom property if you implement custom zoom. (e.g. reanimated shared value should be initially set to this value)
+ * @example const device = ...
+ *
+ * const zoom = useSharedValue(device.neutralZoom) // <-- initial value so it doesn't start at ultra-wide
+ * const cameraProps = useAnimatedProps(() => ({
+ * zoom: zoom.value
+ * }))
+ */
+ neutralZoom: number;
+
+ /**
+ * 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://mrousavy.github.io/react-native-vision-camera/docs/guides/formats) for more information about Camera Formats.
+ */
+ formats: CameraDeviceFormat[];
+
+ /**
+ * Whether this camera device supports low light boost.
+ */
+ supportsLowLightBoost: boolean;
+
+ /**
+ * Whether this camera supports taking photos in RAW format
+ declare export type UnknownError = "unknown/unknown";
+
+ /**
+ * Represents a JSON-style error cause. This contains native `NSError`/`Throwable` information, and can have recursive {@linkcode ErrorWithCause.cause | .cause} properties until the ultimate cause has been found.
+ */
+ declare export interface ErrorWithCause {
+ /**
+ * The native error's code.
+ *
+ * * iOS: `NSError.code`
+ * * Android: N/A
+ */
+ code?: number;
+
+ /**
+ * The native error's domain.
+ *
+ * * iOS: `NSError.domain`
+ * * Android: N/A
+ */
+ domain?: string;
+
+ /**
+ * The native error description
+ *
+ * * iOS: `NSError.message`
+ * * Android: `Throwable.message`
+ */
+ message: string;
+
+ /**
+ * Optional additional details
+ *
+ * * iOS: `NSError.userInfo`
+ * * Android: N/A
+ */
+ details?: { [key: string]: mixed };
+
+ /**
+ * Optional Java stacktrace
+ *
+ * * iOS: N/A
+ * * Android: `Throwable.stacktrace.toString()`
+ */
+ stacktrace?: string;
+
+ /**
+ * Optional additional cause for nested errors
+ *
+ * * iOS: N/A
+ * * Android: `Throwable.cause`
+ */
+ cause?: ErrorWithCause;
+ }
+ declare export type CameraErrorCode =
+ | PermissionError
+ | ParameterError
+ | DeviceError
+ | FormatError
+ | SessionError
+ | CaptureError
+ | SystemError
+ | UnknownError;
+ declare export class CameraError<TCode: CameraErrorCode> extends Error {
+ * console.log(`Pixel at 0,0: RGB(${data[0]}, ${data[1]}, ${data[2]})`)
+ * }
+ * }, [])
+ * ```
+ */
+ toArrayBuffer(): Uint8Array;
+
+ /**
+ * Returns a string representation of the frame.
+ * @example ```ts
+ * console.log(frame.toString()) // -> "3840 x 2160 Frame"
+ * ```
+ */
+ toString(): string;
+ }
+
+ /**
+ * @internal
+ */
+ declare export type FrameInternal = {|
+ /**
+ * Increment the Frame Buffer ref-count by one.
+ *
+ * This is a private API, do not use this.
+ * @internal
+ */
+ incrementRefCount(): void,
+
+ /**
+ * Increment the Frame Buffer ref-count by one.
+ *
+ * This is a private API, do not use this.
+ * @internal
+ */
+ decrementRefCount(): void
+ |} & Frame;
+
+ declare export type FrameProcessor = {|
+ frameProcessor: (frame: Frame) => void,
+ type: "frame-processor"
+ |};
+ declare export type CameraProps = {
+ ...ViewProps,
+
+ /**
+ * The Camera Device to use.
+ *
+ * See the [Camera Devices](https://react-native-vision-camera.com/docs/guides/devices) section in the documentation for more information about Camera Devices.
+ * @example ```tsx
+ * const device = useCameraDevice('back')
+ *
+ * if (device == null) return <NoCameraErrorView />
+ * return (
+ * <Camera
+ * device={device}
+ * isActive={true}
+ * style={StyleSheet.absoluteFill}
+ * />
+ * )
+ * ```
+ */
+ device: CameraDevice,
+
+ /**
+ * Whether the Camera should actively stream video frames, or not. See the [documentation about the `isActive` prop](https://react-native-vision-camera.com/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.
+ *
+ * > Note: If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again. In return, it will use less resources since the Camera will be completely destroyed when unmounted.
+ */
+ isActive: boolean,
+
+ /**
+ * Enables **photo capture** with the `takePhoto` function (see ["Taking Photos"](https://react-native-vision-camera.com/docs/guides/taking-photos))
+ */
+ photo?: boolean,
+
+ /**
+ * Enables **video capture** with the `startRecording` function (see ["Recording Videos"](https://react-native-vision-camera.com/docs/guides/recording-videos))
+ */
+ video?: boolean,
+
+ /**
+ * Enables **audio capture** for video recordings (see ["Recording Videos"](https://react-native-vision-camera.com/docs/guides/recording-videos))
+ */
+ audio?: boolean,
+
+ /**
+ * Enables **audio capture** for video recordings (see ["Recording Videos"](https://mrousavy.github.io/react-native-vision-camera/docs/guides/capturing/#recording-videos))
+ */
+ pixelFormat?: "native" | "yuv" | "rgb",
+
+ /**
+ * Set the current torch mode.
+ *
+ * Note: The torch is only available on `"back"` cameras, and isn't supported by every phone.
+ *
+ * @default "off"
+ */
+ torch?: "off" | "on",
+
+ /**
+ * Specifies the zoom factor of the current camera, in "factor"/scale.
+ *
+ * This value ranges from `minZoom` (e.g. `1`) to `maxZoom` (e.g. `128`). It is recommended to set this value
+ * to the CameraDevice's `neutralZoom` per default and let the user zoom out to the fish-eye (ultra-wide) camera
+ * on demand (if available)
+ *
+ * **Note:** Linearly increasing this value always appears logarithmic to the user.
+ * @default 1.0
+ */
+ zoom?: number,
+
+ /**
+ * 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://react-native-vision-camera.com/docs/guides/zooming).
+ * @default false
+ */
+ enableZoomGesture?: boolean,
+
+ /**
+ * Selects a given format. Must be `undefined` when `preset` is set!
+ */
+ format?: CameraDeviceFormat,
+
+ /**
+ * Specifies the Preview's resize mode.
+ * * `"cover"`: Keep aspect ratio and fill entire parent view (centered).
+ * * `"contain"`: Keep aspect ratio and make sure the entire content is visible inside the parent view, even if it introduces additional blank areas (centered).
+ * @default "cover"
+ */
+ resizeMode?: "cover" | "contain",
+
+ /**
+ * Enables or disables HDR on this camera device. Make sure the given `format` supports HDR mode.
+ *
+ * Requires `format` to be set.
+ */
+ fps?: number,
+ /**
+ * Enables or disables HDR Video Streaming for Preview, Video and Frame Processor via a 10-bit wide-color pixel format.
+ *
+ * Make sure the given {@linkcode format} supports HDR (see {@linkcode CameraDeviceFormat.supportsVideoHdr format.supportsVideoHdr}).
+ */
+ videoHdr?: boolean,
+ /**
+ * Enables or disables HDR Photo Capture via a double capture routine that combines low- and high exposure photos.
+ *
+ * Make sure the given {@linkcode format} supports HDR (see {@linkcode CameraDeviceFormat.supportsPhotoHdr format.supportsPhotoHdr}).
+ */
+ photoHdr?: boolean,
+ /**
+ * Enables or disables lossless buffer compression for the video stream.
+ * If you only use {@linkcode video} or a {@linkcode frameProcessor}, this
+ * can increase the efficiency and lower memory usage of the Camera.
+ *
+ * If buffer compression is enabled, the video pipeline will try to use a
+ * lossless-compressed pixel format instead of the normal one.
+ *
+ * If you use a {@linkcode frameProcessor}, you might need to change how pixels
+ * are read inside your native frame processor function as this is different
+ * from the usual `yuv` or `rgb` layout.
+ *
+ * If buffer compression is not available but this property is enabled, the normal
+ * pixel formats will be used and no error will be thrown.
+ *
+ * @platform iOS
+ * @default
+ * - true // if video={true} and frameProcessor={undefined}
+ * - false // otherwise
+ */
+ enableBufferCompression?: boolean,
+ /**
+ * Enables or disables low-light boost on this camera device.
+ *
+ * Make sure the given {@linkcode device} supports low-light-boost (see {@linkcode CameraDevice.supportsLowLightBoost device.supportsLowLightBoost}).
+ */
+ lowLightBoost?: boolean,
+ /**
+ * Specifies the video stabilization mode to use.
+ *
+ * Make sure the given {@linkcode format} supports the given {@linkcode videoStabilizationMode}.
+ * Enables or disables depth data delivery for photo capture.
+ *
+ * Make sure the given {@linkcode format} supports depth data (see {@linkcode CameraDeviceFormat.supportsDepthCapture format.supportsDepthCapture}).
+ *
+ * @default false
+ */
+ enableDepthData?: boolean,
+
+ /**
+ * A boolean specifying whether the photo render pipeline is prepared for portrait effects matte delivery.
+ *
+ * When enabling this, you must also set `enableDepthData` to `true`.
+ * @platform iOS 12.0+
+ * @default false
+ */
+ enablePortraitEffectsMatteDelivery?: boolean,
+
+ /**
+ * Indicates whether the Camera should prepare the photo pipeline to provide maximum quality photos.
+ *
+ * This enables:
+ * * High Resolution Capture ([`isHighResolutionCaptureEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1648721-ishighresolutioncaptureenabled))
+ * * Virtual Device fusion for greater detail ([`isVirtualDeviceConstituentPhotoDeliveryEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/3192189-isvirtualdeviceconstituentphotod))
+ * * Dual Device fusion for greater detail ([`isDualCameraDualPhotoDeliveryEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/2873917-isdualcameradualphotodeliveryena))
+ * * Sets the maximum quality prioritization to `.quality` ([`maxPhotoQualityPrioritization`](https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/3182995-maxphotoqualityprioritization))
+ * @default false
+ */
+ enableHighQualityPhotos?: boolean,
+
+ /**
+ * If `true`, show a debug view to display the FPS of the Camera session.
+ * This is useful for debugging your Frame Processor's speed.
+ * @default false
+ */
+ enableFpsGraph?: boolean,
+
+ /**
+ * Represents the orientation of all Camera Outputs (Photo, Video, and Frame Processor). If this value is not set, the device orientation is used.
+ */
+ orientation?: Orientation,
+
+ /**
+ * Called when any kind of runtime error occured.
+ */
+ onError?: (error: CameraRuntimeError) => void,
+
+ /**
+ * Called when the camera was successfully initialized.
+ */
+ onInitialized?: () => void,
+
+ /**
+ * A worklet which will be called for every frame the Camera "sees".
+ *
+ * > See [the Frame Processors documentation](https://react-native-vision-camera.com/docs/guides/frame-processors) for more information
+ declare export type CameraPermissionRequestResult = "granted" | "denied";
+
+ /**
+ * ### A powerful `<Camera>` component.
+ *
+ * Read the [VisionCamera documentation](https://react-native-vision-camera.com/) for more information.
+ *
+ * The `<Camera>` component's most important properties are:
+ *
+ * * {@linkcode CameraProps.device | device}: Specifies the {@linkcode CameraDevice} to use. Get a {@linkcode CameraDevice} by using the {@linkcode useCameraDevice | useCameraDevice(..)} hook, or manually by using the {@linkcode CameraDevices.getAvailableCameraDevices CameraDevices.getAvailableCameraDevices()} function.
+ * * {@linkcode CameraProps.isActive | isActive}: A boolean value that specifies whether the Camera should actively stream video frames or not. This can be compared to a Video component, where `isActive` specifies whether the video is paused or not. If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again.
+ *
+ * @example
+ * ```tsx
+ * function App() {
+ * const device = useCameraDevice('back')
+ *
+ * if (device == null) return <NoCameraErrorView />
+ * return (
+ * <Camera
+ * style={StyleSheet.absoluteFill}
+ * device={device}
+ * isActive={true}
+ * />
+ * )
+ * }
+ * ```
+ *
+ * @component
+ */
+ declare export class Camera extends React.PureComponent<CameraProps> {
+ /**
+ * @internal
+ */
+ static displayName?: ?string;
+
+ /**
+ * @internal
+ */
+ displayName: string;
+
+ /**
+ * @internal
+ */
+ constructor(props: CameraProps): this;
+ handle: any;
+
+ /**
+ * Take a single photo and write it's content to a temporary file.
+ *
+ * @throws {@linkcode CameraCaptureError} When any kind of error occured while capturing the photo. Use the {@linkcode CameraCaptureError.code | code} property to get the actual error
+ * @blocking This function is synchronized/blocking.
+ *
+ * @throws {@linkcode CameraCaptureError} When any kind of error occured while starting the video recording. Use the {@linkcode CameraCaptureError.code | code} property to get the actual error
+ * @throws {@linkcode CameraCaptureError} When any kind of error occured while pausing the video recording. Use the {@linkcode CameraCaptureError.code | code} property to get the actual error
+ *
+ * @example
+ * ```ts
+ * // Start
+ * await camera.current.startRecording()
+ * await timeout(1000)
+ * // Pause
+ * await camera.current.pauseRecording()
+ * await timeout(500)
+ * // Resume
+ * await camera.current.resumeRecording()
+ * await timeout(2000)
+ * // Stop
+ * const video = await camera.current.stopRecording()
+ * ```
+ */
+ pauseRecording(): Promise<void>;
+
+ /**
+ * Resumes a currently paused video recording.
+ *
+ * @throws {@linkcode CameraCaptureError} When any kind of error occured while resuming the video recording. Use the {@linkcode CameraCaptureError.code | code} property to get the actual error
+ *
+ * @example
+ * ```ts
+ * // Start
+ * await camera.current.startRecording()
+ * await timeout(1000)
+ * // Pause
+ * await camera.current.pauseRecording()
+ * await timeout(500)
+ * // Resume
+ * await camera.current.resumeRecording()
+ * await timeout(2000)
+ * // Stop
+ * const video = await camera.current.stopRecording()
+ * ```
+ */
+ resumeRecording(): Promise<void>;
+
+ /**
+ * Stop the current video recording.
+ *
+ * @throws {@linkcode CameraCaptureError} When any kind of error occured while stopping the video recording. Use the {@linkcode CameraCaptureError.code | code} property to get the actual error
+ *
+ * @example
+ * ```ts
+ * await camera.current.startRecording()
+ * setTimeout(async () => {
+ * const video = await camera.current.stopRecording()
+ * }, 5000)
+ * ```
+ */
+ stopRecording(): Promise<void>;
+
+ /**
+ * Focus the camera to a specific point in the coordinate system.
+ * @param {Point} point The point to focus to. This should be relative
+ * to the Camera view's coordinate system and is expressed in points.
+ * * `(0, 0)` means **top left**.
+ * * `(CameraView.width, CameraView.height)` means **bottom right**.
+ *
+ * Make sure the value doesn't exceed the CameraView's dimensions.
+ *
+ * @throws {@linkcode CameraRuntimeError} When any kind of error occured while focussing. Use the {@linkcode CameraRuntimeError.code | code} property to get the actual error
+ * @example
+ * ```ts
+ * await camera.current.focus({
+ * x: tapEvent.x,
+ * y: tapEvent.y
+ * })
+ * ```
+ */
+ focus(point: Point): Promise<void>;
+
+ /**
+ * Get a list of video codecs the current camera supports for a given file type. Returned values are ordered by efficiency (descending).
+ * Gets the current Camera Permission Status. Check this before mounting the Camera to ensure
+ * the user has permitted the app to use the camera.
+ *
+ * To actually prompt the user for camera permission, use {@linkcode Camera.requestCameraPermission | requestCameraPermission()}.
+ *
+ * @throws {@linkcode CameraRuntimeError} When any kind of error occured while getting the current permission status. Use the {@linkcode CameraRuntimeError.code | code} property to get the actual error
+ * Gets the current Microphone-Recording Permission Status. Check this before mounting the Camera to ensure
+ * the user has permitted the app to use the microphone.
+ *
+ * To actually prompt the user for microphone permission, use {@linkcode Camera.requestMicrophonePermission | requestMicrophonePermission()}.
+ *
+ * @throws {@linkcode CameraRuntimeError} When any kind of error occured while getting the current permission status. Use the {@linkcode CameraRuntimeError.code | code} property to get the actual error
+ * Shows a "request permission" alert to the user, and resolves with the new camera permission status.
+ *
+ * If the user has previously blocked the app from using the camera, the alert will not be shown
+ * and `"denied"` will be returned.
+ *
+ * @throws {@linkcode CameraRuntimeError} When any kind of error occured while requesting permission. Use the {@linkcode CameraRuntimeError.code | code} property to get the actual error
+ * Shows a "request permission" alert to the user, and resolves with the new microphone permission status.
+ *
+ * If the user has previously blocked the app from using the microphone, the alert will not be shown
+ * and `"denied"` will be returned.
+ *
+ * @throws {@linkcode CameraRuntimeError} When any kind of error occured while requesting permission. Use the {@linkcode CameraRuntimeError.code | code} property to get the actual error
+ * If no format supports the target pixel format, the best other matching format will be used.
+ */
+ pixelFormat?: PixelFormat;
+
+ /**
+ * Whether you want to find a format that supports Photo HDR.
+ */
+ photoHdr?: boolean;
+
+ /**
+ * Whether you want to find a format that supports Photo HDR.
+ */
+ videoHdr?: boolean;
+ }
+
+ /**
+ * Get the best matching Camera format for the given device that satisfies your requirements using a sorting filter. By default, formats are sorted by highest to lowest resolution.
+ *
+ * The {@linkcode filters | filters} are ranked by priority, from highest to lowest.
+ * This means the first item you pass will have a higher priority than the second, and so on.
+ *
+ * @param device The Camera Device you're currently using
+ * @param filter The filter you want to use. The format that matches your filter the closest will be returned
+ * @returns The format that matches your filter the closest.
+ declare export function getCameraFormat(device: CameraDevice, filters: FormatFilter[]): CameraDeviceFormat;
+
+ declare export interface DeviceFilter {
+ /**
+ * The desired physical devices your camera device should have.
+ *
+ * Many modern phones have multiple Camera devices on one side and can combine those physical camera devices to one logical camera device.
+ * For example, the iPhone 11 has two physical camera devices, the `ultra-wide-angle-camera` ("fish-eye") and the normal `wide-angle-camera`. You can either use one of those devices individually, or use a combined logical camera device which can smoothly switch over between the two physical cameras depending on the current `zoom` level.
+ * When the user is at 0.5x-1x zoom, the `ultra-wide-angle-camera` can be used to offer a fish-eye zoom-out effect, and anything above 1x will smoothly switch over to the `wide-angle-camera`.
+ *
+ * **Note:** Devices with less phyiscal devices (`['wide-angle-camera']`) are usually faster to start-up than more complex
+ * Get the best matching Camera device that best satisfies your requirements using a sorting filter, or `undefined` if {@linkcode devices} does not contain any devices.
+ * @param position The position of the Camera device relative to the phone.
+ * @param filter The filter you want to use. The Camera device that matches your filter the closest will be returned
+ * @returns The Camera device that matches your filter the closest, or `undefined` if no such Camera Device exists on the given {@linkcode position}.
+ * Get all available Camera Devices this phone has.
+ *
+ * Camera Devices attached to this phone (`back` or `front`) are always available,
+ * while `external` devices might be plugged in or out at any point,
+ * so the result of this function might update over time.
+ */
+ declare export function useCameraDevices(): CameraDevice[];
+ /**
+ * Get the best matching Camera format for the given device that satisfies your requirements using a sorting filter. By default, formats are sorted by highest to lowest resolution.
+ *
+ * The {@linkcode filters | filters} are ranked by priority, from highest to lowest.
+ * This means the first item you pass will have a higher priority than the second, and so on.
+ *
+ * @param device The Camera Device you're currently using
+ * @param filter The filter you want to use. The format that matches your filter the closest will be returned
+ * @returns The format that matches your filter the closest.