From 4c159aff61e7fd16114dc9dcd9dc438cc7d12520 Mon Sep 17 00:00:00 2001 From: Lia/Leo Treloar <79512656+ltrel@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:54:08 +1100 Subject: [PATCH] docs: Fix `toArrayBuffer` example in Frame Processor Guide (#2595) --- docs/docs/guides/FRAME_PROCESSORS.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/docs/guides/FRAME_PROCESSORS.mdx b/docs/docs/guides/FRAME_PROCESSORS.mdx index 31b36a1..755c510 100644 --- a/docs/docs/guides/FRAME_PROCESSORS.mdx +++ b/docs/docs/guides/FRAME_PROCESSORS.mdx @@ -89,7 +89,8 @@ Additionally, you can also directly access the Frame's pixel data using [`toArra const frameProcessor = useFrameProcessor((frame) => { 'worklet' if (frame.pixelFormat === 'rgb') { - const data = frame.toArrayBuffer() + const buffer = frame.toArrayBuffer() + const data = new Uint8Array(buffer) console.log(`Pixel at 0,0: RGB(${data[0]}, ${data[1]}, ${data[2]})`) } }, [])