vtk
Class vtkVideoSource

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkProcessObject
              extended byvtk.vtkSource
                  extended byvtk.vtkImageSource
                      extended byvtk.vtkVideoSource
All Implemented Interfaces:
java.io.Serializable

public class vtkVideoSource
extends vtkImageSource
implements java.io.Serializable

vtkVideoSource - Superclass of video input devices for VTK. vtkVideoSource is a superclass for video input interfaces for VTK. The goal is to provide an interface which is very similar to the interface of a VCR, where the 'tape' is an internal frame buffer capable of holding a preset number of video frames. Specialized versions of this class record input from various video input sources. This base class records input from a noise source. JavaBean wrapper for vtkVideoSource object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
vtkWin32VideoSource, Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkVideoSource()
           
protected vtkVideoSource(int dmy)
           
 
Method Summary
 void autoAdvanceOff()
          Set whether to automatically advance the buffer before each grab.
 void autoAdvanceOn()
          Set whether to automatically advance the buffer before each grab.
 void fastForward()
          FastForward to the last frame that was recorded (i.e. to the frame that has the most recent timestamp).
 int getAutoAdvance()
          Set whether to automatically advance the buffer before each grab.
 java.lang.String getClassName()
          Return the class name as a string.
 int[] getClipRegion()
          Set the clip rectangle for the frames.
 double[] getDataOrigin()
          Set/Get the coordinates of the lower, left corner of the frame.
 double[] getDataSpacing()
          Set/Get the pixel spacing.
 int getFrameBufferSize()
          Set size of the frame buffer, i.e. the number of frames that the 'tape' can store.
 int getFrameCount()
          This value is incremented each time a frame is grabbed.
 int getFrameIndex()
          Get the frame index relative to the 'beginning of the tape'.
 double getFrameRate()
          Request a particular frame rate (default 30 frames per second).
 int[] getFrameSize()
          Set the full-frame size.
 double getFrameTimeStamp()
          Get a time stamp in seconds (resolution of milliseconds) for the Output.
 double getFrameTimeStamp(int id0)
          Get a time stamp in seconds (resolution of milliseconds) for a video frame.
 int getInitialized()
          Initialize the hardware.
 int getNumberOfOutputFrames()
          Set the number of frames to copy to the output on each execute.
 double getOpacity()
          For RGBA output only (4 scalar components), set the opacity.
 int getOutputFormat()
          Set the output format.
 int[] getOutputWholeExtent()
          Get/Set the WholeExtent of the output.
 int getPlaying()
          Are we in play mode?
 int getRecording()
          Are we in record mode?
 double getStartTimeStamp()
          And internal variable which marks the beginning of a Record session.
 vtkVideoSource getThisVideoSource()
           
 void grab()
          Grab a single video frame.
 void initialize()
          Initialize the hardware.
 void internalGrab()
          The internal function which actually does the grab.
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 void play()
          Play through the 'tape' sequentially at the specified frame rate.
 void record()
          Record incoming video at the specified FrameRate.
 void releaseSystemResources()
          Release the video driver.
 void rewind()
          Rewind to the frame with the earliest timestamp.
 void seek(int id0)
          Seek forwards or backwards by the specified number of frames (positive is forward, negative is backward).
 void setAutoAdvance(int id0)
          Set whether to automatically advance the buffer before each grab.
 void setClipRegion(int[] id0)
          Set the clip rectangle for the frames.
 void setClipRegion(int id0, int id1, int id2, int id3, int id4, int id5)
          Set the clip rectangle for the frames.
 void setDataOrigin(double[] id0)
          Set/Get the coordinates of the lower, left corner of the frame.
 void setDataOrigin(double id0, double id1, double id2)
          Set/Get the coordinates of the lower, left corner of the frame.
 void setDataSpacing(double[] id0)
          Set/Get the pixel spacing.
 void setDataSpacing(double id0, double id1, double id2)
          Set/Get the pixel spacing.
 void setFrameBufferSize(int id0)
          Set size of the frame buffer, i.e. the number of frames that the 'tape' can store.
 void setFrameCount(int id0)
          This value is incremented each time a frame is grabbed.
 void setFrameRate(double id0)
          Request a particular frame rate (default 30 frames per second).
 void setFrameSize(int[] id0)
          Set the full-frame size.
 void setFrameSize(int id0, int id1, int id2)
          Set the full-frame size.
 void setNumberOfOutputFrames(int id0)
          Set the number of frames to copy to the output on each execute.
 void setOpacity(double id0)
          For RGBA output only (4 scalar components), set the opacity.
 void setOutputFormat(int id0)
          Set the output format.
 void setOutputFormatToLuminance()
          Set the output format.
 void setOutputFormatToRGB()
          Set the output format.
 void setOutputFormatToRGBA()
          Set the output format.
 void setOutputWholeExtent(int[] id0)
          Get/Set the WholeExtent of the output.
 void setOutputWholeExtent(int id0, int id1, int id2, int id3, int id4, int id5)
          Get/Set the WholeExtent of the output.
 void setStartTimeStamp(double id0)
          And internal variable which marks the beginning of a Record session.
 void stop()
          Stop recording or playing.
protected  void VTKCastInit()
           
 void VTKInit()
           
 
Methods inherited from class vtk.vtkImageSource
getOutput, getOutput, getThisImageSource, setOutput
 
Methods inherited from class vtk.vtkSource
computeInputUpdateExtents, getNumberOfOutputs, getOutputIndex, getReleaseDataFlag, getThisSource, inRegisterLoop, propagateUpdateExtent, releaseDataFlagOff, releaseDataFlagOn, setReleaseDataFlag, triggerAsynchronousUpdate, unRegister, unRegisterAllOutputs, update, updateData, updateInformation, updateWholeExtent
 
Methods inherited from class vtk.vtkProcessObject
abortExecuteOff, abortExecuteOn, getAbortExecute, getErrorCode, getNumberOfInputs, getProgress, getProgressMaxValue, getProgressMinValue, getProgressText, getThisProcessObject, removeAllInputs, setAbortExecute, setProgress, setProgressText, squeezeInputArray, updateProgress
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getMTime, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay
 
Methods inherited from class vtk.vtkObjectBase
addPropertyChangeListener, finalize, getReferenceCount, getThisObjectBase, isTypeOf, removePropertyChangeListener, setReferenceCount, VTKDelete
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

protected java.beans.PropertyChangeSupport changes
Constructor Detail

vtkVideoSource

public vtkVideoSource()

vtkVideoSource

protected vtkVideoSource(int dmy)
Method Detail

getThisVideoSource

public vtkVideoSource getThisVideoSource()

getClassName

public java.lang.String getClassName()
Description copied from class: vtkObjectBase
Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
getClassName in class vtkImageSource

isA

public int isA(java.lang.String id0)
Description copied from class: vtkObjectBase
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
isA in class vtkImageSource

record

public void record()
Record incoming video at the specified FrameRate. The recording continues indefinitely until Stop() is called.


play

public void play()
Play through the 'tape' sequentially at the specified frame rate. If you have just finished Recoding, you should call Rewind() first.


stop

public void stop()
Stop recording or playing.


rewind

public void rewind()
Rewind to the frame with the earliest timestamp. Record operations will start on the following frame, therefore if you want to re-record over this frame you must call Seek(-1) before calling Grab() or Record().


fastForward

public void fastForward()
FastForward to the last frame that was recorded (i.e. to the frame that has the most recent timestamp).


seek

public void seek(int id0)
Seek forwards or backwards by the specified number of frames (positive is forward, negative is backward).


grab

public void grab()
Grab a single video frame.


getRecording

public int getRecording()
Are we in record mode? (record mode and play mode are mutually exclusive).


getPlaying

public int getPlaying()
Are we in play mode? (record mode and play mode are mutually exclusive).


setFrameSize

public void setFrameSize(int id0,
                         int id1,
                         int id2)
Set the full-frame size. This must be an allowed size for the device, the device may either refuse a request for an illegal frame size or automatically choose a new frame size. The default is usually 320x240x1, but can be device specific. The 'depth' should always be 1 (unless you have a device that can handle 3D acquisition).


setFrameSize

public void setFrameSize(int[] id0)
Set the full-frame size. This must be an allowed size for the device, the device may either refuse a request for an illegal frame size or automatically choose a new frame size. The default is usually 320x240x1, but can be device specific. The 'depth' should always be 1 (unless you have a device that can handle 3D acquisition).


getFrameSize

public int[] getFrameSize()
Set the full-frame size. This must be an allowed size for the device, the device may either refuse a request for an illegal frame size or automatically choose a new frame size. The default is usually 320x240x1, but can be device specific. The 'depth' should always be 1 (unless you have a device that can handle 3D acquisition).


setFrameRate

public void setFrameRate(double id0)
Request a particular frame rate (default 30 frames per second).


getFrameRate

public double getFrameRate()
Request a particular frame rate (default 30 frames per second).


setOutputFormat

public void setOutputFormat(int id0)
Set the output format. This must be appropriate for device, usually only VTK_LUMINANCE, VTK_RGB, and VTK_RGBA are supported.


setOutputFormatToLuminance

public void setOutputFormatToLuminance()
Set the output format. This must be appropriate for device, usually only VTK_LUMINANCE, VTK_RGB, and VTK_RGBA are supported.


setOutputFormatToRGB

public void setOutputFormatToRGB()
Set the output format. This must be appropriate for device, usually only VTK_LUMINANCE, VTK_RGB, and VTK_RGBA are supported.


setOutputFormatToRGBA

public void setOutputFormatToRGBA()
Set the output format. This must be appropriate for device, usually only VTK_LUMINANCE, VTK_RGB, and VTK_RGBA are supported.


getOutputFormat

public int getOutputFormat()
Set the output format. This must be appropriate for device, usually only VTK_LUMINANCE, VTK_RGB, and VTK_RGBA are supported.


setFrameBufferSize

public void setFrameBufferSize(int id0)
Set size of the frame buffer, i.e. the number of frames that the 'tape' can store.


getFrameBufferSize

public int getFrameBufferSize()
Set size of the frame buffer, i.e. the number of frames that the 'tape' can store.


setNumberOfOutputFrames

public void setNumberOfOutputFrames(int id0)
Set the number of frames to copy to the output on each execute. The frames will be concatenated along the Z dimension, with the most recent frame first. Default: 1


getNumberOfOutputFrames

public int getNumberOfOutputFrames()
Set the number of frames to copy to the output on each execute. The frames will be concatenated along the Z dimension, with the most recent frame first. Default: 1


autoAdvanceOn

public void autoAdvanceOn()
Set whether to automatically advance the buffer before each grab. Default: on


autoAdvanceOff

public void autoAdvanceOff()
Set whether to automatically advance the buffer before each grab. Default: on


setAutoAdvance

public void setAutoAdvance(int id0)
Set whether to automatically advance the buffer before each grab. Default: on


getAutoAdvance

public int getAutoAdvance()
Set whether to automatically advance the buffer before each grab. Default: on


setClipRegion

public void setClipRegion(int[] id0)
Set the clip rectangle for the frames. The video will be clipped before it is copied into the framebuffer. Changing the ClipRegion will destroy the current contents of the framebuffer. The default ClipRegion is (0,VTK_INT_MAX,0,VTK_INT_MAX,0,VTK_INT_MAX).


setClipRegion

public void setClipRegion(int id0,
                          int id1,
                          int id2,
                          int id3,
                          int id4,
                          int id5)
Set the clip rectangle for the frames. The video will be clipped before it is copied into the framebuffer. Changing the ClipRegion will destroy the current contents of the framebuffer. The default ClipRegion is (0,VTK_INT_MAX,0,VTK_INT_MAX,0,VTK_INT_MAX).


getClipRegion

public int[] getClipRegion()
Set the clip rectangle for the frames. The video will be clipped before it is copied into the framebuffer. Changing the ClipRegion will destroy the current contents of the framebuffer. The default ClipRegion is (0,VTK_INT_MAX,0,VTK_INT_MAX,0,VTK_INT_MAX).


setOutputWholeExtent

public void setOutputWholeExtent(int id0,
                                 int id1,
                                 int id2,
                                 int id3,
                                 int id4,
                                 int id5)
Get/Set the WholeExtent of the output. This can be used to either clip or pad the video frame. This clipping/padding is done when the frame is copied to the output, and does not change the contents of the framebuffer. This is useful e.g. for expanding the output size to a power of two for texture mapping. The default is (0,-1,0,-1,0,-1) which causes the entire frame to be copied to the output.


setOutputWholeExtent

public void setOutputWholeExtent(int[] id0)
Get/Set the WholeExtent of the output. This can be used to either clip or pad the video frame. This clipping/padding is done when the frame is copied to the output, and does not change the contents of the framebuffer. This is useful e.g. for expanding the output size to a power of two for texture mapping. The default is (0,-1,0,-1,0,-1) which causes the entire frame to be copied to the output.


getOutputWholeExtent

public int[] getOutputWholeExtent()
Get/Set the WholeExtent of the output. This can be used to either clip or pad the video frame. This clipping/padding is done when the frame is copied to the output, and does not change the contents of the framebuffer. This is useful e.g. for expanding the output size to a power of two for texture mapping. The default is (0,-1,0,-1,0,-1) which causes the entire frame to be copied to the output.


setDataSpacing

public void setDataSpacing(double id0,
                           double id1,
                           double id2)
Set/Get the pixel spacing. Default: (1.0,1.0,1.0)


setDataSpacing

public void setDataSpacing(double[] id0)
Set/Get the pixel spacing. Default: (1.0,1.0,1.0)


getDataSpacing

public double[] getDataSpacing()
Set/Get the pixel spacing. Default: (1.0,1.0,1.0)


setDataOrigin

public void setDataOrigin(double id0,
                          double id1,
                          double id2)
Set/Get the coordinates of the lower, left corner of the frame. Default: (0.0,0.0,0.0)


setDataOrigin

public void setDataOrigin(double[] id0)
Set/Get the coordinates of the lower, left corner of the frame. Default: (0.0,0.0,0.0)


getDataOrigin

public double[] getDataOrigin()
Set/Get the coordinates of the lower, left corner of the frame. Default: (0.0,0.0,0.0)


setOpacity

public void setOpacity(double id0)
For RGBA output only (4 scalar components), set the opacity. This will not modify the existing contents of the framebuffer, only subsequently grabbed frames.


getOpacity

public double getOpacity()
For RGBA output only (4 scalar components), set the opacity. This will not modify the existing contents of the framebuffer, only subsequently grabbed frames.


getFrameCount

public int getFrameCount()
This value is incremented each time a frame is grabbed. reset it to zero (or any other value) at any time.


setFrameCount

public void setFrameCount(int id0)
This value is incremented each time a frame is grabbed. reset it to zero (or any other value) at any time.


getFrameIndex

public int getFrameIndex()
Get the frame index relative to the 'beginning of the tape'. This value wraps back to zero if it increases past the FrameBufferSize.


getFrameTimeStamp

public double getFrameTimeStamp(int id0)
Get a time stamp in seconds (resolution of milliseconds) for a video frame. Time began on Jan 1, 1970. You can specify a number (negative or positive) to specify the position of the video frame relative to the current frame.


getFrameTimeStamp

public double getFrameTimeStamp()
Get a time stamp in seconds (resolution of milliseconds) for the Output. Time began on Jan 1, 1970. This timestamp is only valid after the Output has been Updated.


initialize

public void initialize()
Initialize the hardware. This is called automatically on the first Update or Grab.


getInitialized

public int getInitialized()
Initialize the hardware. This is called automatically on the first Update or Grab.


releaseSystemResources

public void releaseSystemResources()
Release the video driver. This method must be called before application exit, or else the application might hang during exit.


internalGrab

public void internalGrab()
The internal function which actually does the grab. You will definitely want to override this if you develop a vtkVideoSource subclass.


setStartTimeStamp

public void setStartTimeStamp(double id0)
And internal variable which marks the beginning of a Record session. These methods are for internal use only.


getStartTimeStamp

public double getStartTimeStamp()
And internal variable which marks the beginning of a Record session. These methods are for internal use only.


VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkImageSource


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.