T
- the image type of the framespublic abstract class FileBackedVideo<T extends Image<?,T>> extends Video<T>
currentFrame
Constructor and Description |
---|
FileBackedVideo(List<File> files)
Construct the video from the provided files.
|
FileBackedVideo(List<File> files,
double fps)
Construct the video from the provided files.
|
FileBackedVideo(String filenameFormat,
int start,
int stop)
Construct videos from numbered files using the given format string and
indices.
|
Modifier and Type | Method and Description |
---|---|
long |
countFrames()
Return the number of frames in the whole video.
|
T |
getCurrentFrame()
Get the current frame
|
static List<File> |
getFilesList(String filenameFormat,
int start,
int stop)
Get a list of numbered files using the given format string and indices.
|
double |
getFPS()
Get the frame rate
|
int |
getHeight()
Get the height of the video frame.
|
T |
getNextFrame()
Get the next frame.
|
long |
getTimeStamp()
Get the timestamp of the current frame in milliseconds
|
int |
getWidth()
Get the width of the video frame
|
boolean |
hasNextFrame()
Returns whether this video has another frame to provide.
|
protected abstract T |
loadImage(File f) |
void |
reset()
Reset the video - putting the frame counter back to the start.
|
close, getCurrentFrameIndex, iterator, seek, setCurrentFrameIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public FileBackedVideo(List<File> files)
files
- the image filespublic FileBackedVideo(List<File> files, double fps)
files
- the image filesfps
- the frame ratepublic FileBackedVideo(String filenameFormat, int start, int stop)
filenameFormat
- format stringstart
- starting index (inclusive)stop
- stop index (exclusive)public T getNextFrame()
Video
getNextFrame
in class Video<T extends Image<?,T>>
public boolean hasNextFrame()
Video
hasNextFrame
in class Video<T extends Image<?,T>>
public T getCurrentFrame()
Video
getCurrentFrame
in class Video<T extends Image<?,T>>
public int getWidth()
public int getHeight()
protected abstract T loadImage(File f) throws IOException
IOException
public long countFrames()
Video
countFrames
in class Video<T extends Image<?,T>>
public void reset()
Video
public long getTimeStamp()
getTimeStamp
in class Video<T extends Image<?,T>>
Video.getTimeStamp()
public double getFPS()
public static List<File> getFilesList(String filenameFormat, int start, int stop)
filenameFormat
- format stringstart
- starting index (inclusive)stop
- stop index (exclusive)