@dprado/vision-camera-cropper
v2.0.0
Published
A react native vision camera frame processor for cropping
Maintainers
Readme
vision-camera-cropper
A react native vision camera frame processor for cropping
Versions
For Vision Camera v3, use versions 0.x.
For Vision Camera v4, use versions >= 1.0.0 < 2.0.0
For Vision Camera v5, use versions >= 2.0.0
Installation
yarn add vision-camera-cropper
cd ios && pod installAdd the plugin to your babel.config.js:
module.exports = {
plugins: [['react-native-worklets/plugin']],
// ...Note: You have to restart metro-bundler for changes in the
babel.config.jsfile to take effect.
Usage
Crop a frame and return its base64 or path.
import { crop } from 'vision-camera-cropper'; // ... const frameOutput = useFrameOutput({ pixelFormat: 'yuv', onFrame: (frame) => { 'worklet'; const result = crop(frame, { cropRegion: cropRegionShared.value, includeImageBase64: true, }); frame.dispose(); },
}); ```
Rotate an image.
const rotated = await rotateImage(base64,degree);
Blog
How to Create a React Native Vision Camera Plugin to Crop Frames
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
