|
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.ImageSequenceVideoSource
public class ImageSequenceVideoSource
An ImageSequenceVideoSource presents all of the images in a specified directory in lexicographical order as a VideoSource. The easiest way to sequence the images in a directory is to prefix their names with a 0-padded numeral (e.g. 001ball.jpg, 002ball.jpg etc...).
Ideally all images in the specified directory are the same size. However, if there are images of different sizes, the width and height of the video for this ImageSequenceVideoSource will be determined by the width and height of the largest image.
| Field Summary | |
|---|---|
static int |
DEFAULT_FRAME_RATE
Default frame rate for an ImageSequenceVideoSource in frames/second. |
| Fields inherited from class dlife.vision.VideoSource |
|---|
loop |
| Constructor Summary | |
|---|---|
ImageSequenceVideoSource()
Construct a new ImageSequenceVideoSource by allowing the user to select a directory of files using a file chooser dialog. |
|
ImageSequenceVideoSource(String directory)
Construct a new ImageVideoSequence using all of the image files contained in the specified directory. |
|
| Method Summary | |
|---|---|
boolean |
canLoop()
An ImageSequenceVideoSource can be looped. |
boolean |
canPause()
An ImageSequenceVideoSource can be paused when it is playing. |
boolean |
canPlay()
An ImageSequenceVideoSource can be played any time that it is not currently playing if it is looping. |
boolean |
canRewind()
An ImageSequenceVideoSource can be rewound if is not playing and it is not already at the first frame. |
boolean |
canSeek()
An ImageSequenceVideoSource can seek any time that it is not playing. |
boolean |
canStepBackward()
An ImageSequenceVideoSource can step backward if it is not playing and it is not already at the start. |
boolean |
canStepForward()
An ImageSequenceVideoSource can step forward if it is not playing and it is not already at the end. |
void |
connect()
Read the images from the files and setup the initial state of the ImageSequenceVideoSource. |
void |
disconnect()
Disconnect from the ImageSequenceVideoSource. |
int |
getCurrentFrame()
Return the current frame (i.e. |
int |
getFrameCount()
Get the number of frames in this ImageSequenceVideoSource. |
int |
getFrameRate()
Get the current frame rate for this ImageSequenceVideoSource. |
VideoSourceGUI |
getGUI()
Get the GUI for this ImageSequenceVideoSource. |
int |
getHeight()
Get the height of the video for this ImageSequenceVideoSource. |
int |
getSeekLocation()
Return the current seek location of this ImageSequenceVideoSource. |
BufferedImage |
getVideoFrame()
Get the image representing the current frame of video. |
int |
getWidth()
Get the width of the video for this ImageSequenceVideoSource. |
static void |
main(String[] args)
Little test method that creates and displays a Camera (and all of the GUI parts) using an ImageSequenceVideoSource as the video source. |
void |
pause()
Pause the video. |
void |
play()
Play the video. |
void |
rewind()
Rewind the video to the first frame and seek location 0. |
void |
seek(int location)
Seek this video to the specified location. |
void |
setFrameRate(int fps)
Change the frame rate for this ImageSequenceVideoSource. |
void |
stepBackward()
Step the video backward by one frame. |
void |
stepForward()
Step the video forward by one frame. |
| 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 |
| Field Detail |
|---|
public static final int DEFAULT_FRAME_RATE
| Constructor Detail |
|---|
public ImageSequenceVideoSource()
throws VideoSourceCreationFailedException
VideoSourceCreationFailedException - if user cancels the creation.
public ImageSequenceVideoSource(String directory)
throws VideoSourceCreationFailedException
directory - the absolute path to the directory containing the image
files to be used.
VideoSourceCreationFailedException - if the specified directory
cannot be found.| Method Detail |
|---|
public void connect()
throws VideoSourceConnectionException
connect in class VideoSourceVideoSourceConnectionException - if any of the files cannot be
read.public void disconnect()
disconnect in class VideoSourcepublic VideoSourceGUI getGUI()
getGUI in class VideoSourcepublic void setFrameRate(int fps)
fps - number of frames per second to display.public int getFrameRate()
public int getFrameCount()
public int getWidth()
getWidth in class VideoSourcepublic int getHeight()
getHeight in class VideoSourcepublic boolean canLoop()
canLoop in class VideoSourcepublic boolean canPause()
canPause in class VideoSourcepublic boolean canPlay()
canPlay in class VideoSourcepublic boolean canRewind()
canRewind in class VideoSourcepublic boolean canSeek()
canSeek in class VideoSourcepublic boolean canStepBackward()
canStepBackward in class VideoSourcepublic boolean canStepForward()
canStepForward in class VideoSourcepublic int getSeekLocation()
getSeekLocation in class VideoSourcepublic int getCurrentFrame()
public void seek(int location)
seek in class VideoSourcelocation - the new seek location.public void stepForward()
stepForward in class VideoSourcepublic void stepBackward()
stepBackward in class VideoSourcepublic void rewind()
rewind in class VideoSourcepublic void pause()
pause in class VideoSourcepublic void play()
play in class VideoSourcepublic BufferedImage getVideoFrame()
getVideoFrame 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 | |||||||||