MYNT-EYE-S-SDK/samples/tutorials/util/cv_painter.h

54 lines
1.6 KiB
C
Raw Normal View History

2018-05-11 04:56:21 +03:00
// 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_TUTORIALS_CV_PAINTER_H_ // NOLINT
#define MYNTEYE_TUTORIALS_CV_PAINTER_H_
#pragma once
#include <string>
2018-10-27 16:51:44 +03:00
#include <opencv2/core/core.hpp>
2018-05-11 04:56:21 +03:00
#include "mynteye/types.h"
class CVPainter {
public:
typedef enum Gravity {
TOP_LEFT,
TOP_RIGHT,
BOTTOM_LEFT,
BOTTOM_RIGHT
} gravity_t;
2018-05-13 05:34:03 +03:00
explicit CVPainter(std::int32_t frame_rate = 0);
2018-05-11 04:56:21 +03:00
~CVPainter();
cv::Rect DrawSize(const cv::Mat &img, const gravity_t &gravity = TOP_LEFT);
2018-05-11 05:14:58 +03:00
cv::Rect DrawImgData(
const cv::Mat &img, const mynteye::ImgData &data,
const gravity_t &gravity = TOP_LEFT);
2018-05-11 04:56:21 +03:00
cv::Rect DrawImuData(
const cv::Mat &img, const mynteye::ImuData &data,
const gravity_t &gravity = TOP_RIGHT);
cv::Rect DrawText(
const cv::Mat &img, const std::string &text,
const gravity_t &gravity = TOP_LEFT, const int &margin = 5,
const int &offset_x = 0, const int &offset_y = 0);
2018-05-13 05:34:03 +03:00
private:
std::int32_t frame_rate_;
2018-05-11 04:56:21 +03:00
};
#endif // MYNTEYE_TUTORIALS_CV_PAINTER_H_ NOLINT