forked from inspirit/PS3EYEDriver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinternal.hpp
53 lines (43 loc) · 1.28 KB
/
internal.hpp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#ifdef PS3EYE_DEBUG
# include <cstdio>
#endif
namespace ps3eye::detail {
extern volatile bool _ps3eye_debug_status;
#ifdef PS3EYE_DEBUG
#ifdef __GNUG__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-security"
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
template<unsigned N, typename... xs>
inline void ps3eye_debug(const char(&fmt)[N], const xs&... args)
{
if (_ps3eye_debug_status)
{
fputs("ps3eye: ", stderr);
fprintf(stderr, fmt, args...);
fputs("\n", stderr);
}
}
#ifdef __GNUG__
# pragma GCC diagnostic pop
#endif
#else
template<unsigned N, typename... xs>
inline void ps3eye_debug(const char(&)[N], const xs&... args)
{
}
#endif
} // ns ps3eye::detail
namespace ps3eye {
enum class format
{
Bayer, // Output in Bayer. Destination buffer must be width * height bytes
BGR, // Output in BGR. Destination buffer must be width * height * 3 bytes
RGB, // Output in RGB. Destination buffer must be width * height * 3 bytes
BGRA, // Output in BGRA. Destination buffer must be width * height * 4 bytes
RGBA, // Output in RGBA. Destination buffer must be width * height * 4 bytes
Gray // Output in Grayscale. Destination buffer must be width * height bytes
};
} // ns ps3eye