From e1f8e1bd2adc1939bba4e251e8dd136152269732 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Tue, 24 Oct 2023 14:50:29 +0200 Subject: [PATCH] docs: Add "Templates" to Format docs --- docs/docs/guides/FORMATS.mdx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/docs/guides/FORMATS.mdx b/docs/docs/guides/FORMATS.mdx index 4f96c7b..852848f 100644 --- a/docs/docs/guides/FORMATS.mdx +++ b/docs/docs/guides/FORMATS.mdx @@ -148,6 +148,35 @@ const format = getCameraFormat(device, [ +### Templates + +For common use-cases, VisionCamera also exposes pre-defined Format templates: + + + + +```ts +const device = ... +const format = useCameraFormat(device, Templates.Snapchat) +``` + + + + +```ts +const device = ... +const format = getCameraFormat(device, Templates.Snapchat) +``` + + + + ## Camera Props The `Camera` View provides a few props that depend on the specified `format`. For example, you can only set the `fps` prop to a value that is supported by the current `format`. So if you have a format that supports 240 FPS, you can set the `fps` to `240`: