T
- the image type of the framespublic class ArrayBackedVideo<T extends Image<?,T>> extends Video<T>
currentFrame
Modifier | Constructor and Description |
---|---|
protected |
ArrayBackedVideo()
Default constructor for creating array backed videos with no frames for
subclasses.
|
|
ArrayBackedVideo(T[] frames)
Construct a video from the provided frames.
|
|
ArrayBackedVideo(T[] frames,
double fps)
Construct a video from the provided frames.
|
|
ArrayBackedVideo(T[] frames,
double fps,
boolean loop)
Construct a video from the provided frames.
|
Modifier and Type | Method and Description |
---|---|
long |
countFrames()
Return the number of frames in the whole video.
|
T |
getCurrentFrame()
Get the current frame
|
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.
|
void |
reset()
Reset the video - putting the frame counter back to the start.
|
void |
setCurrentFrameIndex(long newFrame)
Set the current frame index (i.e.
|
close, getCurrentFrameIndex, iterator, seek
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected ArrayBackedVideo()
public ArrayBackedVideo(T[] frames)
frames
- the framespublic ArrayBackedVideo(T[] frames, double fps)
frames
- the framesfps
- the frame ratepublic ArrayBackedVideo(T[] frames, double fps, boolean loop)
frames
- the framesfps
- the frame rateloop
- loop the videopublic T getNextFrame()
Video
getNextFrame
in class Video<T extends Image<?,T>>
public T getCurrentFrame()
Video
getCurrentFrame
in class Video<T extends Image<?,T>>
public void setCurrentFrameIndex(long newFrame)
Video
setCurrentFrameIndex
in class Video<T extends Image<?,T>>
newFrame
- the new indexpublic boolean hasNextFrame()
Video
hasNextFrame
in class Video<T extends Image<?,T>>
public int getWidth()
public int getHeight()
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()