-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override eocv sim tuner manager and invoke reflect directly
- Loading branch information
1 parent
ca9b8ec
commit 92b420b
Showing
3 changed files
with
69 additions
and
9 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
26 changes: 26 additions & 0 deletions
26
...b/deltacv/papervision/plugin/ipc/eocvsim/StreamableNoReflectOpenCvPipelineInstantiator.kt
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,26 @@ | ||
package io.github.deltacv.papervision.plugin.ipc.eocvsim | ||
|
||
import io.github.deltacv.eocvsim.pipeline.StreamableOpenCvPipeline | ||
import com.github.serivesmejia.eocvsim.pipeline.instantiator.DefaultPipelineInstantiator | ||
import com.github.serivesmejia.eocvsim.pipeline.instantiator.PipelineInstantiator | ||
import io.github.deltacv.eocvsim.stream.ImageStreamer | ||
import io.github.deltacv.eocvsim.virtualreflect.jvm.JvmVirtualReflection | ||
import org.firstinspires.ftc.robotcore.external.Telemetry | ||
import org.openftc.easyopencv.OpenCvPipeline | ||
|
||
class StreamableNoReflectOpenCvPipelineInstantiator( | ||
val imageStreamer: ImageStreamer | ||
) : PipelineInstantiator { | ||
|
||
override fun instantiate(clazz: Class<*>, telemetry: Telemetry) = | ||
DefaultPipelineInstantiator.instantiate(clazz, telemetry).apply { | ||
if(this is StreamableOpenCvPipeline) { | ||
this.streamer = imageStreamer | ||
} | ||
} | ||
|
||
override fun virtualReflectOf(pipeline: OpenCvPipeline) = JvmVirtualReflection | ||
|
||
override fun variableTunerTarget(pipeline: OpenCvPipeline) = Any() | ||
|
||
} |