diff --git a/myimage.cpp b/myimage.cpp index 6c7d4a2..e88d572 100644 --- a/myimage.cpp +++ b/myimage.cpp @@ -1,4 +1,5 @@ #include "myimage.h" +#include 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; } diff --git a/myimage.h b/myimage.h index 25d856f..81183db 100644 --- a/myimage.h +++ b/myimage.h @@ -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];