QtDisplayStream Class Reference

FrameOstream subclass that displays images in a QWidgetStack. More...

#include <GUI/QtDisplayStream.H>

Inheritance diagram for QtDisplayStream:
Inheritance graph
[legend]
Collaboration diagram for QtDisplayStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QtDisplayStream (OptionManager &mgr, const std::string &descrName="QtDisplayStream", const std::string &tagName="QtDisplayStream")
virtual void paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status)
 Override the base version so that we can trap --qt-echo options.
virtual bool setFrameNumber (int n)
 Advise the FrameOstream object of the current frame number.
virtual void writeFrame (const GenericFrame &frame, const std::string &shortname, const FrameInfo &auxinfo)
 Write a frame to the output destination.
virtual bool isVoid () const
 Returns true if the user has clicked the close button.
virtual void closeStream (const std::string &shortname)
 Close off the underlying destination corresponding to shortname.
bool isClosed () const
 Returns true if the user has clicked the close button.
 QtDisplayStream (OptionManager &mgr, const std::string &descrName="QtDisplayStream", const std::string &tagName="QtDisplayStream")
virtual void paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status)
 Override the base version so that we can trap --qt-echo options.
virtual bool setFrameNumber (int n)
 Advise the FrameOstream object of the current frame number.
virtual void writeFrame (const GenericFrame &frame, const std::string &shortname, const FrameInfo &auxinfo)
 Write a frame to the output destination.
virtual bool isVoid () const
 Returns true if the user has clicked the close button.
virtual void closeStream (const std::string &shortname)
 Close off the underlying destination corresponding to shortname.
bool isClosed () const
 Returns true if the user has clicked the close button.
void * run ()
 Run our QApplication in a thread.

Protected Member Functions

virtual void start1 ()
 This is called from within start() before the subcomponents start.

Friends

class EventFilt
 get started

Detailed Description

FrameOstream subclass that displays images in a QWidgetStack.

FrameOstream subclass that displays images in a QImageStack.

Definition at line 50 of file QtDisplayStream.H.


Member Function Documentation

virtual void QtDisplayStream::closeStream ( const std::string shortname  )  [virtual]

Close off the underlying destination corresponding to shortname.

The semantics of this operation are subclass-dependent, but the intention is for subclasses to follow these guidelines when implementing closeStream():

  • if the FrameOstream subclass deals with files, then the file corresponding to shortname should be closed, or if the FrameOstream deals with onscreen windows, then the corresponding window should be closed
  • calling closeStream() for a particular shortname should not prevent a stream later being reopened for that shortname if writeFrame() is later called again with that shortname.
  • calling closeStream() with a shortname for which there is no associated destination, or for a shortname which has already been closed, should not be an error but should just be silently ignored

Implements FrameOstream.

void QtDisplayStream::closeStream ( const std::string shortname  )  [virtual]

Close off the underlying destination corresponding to shortname.

The semantics of this operation are subclass-dependent, but the intention is for subclasses to follow these guidelines when implementing closeStream():

  • if the FrameOstream subclass deals with files, then the file corresponding to shortname should be closed, or if the FrameOstream deals with onscreen windows, then the corresponding window should be closed
  • calling closeStream() for a particular shortname should not prevent a stream later being reopened for that shortname if writeFrame() is later called again with that shortname.
  • calling closeStream() with a shortname for which there is no associated destination, or for a shortname which has already been closed, should not be an error but should just be silently ignored

Implements FrameOstream.

Definition at line 256 of file QtDisplayStream.C.

bool QtDisplayStream::isClosed (  )  const

Returns true if the user has clicked the close button.

bool QtDisplayStream::isClosed (  )  const

Returns true if the user has clicked the close button.

Definition at line 263 of file QtDisplayStream.C.

virtual bool QtDisplayStream::isVoid (  )  const [virtual]

Returns true if the user has clicked the close button.

Reimplemented from FrameOstream.

bool QtDisplayStream::isVoid (  )  const [virtual]

Returns true if the user has clicked the close button.

Reimplemented from FrameOstream.

Definition at line 250 of file QtDisplayStream.C.

virtual void QtDisplayStream::paramChanged ( ModelParamBase *const   param,
const bool  valueChanged,
ParamClient::ChangeStatus status 
) [virtual]

Override the base version so that we can trap --qt-echo options.

Reimplemented from ModelComponent.

void QtDisplayStream::paramChanged ( ModelParamBase *const   param,
const bool  valueChanged,
ParamClient::ChangeStatus status 
) [virtual]

Override the base version so that we can trap --qt-echo options.

Reimplemented from ModelComponent.

Definition at line 185 of file QtDisplayStream.C.

References ModelComponent::addSubComponent(), ModelComponent::getManager(), OModelParam< T >::getVal(), makeFrameOstream(), MC_RECURSE, and ModelComponent::removeSubComponent().

void * QtDisplayStream::run (  ) 

Run our QApplication in a thread.

Definition at line 184 of file QtDisplayStream4.C.

References argv2qt(), EventFilt, and OModelParam< T >::getVal().

virtual bool QtDisplayStream::setFrameNumber ( int  n  )  [virtual]

Advise the FrameOstream 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 output formats (e.g., onscreen windows) it doesn't make any sense to specify a frame number. 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 FrameOstream must be sure to call setFrameNumber(), but should make no assumptions about what it will actually do.

Returns:
Whether the frame number was successfully set as requested.

Reimplemented from FrameOstream.

bool QtDisplayStream::setFrameNumber ( int  n  )  [virtual]

Advise the FrameOstream 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 output formats (e.g., onscreen windows) it doesn't make any sense to specify a frame number. 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 FrameOstream must be sure to call setFrameNumber(), but should make no assumptions about what it will actually do.

Returns:
Whether the frame number was successfully set as requested.

Reimplemented from FrameOstream.

Definition at line 219 of file QtDisplayStream.C.

References convertToImage().

void QtDisplayStream::start1 (  )  [protected, virtual]

This is called from within start() before the subcomponents start.

Reimplemented from ModelComponent.

Definition at line 169 of file QtDisplayStream4.C.

virtual void QtDisplayStream::writeFrame ( const GenericFrame frame,
const std::string shortname,
const FrameInfo auxinfo 
) [virtual]

Write a frame to the output destination.

Destination could be a raster file, frame in an mpeg-encoded movie, an on-screen window, etc., depending on the concrete subclass.

Parameters:
image the image to be written, displayed, etc.
shortname a brief string (with no spaces) describing the image; it is expected that this shortname should be usable as part of a filename if the particular FrameOstream subclass involves writing files to disk
auxinfo extra optional information describing the image; FrameOstream subclasses make use of this information in a subclass-dependent manner, e.g. they could display this information in an onscreen window, or embed it into a comments in an image or movie file, etc.

Implements FrameOstream.

void QtDisplayStream::writeFrame ( const GenericFrame frame,
const std::string shortname,
const FrameInfo auxinfo 
) [virtual]

Write a frame to the output destination.

Destination could be a raster file, frame in an mpeg-encoded movie, an on-screen window, etc., depending on the concrete subclass.

Parameters:
image the image to be written, displayed, etc.
shortname a brief string (with no spaces) describing the image; it is expected that this shortname should be usable as part of a filename if the particular FrameOstream subclass involves writing files to disk
auxinfo extra optional information describing the image; FrameOstream subclasses make use of this information in a subclass-dependent manner, e.g. they could display this information in an onscreen window, or embed it into a comments in an image or movie file, etc.

Implements FrameOstream.

Definition at line 239 of file QtDisplayStream.C.

References OModelParam< T >::getVal().


Friends And Related Function Documentation

friend class EventFilt [friend]

get started

Definition at line 85 of file QtDisplayStream4.H.

Referenced by run().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:24:04 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3