Update types & add callbacks

This commit is contained in:
John Zhao
2018-04-06 09:12:09 +08:00
parent d1740c625e
commit 3e56de0a45
8 changed files with 204 additions and 24 deletions

29
src/internal/callbacks.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef MYNTEYE_INTERNAL_CALLBACKS_H_ // NOLINT
#define MYNTEYE_INTERNAL_CALLBACKS_H_
#pragma once
#include <functional>
#include "mynteye/mynteye.h"
#include "mynteye/types.h"
MYNTEYE_BEGIN_NAMESPACE
namespace device {
struct MYNTEYE_API StreamData {
ImgData img;
};
struct MYNTEYE_API MotionData {
ImuData imu;
};
using StreamCallback = std::function<void(const StreamData &data)>;
using MotionCallback = std::function<void(const MotionData &data)>;
} // namespace device
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_CALLBACKS_H_ NOLINT

View File

@@ -12,20 +12,6 @@
MYNTEYE_BEGIN_NAMESPACE
#define MYNTEYE_FOURCC(a, b, c, d) \
((std::uint32_t)(a) | ((std::uint32_t)(b) << 8) | \
((std::uint32_t)(c) << 16) | ((std::uint32_t)(d) << 24)) // NOLINT
/**
* @ingroup enumerations
* @brief Formats define how each stream can be encoded.
*/
enum class Format : std::uint32_t {
YUYV = MYNTEYE_FOURCC('Y', 'U', 'Y', 'V'),
};
#undef MYNTEYE_FOURCC
#define MYNTEYE_PROPERTY(TYPE, NAME) \
public: \
void set_##NAME(TYPE NAME) { \