#include <imagelist.h>
Public Member Functions | |
void | add (const std::shared_ptr< const Image > &image) |
void | add (const Buffer *buffer) |
std::shared_ptr< const Image > | find (uint64_t timestamp) |
ImageList (size_t maxsize=25) | |
void | removeOld (uint64_t timestamp) |
Private Attributes | |
std::vector< std::shared_ptr < const Image > > | list |
size_t | maxsize |
An object of this class manages a limited number of images. It is intended as a helper class for time synchronization of different images that can be associated by timestamp.
Definition at line 53 of file imagelist.h.
rcg::ImageList::ImageList | ( | size_t | maxsize = 25 | ) |
Create an image list.
maxsize | Maximum number of elements that the list can hold. The default is 25, which is 1s at 25 Hz. |
Definition at line 41 of file imagelist.cc.
void rcg::ImageList::add | ( | const std::shared_ptr< const Image > & | image | ) |
Adds the given image to the internal list. If the maximum number of elements is exceeded, then the oldes image will be dropped.
image | Image to be added. |
Definition at line 46 of file imagelist.cc.
void rcg::ImageList::add | ( | const Buffer * | buffer | ) |
Creates an image from the given buffer and adds it to the internal list. If the maximum number of elements is exceeded, then the oldes image will be dropped.
buffer | Buffer from which an image will be created. |
Definition at line 56 of file imagelist.cc.
std::shared_ptr< const Image > rcg::ImageList::find | ( | uint64_t | timestamp | ) |
Returns the image that has the given timestamp. If the image cannot be found, then a nullptr is returned.
timestamp | Timestamp. |
Definition at line 83 of file imagelist.cc.
void rcg::ImageList::removeOld | ( | uint64_t | timestamp | ) |
Removes all images that have a timestamp that is older or equal than the given timestamp.
timestamp | Timestamp. |
Definition at line 66 of file imagelist.cc.
std::vector<std::shared_ptr<const Image> > rcg::ImageList::list [private] |
Definition at line 107 of file imagelist.h.
size_t rcg::ImageList::maxsize [private] |
Definition at line 106 of file imagelist.h.