Skip to content

Commit

Permalink
docs: Fix toArrayBuffer example in Frame Processor Guide (#2595)
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrel committed Feb 20, 2024
1 parent 55992bb commit 4c159af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/docs/guides/FRAME_PROCESSORS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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]})`)
}
}, [])
Expand Down

0 comments on commit 4c159af

Please sign in to comment.