50 maxsize=std::max(static_cast<size_t>(1), _maxsize);
55 list.push_back(image);
65 list.push_back(std::shared_ptr<const Image>(
new Image(buffer, part)));
77 while (i <
list.size())
79 if (
list[i]->getTimestampNS() <= timestamp)
81 list.erase(
list.begin()+
static_cast<int>(i));
96 ret=
list[0]->getTimestampNS();
104 for (
size_t i=0; i<
list.size(); i++)
106 if (
list[i]->getTimestampNS() == timestamp)
112 return std::shared_ptr<const Image>();
115 std::shared_ptr<const Image>
ImageList::find(uint64_t timestamp, uint64_t tolerance)
const 119 for (
size_t i=0; i<
list.size(); i++)
121 if (
list[i]->getTimestampNS() >= timestamp-tolerance &&
122 list[i]->getTimestampNS() <= timestamp+tolerance)
130 return find(timestamp);
133 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.