Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <ftl/rgbd/frameset.hpp>
using ftl::rgbd::FrameSet;
using ftl::rgbd::Channels;
using ftl::rgbd::Channel;
void FrameSet::upload(ftl::rgbd::Channels c, cudaStream_t stream) {
for (auto &f : frames) {
f.upload(c, stream);
}
}
void FrameSet::download(ftl::rgbd::Channels c, cudaStream_t stream) {
for (auto &f : frames) {
f.download(c, stream);
}
}
void FrameSet::swapTo(ftl::rgbd::FrameSet &fs) {
UNIQUE_LOCK(fs.mtx, lk);
if (fs.frames.size() != frames.size()) {
// Assume "this" is correct and "fs" is not.
fs.sources.clear();
for (auto s : sources) fs.sources.push_back(s);
fs.frames.resize(frames.size());
}
fs.timestamp = timestamp;
fs.count = count;
fs.stale = stale;
fs.mask = mask;
for (size_t i=0; i<frames.size(); ++i) {
frames[i].swap(Channels::All(), fs.frames[i]);
}
stale = true;
}