Class VideoCaptureTool

java.lang.Object
org.opensourcephysics.tools.VideoCaptureTool
All Implemented Interfaces:
Tool, VideoTool
Direct Known Subclasses:
VideoGrabber

public class VideoCaptureTool extends Object implements Tool, VideoTool
A video capture tool. This simply forwards jobs to the media tool.
Version:
1.0
Author:
Douglas Brown
  • 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

      public boolean addFrame(BufferedImage image)
      Adds a frame to the video if it is recording.
      Specified by:
      addFrame in interface VideoTool
      Parameters:
      image - the frame to be added
      Returns:
      true if frame was added
    • clear

      public void clear()
      Clear the video from the tool in preparation for a new video.
      Specified by:
      clear in interface VideoTool
    • 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 interface VideoTool
      Returns:
      true if recording rendered images
    • setVisible

      public void setVisible(boolean visible)
      Sets the visibility.
      Specified by:
      setVisible in interface VideoTool
      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

      public void setVideoType(VideoType type)
      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

      public void send(Job job, Tool noReply)
      Adds frame specified by image file path.
      Specified by:
      send in interface Tool
      Parameters:
      job - the job
      noReply - ignored
    • getTool

      public static VideoCaptureTool getTool()
      Gets the shared Tool.
      Returns:
      the shared VideoCaptureTool