-
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.
Local Filters implemented. First demo: Black&White
- Loading branch information
Showing
7 changed files
with
266 additions
and
28 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
42 changes: 42 additions & 0 deletions
42
src/main/java/de/screenflow/frankenstein/fxml/FilterSetupController.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 |
---|---|---|
@@ -1,5 +1,47 @@ | ||
package de.screenflow.frankenstein.fxml; | ||
|
||
import de.screenflow.frankenstein.vf.LocalVideoFilter; | ||
import javafx.beans.value.ChangeListener; | ||
import javafx.beans.value.ObservableValue; | ||
import javafx.fxml.FXML; | ||
import javafx.scene.control.ComboBox; | ||
import javafx.stage.Stage; | ||
|
||
public class FilterSetupController { | ||
|
||
@FXML ComboBox<LocalVideoFilter> cbFilter; | ||
|
||
private ProcessingSceneController parent; | ||
|
||
private Stage stage; | ||
|
||
private LocalVideoFilter selectedFilter = null; | ||
|
||
public void configure(ProcessingSceneController parent, Stage stage) { | ||
this.parent = parent; | ||
this.stage = stage; | ||
|
||
cbFilter.getItems().setAll(parent.getLocalFilters()); | ||
|
||
cbFilter.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<LocalVideoFilter>() { | ||
@Override public void changed(ObservableValue<? extends LocalVideoFilter> selected, LocalVideoFilter oldFilter, LocalVideoFilter newFilter) { | ||
if (oldFilter != null) { | ||
selectedFilter = null; | ||
} | ||
if (newFilter != null) { | ||
selectedFilter = newFilter; | ||
} | ||
} | ||
}); | ||
} | ||
|
||
public void ok() { | ||
System.out.println("ok"); | ||
stage.close(); | ||
} | ||
|
||
public LocalVideoFilter getSelectedFilterType() { | ||
return selectedFilter; | ||
} | ||
|
||
} |
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
28 changes: 28 additions & 0 deletions
28
src/main/java/de/screenflow/frankenstein/vf/FilterElement.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,28 @@ | ||
package de.screenflow.frankenstein.vf; | ||
|
||
import org.opencv.core.Range; | ||
|
||
import de.screenflow.frankenstein.fxml.ProcessingSceneController; | ||
|
||
public class FilterElement { | ||
public Range r; | ||
public LocalVideoFilter filter = null; | ||
ProcessingSceneController psc; | ||
|
||
public FilterElement(Range r, ProcessingSceneController psc) { | ||
FilterElement.this.r = r; | ||
this.psc = psc; | ||
} | ||
|
||
public void setType(LocalVideoFilter selectedFilterType) { | ||
filter = selectedFilterType; | ||
} | ||
|
||
public String toString() { | ||
return toStringRange() + " " + (filter != null ? filter : "<none>"); | ||
} | ||
|
||
public String toStringRange() { | ||
return "" + psc.time((r.start - 1.0) / psc.fps) + "-" + psc.time((r.end - 1.0) / psc.fps) + " " + r.toString(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/de/screenflow/frankenstein/vf/LocalVideoFilter.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,20 @@ | ||
/* | ||
* 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; | ||
|
||
public interface LocalVideoFilter extends VideoFilter { | ||
LocalVideoFilter getInstance(); | ||
} |
Oops, something went wrong.