[myimage] add timestamp member to image
This commit is contained in:
parent
09a3a5e3b1
commit
e4a2c2856a
@ -1,4 +1,5 @@
|
|||||||
#include "myimage.h"
|
#include "myimage.h"
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
MyImage::MyImage()
|
MyImage::MyImage()
|
||||||
{}
|
{}
|
||||||
@ -14,6 +15,8 @@ bool MyImage::setFrame(Pylon::CGrabResultPtr ptr) {
|
|||||||
img_width = ptr->GetWidth();
|
img_width = ptr->GetWidth();
|
||||||
img_height = ptr->GetHeight();
|
img_height = ptr->GetHeight();
|
||||||
memcpy(&buffer, ptr->GetBuffer(), ptr->GetImageSize());
|
memcpy(&buffer, ptr->GetBuffer(), ptr->GetImageSize());
|
||||||
|
auto t = std::chrono::system_clock::now();
|
||||||
|
timestamp = std::chrono::system_clock::to_time_t(t);
|
||||||
}
|
}
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ private:
|
|||||||
uint32_t img_width = 0;
|
uint32_t img_width = 0;
|
||||||
uint32_t img_height = 0;
|
uint32_t img_height = 0;
|
||||||
int64_t img_index = 0;
|
int64_t img_index = 0;
|
||||||
|
time_t timestamp;
|
||||||
static const int max_width = 2048;
|
static const int max_width = 2048;
|
||||||
static const int max_height = 1536;
|
static const int max_height = 1536;
|
||||||
char buffer[max_width * max_height];
|
char buffer[max_width * max_height];
|
||||||
|
Loading…
Reference in New Issue
Block a user