14 #ifndef MYNTEYE_DEVICE_IMAGE_H_ 15 #define MYNTEYE_DEVICE_IMAGE_H_ 25 #include <opencv2/core/core.hpp> 28 #include "mynteyed/device/types.h" 29 #include "mynteyed/stubs/global.h" 31 MYNTEYE_BEGIN_NAMESPACE
35 using pointer = std::shared_ptr<Image>;
37 using data_t = std::vector<std::uint8_t>;
38 using data_ptr_t = std::shared_ptr<data_t>;
41 Image(
const ImageType& type,
const ImageFormat& format,
42 int width,
int height,
bool is_buffer);
47 static pointer Create(
const ImageType& type,
const ImageFormat& format,
48 int width,
int height,
bool is_buffer);
50 ImageType type()
const {
54 ImageFormat format()
const {
66 std::size_t size()
const {
67 return width_ * height_;
70 bool is_buffer()
const {
74 int frame_id()
const {
78 void set_frame_id(
int frame_id) {
82 bool is_dual()
const {
86 void set_is_dual(
bool is_dual) {
90 std::uint8_t* data() {
94 const std::uint8_t* data()
const {
98 std::size_t data_size()
const {
102 std::size_t valid_size()
const {
107 void set_valid_size(std::size_t valid_size);
109 virtual pointer To(
const ImageFormat& format) = 0;
115 pointer Clone()
const;
116 pointer Shadow(
const ImageType& type)
const;
127 ImageFormat raw_format_;
136 std::size_t valid_size_;
138 MYNTEYE_DISABLE_COPY(
Image)
139 MYNTEYE_DISABLE_MOVE(
Image)
143 public std::enable_shared_from_this<ImageColor> {
145 using pointer = std::shared_ptr<ImageColor>;
148 ImageColor(
const ImageType& type,
const ImageFormat& format,
149 int width,
int height,
bool is_buffer);
154 static pointer Create(
const ImageFormat& format,
int width,
int height,
156 return Create(ImageType::IMAGE_LEFT_COLOR, format, width, height,
160 static pointer Create(
const ImageType& type,
const ImageFormat& format,
161 int width,
int height,
bool is_buffer);
163 Image::pointer To(
const ImageFormat& format)
override;
171 public std::enable_shared_from_this<ImageDepth> {
173 using pointer = std::shared_ptr<ImageDepth>;
176 ImageDepth(
const ImageFormat& format,
int width,
int height,
bool is_buffer);
181 static pointer Create(
const ImageFormat& format,
int width,
int height,
183 return pointer(
new ImageDepth(format, width, height, is_buffer));
186 Image::pointer To(
const ImageFormat& format)
override;
193 MYNTEYE_END_NAMESPACE
195 #endif // MYNTEYE_DEVICE_IMAGE_H_