-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Oliver Rode
committed
Mar 27, 2018
1 parent
68283ff
commit 31b2566
Showing
21 changed files
with
281 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...in/java/src/main/java/cc0/JniExample.java → ...lugin/java/src/main/java/cc0/JniTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
jniplugin/java/src/main/java/de/screenflow/frankenstein/vf/external/ExternalSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package de.screenflow.frankenstein.vf.external; | ||
|
||
import de.screenflow.frankenstein.vf.NativeFilter; | ||
|
||
public class ExternalSample extends NativeFilter { | ||
public ExternalSample() throws UnsatisfiedLinkError { | ||
} | ||
|
||
public native void init(); | ||
public native void process(Object mat, int frameId, Object context, Object params, Object result); | ||
} |
10 changes: 10 additions & 0 deletions
10
.../src/main/java/de/screenflow/frankenstein/vf/external/ExternalSampleConfigController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package de.screenflow.frankenstein.vf.external; | ||
|
||
import javafx.fxml.FXML; | ||
|
||
import de.screenflow.frankenstein.vf.segment.SegmentConfigController; | ||
|
||
|
||
public class ExternalSampleConfigController extends SegmentConfigController { | ||
|
||
} |
73 changes: 73 additions & 0 deletions
73
...lugin/java/src/main/java/de/screenflow/frankenstein/vf/external/ExternalSampleFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright 2017 Oliver Rode, https://github.com/olir/Frankenstein | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.screenflow.frankenstein.vf.external; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
import java.util.Deque; | ||
import java.util.ArrayDeque; | ||
|
||
import org.opencv.core.Mat; | ||
import org.opencv.imgproc.Imgproc; | ||
|
||
import de.screenflow.frankenstein.vf.FilterContext; | ||
import de.screenflow.frankenstein.vf.segment.NativeSegmentFilter; | ||
|
||
public class ExternalSampleFilter extends NativeSegmentFilter<ExternalSampleConfigController> { | ||
|
||
private final static String JNI_FILTER_CLASS = "de.screenflow.frankenstein.vf.external.ExternalSample"; | ||
|
||
private final Method jniProxyProcessMethod; | ||
|
||
private Mat mHsvMat = new Mat(); | ||
|
||
@SuppressWarnings("unchecked") | ||
public ExternalSampleFilter() throws UnsatisfiedLinkError { | ||
super("externalsample", JNI_FILTER_CLASS); | ||
try { | ||
jniProxyProcessMethod = getJniProxyClass().getMethod("process", Object.class, int.class, Object.class); | ||
} catch (Throwable e) { | ||
throw new RuntimeException("jni wrapper creation failed", e); | ||
} | ||
} | ||
|
||
@Override | ||
public Mat process(Mat rgbaImage, int frameId, FilterContext context) { | ||
Imgproc.cvtColor(rgbaImage, mHsvMat, Imgproc.COLOR_RGB2HSV_FULL); | ||
|
||
ExternalSampleConfigController c = ((ExternalSampleConfigController)getConfigController()); | ||
// pass c data to proxy... | ||
|
||
Object params = null; | ||
|
||
try { | ||
jniProxyProcessMethod.invoke(getJniProxy(), mHsvMat, frameId, context); | ||
} catch (Throwable e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
Imgproc.cvtColor(mHsvMat, rgbaImage, Imgproc.COLOR_HSV2RGB_FULL); | ||
|
||
return rgbaImage; | ||
} | ||
|
||
@Override | ||
protected void initializeController() { | ||
ExternalSampleConfigController c = ((ExternalSampleConfigController)getConfigController()); | ||
//c.set...(...); | ||
//c.initialize(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
jniplugin/java/src/main/java/de/screenflow/frankenstein/vf/jni/MatBlender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
jniplugin/java/src/main/java/de/screenflow/frankenstein/vf/jni/VideoEqualizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.