summaryrefslogtreecommitdiff
path: root/src/image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.cpp')
-rw-r--r--src/image.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/image.cpp b/src/image.cpp
index ce814da..000ca2d 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -1,7 +1,11 @@
#include "image.h"
+// #include <format>
+
#include <QElapsedTimer>
+#include <libcamera/formats.h>
+
#include "macro.h"
#include "pixels.h"
@@ -125,3 +129,16 @@ std::shared_ptr<Pixels> Image::pixels() const
return result;
}
+
+void Image::copyFromData(const void *src, size_t size)
+{
+ if (size > sizeof(data))
+ {
+ // throw std::logic_error(std::format)
+ }
+
+ if (pixelFormat == libcamera::formats::R8)
+ {
+ memcpy(data, src, size);
+ }
+}