
#include <Transport/FrameIstream.H>
Inheritance diagram for FrameIstream:


Concrete classes might implement this interface so that the real source is a series of bitmap files (RasterInputSeries), or a movie file (InputMPEGSeries), or an external device (V4Lgrabber, IEEE1394grabber).
See also FrameOstream for the analogous output interface.
Definition at line 70 of file FrameIstream.H.
Public Member Functions | |
| FrameIstream (OptionManager &mgr, const std::string &descrName, const std::string &tagName) | |
| Constructor. | |
| virtual | ~FrameIstream () |
| Virtual destructor. | |
| virtual void | setConfigInfo (const std::string &cfg) |
| Configure the FrameIstream object in a type-dependent manner. | |
| virtual void | setListener (rutz::shared_ptr< FrameListener > listener) |
| Install a FrameListener; default implementation does nothing. | |
| virtual bool | setFrameNumber (int n) |
| Advise the FrameIstream object of the current frame number. | |
| virtual GenericFrameSpec | peekFrameSpec ()=0 |
| Return the specifications of the next frame. | |
| virtual SimTime | getNaturalFrameTime () const |
| Get the natural inter-frame time for this frame source. | |
| Dims | peekDims () |
| Convenience function to get the frame dims from peekFrameSpec(). | |
| int | getWidth () |
| Convenience function to get the frame width from peekFrameSpec(). | |
| int | getHeight () |
| Convenience function to get the frame height from peekFrameSpec(). | |
| virtual void | startStream () |
| Optional call to efficiently prepare for frame streaming. | |
| virtual GenericFrame | readFrame ()=0 |
| Read a frame from the input source. | |
| virtual Image< PixRGB< byte > > | readRGB () |
| Read an image from the input source. | |
| virtual Image< PixRGB< uint16 > > | readRGBU16 () |
| virtual Image< byte > | readGray () |
| Read an image from the input source. | |
| virtual Image< uint16 > | readGrayU16 () |
| virtual Image< float > | readFloat () |
| Read an image from the input source. | |
| virtual bool | readAndDiscardFrame () |
| Read a frame from the stream and discard it. | |
|
||||||||||||||||
|
Constructor.
Definition at line 51 of file FrameIstream.C. |
|
|
Virtual destructor.
Definition at line 58 of file FrameIstream.C. |
|
|
Convenience function to get the frame height from peekFrameSpec().
Definition at line 96 of file FrameIstream.C. References GenericFrameSpec::dims, Dims::h(), and peekFrameSpec(). |
|
|
Get the natural inter-frame time for this frame source. A return value of 0 means that there is no particular natural inter-frame time; the default implementation returns 0 so subclasses should override if they need to specify a different inter-frame time. This information should be treated as advisory only; for instance, callers might use this information to try to display frames to the user at the "natural" framerate. Reimplemented in DC1394Grabber2, IEEE1394grabber, V4Lgrabber, XCgrabber, BobDeinterlacer, and BufferedFrameIstream. Definition at line 81 of file FrameIstream.C. References SimTime::ZERO(). Referenced by BobDeinterlacer::start2(). |
|
|
Convenience function to get the frame width from peekFrameSpec().
Definition at line 91 of file FrameIstream.C. References GenericFrameSpec::dims, peekFrameSpec(), and Dims::w(). |
|
|
Convenience function to get the frame dims from peekFrameSpec().
Definition at line 86 of file FrameIstream.C. References GenericFrameSpec::dims, and peekFrameSpec(). |
|
|
Return the specifications of the next frame. Subclasses may have to load the next frame in order to peek at the dimensions, then cache that frame and return it the next time readRGB(), readGray(), or readFloat() is called. Implemented in DC1394Grabber2, IEEE1394grabber, QuickTimeGrabber, V4Lgrabber, XCgrabber, InputFrameSeries, MgzInputStream, InputMPEGStream, MrawvInputStream, BobDeinterlacer, BufferedFrameIstream, ColorbarsInput, GameOfLifeInput, HalfFieldDeinterlacer< BottomField >, RandomInput, RasterInputSeries, RasterlistInputSeries, World2DInput, and XMLInput. Referenced by getHeight(), getWidth(), peekDims(), HalfFieldDeinterlacer< BottomField >::peekFrameSpec(), BobDeinterlacer::peekFrameSpec(), and BobDeinterlacer::start2(). |
|
|
Read a frame from the stream and discard it. Subclasses may be able to implement this function more efficiently than the other functions that actually return an Image object (since they might avoid converting from some raw representation to Image). So, if you know you are going to discard the frame (e.g. to skip ahead to a certain frame number, or to count the frame), then it is more efficient to call readAndDiscardFrame() than to call readVideoFrame() or readRGB() but ignore the result. The return value will be true if a frame was actually read, or false if no frame was found (e.g., end-of-stream was reached). The default implementation just calls readRGB() but ignores the result. Reimplemented in InputMPEGStream. Definition at line 132 of file FrameIstream.C. References GenericFrame::initialized(), and readFrame(). |
|
|
Read an image from the input source. The actual input source could be a raster file, a movie file, or some external device, etc., depending on the concrete subclass. The default implementation just returns readFrame().asFloat(). Definition at line 127 of file FrameIstream.C. References GenericFrame::asFloat(), and readFrame(). |
|
|
Read a frame from the input source. The actual input source could be a raster file, a movie file, or some external device, etc., depending on the concrete subclass. Implemented in DC1394Grabber2, IEEE1394grabber, QuickTimeGrabber, V4Lgrabber, XCgrabber, InputFrameSeries, MgzInputStream, InputMPEGStream, MrawvInputStream, BobDeinterlacer, BufferedFrameIstream, ColorbarsInput, GameOfLifeInput, HalfFieldDeinterlacer< BottomField >, RandomInput, RasterInputSeries, RasterlistInputSeries, World2DInput, and XMLInput. Referenced by readAndDiscardFrame(), readFloat(), HalfFieldDeinterlacer< BottomField >::readFrame(), BobDeinterlacer::readFrame(), readGray(), readGrayU16(), readRGB(), and readRGBU16(). |
|
|
Read an image from the input source. The actual input source could be a raster file, a movie file, or some external device, etc., depending on the concrete subclass. The default implementation just returns readFrame().asGray(). Definition at line 117 of file FrameIstream.C. References GenericFrame::asGray(), and readFrame(). |
|
|
the specific 12 bit depth (actually any uint16 data type) implemtation return from readFrame().asRgb16(). Definition at line 122 of file FrameIstream.C. References GenericFrame::asGrayU16(), and readFrame(). |
|
|
Read an image from the input source. The actual input source could be a raster file, a movie file, or some external device, etc., depending on the concrete subclass. The default implementation just returns readFrame().asRgb(). Reimplemented in InputMPEGStream. Definition at line 107 of file FrameIstream.C. References GenericFrame::asRgb(), and readFrame(). |
|
|
the specific 12 bit depth (actually any uint16 data type) implemtation return from readFrame().asRgb16(). Definition at line 112 of file FrameIstream.C. References GenericFrame::asRgbU16(), and readFrame(). |
|
|
Configure the FrameIstream object in a type-dependent manner. The string is expected to be some piece of user input (e.g. from the command-line) specifying key information for the FrameIstream (e.g., the filename for an input movie). The default implementation does nothing; derived classes can override if they need to receive such user input. Reimplemented in MgzInputStream, InputMPEGStream, MrawvInputStream, BufferedFrameIstream, ColorbarsInput, Deinterlacer, GameOfLifeInput, RandomInput, RasterInputSeries, RasterlistInputSeries, World2DInput, and XMLInput. Definition at line 61 of file FrameIstream.C. |
|
|
Advise the FrameIstream object of the current frame number. NOTE: the default implementation does nothing -- it just ignores the frame number. This is allowed for subclasses, too, since for certain input formats (e.g., framegrabbers) it doesn't make any sense to specify a frame number, since the format doesn't support random-access reading. On the other hand, certain subclasses require a frame number to function properly (e.g., for writing a series of consecutively-numbered raster files). So, the bottom line is: clients of FrameIstream must be sure to call setFrameNumber(), but should make no assumptions about what it will actually do.
Reimplemented in InputMPEGStream, BobDeinterlacer, BufferedFrameIstream, ColorbarsInput, HalfFieldDeinterlacer< BottomField >, RasterInputSeries, RasterlistInputSeries, and XMLInput. Definition at line 73 of file FrameIstream.C. Referenced by HalfFieldDeinterlacer< BottomField >::setFrameNumber(), and BobDeinterlacer::setFrameNumber(). |
|
|
Install a FrameListener; default implementation does nothing. Subclasses may override this method if they want to actually pass some information to the listener. Reimplemented in V4Lgrabber, and BobDeinterlacer. Definition at line 67 of file FrameIstream.C. Referenced by BobDeinterlacer::setListener(). |
|
|
Optional call to efficiently prepare for frame streaming. Some FrameIstream subclasses may require some preparatory work before they can start returning image frames, and this function lets that work be done outside of the application's main frame-reading loop. A good example of this is streaming-mode frame-grabbers, such as the video4linux driver. To use that driver in streaming mode, each of the internal frame buffers must be started, but they shouldn't be started "too soon" either; so, it's best to call startStream() just before the main loops starts calling readFrame() (or readRGB(), etc.). Subclass authors should design their classes so that readFrame() always "just works", regardless of whether the user has called startStream() or not, typically by keeping a flag to mark whether startStream() has been called, and then calling startStream() from within the first readFrame() call, if needed. The default implementation of startStream() is a no-op. Reimplemented in QuickTimeGrabber, V4Lgrabber, InputFrameSeries, BobDeinterlacer, BufferedFrameIstream, and HalfFieldDeinterlacer< BottomField >. Definition at line 101 of file FrameIstream.C. Referenced by HalfFieldDeinterlacer< BottomField >::startStream(), and BobDeinterlacer::startStream(). |
1.4.4