docs: Fix highlight
This commit is contained in:
parent
4830ba8bf6
commit
bb7549bc01
@ -69,10 +69,6 @@ public class FaceDetectorFrameProcessorPlugin extends FrameProcessorPlugin {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
:::note
|
|
||||||
The Frame Processor Plugin will be exposed to JS through the `VisionCameraProxy` object. In this case, it would be `VisionCameraProxy.getFrameProcessorPlugin("detectFaces")`.
|
|
||||||
:::
|
|
||||||
|
|
||||||
4. **Implement your Frame Processing.** See the [Example Plugin (Java)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleFrameProcessorPlugin.java) for reference.
|
4. **Implement your Frame Processing.** See the [Example Plugin (Java)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleFrameProcessorPlugin.java) for reference.
|
||||||
5. Create a new Java file which registers the Frame Processor Plugin in a React Package, for the Face Detector plugin this file will be called `FaceDetectorFrameProcessorPluginPackage.java`:
|
5. Create a new Java file which registers the Frame Processor Plugin in a React Package, for the Face Detector plugin this file will be called `FaceDetectorFrameProcessorPluginPackage.java`:
|
||||||
|
|
||||||
@ -106,6 +102,10 @@ public class FaceDetectorFrameProcessorPluginPackage implements ReactPackage {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
:::note
|
||||||
|
The Frame Processor Plugin will be exposed to JS through the `VisionCameraProxy` object. In this case, it would be `VisionCameraProxy.getFrameProcessorPlugin("detectFaces")`.
|
||||||
|
:::
|
||||||
|
|
||||||
6. Register the package in MainApplication.java
|
6. Register the package in MainApplication.java
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@ -140,10 +140,6 @@ class FaceDetectorFrameProcessorPlugin: FrameProcessorPlugin() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
:::note
|
|
||||||
The Frame Processor Plugin will be exposed to JS through the `VisionCameraProxy` object. In this case, it would be `VisionCameraProxy.getFrameProcessorPlugin("detectFaces")`.
|
|
||||||
:::
|
|
||||||
|
|
||||||
4. **Implement your Frame Processing.** See the [Example Plugin (Java)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleFrameProcessorPlugin.java) for reference.
|
4. **Implement your Frame Processing.** See the [Example Plugin (Java)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleFrameProcessorPlugin.java) for reference.
|
||||||
5. Create a new Kotlin file which registers the Frame Processor Plugin in a React Package, for the Face Detector plugin this file will be called `FaceDetectorFrameProcessorPluginPackage.kt`:
|
5. Create a new Kotlin file which registers the Frame Processor Plugin in a React Package, for the Face Detector plugin this file will be called `FaceDetectorFrameProcessorPluginPackage.kt`:
|
||||||
|
|
||||||
@ -173,6 +169,10 @@ class FaceDetectorFrameProcessorPluginPackage : ReactPackage {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
:::note
|
||||||
|
The Frame Processor Plugin will be exposed to JS through the `VisionCameraProxy` object. In this case, it would be `VisionCameraProxy.getFrameProcessorPlugin("detectFaces")`.
|
||||||
|
:::
|
||||||
|
|
||||||
6. Register the package in MainApplication.java
|
6. Register the package in MainApplication.java
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
@ -64,10 +64,12 @@ For reference see the [CLI's docs](https://github.com/mateusz1913/vision-camera-
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ (void) load {
|
+ (void) load {
|
||||||
|
// highlight-start
|
||||||
[FrameProcessorPluginRegistry addFrameProcessorPlugin:@"detectFaces"
|
[FrameProcessorPluginRegistry addFrameProcessorPlugin:@"detectFaces"
|
||||||
withInitializer:^FrameProcessorPlugin*(NSDictionary* options) {
|
withInitializer:^FrameProcessorPlugin*(NSDictionary* options) {
|
||||||
return [[FaceDetectorFrameProcessorPlugin alloc] initWithOptions:options];
|
return [[FaceDetectorFrameProcessorPlugin alloc] initWithOptions:options];
|
||||||
}];
|
}];
|
||||||
|
// highlight-end
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -99,7 +101,9 @@ The Frame Processor Plugin will be exposed to JS through the `VisionCameraProxy`
|
|||||||
```swift
|
```swift
|
||||||
@objc(FaceDetectorFrameProcessorPlugin)
|
@objc(FaceDetectorFrameProcessorPlugin)
|
||||||
public class FaceDetectorFrameProcessorPlugin: FrameProcessorPlugin {
|
public class FaceDetectorFrameProcessorPlugin: FrameProcessorPlugin {
|
||||||
public override func callback(_ frame: Frame!, withArguments arguments: [String:Any]) -> Any {
|
|
||||||
|
public override func callback(_ frame: Frame!,
|
||||||
|
withArguments arguments: [String:Any]) -> Any {
|
||||||
let buffer = frame.buffer
|
let buffer = frame.buffer
|
||||||
let orientation = frame.orientation
|
let orientation = frame.orientation
|
||||||
// code goes here
|
// code goes here
|
||||||
@ -123,12 +127,12 @@ public class FaceDetectorFrameProcessorPlugin: FrameProcessorPlugin {
|
|||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
// hightlight-start
|
// highlight-start
|
||||||
[FrameProcessorPluginRegistry addFrameProcessorPlugin:@"detectFaces"
|
[FrameProcessorPluginRegistry addFrameProcessorPlugin:@"detectFaces"
|
||||||
withInitializer:^FrameProcessorPlugin*(NSDictionary* options) {
|
withInitializer:^FrameProcessorPlugin*(NSDictionary* options) {
|
||||||
return [[FaceDetectorFrameProcessorPlugin alloc] initWithOptions:options];
|
return [[FaceDetectorFrameProcessorPlugin alloc] initWithOptions:options];
|
||||||
}];
|
}];
|
||||||
// hightlight-end
|
// highlight-end
|
||||||
|
|
||||||
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user