OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
ev::Player_< Reader > Class Template Reference

This class plays a reader, or anything offering events() and reset() as readers do. More...

#include <player.hpp>

Inheritance diagram for ev::Player_< Reader >:
SteppedPlayer< Reader > SteppedPlayer< Reader >

Public Member Functions

 Player_ (Reader &reader)
 Construct the player. The playback starts with the first call to next().
void setSpeed (const double speed)
 Set the playback speed.
double speed () const
 Get the playback speed.
void pause (const bool paused)
 Hold the playhead, so next() delivers nothing.
bool isPaused () const
 Check if the playback is paused.
void setLoop (const bool loop)
 Choose what happens when the reader runs out of events.
void restart ()
 Start again from the beginning.
std::size_t loops () const
 Number of times the playback has started again, either by restart() or by reaching the end.
TimeType playhead () const
 Current position of the playback, which starts at the timestamp of the first event.
bool isFinished () const
 Check if the reader ran out of events with setLoop(false).
void next (Queue &events)
 Deliver what happened since the previous call.
void next (Queue &events, StampedMatQueue &frames)
void next (Queue &events, StampedMatQueue &frames, ImuQueue &imus)

Detailed Description

template<typename Reader>
class ev::Player_< Reader >

This class plays a reader, or anything offering events() and reset() as readers do.

Note
Timestamps are expected in microseconds.
Examples
example-event-camera-dataset.cpp.

Constructor & Destructor Documentation

◆ Player_()

template<typename Reader>
ev::Player_< Reader >::Player_ ( Reader & reader)
inlineexplicit

Construct the player. The playback starts with the first call to next().

Parameters
readerReader to play

Member Function Documentation

◆ isFinished()

template<typename Reader>
bool ev::Player_< Reader >::isFinished ( ) const
inlinenodiscard

Check if the reader ran out of events with setLoop(false).

Returns
True if there is nothing else to deliver

◆ isPaused()

template<typename Reader>
bool ev::Player_< Reader >::isPaused ( ) const
inlinenodiscard

Check if the playback is paused.

Returns
True if paused

◆ loops()

template<typename Reader>
std::size_t ev::Player_< Reader >::loops ( ) const
inlinenodiscard

Number of times the playback has started again, either by restart() or by reaching the end.

Returns
Count

◆ next() [1/3]

template<typename Reader>
void ev::Player_< Reader >::next ( Queue & events)
inline

Deliver what happened since the previous call.

Parameters
eventsEvents are pushed here
Examples
example-event-camera-dataset.cpp.

◆ next() [2/3]

template<typename Reader>
void ev::Player_< Reader >::next ( Queue & events,
StampedMatQueue & frames )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
framesFrames are pushed here

◆ next() [3/3]

template<typename Reader>
void ev::Player_< Reader >::next ( Queue & events,
StampedMatQueue & frames,
ImuQueue & imus )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
imusInertial measurements are pushed here

◆ pause()

template<typename Reader>
void ev::Player_< Reader >::pause ( const bool paused)
inline

Hold the playhead, so next() delivers nothing.

Parameters
pausedTrue to pause, false to resume

◆ playhead()

template<typename Reader>
TimeType ev::Player_< Reader >::playhead ( ) const
inlinenodiscard

Current position of the playback, which starts at the timestamp of the first event.

Returns
Playhead in microseconds
Examples
example-event-camera-dataset.cpp.

◆ setLoop()

template<typename Reader>
void ev::Player_< Reader >::setLoop ( const bool loop)
inline

Choose what happens when the reader runs out of events.

Parameters
loopTrue to start again, false to stop

◆ setSpeed()

template<typename Reader>
void ev::Player_< Reader >::setSpeed ( const double speed)
inline

Set the playback speed.

Parameters
speedSpeed relative to real time
Examples
example-event-camera-dataset.cpp.

◆ speed()

template<typename Reader>
double ev::Player_< Reader >::speed ( ) const
inlinenodiscard

Get the playback speed.

Returns
Speed relative to real time

The documentation for this class was generated from the following file:
  • modules/readers/include/openev/readers/player.hpp