[myimage] add timestamp member to image

This commit is contained in:
Jan Grewe 2020-06-10 09:32:23 +02:00
parent 09a3a5e3b1
commit e4a2c2856a
2 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include "myimage.h"
#include <chrono>
MyImage::MyImage()
{}
@ -14,6 +15,8 @@ bool MyImage::setFrame(Pylon::CGrabResultPtr ptr) {
img_width = ptr->GetWidth();
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);
}
return valid;
}

View File

@ -20,6 +20,7 @@ private:
uint32_t img_width = 0;
uint32_t img_height = 0;
int64_t img_index = 0;
time_t timestamp;
static const int max_width = 2048;
static const int max_height = 1536;
char buffer[max_width * max_height];