
#include <Media/FrameSeries.H>
Inheritance diagram for OutputFrameSeries:


OutputFrameSeries implements a number of helper functions to facilitate writing frames in a standardized manner, with possible on-the-fly rescaling and visualization.
SEE ADDITIONAL DOCUMENTATION in InputFrameSeries.
Definition at line 305 of file FrameSeries.H.
Public Member Functions | |
| OutputFrameSeries (OptionManager &mgr, const std::string &descrName="Frame Series", const std::string &tagName="FrameSeries") | |
| Constructor. | |
| virtual | ~OutputFrameSeries () |
| Destructor. | |
| virtual void | reset1 () |
| resets this FrameSeries to its state after construction | |
| virtual void | paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status) |
| Override the base version so that we can trap --out options. | |
| FrameState | update (const SimTime &stime, bool new_event) |
| Update internal state and return corresponding FrameState. | |
| FrameState | updateNext () |
| Update by moving to the next frame and not worrying about time counts. | |
| bool | shouldWait () const |
| Have we displayed frames and need to wait for a user keypress? | |
| virtual void | writeFrame (const GenericFrame &frame, const std::string &shortname, const FrameInfo &auxinfo=FrameOstream::defaultInfo) |
| Write a frame to all frame destinations. | |
| virtual bool | isVoid () const |
| Check if we have no output destinations (e.g., user gave --out=none). | |
| bool | becameVoid () const |
| Check if we have become void after starting out non-void. | |
| virtual void | closeStream (const std::string &shortname) |
| Call closeStream(shortname) on all of our substreams. | |
| void | addFrameDest (const std::string &source) |
| Add a frame destination; same as doing --out=source on the command line. | |
| int | frame () const |
| Get the current frame number. | |
| size_t | getNumFrameDests () const |
| Get the number of frame destinations that we have. | |
| nub::ref< FrameOstream > | getFrameDest (size_t n) const |
| Get a reference to the n-th frame destination. | |
| template<class T> | |
| nub::soft_ref< T > | findFrameDestType () const |
| Try to return a frame destination matching type T, if any. | |
Classes | |
| struct | Impl |
|
||||||||||||||||
|
Constructor.
Definition at line 931 of file FrameSeries.C. References init_manager, istream_init(), istream_init_once, ostream_init(), and ostream_init_once. |
|
|
Destructor.
Definition at line 955 of file FrameSeries.C. |
|
|
Add a frame destination; same as doing --out=source on the command line.
Definition at line 1088 of file FrameSeries.C. References ModelComponent::addSubComponent(), OutputFrameSeries::Impl::explicitNone, ModelComponent::getManager(), makeFrameOstream(), MC_RECURSE, ModelComponent::removeSubComponent(), and OutputFrameSeries::Impl::vec. Referenced by paramChanged(). |
|
|
Check if we have become void after starting out non-void. This is useful to test in main loops to know whether some substream has gotten closed (e.g. the user pressing the close button on an open window). Definition at line 1075 of file FrameSeries.C. References isVoid(), and OutputFrameSeries::Impl::wasNonvoidAtStart. |
|
|
Call closeStream(shortname) on all of our substreams.
Implements FrameOstream. Definition at line 1081 of file FrameSeries.C. References i, and OutputFrameSeries::Impl::vec. Referenced by Nv2UiJob::run(). |
|
|||||||||
|
Try to return a frame destination matching type T, if any.
Definition at line 379 of file FrameSeries.H. References getFrameDest(), getNumFrameDests(), i, and nub::soft_ref< T >::is_valid(). Referenced by Nv2UiJob::run(). |
|
|
Get the current frame number.
Definition at line 1148 of file FrameSeries.C. References OutputFrameSeries::Impl::counter, FrameCounter::currentFrame(), and OModelParam< T >::getVal(). |
|
|
Get a reference to the n-th frame destination.
Definition at line 1124 of file FrameSeries.C. References ASSERT, and OutputFrameSeries::Impl::vec. Referenced by findFrameDestType(). |
|
|
Get the number of frame destinations that we have.
Definition at line 1118 of file FrameSeries.C. References OutputFrameSeries::Impl::vec. Referenced by findFrameDestType(). |
|
|
Check if we have no output destinations (e.g., user gave --out=none). Clients can test isVoid() before they generate potentially expensive output images. This is just a performance optimization -- even if isVoid() is true, it's still safe to call writeRGB(), writeGray(), etc., but those calls will do nothing, and so any time spent computing the image will have been wasted. Reimplemented from FrameOstream. Definition at line 1063 of file FrameSeries.C. References i, and OutputFrameSeries::Impl::vec. Referenced by becameVoid(), Context::testFrame(), and Context::trainingFrame(). |
|
||||||||||||||||
|
Override the base version so that we can trap --out options.
Reimplemented from ModelComponent. Definition at line 975 of file FrameSeries.C. References addFrameDest(), OutputFrameSeries::Impl::counter, OModelParam< T >::getVal(), ModelComponent::paramChanged(), and FrameCounter::reset(). |
|
|
resets this FrameSeries to its state after construction
Reimplemented from ModelComponent. Definition at line 961 of file FrameSeries.C. References OutputFrameSeries::Impl::counter, OutputFrameSeries::Impl::explicitNone, OModelParam< T >::getVal(), FrameCounter::reset(), ModelComponent::reset1(), and OutputFrameSeries::Impl::vec. |
|
|
Have we displayed frames and need to wait for a user keypress? This is reset to false on each call to update(), and becomes true if (1) any frames were written AND (2) itsWaitForUser is true (which the use can control with --wait/--nowait). You can check it in order to decide whether you should pause and wait for the user after each series of displays at a given time step). Definition at line 1026 of file FrameSeries.C. References OModelParam< T >::getVal(). Referenced by Outputframeseries_Init(). |
|
||||||||||||
|
Update internal state and return corresponding FrameState.
Definition at line 996 of file FrameSeries.C. References OutputFrameSeries::Impl::counter, FrameCounter::currentFrame(), OModelParam< T >::getVal(), LDEBUG, SimTime::msecs(), sformat(), ModelComponent::tagName(), textLog(), and FrameCounter::update(). Referenced by Outputframeseries_Init(). |
|
|
Update by moving to the next frame and not worrying about time counts.
Definition at line 1020 of file FrameSeries.C. References OutputFrameSeries::Impl::counter, and FrameCounter::updateNext(). Referenced by Outputframeseries_Init(), and Nv2UiJob::run(). |
|
||||||||||||||||
|
Write a frame to all frame destinations.
Implements FrameOstream. Definition at line 1034 of file FrameSeries.C. References ASSERT, OutputFrameSeries::Impl::counter, FrameCounter::currentFrame(), doResizeFrame(), OutputFrameSeries::Impl::explicitNone, OModelParam< T >::getVal(), i, and OutputFrameSeries::Impl::vec. |
1.4.4