📸 A powerful, high-performance React Native Camera library.
MIT License
Bot releases are visible (Hide)
Published by mrousavy over 1 year ago
CameraDevice
+ CameraFormat
detection using CameraX (#1495) (0d83a13)device == null
error (f227a3e)runAtTargetFps
for multiple invocations per FP (af4e366).so
libraries in package (ad5d64b)jsi::Runtime
's lifecycle (#1488) (0c3cd66)global.expo.modules
for JSI expo modules (a1af891)Published by mrousavy over 1 year ago
This is the first V3 version with Frame Processor + Skia integration (aka "draw onto frame"/write-back Frame Processors)! For now it only works on iOS, Android is currently WIP. I will probably need to rewrite the entire Android part from CameraX to Camera2 (one of Android's worst APIs) for this.
Example:
const INVERTED_COLORS_SHADER = `
uniform shader image;
half4 main(vec2 pos) {
vec4 color = image.eval(pos);
return vec4(1.0 - color.rgb, 1.0);
}`
const runtimeEffect = Skia.RuntimeEffect.Make(INVERTED_COLORS_SHADER)
const shaderBuilder = Skia.RuntimeShaderBuilder(runtimeEffect)
const imageFilter = Skia.ImageFilter.MakeRuntimeShader(shaderBuilder, null, null)
const paint = Skia.Paint()
paint.setImageFilter(imageFilter)
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
console.log(`Frame: ${frame.orientation}`);
frame.render(paint);
}, [paint])
return <Camera frameProcessor={frameProcessor} previewType="skia" ... />
Or:
const paint = Skia.Paint()
paint.setColor(Skia.Color("red"))
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
console.log(`Frame: ${frame.orientation}`);
frame.drawRect({ x: 150, y: 300, width: 100, height: 100 }, paint);
}, [paint])
return <Camera frameProcessor={frameProcessor} previewType="skia" ... />
<regex>
header (0635d4a)global.FrameProcessorPlugins
TS error (1f7a2e0)Frame
as if it was a Skia Canvas (#1479) (12f850c), closes #1487
fpsGraph
prop to show a debug view of the current FPS the Camera is drawing at (#1479
previewType
prop to switch between native OS preview and the Skia Canvas preview view (#1479
toByteArray()
, orientation
, isMirrored
and timestamp
to Frame
(#1487)Published by mrousavy over 1 year ago
runAsync
and runAtTargetFps
) (#1472) (30b5615)Published by mrousavy over 1 year ago
Published by mrousavy over 1 year ago
Published by mrousavy almost 2 years ago
Published by mrousavy almost 2 years ago
Published by mrousavy almost 2 years ago
Published by mrousavy about 2 years ago
Published by mrousavy over 2 years ago
outputOrientation
Main Thread API checker (#1094) (04a8794)Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy almost 3 years ago
Published by mrousavy almost 3 years ago
Published by mrousavy almost 3 years ago