#include <imagelist.h>
Public Member Functions | |
sensor_msgs::ImagePtr | add (const sensor_msgs::ImagePtr &image) |
Adds the given image to the internal list. More... | |
sensor_msgs::ImagePtr | find (const ros::Time ×tamp) const |
Returns the oldest image that has a timestamp within the tolerance of the given timestamp. More... | |
ImageList () | |
Create an image list. More... | |
int | removeOld (const ros::Time ×tamp) |
Remove all images that have a timestamp that is older or equal than the given timestamp. More... | |
void | setSize (size_t maxsize) |
Set maximum size of the list. More... | |
void | setTolerance (uint64_t tolerance) |
Set tolerance for finding corresponding timestamps. More... | |
Private Attributes | |
std::vector< sensor_msgs::ImagePtr > | list_ |
size_t | maxsize_ |
uint64_t | tolerance_ |
Definition at line 44 of file imagelist.h.
rcgccam::ImageList::ImageList | ( | ) |
Create an image list.
Definition at line 42 of file imagelist.cc.
sensor_msgs::ImagePtr rcgccam::ImageList::add | ( | const sensor_msgs::ImagePtr & | image | ) |
Adds the given image to the internal list.
If the maximum number of elements is exceeded, then the oldest image will be dropped.
image | Image to be added. |
Definition at line 57 of file imagelist.cc.
sensor_msgs::ImagePtr rcgccam::ImageList::find | ( | const ros::Time & | timestamp | ) | const |
Returns the oldest image that has a timestamp within the tolerance of the given timestamp.
If the image cannot be found, then a nullptr is returned.
timestamp | Timestamp. |
tolerance | Maximum tolarance added or subtracted to the timestamp. |
Definition at line 93 of file imagelist.cc.
int rcgccam::ImageList::removeOld | ( | const ros::Time & | timestamp | ) |
Remove all images that have a timestamp that is older or equal than the given timestamp.
timestamp | Timestamp. |
Definition at line 72 of file imagelist.cc.
void rcgccam::ImageList::setSize | ( | size_t | maxsize | ) |
Set maximum size of the list.
maxsize | Maximum number of elements that the list can hold. The default is 25. |
Definition at line 47 of file imagelist.cc.
void rcgccam::ImageList::setTolerance | ( | uint64_t | tolerance | ) |
Set tolerance for finding corresponding timestamps.
tolerance | Tolerance in nano seconds. Default is 0. |
Definition at line 52 of file imagelist.cc.
|
private |
Definition at line 99 of file imagelist.h.
|
private |
Definition at line 97 of file imagelist.h.
|
private |
Definition at line 98 of file imagelist.h.