OROCHI
 
Loading...
Searching...
No Matches
GxUnitHudWebCamera.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12#if defined(_WINDOWS)
13
14GX_UTILITY_NAMESPACE_BEGIN()
15
16//===========================================================================
18//===========================================================================
19class GxUnitHudWebCamera : public GxUnitHudImageRender
20{
21 //-------------------------------------------------------------
23 //-------------------------------------------------------------
25public:
26 // RTTI定義
27 GX_RTTI_CLASS(GxUnitHudWebCamera, GxUnitHudImageRender)
28 // ClassBase継承クラス用禁止宣言
29 GX_PROHIBIT_CLASS_BASE(GxUnitHudWebCamera)
30
31
32 class GxReceiveThread : public GxThread
33 {
34 //-------------------------------------------------------------
36 //-------------------------------------------------------------
38 public:
39 GX_RTTI_ABSTRACT_CLASS(GxReceiveThread, GxThread)
40 // GxClassBase継承クラス用禁止宣言
41 GX_PROHIBIT_CLASS_BASE(GxReceiveThread)
42
43
44 //-----------------------------------------------------------
46 //-----------------------------------------------------------
48 public:
50 GxReceiveThread(void) {}
51
53 //-----------------------------------------------------------
55 //-----------------------------------------------------------
57 public:
59 void threadMain(void* pArgument) override;
60
62 };
63
65 //-------------------------------------------------------------
67 //-------------------------------------------------------------
69public:
71 GxUnitHudWebCamera(void);
73 ~GxUnitHudWebCamera(void) override {}
75 void cleanup(void) override;
76
78 //-------------------------------------------------------------
80 //-------------------------------------------------------------
82public:
84 b32 setup(void) override;
86 void asyncUpdate(void) override;
88 void sequentialUpdate(void) override;
90 static void getDeviceIndexes(GxArray& list, u32 maxCount = 16);
91private:
93 void updateSub(void);
95 void updateRow(u32 index);
96
98 //-------------------------------------------------------------
100 //-------------------------------------------------------------
102public:
104 constexpr s32 getDeviceIndex(void) const { return _deviceIndex; }
106 constexpr void setDeviceIndex(s32 index) { _deviceIndex = index; }
108 GX_FORCE_INLINE b32 isAutoSize(void) const { return _isAutoSize; }
110 GX_FORCE_INLINE void setAutoSize(b32 enable) { _isAutoSize = enable; }
112 GX_FORCE_INLINE b32 isUseWorkerThread(void) const { return _isUseWorkerThread; }
114 GX_FORCE_INLINE void setUseWorkerThread(b32 enable) { _isUseWorkerThread = enable; }
116 constexpr u32 getUseWorkerThreadCount(void) const { return _useWorkerThreadCount; }
118 GX_FORCE_INLINE void setUseWorkerThreadCount(u32 count) { _useWorkerThreadCount = GxMath::getMax(0u, GxMath::getMin(count, getGxSysMain()->getSequentialThreadManager()->getMaxThread())); }
119
121 //-------------------------------------------------------------
123 //-------------------------------------------------------------
125private:
126 cv::VideoCapture _capture;
127 cv::Mat _frames[RENDER::RENDER_BUFFER_COUNT_MAX];
129 s32 _deviceIndex;
130 s32 _deviceIndexBefore;
131 GxSize _beforeSize;
132 b32 _isAutoSize;
133
134 b32 _isUseWorkerThread;
135 u32 _useWorkerThreadCount;
136 u8* _pDst;
137 u8* _pSrc;
138 u32 _elementSize;
139 u32 _rowPitch;
140 u32 _heightStep;
141
142 GxReceiveThread* _pReceiveThread;
143 b32 _isStopRequestThread;
144 u32 _writeIndex;
145 u32 _readIndex;
146
148};
149
150GX_UTILITY_NAMESPACE_END()
151
152#endif //_WINDOWS
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
@ RENDER_BUFFER_COUNT_MAX
トリプルバッファリング
Definition GxRender.h:20
配列クラス
Definition GxArray.h:18
static GX_FORCE_INLINE T getMax(const T value0, const T value1)
大きいほうを取得
Definition GxMath.h:174
static GX_FORCE_INLINE T getMin(const T value0, const T value1)
小さいほうを取得
Definition GxMath.h:172
スレッドクラス
Definition GxThread.h:177
virtual void threadMain(void *pArgument)=0
メインループ
HUD描画画像ユニット
Definition GxUnitHudImageRender.h:18
サイズ
Definition GxStruct.h:730
32bitブーリアン
Definition GxDefine.h:173