Package edu.wpi.grip.core.operations
Class CudaOperation
- java.lang.Object
-
- edu.wpi.grip.core.operations.CudaOperation
-
- All Implemented Interfaces:
Operation
- Direct Known Subclasses:
BlurOperation
,CannyEdgeOperation
,DesaturateOperation
,NormalizeOperation
public abstract class CudaOperation extends java.lang.Object implements Operation
A partial implementation of Operation that has the option to use CUDA acceleration.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.bytedeco.javacpp.opencv_core.Mat
cpuIn
The mat used for an input to the CPU operation.protected org.bytedeco.javacpp.opencv_core.Mat
cpuOut
The output mat of a CPU operation.protected SocketHint<java.lang.Boolean>
gpuHint
protected org.bytedeco.javacpp.opencv_core.GpuMat
gpuIn
The mat used for an input to the CUDA operation.protected org.bytedeco.javacpp.opencv_core.GpuMat
gpuOut
The output mat of a CUDA operation.protected CudaSocket
gpuSocket
Input socket telling the operation to prefer to use CUDA acceleration when possible.protected SocketHint<MatWrapper>
inputHint
protected InputSocket<MatWrapper>
inputSocket
Default image input socket.protected SocketHint<MatWrapper>
outputHint
protected OutputSocket<MatWrapper>
outputSocket
Default image output socket.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CudaOperation(InputSocket.Factory isf, OutputSocket.Factory osf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Allows the step to clean itself up when removed from the pipeline.protected boolean
preferCuda()
Checks thegpuSocket
to see if this operation should prefer to use the CUDA codepath.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.grip.core.Operation
getInputSockets, getOutputSockets, perform
-
-
-
-
Field Detail
-
inputHint
protected final SocketHint<MatWrapper> inputHint
-
gpuHint
protected final SocketHint<java.lang.Boolean> gpuHint
-
outputHint
protected final SocketHint<MatWrapper> outputHint
-
inputSocket
protected final InputSocket<MatWrapper> inputSocket
Default image input socket.
-
gpuSocket
protected final CudaSocket gpuSocket
Input socket telling the operation to prefer to use CUDA acceleration when possible.
-
outputSocket
protected final OutputSocket<MatWrapper> outputSocket
Default image output socket.
-
cpuIn
protected final org.bytedeco.javacpp.opencv_core.Mat cpuIn
The mat used for an input to the CPU operation.
-
gpuIn
protected final org.bytedeco.javacpp.opencv_core.GpuMat gpuIn
The mat used for an input to the CUDA operation.
-
cpuOut
protected final org.bytedeco.javacpp.opencv_core.Mat cpuOut
The output mat of a CPU operation.
-
gpuOut
protected final org.bytedeco.javacpp.opencv_core.GpuMat gpuOut
The output mat of a CUDA operation.
-
-
Constructor Detail
-
CudaOperation
protected CudaOperation(InputSocket.Factory isf, OutputSocket.Factory osf)
-
-
Method Detail
-
cleanUp
public void cleanUp()
Description copied from interface:Operation
Allows the step to clean itself up when removed from the pipeline. This should only be called byStep.setRemoved()
to ensure correct synchronization.
-
preferCuda
protected boolean preferCuda()
Checks thegpuSocket
to see if this operation should prefer to use the CUDA codepath.- Returns:
- true if this operation should prefer to use CUDA, false if it should only use the CPU
-
-