Package org.opensourcephysics.tools
Class VideoCaptureTool
java.lang.Object
org.opensourcephysics.tools.VideoCaptureTool
- Direct Known Subclasses:
VideoGrabber
A video capture tool. This simply forwards jobs to the media tool.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Constructor Summary
ConstructorsModifierConstructorDescriptionPublic constructor.protected
VideoCaptureTool
(boolean ignored) Protected constructor for subclasses to prevent circular references. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addFrame
(BufferedImage image) Adds a frame to the video if it is recording.boolean
Determines whether this tool is functional.void
clear()
Clear the video from the tool in preparation for a new video.static VideoCaptureTool
getTool()
Gets the shared Tool.boolean
Gets the recording flag.boolean
Gets the visibility.void
Adds frame specified by image file path.void
setFrameRate
(double fps) Sets the frame rate.void
setRecording
(boolean record) Sets the recording flag.void
setVideoType
(VideoType type) Sets the video type.void
setVisible
(boolean visible) Sets the visibility.
-
Constructor Details
-
VideoCaptureTool
public VideoCaptureTool()Public constructor. -
VideoCaptureTool
protected VideoCaptureTool(boolean ignored) Protected constructor for subclasses to prevent circular references.- Parameters:
ignored
- ignored
-
-
Method Details
-
addFrame
Adds a frame to the video if it is recording. -
clear
public void clear()Clear the video from the tool in preparation for a new video. -
setRecording
public void setRecording(boolean record) Sets the recording flag.- Parameters:
record
- true to record rendered images
-
isRecording
public boolean isRecording()Gets the recording flag.- Specified by:
isRecording
in interfaceVideoTool
- Returns:
- true if recording rendered images
-
setVisible
public void setVisible(boolean visible) Sets the visibility.- Specified by:
setVisible
in interfaceVideoTool
- Parameters:
visible
- true to set this visible
-
isVisible
public boolean isVisible()Gets the visibility.- Returns:
- true if visible
-
canCapture
public boolean canCapture()Determines whether this tool is functional.- Returns:
- true if media capture is available
-
setVideoType
Sets the video type.- Parameters:
type
- the video type
-
setFrameRate
public void setFrameRate(double fps) Sets the frame rate.- Parameters:
fps
- the frame rate in frames per second
-
send
Adds frame specified by image file path. -
getTool
Gets the shared Tool.- Returns:
- the shared VideoCaptureTool
-