[myimage] expose frame timestamps
This commit is contained in:
parent
e4a2c2856a
commit
efe357e8ea
@ -16,7 +16,7 @@ bool MyImage::setFrame(Pylon::CGrabResultPtr ptr) {
|
||||
img_height = ptr->GetHeight();
|
||||
memcpy(&buffer, ptr->GetBuffer(), ptr->GetImageSize());
|
||||
auto t = std::chrono::system_clock::now();
|
||||
timestamp = std::chrono::system_clock::to_time_t(t);
|
||||
img_timestamp = std::chrono::system_clock::to_time_t(t);
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
@ -41,3 +41,6 @@ void *MyImage::data() {
|
||||
return &buffer;
|
||||
}
|
||||
|
||||
time_t MyImage::timestamp() {
|
||||
return img_timestamp;
|
||||
}
|
||||
|
@ -14,13 +14,14 @@ public:
|
||||
int size();
|
||||
int64_t index();
|
||||
void* data();
|
||||
time_t timestamp();
|
||||
bool setFrame(Pylon::CGrabResultPtr ptr);
|
||||
|
||||
private:
|
||||
uint32_t img_width = 0;
|
||||
uint32_t img_height = 0;
|
||||
int64_t img_index = 0;
|
||||
time_t timestamp;
|
||||
time_t img_timestamp;
|
||||
static const int max_width = 2048;
|
||||
static const int max_height = 1536;
|
||||
char buffer[max_width * max_height];
|
||||
|
Loading…
Reference in New Issue
Block a user