Ocean
|
This class implements a simple buffer holding several frames combined with their timestamps and optional camera calibrations. More...
Public Member Functions | |
FrameCollection ()=default | |
Creates an empty frame collection able to hold one frame. More... | |
FrameCollection (FrameCollection &&frameCollection)=default | |
Move constructor. More... | |
FrameCollection (const FrameCollection &frameCollection)=default | |
Copy constructor. More... | |
FrameCollection (const size_t capacity) | |
Creates a new frame collection. More... | |
~FrameCollection () | |
Destructs a frame collection. More... | |
size_t | capacity () const |
Returns the capacity of this frame collection object. More... | |
FrameRef | recent (SharedAnyCamera *anyCamera=nullptr) const |
Returns the most recent frame. More... | |
FrameRef | get (const Timestamp timestamp, SharedAnyCamera *anyCamera=nullptr) const |
Returns the frame with a specific timestamp. More... | |
bool | has (const Timestamp timestamp) const |
Returns whether a frame with specific timestamp is currently stored inside the frame collection. More... | |
FrameRef | set (const Frame &frame, SharedAnyCamera anyCamera=nullptr) |
Sets a new frame and overwrites the oldest frame. More... | |
FrameRef | set (Frame &&frame, SharedAnyCamera anyCamera=nullptr) |
Sets a new frame and overwrites the oldest frame. More... | |
bool | setCapacity (const size_t capacity) |
Sets or changes the capacity of this frame collection. More... | |
bool | isNull () const |
Returns whether the frame collection is empty. More... | |
void | clear () |
Removes all frames from this frame collection. More... | |
operator bool () const | |
Returns whether the frame collection is not empty. More... | |
FrameCollection & | operator= (FrameCollection &&frameCollection)=default |
Default move operator. More... | |
FrameCollection & | operator= (const FrameCollection &frameCollection)=default |
Default assign operator. More... | |
Protected Types | |
using | FrameCameraPair = std::pair< FrameRef, SharedAnyCamera > |
Definition of a pair combining a frame with a camera profile. More... | |
using | RingMap = RingMapT< Timestamp, FrameCameraPair, true, true > |
Definition of a ring map mapping timestamps to frame pairs. More... | |
Protected Attributes | |
RingMap | ringMap_ = RingMap(1) |
The ring map mapping timestamps to frame/camera pairs. More... | |
This class implements a simple buffer holding several frames combined with their timestamps and optional camera calibrations.
|
protected |
Definition of a pair combining a frame with a camera profile.
|
protected |
Definition of a ring map mapping timestamps to frame pairs.
|
default |
Creates an empty frame collection able to hold one frame.
|
default |
Move constructor.
frameCollection | Frame collection to move |
|
default |
Copy constructor.
frameCollection | Frame collection to copy |
|
explicit |
Creates a new frame collection.
capacity | Number of maximal frames this object can store [1, infinity) |
Ocean::Media::FrameCollection::~FrameCollection | ( | ) |
Destructs a frame collection.
|
inline |
Returns the capacity of this frame collection object.
void Ocean::Media::FrameCollection::clear | ( | ) |
Removes all frames from this frame collection.
The capacity will be kept.
FrameRef Ocean::Media::FrameCollection::get | ( | const Timestamp | timestamp, |
SharedAnyCamera * | anyCamera = nullptr |
||
) | const |
Returns the frame with a specific timestamp.
If no frame with the given timestamp exists, the most recent frame will be returned.
timestamp | The timestamp of the frame to return |
anyCamera | Optional resulting camera if known; nullptr if not of interest |
bool Ocean::Media::FrameCollection::has | ( | const Timestamp | timestamp | ) | const |
Returns whether a frame with specific timestamp is currently stored inside the frame collection.
timestamp | The timestamp to be checked |
|
inline |
Returns whether the frame collection is empty.
|
inlineexplicit |
Returns whether the frame collection is not empty.
|
default |
Default assign operator.
frameCollection | Frame collection to assign |
|
default |
Default move operator.
frameCollection | Frame collection to move |
FrameRef Ocean::Media::FrameCollection::recent | ( | SharedAnyCamera * | anyCamera = nullptr | ) | const |
Returns the most recent frame.
anyCamera | Optional resulting camera if known; nullptr if not of interest |
FrameRef Ocean::Media::FrameCollection::set | ( | const Frame & | frame, |
SharedAnyCamera | anyCamera = nullptr |
||
) |
Sets a new frame and overwrites the oldest frame.
frame | The frame to set, a copy will be created |
anyCamera | Optional camera profile associated with the given frame, nullptr if unknown |
FrameRef Ocean::Media::FrameCollection::set | ( | Frame && | frame, |
SharedAnyCamera | anyCamera = nullptr |
||
) |
Sets a new frame and overwrites the oldest frame.
frame | The frame to set |
anyCamera | Optional camera profile associated with the given frame, nullptr if unknown |
bool Ocean::Media::FrameCollection::setCapacity | ( | const size_t | capacity | ) |
Sets or changes the capacity of this frame collection.
In case the capacity is reduced, the oldest frames will be removed
capacity | The capacity to set, with range [1, infinity) |
The ring map mapping timestamps to frame/camera pairs.