Rearrage include and src

This commit is contained in:
John Zhao
2018-10-27 21:24:04 +08:00
parent 08271be063
commit 972ab79a76
72 changed files with 280 additions and 260 deletions

View File

@@ -1,285 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_API_H_ // NOLINT
#define MYNTEYE_API_H_
#pragma once
#include <opencv2/core/core.hpp>
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include "mynteye/mynteye.h"
#include "mynteye/types.h"
MYNTEYE_BEGIN_NAMESPACE
class Device;
class Synthetic;
namespace device {
class Frame;
} // namespace device
namespace api {
/**
* @ingroup datatypes
* API stream data.
*/
struct MYNTEYE_API StreamData {
/** ImgData. */
std::shared_ptr<ImgData> img;
/** Frame. */
cv::Mat frame;
/** Raw frame. */
std::shared_ptr<device::Frame> frame_raw;
/** Frame ID. */
std::uint16_t frame_id;
bool operator==(const StreamData &other) const {
if (img && other.img) {
return img->frame_id == other.img->frame_id &&
img->timestamp == other.img->timestamp;
}
return false;
}
};
/**
* @ingroup datatypes
* API motion data.
*/
struct MYNTEYE_API MotionData {
/** ImuData. */
std::shared_ptr<ImuData> imu;
bool operator==(const MotionData &other) const {
if (imu && other.imu) {
return imu->frame_id == other.imu->frame_id &&
imu->timestamp == other.imu->timestamp;
}
return false;
}
};
} // namespace api
/**
* The API class to communicate with MYNT® EYE device.
*/
class MYNTEYE_API API {
public:
/** The api::StreamData callback. */
using stream_callback_t = std::function<void(const api::StreamData &data)>;
/** The api::MotionData callback. */
using motion_callback_t = std::function<void(const api::MotionData &data)>;
explicit API(std::shared_ptr<Device> device);
virtual ~API();
/**
* Create the API instance.
* @return the API instance.
* @note This will call device::select() to select a device.
*/
static std::shared_ptr<API> Create();
/**
* Create the API instance.
* @param device the selected device.
* @return the API instance.
*/
static std::shared_ptr<API> Create(std::shared_ptr<Device> device);
/**
* Create the API instance.
* @param argc the arg count.
* @param argv the arg values.
* @return the API instance.
* @note This will init glog with args and call device::select() to select a
* device.
*/
static std::shared_ptr<API> Create(int argc, char *argv[]);
/**
* Create the API instance.
* @param argc the arg count.
* @param argv the arg values.
* @param device the selected device.
* @return the API instance.
* @note This will init glog with args.
*/
static std::shared_ptr<API> Create(
int argc, char *argv[], std::shared_ptr<Device> device);
/**
* Get the model.
*/
Model GetModel() const;
/**
* Supports the stream or not.
*/
bool Supports(const Stream &stream) const;
/**
* Supports the capability or not.
*/
bool Supports(const Capabilities &capability) const;
/**
* Supports the option or not.
*/
bool Supports(const Option &option) const;
/**
* Supports the addon or not.
*/
bool Supports(const AddOns &addon) const;
/**
* Get all stream requests of the capability.
*/
const std::vector<StreamRequest> &GetStreamRequests(
const Capabilities &capability) const;
/**
* Config the stream request to the capability.
*/
void ConfigStreamRequest(
const Capabilities &capability, const StreamRequest &request);
/**
* Get the device info.
*/
std::string GetInfo(const Info &info) const;
/**
* Get the intrinsics of stream.
*/
Intrinsics GetIntrinsics(const Stream &stream) const;
/**
* Get the extrinsics from one stream to another.
*/
Extrinsics GetExtrinsics(const Stream &from, const Stream &to) const;
/**
* Get the intrinsics of motion.
*/
MotionIntrinsics GetMotionIntrinsics() const;
/**
* Get the extrinsics from one stream to motion.
*/
Extrinsics GetMotionExtrinsics(const Stream &from) const;
/**
* Log all option infos.
*/
void LogOptionInfos() const;
/**
* Get the option info.
*/
OptionInfo GetOptionInfo(const Option &option) const;
/**
* Get the option value.
*/
std::int32_t GetOptionValue(const Option &option) const;
/**
* Set the option value.
*/
void SetOptionValue(const Option &option, std::int32_t value);
/**
* Run the option action.
*/
bool RunOptionAction(const Option &option) const;
/**
* Set the callback of stream.
*/
void SetStreamCallback(const Stream &stream, stream_callback_t callback);
/**
* Set the callback of motion.
*/
void SetMotionCallback(motion_callback_t callback);
/**
* Has the callback of stream.
*/
bool HasStreamCallback(const Stream &stream) const;
/**
* Has the callback of motion.
*/
bool HasMotionCallback() const;
/**
* Start capturing the source.
*/
void Start(const Source &source);
/**
* Stop capturing the source.
*/
void Stop(const Source &source);
/**
* Wait the streams are ready.
*/
void WaitForStreams();
/**
* Enable the data of stream.
* @note must enable the stream if it's a synthetic one. This means the stream
* in not native, the device has the capability to provide this stream, but
* still support this stream.
*/
void EnableStreamData(const Stream &stream);
/**
* Disable the data of stream.
*/
void DisableStreamData(const Stream &stream);
/**
* Get the latest data of stream.
*/
api::StreamData GetStreamData(const Stream &stream);
/**
* Get the datas of stream.
* @note default cache 4 datas at most.
*/
std::vector<api::StreamData> GetStreamDatas(const Stream &stream);
/**
* Enable cache motion datas.
*/
void EnableMotionDatas(
std::size_t max_size = std::numeric_limits<std::size_t>::max());
/**
* Get the motion datas.
*/
std::vector<api::MotionData> GetMotionDatas();
/**
* Enable the plugin.
*/
void EnablePlugin(const std::string &path);
std::shared_ptr<Device> device();
private:
std::shared_ptr<Device> device_;
std::unique_ptr<Synthetic> synthetic_;
};
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_API_H_ NOLINT

View File

@@ -1,140 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_PLUGIN_H_ // NOLINT
#define MYNTEYE_PLUGIN_H_
#pragma once
#include <opencv2/core/core.hpp>
#include <cstdint>
#include "mynteye/mynteye.h"
#ifndef MYNTEYE_PLUGIN_VERSION_CODE
#define MYNTEYE_PLUGIN_VERSION_CODE 0
#endif
MYNTEYE_BEGIN_NAMESPACE
class API;
struct Object;
/**
* The plugin which could implement processing by yourself.
*/
class MYNTEYE_API Plugin {
public:
Plugin() = default;
virtual ~Plugin() = 0;
/**
* Called when plugin created.
* @param api the API instacne.
*/
virtual void OnCreate(API *api) {
api_ = api;
}
/**
* Called when process rectify.
* @param in input object.
* @param out output object.
* @return `true` if you process rectify.
*/
virtual bool OnRectifyProcess(Object *const in, Object *const out) {
MYNTEYE_UNUSED(in)
MYNTEYE_UNUSED(out)
return false;
}
/**
* Called when process disparity.
* @param in input object.
* @param out output object.
* @return `true` if you process disparity.
*/
virtual bool OnDisparityProcess(Object *const in, Object *const out) {
MYNTEYE_UNUSED(in)
MYNTEYE_UNUSED(out)
return false;
}
/**
* Called when process normalized disparity.
* @param in input object.
* @param out output object.
* @return `true` if you process normalized disparity.
*/
virtual bool OnDisparityNormalizedProcess(
Object *const in, Object *const out) {
MYNTEYE_UNUSED(in)
MYNTEYE_UNUSED(out)
return false;
}
/**
* Called when process points.
* @param in input object.
* @param out output object.
* @return `true` if you process points.
*/
virtual bool OnPointsProcess(Object *const in, Object *const out) {
MYNTEYE_UNUSED(in)
MYNTEYE_UNUSED(out)
return false;
}
/**
* Called when process depth.
* @param in input object.
* @param out output object.
* @return `true` if you process depth.
*/
virtual bool OnDepthProcess(Object *const in, Object *const out) {
MYNTEYE_UNUSED(in)
MYNTEYE_UNUSED(out)
return false;
}
protected:
API *api_;
};
inline Plugin::~Plugin() = default;
using plugin_version_code_t = std::uint32_t();
using plugin_create_t = Plugin *();
using plugin_destroy_t = void(Plugin *);
MYNTEYE_END_NAMESPACE
extern "C" {
/**
* Get the plugin version code.
*/
MYNTEYE_API std::uint32_t plugin_version_code();
/**
* Create the plugin.
*/
MYNTEYE_API mynteye::Plugin *plugin_create();
/**
* Destroy the plugin.
*/
MYNTEYE_API void plugin_destroy(mynteye::Plugin *plugin);
}
#endif // MYNTEYE_PLUGIN_H_ NOLINT

View File

@@ -1,115 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_OBJECT_H_ // NOLINT
#define MYNTEYE_OBJECT_H_
#pragma once
#include <opencv2/core/core.hpp>
#include <memory>
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
/**
* Input & output object.
*/
struct MYNTEYE_API Object {
Object() = default;
virtual ~Object() = default;
virtual Object *Clone() const = 0;
virtual bool DecValidity() const = 0;
/** Cast the obj to T pointer */
template <typename T>
static T *Cast(Object *obj) {
return dynamic_cast<T *>(obj);
}
/** Cast the obj to const T pointer */
template <typename T>
static const T *Cast(const Object *obj) {
return dynamic_cast<const T *>(obj);
}
template <typename T>
static std::shared_ptr<T> Cast(const std::shared_ptr<Object> &obj) {
return std::dynamic_pointer_cast<T>(obj);
}
};
/**
* Input & output object of one cv::Mat.
*/
struct MYNTEYE_API ObjMat : public Object {
ObjMat() = default;
ObjMat(const cv::Mat &value, std::uint16_t id)
: value(value), id(id) {}
/** The value */
cv::Mat value;
/** The id **/
std::uint16_t id;
Object *Clone() const {
ObjMat *mat = new ObjMat;
mat->value = value.clone();
mat->id = id;
return mat;
}
bool DecValidity() const {
return !value.empty();
}
};
/**
* Input & output object of two cv::Mat.
*/
struct MYNTEYE_API ObjMat2 : public Object {
ObjMat2() = default;
ObjMat2(const cv::Mat &first, std::uint16_t first_id,
const cv::Mat &second, std::uint16_t second_id)
: first(first), first_id(first_id),
second(second), second_id(second_id) {}
/** The first value */
cv::Mat first;
/** The first id **/
std::uint16_t first_id;
/** The second value */
cv::Mat second;
/** The second id **/
std::uint16_t second_id;
Object *Clone() const {
ObjMat2 *mat2 = new ObjMat2;
mat2->first = first.clone();
mat2->first_id = first_id;
mat2->second = second.clone();
mat2->second_id = second_id;
return mat2;
}
bool DecValidity() const {
return !first.empty() && !second.empty();
}
};
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_OBJECT_H_ NOLINT

View File

@@ -1,56 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_CONTEXT_H_ // NOLINT
#define MYNTEYE_CONTEXT_H_
#pragma once
#include <memory>
#include <vector>
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
namespace uvc {
struct context;
} // namespace uvc
class Device;
/**
* The context about devices.
*/
class MYNTEYE_API Context {
public:
Context();
~Context();
/**
* Get all devices now.
* @return a vector of all devices.
*/
std::vector<std::shared_ptr<Device>> devices() const {
return devices_;
}
private:
std::shared_ptr<uvc::context> context_;
std::vector<std::shared_ptr<Device>> devices_;
};
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_CONTEXT_H_ NOLINT

View File

@@ -1,325 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_DEVICE_H_ // NOLINT
#define MYNTEYE_DEVICE_H_
#pragma once
#include <limits>
#include <map>
#include <memory>
#include <mutex>
#include <string>
#include <vector>
#include "mynteye/callbacks.h"
#include "mynteye/mynteye.h"
#include "mynteye/types.h"
MYNTEYE_BEGIN_NAMESPACE
namespace uvc {
struct device;
} // namespace uvc
namespace tools {
class DeviceWriter;
} // namespace tools
struct DeviceInfo;
class API;
class Channels;
class Motions;
class Streams;
template <class Data>
class AsyncCallback;
/**
* The Device class to communicate with MYNT® EYE device.
*/
class MYNTEYE_API Device {
public:
/** The device::StreamData callback. */
using stream_callback_t = device::StreamCallback;
/** The device::MotionData callback. */
using motion_callback_t = device::MotionCallback;
using stream_callbacks_t = std::map<Stream, stream_callback_t>;
using stream_async_callback_t = AsyncCallback<device::StreamData>;
using motion_async_callback_t = AsyncCallback<device::MotionData>;
using stream_async_callback_ptr_t = std::shared_ptr<stream_async_callback_t>;
using motion_async_callback_ptr_t = std::shared_ptr<motion_async_callback_t>;
Device(const Model &model, std::shared_ptr<uvc::device> device);
virtual ~Device();
/**
* Create the Device instance.
* @param name the device name.
* @param device the device from uvc.
* @return the Device instance.
*/
static std::shared_ptr<Device> Create(
const std::string &name, std::shared_ptr<uvc::device> device);
/**
* Get the model.
*/
Model GetModel() const {
return model_;
}
/**
* Supports the stream or not.
*/
bool Supports(const Stream &stream) const;
/**
* Supports the capability or not.
*/
bool Supports(const Capabilities &capability) const;
/**
* Supports the option or not.
*/
bool Supports(const Option &option) const;
/**
* Supports the addon or not.
*/
bool Supports(const AddOns &addon) const;
/**
* Get all stream requests of the capability.
*/
const std::vector<StreamRequest> &GetStreamRequests(
const Capabilities &capability) const;
/**
* Config the stream request to the capability.
*/
void ConfigStreamRequest(
const Capabilities &capability, const StreamRequest &request);
/**
* Get the device info.
*/
std::shared_ptr<DeviceInfo> GetInfo() const;
/**
* Get the device info of a field.
*/
std::string GetInfo(const Info &info) const;
/**
* Get the intrinsics of stream.
*/
Intrinsics GetIntrinsics(const Stream &stream) const;
/**
* Get the extrinsics from one stream to another.
*/
Extrinsics GetExtrinsics(const Stream &from, const Stream &to) const;
/**
* Get the intrinsics of motion.
*/
MotionIntrinsics GetMotionIntrinsics() const;
/**
* Get the extrinsics from one stream to motion.
*/
Extrinsics GetMotionExtrinsics(const Stream &from) const;
/**
* Get the intrinsics of stream.
*/
Intrinsics GetIntrinsics(const Stream &stream, bool *ok) const;
/**
* Get the extrinsics from one stream to another.
*/
Extrinsics GetExtrinsics(
const Stream &from, const Stream &to, bool *ok) const;
/**
* Get the intrinsics of motion.
*/
MotionIntrinsics GetMotionIntrinsics(bool *ok) const;
/**
* Get the extrinsics from one stream to motion.
*/
Extrinsics GetMotionExtrinsics(const Stream &from, bool *ok) const;
/**
* Set the intrinsics of stream.
*/
void SetIntrinsics(const Stream &stream, const Intrinsics &in);
/**
* Set the extrinsics from one stream to another.
*/
void SetExtrinsics(
const Stream &from, const Stream &to, const Extrinsics &ex);
/**
* Set the intrinsics of motion.
*/
void SetMotionIntrinsics(const MotionIntrinsics &in);
/**
* Set the extrinsics from one stream to motion.
*/
void SetMotionExtrinsics(const Stream &from, const Extrinsics &ex);
/**
* Log all option infos.
*/
void LogOptionInfos() const;
/**
* Get the option info.
*/
OptionInfo GetOptionInfo(const Option &option) const;
/**
* Get the option value.
*/
std::int32_t GetOptionValue(const Option &option) const;
/**
* Set the option value.
*/
void SetOptionValue(const Option &option, std::int32_t value);
/**
* Run the option action.
*/
bool RunOptionAction(const Option &option) const;
/**
* Set the callback of stream.
*/
void SetStreamCallback(
const Stream &stream, stream_callback_t callback, bool async = false);
/**
* Set the callback of motion.
*/
void SetMotionCallback(motion_callback_t callback, bool async = false);
/**
* Has the callback of stream.
*/
bool HasStreamCallback(const Stream &stream) const;
/**
* Has the callback of motion.
*/
bool HasMotionCallback() const;
/**
* Start capturing the source.
*/
virtual void Start(const Source &source);
/**
* Stop capturing the source.
*/
virtual void Stop(const Source &source);
/**
* Wait the streams are ready.
*/
void WaitForStreams();
/**
* Get the datas of stream.
* @note default cache 4 datas at most.
*/
std::vector<device::StreamData> GetStreamDatas(const Stream &stream);
/**
* Get the latest data of stream.
*/
device::StreamData GetLatestStreamData(const Stream &stream);
/**
* Enable cache motion datas.
*/
void EnableMotionDatas(
std::size_t max_size = std::numeric_limits<std::size_t>::max());
/**
* Get the motion datas.
*/
std::vector<device::MotionData> GetMotionDatas();
protected:
std::shared_ptr<uvc::device> device() const {
return device_;
}
std::shared_ptr<Streams> streams() const {
return streams_;
}
std::shared_ptr<Channels> channels() const {
return channels_;
}
std::shared_ptr<Motions> motions() const {
return motions_;
}
const StreamRequest &GetStreamRequest(const Capabilities &capability);
virtual void StartVideoStreaming();
virtual void StopVideoStreaming();
virtual void StartMotionTracking();
virtual void StopMotionTracking();
virtual void OnStereoStreamUpdate();
virtual std::vector<Stream> GetKeyStreams() const = 0;
bool video_streaming_;
bool motion_tracking_;
private:
Model model_;
std::shared_ptr<uvc::device> device_;
std::shared_ptr<DeviceInfo> device_info_;
std::map<Stream, Intrinsics> stream_intrinsics_;
std::map<Stream, std::map<Stream, Extrinsics>> stream_from_extrinsics_;
std::shared_ptr<MotionIntrinsics> motion_intrinsics_;
std::map<Stream, Extrinsics> motion_from_extrinsics_;
stream_callbacks_t stream_callbacks_;
motion_callback_t motion_callback_;
std::map<Stream, stream_async_callback_ptr_t> stream_async_callbacks_;
motion_async_callback_ptr_t motion_async_callback_;
std::shared_ptr<Streams> streams_;
std::map<Capabilities, StreamRequest> stream_config_requests_;
std::mutex mtx_streams_;
std::shared_ptr<Channels> channels_;
std::shared_ptr<Motions> motions_;
void ReadAllInfos();
void CallbackPushedStreamData(const Stream &stream);
void CallbackMotionData(const device::MotionData &data);
friend API;
friend tools::DeviceWriter;
};
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_DEVICE_H_ NOLINT

View File

@@ -1,32 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_FILES_H_ // NOLINT
#define MYNTEYE_INTERNAL_FILES_H_
#pragma once
#include <string>
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
namespace files {
MYNTEYE_API bool mkdir(const std::string &path);
} // namespace files
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_FILES_H_ NOLINT

View File

@@ -1,62 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_STRINGS_H_ // NOLINT
#define MYNTEYE_INTERNAL_STRINGS_H_
#pragma once
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
/** The strings error */
class MYNTEYE_API strings_error : public std::runtime_error {
public:
explicit strings_error(const std::string &what_arg) noexcept
: std::runtime_error(std::move(what_arg)) {}
explicit strings_error(const char *what_arg) noexcept
: std::runtime_error(std::move(what_arg)) {}
};
namespace strings {
MYNTEYE_API
int hex2int(const std::string &text);
MYNTEYE_API
bool starts_with(const std::string &text, const std::string &prefix);
MYNTEYE_API
bool ends_with(const std::string &text, const std::string &suffix);
MYNTEYE_API
std::vector<std::string> split(
const std::string &text, const std::string &delimiters);
MYNTEYE_API void ltrim(std::string &s); // NOLINT
MYNTEYE_API void rtrim(std::string &s); // NOLINT
MYNTEYE_API void trim(std::string &s); // NOLINT
MYNTEYE_API
std::string trim_copy(const std::string &text);
} // namespace strings
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_STRINGS_H_ NOLINT

View File

@@ -1,223 +0,0 @@
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_TIMES_H_ // NOLINT
#define MYNTEYE_INTERNAL_TIMES_H_
#pragma once
#include <chrono>
#include <cmath>
#include <cstdint>
#include <ctime>
#include <iomanip>
#include <ratio>
#include <sstream>
#include <string>
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
namespace times {
using system_clock = std::chrono::system_clock;
using nanoseconds = std::chrono::nanoseconds;
using microseconds = std::chrono::microseconds;
using milliseconds = std::chrono::milliseconds;
using seconds = std::chrono::seconds;
using minutes = std::chrono::minutes;
using hours = std::chrono::hours;
using days = std::chrono::duration<std::int64_t, std::ratio<86400>>;
// to
template <typename Duration>
inline Duration to_duration(const std::int64_t &t) {
return Duration{t};
}
template <typename Duration>
inline system_clock::time_point to_time_point(const Duration &d) {
return system_clock::time_point(d);
}
template <typename Duration>
inline system_clock::time_point to_time_point(const std::int64_t &t) {
return system_clock::time_point(Duration{t});
}
inline system_clock::time_point to_time_point(std::tm *tm) {
return system_clock::from_time_t(std::mktime(tm));
}
inline struct std::tm *to_local_tm(const system_clock::time_point &t) {
auto t_c = system_clock::to_time_t(t);
return std::localtime(&t_c);
}
inline struct std::tm *to_utc_tm(const system_clock::time_point &t) {
auto t_c = system_clock::to_time_t(t);
return std::gmtime(&t_c);
}
// cast
template <typename FromDuration, typename ToDuration>
inline ToDuration cast(const FromDuration &d) {
return std::chrono::duration_cast<ToDuration>(d);
}
template <typename Duration>
inline Duration cast(const system_clock::duration &d) {
return cast<system_clock::duration, Duration>(d);
}
template <typename FromDuration, typename ToDuration>
inline std::int64_t cast(const std::int64_t &t) {
return cast<FromDuration, ToDuration>(FromDuration{t}).count();
}
template <typename Duration>
inline system_clock::time_point cast(const system_clock::time_point &d) {
// C++17, floor
return std::chrono::time_point_cast<Duration>(d);
}
template <typename Duration>
inline system_clock::duration cast_mod(const system_clock::time_point &t) {
return t - cast<Duration>(t);
}
// count
template <typename FromDuration, typename ToDuration>
inline std::int64_t count(const FromDuration &d) {
return cast<FromDuration, ToDuration>(d).count();
}
template <typename Duration>
inline std::int64_t count(const system_clock::duration &d) {
return cast<Duration>(d).count();
}
// day
inline std::tm *day_beg(std::tm *tm) {
tm->tm_hour = 0;
tm->tm_min = 0;
tm->tm_sec = 0;
return tm;
}
inline std::tm *day_end(std::tm *tm) {
tm->tm_hour = 23;
tm->tm_min = 59;
tm->tm_sec = 59;
return tm;
}
inline system_clock::time_point day_beg(const system_clock::time_point &t) {
return cast<days>(t);
}
inline system_clock::time_point day_end(const system_clock::time_point &t) {
return day_beg(t) + days(1) - system_clock::duration(1);
}
inline system_clock::duration day_time(const system_clock::time_point &t) {
return cast_mod<days>(t);
}
// between
template <typename Duration>
inline std::int64_t between(
const system_clock::time_point &t1, const system_clock::time_point &t2) {
return count<Duration>(t2 - t1);
}
inline std::int64_t between_days(
const system_clock::time_point &t1, const system_clock::time_point &t2) {
return between<days>(day_beg(t1), day_beg(t2));
}
template <typename Duration>
inline std::int64_t between_days(
const std::int64_t &t1, const std::int64_t &t2) {
return between_days(to_time_point<Duration>(t1), to_time_point<Duration>(t2));
}
// epoch
inline system_clock::time_point epoch() {
return system_clock::time_point(system_clock::duration{0});
}
template <typename Duration>
inline std::int64_t since_epoch(const system_clock::time_point &t) {
return count<Duration>(t.time_since_epoch());
}
// now
inline system_clock::time_point now() {
return system_clock::now();
}
template <typename Duration>
inline std::int64_t now() {
return since_epoch<Duration>(now());
}
// string
inline std::string to_string(
const system_clock::time_point &t, const std::tm *tm,
const char *fmt = "%F %T", std::int32_t precision = 6) {
std::stringstream ss;
#if defined(MYNTEYE_OS_ANDROID) || defined(MYNTEYE_OS_LINUX)
char foo[20];
strftime(foo, sizeof(foo), fmt, tm);
ss << foo;
#else
ss << std::put_time(tm, fmt);
#endif
if (precision > 0) {
if (precision > 6)
precision = 6;
ss << '.' << std::setfill('0') << std::setw(precision)
<< static_cast<std::int32_t>(
count<microseconds>(cast_mod<seconds>(t)) /
std::pow(10, 6 - precision));
}
return ss.str();
}
inline std::string to_local_string(
const system_clock::time_point &t, const char *fmt = "%F %T",
const std::int32_t &precision = 6) {
return to_string(t, to_local_tm(t), fmt, precision);
}
inline std::string to_utc_string(
const system_clock::time_point &t, const char *fmt = "%F %T",
const std::int32_t &precision = 6) {
return to_string(t, to_utc_tm(t), fmt, precision);
}
} // namespace times
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_TIMES_H_ NOLINT

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/api.h"
#include "mynteye/api/api.h"
#ifdef WITH_BOOST_FILESYSTEM
#include <boost/filesystem.hpp>
@@ -22,13 +22,12 @@
#include <thread>
#include "mynteye/logger.h"
#include "mynteye/utils.h"
#include "api/plugin.h"
#include "api/synthetic.h"
#include "device/device.h"
#include "device/device_s.h"
#include "internal/dl.h"
#include "mynteye/api/dl.h"
#include "mynteye/api/plugin.h"
#include "mynteye/api/synthetic.h"
#include "mynteye/device/device.h"
#include "mynteye/device/device_s.h"
#include "mynteye/device/utils.h"
#if defined(WITH_FILESYSTEM) && defined(WITH_NATIVE_FILESYSTEM)
#if defined(MYNTEYE_OS_WIN)

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/dl.h"
#include "mynteye/api/dl.h"
#include "mynteye/logger.h"

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_DL_H_ // NOLINT
#define MYNTEYE_INTERNAL_DL_H_
#ifndef MYNTEYE_API_DL_H_
#define MYNTEYE_API_DL_H_
#pragma once
#include "mynteye/mynteye.h"
@@ -68,4 +68,4 @@ Func *DL::Sym(const char *symbol) {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_DL_H_ NOLINT
#endif // MYNTEYE_API_DL_H_

View File

@@ -11,15 +11,14 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/processor/processor.h"
#include "mynteye/api/processor.h"
#include <exception>
#include <utility>
#include "mynteye/logger.h"
#include "internal/strings.h"
#include "internal/times.h"
#include "mynteye/util/strings.h"
#include "mynteye/util/times.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_PROCESSOR_H_ // NOLINT
#define MYNTEYE_PROCESSOR_H_
#ifndef MYNTEYE_API_PROCESSOR_H_
#define MYNTEYE_API_PROCESSOR_H_
#pragma once
#include <condition_variable>
@@ -25,8 +25,7 @@
#include <thread>
#include "mynteye/mynteye.h"
#include "api/processor/object.h"
#include "mynteye/api/object.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -119,4 +118,4 @@ void iterate_processors(
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_PROCESSOR_H_ NOLINT
#endif // MYNTEYE_API_PROCESSOR_H_

View File

@@ -11,12 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/processor/depth_processor.h"
#include "mynteye/logger.h"
#include "mynteye/api/processor/depth_processor.h"
#include <utility>
#include "mynteye/logger.h"
MYNTEYE_BEGIN_NAMESPACE
const char DepthProcessor::NAME[] = "DepthProcessor";

View File

@@ -11,13 +11,13 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_DEPTH_PROCESSOR_H_ // NOLINT
#define MYNTEYE_DEPTH_PROCESSOR_H_
#ifndef MYNTEYE_API_PROCESSOR_DEPTH_PROCESSOR_H_
#define MYNTEYE_API_PROCESSOR_DEPTH_PROCESSOR_H_
#pragma once
#include <string>
#include "api/processor/processor.h"
#include "mynteye/api/processor.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -38,4 +38,4 @@ class DepthProcessor : public Processor {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_DEPTH_PROCESSOR_H_ NOLINT
#endif // MYNTEYE_API_PROCESSOR_DEPTH_PROCESSOR_H_

View File

@@ -11,12 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/processor/disparity_normalized_processor.h"
#include <opencv2/imgproc/imgproc.hpp>
#include "mynteye/api/processor/disparity_normalized_processor.h"
#include <utility>
#include <opencv2/imgproc/imgproc.hpp>
#include "mynteye/logger.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,13 +11,13 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_DISPARITY_NORMALIZED_PROCESSOR_H_ // NOLINT
#define MYNTEYE_DISPARITY_NORMALIZED_PROCESSOR_H_
#ifndef MYNTEYE_API_PROCESSOR_DISPARITY_NORMALIZED_PROCESSOR_H_
#define MYNTEYE_API_PROCESSOR_DISPARITY_NORMALIZED_PROCESSOR_H_
#pragma once
#include <string>
#include "api/processor/processor.h"
#include "mynteye/api/processor.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -38,4 +38,4 @@ class DisparityNormalizedProcessor : public Processor {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_DISPARITY_NORMALIZED_PROCESSOR_H_ NOLINT
#endif // MYNTEYE_API_PROCESSOR_DISPARITY_NORMALIZED_PROCESSOR_H_

View File

@@ -11,12 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/processor/disparity_processor.h"
#include <opencv2/calib3d/calib3d.hpp>
#include "mynteye/api/processor/disparity_processor.h"
#include <utility>
#include <opencv2/calib3d/calib3d.hpp>
#include "mynteye/logger.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,13 +11,13 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_DISPARITY_PROCESSOR_H_ // NOLINT
#define MYNTEYE_DISPARITY_PROCESSOR_H_
#ifndef MYNTEYE_API_PROCESSOR_DISPARITY_PROCESSOR_H_
#define MYNTEYE_API_PROCESSOR_DISPARITY_PROCESSOR_H_
#pragma once
#include <string>
#include "api/processor/processor.h"
#include "mynteye/api/processor.h"
namespace cv {
@@ -47,4 +47,4 @@ class DisparityProcessor : public Processor {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_DISPARITY_PROCESSOR_H_ NOLINT
#endif // MYNTEYE_API_PROCESSOR_DISPARITY_PROCESSOR_H_

View File

@@ -11,12 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/processor/points_processor.h"
#include <opencv2/calib3d/calib3d.hpp>
#include "mynteye/api/processor/points_processor.h"
#include <utility>
#include <opencv2/calib3d/calib3d.hpp>
#include "mynteye/logger.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,15 +11,15 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_POINTS_PROCESSOR_H_ // NOLINT
#define MYNTEYE_POINTS_PROCESSOR_H_
#ifndef MYNTEYE_API_PROCESSOR_POINTS_PROCESSOR_H_
#define MYNTEYE_API_PROCESSOR_POINTS_PROCESSOR_H_
#pragma once
#include <opencv2/core/core.hpp>
#include <string>
#include "api/processor/processor.h"
#include <opencv2/core/core.hpp>
#include "mynteye/api/processor.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -43,4 +43,4 @@ class PointsProcessor : public Processor {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_POINTS_PROCESSOR_H_ NOLINT
#endif // MYNTEYE_API_PROCESSOR_POINTS_PROCESSOR_H_

View File

@@ -11,16 +11,15 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/processor/rectify_processor.h"
#include "mynteye/api/processor/rectify_processor.h"
#include <utility>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <utility>
#include "mynteye/logger.h"
#include "device/device.h"
#include "mynteye/device/device.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,17 +11,17 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_RECTIFY_PROCESSOR_H_ // NOLINT
#define MYNTEYE_RECTIFY_PROCESSOR_H_
#ifndef MYNTEYE_API_PROCESSOR_RECTIFY_PROCESSOR_H_
#define MYNTEYE_API_PROCESSOR_RECTIFY_PROCESSOR_H_
#pragma once
#include <opencv2/core/core.hpp>
#include <memory>
#include <string>
#include "api/processor/processor.h"
#include <opencv2/core/core.hpp>
#include "mynteye/types.h"
#include "mynteye/api/processor.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -52,4 +52,4 @@ class RectifyProcessor : public Processor {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_RECTIFY_PROCESSOR_H_ NOLINT
#endif // MYNTEYE_API_PROCESSOR_RECTIFY_PROCESSOR_H_

View File

@@ -11,23 +11,22 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "api/synthetic.h"
#include "mynteye/api/synthetic.h"
#include <algorithm>
#include <functional>
#include <stdexcept>
#include "mynteye/logger.h"
#include "api/plugin.h"
#include "api/processor/depth_processor.h"
#include "api/processor/disparity_normalized_processor.h"
#include "api/processor/disparity_processor.h"
#include "api/processor/object.h"
#include "api/processor/points_processor.h"
#include "api/processor/processor.h"
#include "api/processor/rectify_processor.h"
#include "device/device.h"
#include "mynteye/api/object.h"
#include "mynteye/api/plugin.h"
#include "mynteye/api/processor.h"
#include "mynteye/api/processor/depth_processor.h"
#include "mynteye/api/processor/disparity_normalized_processor.h"
#include "mynteye/api/processor/disparity_processor.h"
#include "mynteye/api/processor/points_processor.h"
#include "mynteye/api/processor/rectify_processor.h"
#include "mynteye/device/device.h"
#define RECTIFY_PROC_PERIOD 0
#define DISPARITY_PROC_PERIOD 0

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_SYNTHETIC_H_ // NOLINT
#define MYNTEYE_SYNTHETIC_H_
#ifndef MYNTEYE_API_SYNTHETIC_H_
#define MYNTEYE_API_SYNTHETIC_H_
#pragma once
#include <map>
@@ -20,7 +20,7 @@
#include <string>
#include <vector>
#include "api/api.h"
#include "mynteye/api/api.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -169,4 +169,4 @@ bool Synthetic::DeactivateProcessor(bool childs) {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_SYNTHETIC_H_ NOLINT
#endif // MYNTEYE_API_SYNTHETIC_H_

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_ASYNC_CALLBACK_H_ // NOLINT
#define MYNTEYE_INTERNAL_ASYNC_CALLBACK_H_
#ifndef MYNTEYE_DEVICE_ASYNC_CALLBACK_H_
#define MYNTEYE_DEVICE_ASYNC_CALLBACK_H_
#pragma once
#include <condition_variable>
@@ -57,6 +57,6 @@ class AsyncCallback {
MYNTEYE_END_NAMESPACE
#include "internal/async_callback_impl.h"
#include "mynteye/device/async_callback_impl.h"
#endif // MYNTEYE_INTERNAL_ASYNC_CALLBACK_H_ NOLINT
#endif // MYNTEYE_DEVICE_ASYNC_CALLBACK_H_

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_ASYNC_CALLBACK_IMPL_H_ // NOLINT
#define MYNTEYE_INTERNAL_ASYNC_CALLBACK_IMPL_H_
#ifndef MYNTEYE_DEVICE_ASYNC_CALLBACK_IMPL_H_
#define MYNTEYE_DEVICE_ASYNC_CALLBACK_IMPL_H_
#pragma once
#include <string>
@@ -89,4 +89,4 @@ void AsyncCallback<Data>::Run() {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_ASYNC_CALLBACK_IMPL_H_ NOLINT
#endif // MYNTEYE_DEVICE_ASYNC_CALLBACK_IMPL_H_

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/channels.h"
#include "mynteye/device/channels.h"
#include <bitset>
#include <chrono>
@@ -21,9 +21,8 @@
#include <stdexcept>
#include "mynteye/logger.h"
#include "internal/strings.h"
#include "internal/times.h"
#include "mynteye/util/strings.h"
#include "mynteye/util/times.h"
#define IMU_TRACK_PERIOD 25 // ms

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_CHANNELS_H_ // NOLINT
#define MYNTEYE_INTERNAL_CHANNELS_H_
#ifndef MYNTEYE_DEVICE_CHANNELS_H_
#define MYNTEYE_DEVICE_CHANNELS_H_
#pragma once
#include <map>
@@ -21,9 +21,8 @@
#include "mynteye/mynteye.h"
#include "mynteye/types.h"
#include "internal/types.h"
#include "uvc/uvc.h"
#include "mynteye/device/types.h"
#include "mynteye/uvc/uvc.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -154,4 +153,4 @@ class MYNTEYE_API Channels {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_CHANNELS_H_ NOLINT
#endif // MYNTEYE_DEVICE_CHANNELS_H_

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/config.h"
#include "mynteye/device/config.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_CONFIG_H_ // NOLINT
#define MYNTEYE_INTERNAL_CONFIG_H_
#ifndef MYNTEYE_DEVICE_CONFIG_H_
#define MYNTEYE_DEVICE_CONFIG_H_
#pragma once
#include <map>
@@ -39,4 +39,4 @@ extern const std::map<Model, std::map<Capabilities, StreamRequests>>
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_CONFIG_H_ NOLINT
#endif // MYNTEYE_DEVICE_CONFIG_H_

View File

@@ -11,12 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "device/context.h"
#include "mynteye/device/context.h"
#include "mynteye/logger.h"
#include "device/device.h"
#include "uvc/uvc.h"
#include "mynteye/device/device.h"
#include "mynteye/uvc/uvc.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "device/device.h"
#include "mynteye/device/device.h"
#include <algorithm>
#include <iterator>
@@ -19,17 +19,16 @@
#include <utility>
#include "mynteye/logger.h"
#include "device/device_s.h"
#include "internal/async_callback.h"
#include "internal/channels.h"
#include "internal/config.h"
#include "internal/motions.h"
#include "internal/streams.h"
#include "internal/strings.h"
#include "internal/times.h"
#include "internal/types.h"
#include "uvc/uvc.h"
#include "mynteye/device/async_callback.h"
#include "mynteye/device/channels.h"
#include "mynteye/device/config.h"
#include "mynteye/device/device_s.h"
#include "mynteye/device/motions.h"
#include "mynteye/device/streams.h"
#include "mynteye/device/types.h"
#include "mynteye/util/strings.h"
#include "mynteye/util/times.h"
#include "mynteye/uvc/uvc.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "device/device_s.h"
#include "mynteye/device/device_s.h"
#include "mynteye/logger.h"
#include "internal/motions.h"
#include "mynteye/device/motions.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,14 +11,14 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_DEVICE_S_H_ // NOLINT
#define MYNTEYE_DEVICE_S_H_
#ifndef MYNTEYE_DEVICE_DEVICE_S_H_
#define MYNTEYE_DEVICE_DEVICE_S_H_
#pragma once
#include <memory>
#include <vector>
#include "device/device.h"
#include "mynteye/device/device.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -34,4 +34,4 @@ class StandardDevice : public Device {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_DEVICE_S_H_ NOLINT
#endif // MYNTEYE_DEVICE_DEVICE_S_H_

View File

@@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/motions.h"
#include "mynteye/device/motions.h"
#include "mynteye/logger.h"
#include "internal/channels.h"
#include "mynteye/device/channels.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,16 +11,16 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_MOTIONS_H_ // NOLINT
#define MYNTEYE_INTERNAL_MOTIONS_H_
#ifndef MYNTEYE_DEVICE_MOTIONS_H_
#define MYNTEYE_DEVICE_MOTIONS_H_
#pragma once
#include <memory>
#include <mutex>
#include <vector>
#include "mynteye/callbacks.h"
#include "mynteye/mynteye.h"
#include "mynteye/device/callbacks.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -61,4 +61,4 @@ class Motions {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_MOTIONS_H_ NOLINT
#endif // MYNTEYE_DEVICE_MOTIONS_H_

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/streams.h"
#include "mynteye/device/streams.h"
#include <algorithm>
#include <chrono>
@@ -19,8 +19,7 @@
#include <stdexcept>
#include "mynteye/logger.h"
#include "internal/types.h"
#include "mynteye/device/types.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_STREAMS_H_ // NOLINT
#define MYNTEYE_INTERNAL_STREAMS_H_
#ifndef MYNTEYE_DEVICE_STREAMS_H_
#define MYNTEYE_DEVICE_STREAMS_H_
#pragma once
#include <condition_variable>
@@ -21,9 +21,9 @@
#include <mutex>
#include <vector>
#include "mynteye/callbacks.h"
#include "mynteye/mynteye.h"
#include "mynteye/types.h"
#include "mynteye/device/callbacks.h"
MYNTEYE_BEGIN_NAMESPACE
@@ -90,4 +90,4 @@ class Streams {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_STREAMS_H_ NOLINT
#endif // MYNTEYE_DEVICE_STREAMS_H_

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/types.h"
#include "mynteye/device/types.h"
#include <algorithm>
#include <iomanip>

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_INTERNAL_TYPES_H_ // NOLINT
#define MYNTEYE_INTERNAL_TYPES_H_
#ifndef MYNTEYE_DEVICE_TYPES_H_
#define MYNTEYE_DEVICE_TYPES_H_
#pragma once
#include <cstdint>
@@ -293,4 +293,4 @@ struct ImuResPacket {
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_INTERNAL_TYPES_H_ NOLINT
#endif // MYNTEYE_DEVICE_TYPES_H_

View File

@@ -11,12 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "mynteye/utils.h"
#include "mynteye/device/utils.h"
#include "mynteye/logger.h"
#include "device/context.h"
#include "device/device.h"
#include "mynteye/device/context.h"
#include "mynteye/device/device.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/files.h"
#include "mynteye/util/files.h"
#include "mynteye/logger.h"
@@ -22,7 +22,7 @@
#include <sys/stat.h>
#endif
#include "internal/strings.h"
#include "mynteye/util/strings.h"
MYNTEYE_BEGIN_NAMESPACE

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "internal/strings.h"
#include "mynteye/util/strings.h"
#include <algorithm>
#include <cctype>

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "uvc/uvc.h" // NOLINT
#include "mynteye/uvc/uvc.h"
#include <libuvc/libuvc.h>

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "uvc/uvc.h" // NOLINT
#include "mynteye/uvc/uvc.h"
#include <dirent.h>
#include <errno.h>

View File

@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "uvc/uvc.h" // NOLINT
#include "mynteye/uvc/uvc.h"
#include <windows.h>
#include <usbioctl.h>

View File

@@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MYNTEYE_UVC_H_ // NOLINT
#define MYNTEYE_UVC_H_
#ifndef MYNTEYE_UVC_UVC_H_
#define MYNTEYE_UVC_UVC_H_
#pragma once
#include <functional>
@@ -106,4 +106,4 @@ MYNTEYE_API void stop_streaming(device &device); // NOL
MYNTEYE_END_NAMESPACE
#endif // MYNTEYE_UVC_H_ NOLINT
#endif // MYNTEYE_UVC_UVC_H_