|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.vision.VideoSource
dlife.vision.cameras.sources.ImageVideoSource
public class ImageVideoSource
A VideoSource for a static image. The image can be in any format that is supported by the ImageIO.read method in the javax.imageio package. This includes at least bmp, wbmp, jpeg, gif, and png images. Running the main method in this class will display a list of all of the recognized image formats.
| Field Summary |
|---|
| Fields inherited from class dlife.vision.VideoSource |
|---|
loop |
| Constructor Summary | |
|---|---|
ImageVideoSource()
Use a JFileChooser to allow the user to select the image file to be used for this ImageVideoSource. |
|
ImageVideoSource(URL imageURL)
Construct a new ImageVideoSource for the image at the specified URL. |
|
| Method Summary | |
|---|---|
boolean |
canLoop()
An ImageVideoSource cannot loop. |
boolean |
canPause()
An ImageVideoSource cannot be paused. |
boolean |
canPlay()
An ImageVideoSource acts as if it is always in the paused state. |
boolean |
canRewind()
An ImageVideoSource cannot be rewound. |
boolean |
canSeek()
An ImageVideoSource cannot seek. |
boolean |
canStepBackward()
An ImageVideoSource cannot step backward. |
boolean |
canStepForward()
An ImageVideoSource cannot step forward. |
void |
connect()
Load the image for this ImageVideoSource. |
void |
disconnect()
Disconnect from the ImageVideoSource. |
VideoSourceGUI |
getGUI()
Get the VideoPlayerGUI that will control this ImageVideoSource. |
int |
getHeight()
Get the width of the image associated with this ImageVideoSource. |
int |
getSeekLocation()
An ImageVideoSource cannot seek so this method returns -1. |
BufferedImage |
getVideoFrame()
This method returns the image specified when this ImageVideoSource was constructed. |
int |
getWidth()
Get the height of the image associated with this ImageVideoSource. |
static void |
main(String[] args)
Little test method that creates and displays a Camera (and all of the GUI parts) using an ImageVideoSource as the video source. |
void |
pause()
An ImageVideoSource cannot be paused so this method does nothing in this implementation. |
void |
play()
When play is called the ImageVideoSource simply notifies the observers that a new image is available for display. |
void |
rewind()
An ImageVideoSource cannot be rewound so this method does nothing in this implementation. |
void |
seek(int location)
An ImageVideoSource cannot seek so this method does nothing in this implementation. |
void |
stepBackward()
An ImageVideoSource cannot be stepped backward so this method does nothing in this implementation. |
void |
stepForward()
An ImageVideoSource cannot be stepped forward so this method does nothing in this implementation. |
| Methods inherited from class dlife.vision.VideoSource |
|---|
isLooping, setLoop |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageVideoSource()
throws VideoSourceCreationFailedException
VideoSourceCreationFailedException - if the user cancels the creation or if the
file selected by the user cannot be read.
public ImageVideoSource(URL imageURL)
throws VideoSourceCreationFailedException
imageURL - the URL of the image for the new ImageVideoSource.
VideoSourceCreationFailedException| Method Detail |
|---|
public void connect()
throws VideoSourceConnectionException
connect in class VideoSourceVideoSourceConnectionException - if the image file cannot be read.public void disconnect()
disconnect in class VideoSourcepublic VideoSourceGUI getGUI()
getGUI in class VideoSourcepublic boolean canPause()
canPause in class VideoSourcepublic boolean canPlay()
canPlay in class VideoSourcepublic boolean canRewind()
canRewind in class VideoSourcepublic boolean canStepBackward()
canStepBackward in class VideoSourcepublic boolean canStepForward()
canStepForward in class VideoSourcepublic boolean canLoop()
canLoop in class VideoSourcepublic boolean canSeek()
canSeek in class VideoSourcepublic BufferedImage getVideoFrame()
getVideoFrame in class VideoSourcepublic void pause()
pause in class VideoSourcepublic void play()
play in class VideoSourcepublic void rewind()
rewind in class VideoSourcepublic void stepBackward()
stepBackward in class VideoSourcepublic void stepForward()
stepForward in class VideoSourcepublic void seek(int location)
seek in class VideoSourcelocation - the location to which to seek.public int getSeekLocation()
getSeekLocation in class VideoSourcepublic int getHeight()
getHeight in class VideoSourcepublic int getWidth()
getWidth in class VideoSourcepublic static void main(String[] args)
args - none
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||