docs: Fix toArrayBuffer example in Frame Processor Guide (#2595)

This commit is contained in:
Lia/Leo Treloar 2024-02-20 18:54:08 +11:00 committed by GitHub
parent 55992bb954
commit 4c159aff61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]})`)
}
}, [])