VisPro  1.0
Project of Visualisierung 2
BufferView.h
Go to the documentation of this file.
1 #pragma once
2 
7 // Standard
8 #include <iostream>
9 #include <fstream>
10 #include <sstream>
11 #include <stdio.h>
12 #include <stdlib.h>
13 
14 #include "StringHelpers.hpp"
15 #include <opencv2\opencv.hpp>
16 #include <opencv2\imgproc\imgproc.hpp>
17 #include <opencv2\highgui\highgui.hpp>
18 #include <opencv2\features2d\features2d.hpp>
19 #include <opencv2\nonfree\features2d.hpp>
20 #include <opencv2\highgui\highgui.hpp>
21 #include <opencv2\nonfree\nonfree.hpp>
22 
23 #include <Windows.h>
24 #include <opencv2\highgui\highgui_c.h>
25 
26 #include <glew.h>
27 
30 enum Channels {RGB, RG_B, R_G_B, R, G, B};
31 
36 class BufferView{
37 
38 protected:
39  std::string m_bufferWindowName = "buffer view";
40  std::vector<std::tuple<HWND, std::string>> m_bufferWindowHandles;
41 
42  int m_width = 1024;
43  int m_height = 800;
44 
45  Channels m_channels;
46 
47 public:
54  BufferView(int width, int height, const std::string &windowName, Channels channels = Channels::RGB) : m_width(width), m_height(height), m_bufferWindowName(windowName), m_channels(channels)
55  {
56  m_bufferWindowName = "buffer view: " + windowName;
57  }
58 
63  virtual bool ShowBufferView(bool show);
64 
68  virtual bool UpdateBufferView();
69 
70 protected:
74  virtual cv::Mat ReadBufferToMatrix() = 0;
75 
80  virtual std::vector<std::tuple<cv::Mat, std::string>> SplitMatrixToChannels(const cv::Mat &rgbMat);
81 
86  virtual std::string GetBufferWindowChannelName(const std::string &channelName);
87 
88 };
virtual bool ShowBufferView(bool show)
Definition: BufferView.cpp:3
Channels
Definition: BufferView.h:30
virtual cv::Mat ReadBufferToMatrix()=0
virtual bool UpdateBufferView()
Definition: BufferView.cpp:40
virtual std::string GetBufferWindowChannelName(const std::string &channelName)
Definition: BufferView.cpp:184
virtual std::vector< std::tuple< cv::Mat, std::string > > SplitMatrixToChannels(const cv::Mat &rgbMat)
Definition: BufferView.cpp:88
BufferView(int width, int height, const std::string &windowName, Channels channels=Channels::RGB)
Definition: BufferView.h:54
Definition: BufferView.h:36