MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / imagingCallback

Function imagingCallback

examples/clients/Imaging.cpp:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42bool gotSomething = false;
43
44void imagingCallback(void *userdata,
45 osvr::util::time::TimeValue const &timestamp,
46 osvr::clientkit::ImagingReportOpenCV report) {
47 if (report.frame.empty()) {
48 std::cout << "Error, frame empty!" << std::endl;
49 return;
50 }
51
52 /// The first time, let's print some info.
53 if (!gotSomething) {
54 gotSomething = true;
55 std::cout << "Got first report: image is " << report.frame.cols << "x"
56 << report.frame.rows << std::endl;
57 }
58
59 cv::imshow(windowNameAndInstructions, report.frame);
60 osvr::clientkit::ImagingReportOpenCV &lastReport =
61 *static_cast<osvr::clientkit::ImagingReportOpenCV *>(userdata);
62 lastReport = report;
63}
64int main() {
65 osvr::clientkit::ClientContext context("com.osvr.exampleclients.Imaging");
66

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected