Comments (9)
whoops, docs were wrong. try this:
const invertColorsFilter = Skia.RuntimeEffect.Make(`
uniform shader image;
half4 main(vec2 pos) {
vec4 color = image.eval(pos);
return vec4((1.0 - color).rgb, 1.0);
}
`)
const shaderBuilder = Skia.RuntimeShaderBuilder(invertColorsFilter!)
const imageFilter = Skia.ImageFilter.MakeRuntimeShader(shaderBuilder, null, null)
const paint = Skia.Paint()
paint.setImageFilter(imageFilter)
// later:
frame.render(paint)
from react-native-vision-camera.
I'm already on it
from react-native-vision-camera.
nice
from react-native-vision-camera.
Yea they aren't up to date yet.
from react-native-vision-camera.
Happy to make a PR to fix this if you can describe the process to use a shader within the worklet.
from react-native-vision-camera.
Any news?
from react-native-vision-camera.
yes, I just released 4.0.0 and updated the docs.
from react-native-vision-camera.
Thank you for pretty library, that really cool
Unfortunately, this not working:
const invertColorsFilter = Skia.RuntimeEffect.Make(uniform shader image; half4 main(vec2 pos) { vec4 color = image.eval(pos); return vec4((1.0 - color).rgb, 1.0); }
);
const paint = Skia.Paint(invertColorsFilter);
const frameProcessor = useSkiaFrameProcessor(
frame => {
'worklet';
frame.render(paint);
},
[paint],
);
I have this error - 'Expected arguments: 0, received: 1.ts(2554)' inside Skia.paint(invertColorsFilter)
i working with android and this is my versions of packeges:
"react-native-vision-camera": "^4.0.1",
"@shopify/react-native-skia": "1.2.3",
"react-native-reanimated": "^3.5.4",
Maybe you know how to fix it, maybe i do something wrong
from react-native-vision-camera.
This is working now!, thank you so much
from react-native-vision-camera.
Related Issues (20)
- 💭 Question: Implementing Virtual Background and AR Try-On Glasses with Frame Processing HOT 2
- 💭 CodeScanner does not recognize Data Matrix code on a black background HOT 2
- 🐛 photo.orientation is wrong when outputOrientation = preview on Android HOT 2
- 🐛 OutputOrientation: "Duplicate label in when" HOT 1
- 💭 Add filter to photo when photo is taken HOT 2
- 💭 Obtaining camera calibration data HOT 5
- 🐛 Crash in Android release build HOT 5
- 🐛 Failed to convert NativeBuffer to SkImage HOT 2
- 🔧 RCT_NEW_ARCH_ENABLED=1 failed pod install HOT 2
- 🐛 Cannot debug via Google Chrome if using Android Native method marked as synchronous HOT 2
- 🐛 Crash in iOS release build when using SkiaFrameProcessor HOT 3
- 🐛 Cached apps freezer is freezing app on Google Pixel with Android 14 HOT 6
- 🐛 App Crashes when try to implement camera inside modal. HOT 1
- 💭 iOS photo quality vs native camera HOT 4
- 🐛 RN 0.74, RNVC 4.3.2. Take a photo or snapshot on iOS, the file does not exist at the path indicated by the response HOT 10
- 💭 Getting incorrect coordinates and bounds when using CodeScanner when scanning barcodes HOT 1
- 🔧 Failed to archive HOT 3
- 🐛 Landscape mode camera issue. HOT 1
- 🐛 Landscape mode camera issue HOT 3
- 🐛 Unable to record video more than 30 fps HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-vision-camera.