Scroom 0.14-48-ga0fee447
Loading...
Searching...
No Matches
measure-framerate.cc File Reference
#include <cstdlib>
#include <string>
#include <fmt/core.h>
#include <getopt.h>
#include <spdlog/spdlog.h>
#include <gtk/gtk.h>
#include <scroom/logger.hh>
#include "measure-framerate-callbacks.hh"
#include "measure-framerate-tests.hh"
Include dependency graph for measure-framerate.cc:

Functions

void usage (const std::string &me, const std::string &message=std::string())
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
37{
38 const std::string me = argv[0];
39 char result;
40
41 while((result = getopt(argc, argv, ":h")) != -1)
42 {
43 switch(result)
44 {
45 case 'h':
46 usage(me);
47 break;
48 case '?':
49 // show usage -- unknown option
50 usage(me, "Unknown option");
51 break;
52 case ':':
53 // show usage -- missing argument
54 usage(me, "Option requires an argument");
55 break;
56 default:
57 usage(me, "This shouldn't be happening");
58 break;
59 }
60 }
61
62 // while(optind < argc)
63 // {
64 // filenames.push_back(std::string(argv[optind]));
65 // optind++;
66 // }
67
68 setlocale(LC_ALL, ""); // NOLINT(concurrency-mt-unsafe)
69 gtk_init(&argc, &argv);
70
71 [[maybe_unused]] GtkWidget* window = create_window();
72
73 init_tests();
74 init();
75
76 gtk_main();
77 return 0;
78}
void init()
Definition measure-framerate-callbacks.cc:96
GtkWidget * create_window()
Definition measure-framerate-callbacks.cc:77
void init_tests()
Definition measure-framerate-tests.cc:156
void usage(const std::string &me, const std::string &message=std::string())
Definition measure-framerate.cc:22
SampleIterator< const uint8_t > result
Definition sampleiterator-tests.cc:94
Here is the call graph for this function:

◆ usage()

void usage ( const std::string &  me,
const std::string &  message = std::string() 
)
23{
24 if(!message.empty())
25 {
27 logger->error("{}", message);
28 }
29
30 fmt::print("Usage: {} [options] [input files]\n\n", me);
31 fmt::print("Options:\n");
32 fmt::print(" -h : Show this help\n");
33 exit(-1); // NOLINT(concurrency-mt-unsafe)
34}
Definition logger.hh:49
Scroom::Logger logger
Definition callbacks.cc:54

Referenced by main().

Here is the caller graph for this function: