RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
qr_detect.cpp
Go to the documentation of this file.
7 int main(int argc, char* argv[])
8 {
9  if (argc > 1) {
10  std::cout << "scan for QR: " << argv[1] << std::endl;
11  std::string file = argv[1];
12  std::string token = "my_token";
13 
15 
16  if(auto pic = std::make_shared<rapp::object::picture>(file)) {
17  auto callback = [&](std::vector<rapp::object::qr_code> codes)
18  {
19  std::cout << "found " << codes.size()
20  << " QR codes" << std::endl;
21  for (const auto code : codes)
22  std::cout << code.label() << std::endl;
23  };
24  auto fdetect = std::make_shared<rapp::cloud::qr_detection>(pic, token, callback);
25  ctrl.run_job(fdetect);
26  return 0;
27  }
28  else {
29  throw std::runtime_error("can't load: "+file);
30  }
31  }
32 }
Main class that controllers RAPP Services.
int main(int argc, char *argv[])
Definition: qr_detect.cpp:7
void run_job(const std::shared_ptr< asio_socket > job)
Run one service job.