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.protectedVideoCaptureTool(boolean ignored) Protected constructor for subclasses to prevent circular references. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddFrame(BufferedImage image) Adds a frame to the video if it is recording.booleanDetermines whether this tool is functional.voidclear()Clear the video from the tool in preparation for a new video.static VideoCaptureToolgetTool()Gets the shared Tool.booleanGets the recording flag.booleanGets the visibility.voidAdds frame specified by image file path.voidsetFrameRate(double fps) Sets the frame rate.voidsetRecording(boolean record) Sets the recording flag.voidsetVideoType(VideoType type) Sets the video type.voidsetVisible(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:
isRecordingin interfaceVideoTool- Returns:
- true if recording rendered images
-
setVisible
public void setVisible(boolean visible) Sets the visibility.- Specified by:
setVisiblein 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
-