v4.0.0-beta.15
版本发布时间: 2024-04-17 21:56:53
mrousavy/react-native-vision-camera最新发布版本:v4.5.3(2024-09-08 18:42:23)
4.0.0-beta.15 (2024-04-17)
This is the first beta for Skia Frame Processors! 🥳
You can try this today in your app by using the useSkiaFrameProcessor
hook:
const frameProcessor = useSkiaFrameProcessor((frame) => {
'worklet'
// 1. create blur filter
const blurRadius = 10
const blurFilter = Skia.ImageFilter.MakeBlur(blurRadius, blurRadius, TileMode.Repeat, null)
// 2. wrap blur filter in Paint
const paint = Skia.Paint()
paint.setImageFilter(blurFilter)
// 3. render image with the blur filter paint
frame.render(paint)
}, [])
Note: Skia Frame Processors require react-native-worklets-core 1.1.1 or higher, react-native-reanimated 3.x.x or higher, and react-native-skia 1.2.1 or higher
Note: You might need to set
pixelFormat="rgb"
, as"yuv"
buffers are still work in progress (see https://github.com/Shopify/react-native-skia/pull/2357)