From e4a2c2856a922a174dee980392ff24224683f8b4 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Wed, 10 Jun 2020 09:32:23 +0200 Subject: [PATCH] [myimage] add timestamp member to image --- myimage.cpp | 3 +++ myimage.h | 1 + 2 files changed, 4 insertions(+) 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];