libalvision  1.14
 All Classes Namespaces Files Functions Variables Macros Pages
alvisiondefinitions.h
Go to the documentation of this file.
1 
6 #pragma once
7 #ifndef _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
8 #define _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
9 
14 namespace AL
15 {
16  #define TORAD 3.14f/180.0f
17 
21  const int kOV7670 = 1;
22  const int kMT9M114 = 2;
23 
27  const int kTopCamera = 0;
28  const int kBottomCamera = 1;
29 
33  const float kApertureH_OV7670 = 47.8f;
34  const float kApertureV_OV7670 = 36.8f;
35  const float kApertureH_MT9M114 = 60.9f;
36  const float kApertureV_MT9M114 = 47.6f;
37 
41  const int k960p = 3; //1280*960
42  const int k4VGA = 3; //1280*960
43  const int kVGA = 2; // 640*480
44  const int kQVGA = 1; // 320*240
45  const int kQQVGA = 0; // 160*120
46 
50  const int kYuvColorSpace = 0;
51  const int kyUvColorSpace = 1;
52  const int kyuVColorSpace = 2;
53  const int kRgbColorSpace = 3;
54  const int krGbColorSpace = 4;
55  const int krgBColorSpace = 5;
56  const int kHsyColorSpace = 6;
57  const int khSyColorSpace = 7;
58  const int khsYColorSpace = 8;
59  const int kYUV422InterlacedColorSpace = 9; // deprecated
60  const int kYUV422ColorSpace = 9;
61  const int kYUVColorSpace = 10;
62  const int kRGBColorSpace = 11;
63  const int kHSYColorSpace = 12;
64  const int kBGRColorSpace = 13; // for opencv ease of use
65  const int kYYCbCrColorSpace = 14; // for tiff io implementation
66  const int kH2RGBColorSpace = 15; // H from HSY to RGB in fake colors
67  const int kHSMixedColorSpace = 16; // HS and (H +S)/2
68  const int kDepthColorSpace = 17;
69  const int kARGBColorSpace = 18;
70 
74  const int kCameraBrightnessID = 0;
75  const int kCameraContrastID = 1;
76  const int kCameraSaturationID = 2;
77  const int kCameraHueID = 3;
78  const int kCameraRedChromaID = 4;
79  const int kCameraBlueChromaID = 5;
80  const int kCameraGainID = 6;
81  const int kCameraHFlipID = 7;
82  const int kCameraVFlipID = 8;
83  const int kCameraLensXID = 9;
84  const int kCameraLensYID = 10;
85  const int kCameraAutoExpositionID = 11;
86  const int kCameraAutoWhiteBalanceID = 12;
87  const int kCameraAutoGainID = 13;
88  const int kCameraResolutionID = 14;
89  const int kCameraFrameRateID = 15;
90  const int kCameraBufferSizeID = 16;
91  const int kCameraExposureID = 17;
92  const int kCameraSelectID = 18;
93  const int kCameraSetDefaultParamsID = 19;
94  const int kCameraColorSpaceID = 20;
95  const int kCameraExposureCorrectionID = 21;
96  const int kCameraExposureAlgorithmID = 22;
97  const int kCameraAecAlgorithmID = kCameraExposureAlgorithmID; // deprecated
98  const int kCameraFastSwitchID = 23;
99  const int kCameraSharpnessID = 24;
100  const int kCameraAwbGreenGainID = 25;
101  const int kCameraAblcID = 26;
102  const int kCameraAblcTargetID = 27;
103  const int kCameraAblcStableRangeID = 28;
104  const int kCameraBlcBlueID = 29;
105  const int kCameraBlcRedID = 30;
106  const int kCameraBlcGbID = 31;
107  const int kCameraBlcGrID = 32;
108  const int kCameraWhiteBalanceID = 33;
109  const int kCameraBacklightCompensationID = 34;
110 
111  bool isResolutionValid(const int resIndex);
112  void setSizeFromResolution(const int resIndex, int& outWidth, int& outHeight);
113  int getResolutionFromSize(const int width, const int height);
114  bool isColorSpaceValid(const int colorspace);
115  int getNumLayersInColorSpace(const int colorSpace);
116  inline float convertAngleValToNormalizedImgVal(const float& radValue,
117  const float& imageRadMin,
118  const float& imageRadMax)
119  { return ( radValue / (imageRadMax-imageRadMin)); }
120 
121  inline float convertAnglePosToNormalizedImgPos(const float& radPosition,
122  const float& imageRadMin,
123  const float& imageRadMax)
124  { return ((radPosition-imageRadMin) / (imageRadMax-imageRadMin)); }
125 } // namespace AL
126 
127 
128 #endif // _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_