~sushanth317/+junk/qtcam

« back to all changes in this revision

Viewing changes to qtcam/src/seecam_81.h

  • Committer: Sushanth
  • Date: 2022-11-24 15:56:47 UTC
  • Revision ID: sushanth.s@e-consystems.com-20221124155647-5jx2tzazwlob7vmd
Added Support for See3cam_27CUG

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SEECAM_81_H
 
2
#define SEECAM_81_H
 
3
// Added By Sankari : 17 Dec 2016
 
4
 
 
5
#include <QObject>
 
6
#include <QtConcurrentRun>
 
7
#include "uvccamera.h"
 
8
 
 
9
/* SEE3CAM_81 */
 
10
#define CMD_TIMEOUT_81CAM 3000
 
11
#define CAMERA_CONTROL_81                       0x7C
 
12
#define SETSPECIALEFFECT_81                     0x09
 
13
#define GETSPECIALEFFECT_81                     0x08
 
14
#define GETFLIPMIRRORSTATUS_81                  0x0A
 
15
#define SETFLIPMIRRORSTATUS_81                  0x0B
 
16
#define GET_AF_ROI_MODE_81                      0x13
 
17
#define SET_AF_ROI_MODE_81                      0x14
 
18
#define SET_AF_ROI_MODE_COORDINATES_81          0x16
 
19
#define SET_FOCUS_MODE_81                       0x02
 
20
#define GET_FOCUS_POSITION_81                   0x03
 
21
#define SET_FOCUS_POSITION_81                   0x04
 
22
#define GPIO_OPERATION_81                       0x20
 
23
#define GPIO_GET_LEVEL_81                       0x01
 
24
#define GPIO_SET_LEVEL_81                       0x02
 
25
#define GET_INPUT_GPIO_LEVEL_81                 0x04
 
26
#define SET_TO_DEFAULT_CAM81                    0x0C
 
27
 
 
28
#define GETSTROBE_STATUS                        0x06
 
29
#define SETSTROBE_STATUS                        0x07
 
30
#define GETFOCUS_STATUS                         0x05
 
31
 
 
32
#define GET_FAIL_CAM81                          0x01
 
33
#define GET_SUCCESS_CAM81                       0x00
 
34
 
 
35
class See3CAM_81: public QObject {
 
36
    Q_OBJECT
 
37
 
 
38
public:    
 
39
    uvccamera uvc;        
 
40
 
 
41
    See3CAM_81();
 
42
    ~See3CAM_81();
 
43
 
 
44
    enum flipMirrorControls{
 
45
        FLIP_OFF_MIRROR_OFF_81 = 0x00,
 
46
        FLIP_ON_MIRROR_OFF_81  = 0x01,
 
47
        FLIP_OFF_MIRROR_ON_81  = 0x02,
 
48
        FLIP_ON_MIRROR_ON_81   = 0x03
 
49
    };
 
50
    Q_ENUMS(flipMirrorControls)
 
51
 
 
52
    enum specialEffects {
 
53
        EFFECT_NORMAL = 0x01,
 
54
        EFFECT_GRAYSCALE = 0x02
 
55
    };
 
56
    Q_ENUMS(specialEffects)
 
57
 
 
58
    enum strobeValues{
 
59
        STROBE_OFF_81 = 0x00,
 
60
        STROBE_FLASH_VS_81 = 0x01,        
 
61
        STROBE_TORCH_81 = 0x03
 
62
    };
 
63
    Q_ENUMS(strobeValues)
 
64
 
 
65
    enum focusModes{
 
66
        CONTINUOUS_FOCUS_81 = 0x01,
 
67
        MANUAL_FOCUS_81 = 0x02,
 
68
        SINGLETRIGGER_FOCUS_81 = 0x03
 
69
    };
 
70
    Q_ENUMS(focusModes)
 
71
 
 
72
    enum focusModeStatus{
 
73
        CAM_FOCUS_FAILED = 0x00,
 
74
        CAM_FOCUS_SUCCESS = 0x01,
 
75
        CAM_FOCUS_BUSY = 0x02
 
76
    };
 
77
    Q_ENUMS(focusModeStatus)
 
78
 
 
79
    enum gpioLevel{
 
80
        GPIO_LOW_81 = 0x00,
 
81
        GPIO_HIGH_81 = 0x01
 
82
    };
 
83
    Q_ENUMS(gpioLevel)
 
84
 
 
85
    enum gpoUIIndex{
 
86
        GPIO_OUT8_INDEX = 0x00,
 
87
        GPIO_OUT9_INDEX = 0x01
 
88
    };
 
89
    Q_ENUMS(gpoUIIndex)
 
90
 
 
91
    enum gpiUIIndex{
 
92
        GPIO_IN3_INDEX = 0x00,
 
93
        GPIO_IN6_INDEX = 0x01
 
94
    };
 
95
    Q_ENUMS(gpiUIIndex)
 
96
 
 
97
    enum gpioControlsCam81{
 
98
        CAM81_IN3 = 0x01,
 
99
        CAM81_IN6 = 0x02,
 
100
        CAM81_OUT8 = 0x01,
 
101
        CAM81_OUT9 = 0x02,
 
102
        CAM81_OUT8_READVAL = 25,
 
103
        CAM81_OUT9_READVAL = 24,
 
104
        CAM81_IN3_READVAL = 21,
 
105
        CAM81_IN6_READVAL = 23,
 
106
    };
 
107
    Q_ENUMS(gpioControlsCam81)
 
108
 
 
109
    /**
 
110
     * @brief The camGpioValue enum are used to set status (High/Low) for the Gpio pin.
 
111
     */
 
112
    enum camGpioValue{
 
113
    High = 1,
 
114
    Low = 0
 
115
    };
 
116
    Q_ENUMS(camGpioValue)
 
117
 
 
118
    enum camFocusModesComboIndex{
 
119
        AUTO_MODE_INDEX = 0,
 
120
        MANUAL_MODE_INDEX,
 
121
        SINGLE_TRIGGER_MODE_INDEX
 
122
    };
 
123
    Q_ENUMS(camFocusModesComboIndex)
 
124
 
 
125
    // This is used to set RGB gain value
 
126
    enum camRGBcolor{
 
127
        Red = 0x12,
 
128
        Green = 0x10,
 
129
        Blue = 0x0E
 
130
    };
 
131
    Q_ENUMS(camRGBcolor)
 
132
 
 
133
    // This is used to get RGB gain value
 
134
    enum camRGBcolorGet{
 
135
        GetRed = 0x11,
 
136
        GetGreen = 0x0F,
 
137
        GetBlue = 0x0D
 
138
    };
 
139
 
 
140
    Q_ENUMS(camRGBcolorGet)
 
141
 
 
142
    enum camROIAfMode {
 
143
        AFCentered = 0x01,
 
144
        AFManual = 0x02,
 
145
        AFDisabled = 0x03
 
146
    };
 
147
    Q_ENUMS(camROIAfMode)
 
148
 
 
149
    // APIs running in background to avoid preview hang
 
150
    static bool setGpioLevelBackgrndFn(See3CAM_81 *see3cam81obj, gpioControlsCam81 gpioPin,camGpioValue gpioValue);
 
151
    static bool setFocusModeBackgrndFn(See3CAM_81 *see3cam81obj, uint focusMode);
 
152
    static bool getOutputGpioLevelBackgrndFn(See3CAM_81 *see3cam81obj, gpioControlsCam81 gpioPinNumber);
 
153
    static bool setWbValuesBackgrndFn(See3CAM_81 *see3cam81obj, camRGBcolor rgbColor, uint rgbValue);
 
154
 
 
155
signals:
 
156
    void effectModeValue(uint effectMode);
 
157
    void flipMirrorModeValue(uint flipMirrorMode);
 
158
    void strobeModeValue(uint strobeMode);
 
159
    void focusModeStatus(unsigned int focusModeStatus);
 
160
    void focusModeValue(unsigned int focusModeValue);
 
161
    void focusPostionValue(quint16 focusPositionValue);
 
162
    void gpioLevel(unsigned int level);
 
163
    void updateFrameToSkipfromCam81(uint stillSkip);
 
164
    void returnFromSetFocusMode(bool status);
 
165
    void whiteBalanceGainValue(uint rgbColor, uint whiteBalanceGain);
 
166
    void roiAfMode(uint roiMode, uint winSize);
 
167
    void roiAfModeSuccess();
 
168
    void roiAfModeFail();
 
169
 
 
170
public slots:
 
171
    bool setEffectMode(const See3CAM_81::specialEffects &specialEffect);
 
172
    bool getEffectMode();
 
173
 
 
174
    bool setFlipMirrorMode(bool flipMode, bool mirrorMode);
 
175
    bool getFlipMirrorMode();
 
176
 
 
177
    bool setStrobeMode(const See3CAM_81::strobeValues &strobeMode);
 
178
    bool getStrobeMode();
 
179
 
 
180
    bool getFocusMode();
 
181
 
 
182
    bool setFocusPosition(int focusPosition);
 
183
    bool getFocusPosition();
 
184
    bool getFocusStatus();
 
185
 
 
186
    bool setToDefault();    
 
187
 
 
188
    bool getInputGpioLevel(gpioControlsCam81 gpioPinNumber);
 
189
    void getOutputGpioLevel(gpioControlsCam81 gpioPinNumber);
 
190
 
 
191
    void setGpioLevel(gpioControlsCam81 gpioPin,camGpioValue gpioValue);    
 
192
    void setFocusMode(uint focusMode);
 
193
 
 
194
    void setStillSkipCount(QString stillResoln, QString videoResoln);
 
195
    void setStillSkipCountWhenFPSChange(bool fpsChange);
 
196
 
 
197
    void setWbValues(camRGBcolor rgbColor, uint rgbValue);
 
198
    bool getWbValues(camRGBcolor rgbColor);
 
199
 
 
200
    bool setROIAutoFoucs(camROIAfMode see3camAfROIMode, QString winSize);
 
201
    bool setROIAutoFoucsCoordinates(uint vidResolnWidth, uint vidResolnHeight, uint xCord, uint yCord);
 
202
    bool getAutoFocusROIModeAndWindowSize();
 
203
};
 
204
 
 
205
#endif // SEECAM_81_H