os.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 #include <vector>
6 #include <string>
7 #include <rendering.h>
8 
9 struct GLFWmonitor;
10 struct GLFWwindow;
11 
12 // Either OS specific or common helper functions
13 namespace rs2
14 {
15  bool starts_with(const std::string& s, const std::string& prefix);
16  bool ends_with(const std::string& s, const std::string& prefix);
17 
19 
20  void open_url(const char* url);
21 
22  bool directory_exists(const char* dir);
23 
24  std::vector<std::string> split_string(std::string& input, char delim);
25 
26  // Helper function to get window rect from GLFW
28 
29  // Helper function to get monitor rect from GLFW
31 
32  // Select appropriate scale factor based on the display
33  // that most of the application is presented on
35 
37 
38  // Wrapper for cross-platform dialog control
40  open_file = (1 << 0),
41  save_file = (1 << 1),
42  };
43 
44  const char* file_dialog_open(file_dialog_mode flags, const char* filters, const char* default_path, const char* default_name);
45 
46  // Encapsulate helper function to resolve linking
47  int save_to_png(const char* filename,
48  size_t pixel_width, size_t pixels_height, size_t bytes_per_pixel,
49  const void* raster_data, size_t stride_bytes);
50 
52  {
59  };
60 
63 
65 
67 
68  bool is_debug();
69 }
GLdouble s
GLsizei const GLchar *const * path
Definition: glext.h:4276
GLfloat value
struct GLFWmonitor GLFWmonitor
std::string get_folder_path(special_folder f)
Definition: os.cpp:247
std::string get_timestamped_file_name()
Definition: os.cpp:237
rect get_monitor_rect(GLFWmonitor *monitor)
Definition: os.cpp:107
Definition: cah-model.h:10
GLsizei const GLchar *const * string
bool is_debug()
Definition: os.cpp:368
std::vector< std::string > split_string(std::string &input, char delim)
Definition: os.cpp:79
file_dialog_mode
Definition: os.h:39
bool ends_with(const std::string &s, const std::string &suffix)
Definition: os.cpp:335
std::string truncate_string(const std::string &str, size_t width)
Definition: os.cpp:47
bool directory_exists(const char *dir)
Definition: os.cpp:157
GLdouble f
void open_url(const char *url)
Definition: os.cpp:58
std::string url_encode(const std::string &value)
Definition: os.cpp:381
GLbitfield flags
const char * file_dialog_open(file_dialog_mode flags, const char *filters, const char *default_path, const char *default_name)
Definition: os.cpp:169
int save_to_png(const char *filename, size_t pixel_width, size_t pixels_height, size_t bytes_per_pixel, const void *raster_data, size_t stride_bytes)
Definition: os.cpp:217
int pick_scale_factor(GLFWwindow *window)
Definition: os.cpp:119
Definition: example.hpp:70
std::string get_file_name(const std::string &path)
Definition: os.cpp:224
GLenum GLenum GLenum input
Definition: glext.h:10805
rect get_window_rect(GLFWwindow *window)
Definition: os.cpp:95
bool starts_with(const std::string &s, const std::string &prefix)
Definition: os.cpp:343
special_folder
Definition: os.h:51
std::string get_os_name()
Definition: os.cpp:351
static const char * default_path
Definition: model-views.h:130
struct GLFWwindow GLFWwindow
GLint GLsizei width


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:39