Package edu.wpi.grip.core.sources
Class ImageFileSource
- java.lang.Object
-
- edu.wpi.grip.core.Source
-
- edu.wpi.grip.core.sources.ImageFileSource
-
public final class ImageFileSource extends Source
Provides a way to generate aopencv_core.Matfrom an image on the filesystem.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceImageFileSource.Factory-
Nested classes/interfaces inherited from class edu.wpi.grip.core.Source
Source.SourceFactory, Source.SourceFactoryImpl
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<OutputSocket>createOutputSockets()java.lang.StringgetName()This is used by the GUI to distinguish different sources.java.util.PropertiesgetProperties()This is used for serialization/deserialization.voidinitialize()Performs the loading of the image from the file system.protected booleanupdateOutputSockets()This method will check if there are any pending updates to output sockets.-
Methods inherited from class edu.wpi.grip.core.Source
getExceptionWitness, getOutputSockets, initializeSafely, toString
-
-
-
-
Method Detail
-
initialize
public void initialize() throws java.io.IOExceptionPerforms the loading of the image from the file system.- Specified by:
initializein classSource- Throws:
java.io.IOException- If the image fails to load from the filesystem
-
getName
public java.lang.String getName()
Description copied from class:SourceThis is used by the GUI to distinguish different sources. For example,ImageFileSourcereturns the filename of the image.
-
createOutputSockets
public java.util.List<OutputSocket> createOutputSockets()
- Specified by:
createOutputSocketsin classSource
-
updateOutputSockets
protected boolean updateOutputSockets()
Description copied from class:SourceThis method will check if there are any pending updates to output sockets. If there are any, update the sockets and then return true. If there are no updates this function should return false.- Specified by:
updateOutputSocketsin classSource- Returns:
- true if there are updates ready to be moved into the socket.
-
getProperties
public java.util.Properties getProperties()
Description copied from class:SourceThis is used for serialization/deserialization.- Specified by:
getPropertiesin classSource- Returns:
- A
Propertiescontaining data that can be used to re-create this source.
-
-