-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVisionRGBApp.hpp
66 lines (54 loc) · 1.29 KB
/
VisionRGBApp.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//////////////////////////////////////////////////
// VisionRGBApp.h
// Declaration of the VisionRGBApp class
// Note: we intentionally don't use the "C" prefix for class names here
// because we're mostly outside of Win32++ code and we'd potentially
// be creating name conflicts with existing Win32++ class names.
#ifndef DXAPP_H
#define DXAPP_H
#include "MainFrm.hpp"
#include "Wrappers.hpp"
#include <queue>
// RGBEasy SDK
#include <rgb.h>
#include <rgbapi.h>
#include <rgberror.h>
#define NUM_BUFFERS 2
struct CapturedFrame
{
D3D9Surface* pSurface;
unsigned long newWidth;
unsigned long newHeight;
};
enum SignalState
{
active,
inactive,
invalid
};
class VisionRGBApp : public CWinApp
{
public:
VisionRGBApp();
virtual ~VisionRGBApp() {}
virtual BOOL InitInstance();
virtual int MessageLoop();
CMainFrame& GetMainFrame() { return m_frame; }
void recvSample(PRGBFRAMEDATA pFrameData);
void drawSample();
bool startCapture(int width, int height, PixelFmt pixFormat);
void stopCapture();
bool bCapturing;
D3D9Surface* pSurfaces[NUM_BUFFERS];
unsigned long buffers;
std::queue<CapturedFrame> qFrames;
SignalState signal;
Mutex mutex;
PixelFmt format;
unsigned long width;
unsigned long height;
private:
CMainFrame m_frame;
D3D9Context m_d3D9;
};
#endif