45 maxsize=std::max(static_cast<size_t>(1), _maxsize);
50 list.push_back(image);
60 list.push_back(std::shared_ptr<const Image>(
new Image(buffer, part)));
72 while (i <
list.size())
74 if (
list[i]->getTimestampNS() <= timestamp)
76 list.erase(
list.begin()+
static_cast<int>(i));
91 ret=
list[0]->getTimestampNS();
99 for (
size_t i=0; i<
list.size(); i++)
101 if (
list[i]->getTimestampNS() == timestamp)
107 return std::shared_ptr<const Image>();
110 std::shared_ptr<const Image>
ImageList::find(uint64_t timestamp, uint64_t tolerance)
const 114 for (
size_t i=0; i<
list.size(); i++)
116 if (
list[i]->getTimestampNS() >= timestamp-tolerance &&
117 list[i]->getTimestampNS() <= timestamp+tolerance)
125 return find(timestamp);
128 return std::shared_ptr<const Image>();
The image class encapsulates image information.
std::shared_ptr< const Image > find(uint64_t timestamp) const
Returns the image that has the given timestamp.
void removeOld(uint64_t timestamp)
Removes all images that have a timestamp that is older or equal than the given timestamp.
The buffer class encapsulates a Genicam buffer that is provided by a stream.
void add(const std::shared_ptr< const Image > &image)
Adds the given image to the internal list.
uint64_t getOldestTime() const
Get oldest timestamp of the list.
std::vector< std::shared_ptr< const Image > > list
ImageList(size_t maxsize=25)
Create an image list.