libalvision  1.14.5
alvision/alvisiondefinitions.h
Go to the documentation of this file.
00001 
00006 #pragma once
00007 #ifndef _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
00008 #define _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
00009 
00014 namespace AL
00015 {
00016   #define TORAD  3.14f/180.0f
00017 
00021   const int kOV7670  = 1;
00022   const int kMT9M114 = 2;
00023 
00027   const int kTopCamera = 0;
00028   const int kBottomCamera = 1;
00029 
00033   const float kApertureH_OV7670  = 47.8f;
00034   const float kApertureV_OV7670  = 36.8f;
00035   const float kApertureH_MT9M114 = 60.9f;
00036   const float kApertureV_MT9M114 = 47.6f;
00037 
00041   const int k960p  = 3;  //1280*960
00042   const int k4VGA  = 3;  //1280*960
00043   const int kVGA   = 2;  // 640*480
00044   const int kQVGA  = 1;  // 320*240
00045   const int kQQVGA = 0;  // 160*120
00046 
00050   const int kYuvColorSpace = 0;
00051   const int kyUvColorSpace = 1;
00052   const int kyuVColorSpace = 2;
00053   const int kRgbColorSpace = 3;
00054   const int krGbColorSpace = 4;
00055   const int krgBColorSpace = 5;
00056   const int kHsyColorSpace = 6;
00057   const int khSyColorSpace = 7;
00058   const int khsYColorSpace = 8;
00059   const int kYUV422InterlacedColorSpace = 9; // deprecated
00060   const int kYUV422ColorSpace = 9;
00061   const int kYUVColorSpace = 10;
00062   const int kRGBColorSpace = 11;
00063   const int kHSYColorSpace = 12;
00064   const int kBGRColorSpace = 13;     // for opencv ease of use
00065   const int kYYCbCrColorSpace = 14;  // for tiff io implementation
00066   const int kH2RGBColorSpace = 15;   // H from HSY to RGB in fake colors
00067   const int kHSMixedColorSpace = 16; // HS and (H +S)/2
00068   const int kDepthColorSpace = 17;
00069   const int kARGBColorSpace = 18;
00070 
00074   const int kCameraBrightnessID       = 0;
00075   const int kCameraContrastID         = 1;
00076   const int kCameraSaturationID       = 2;
00077   const int kCameraHueID              = 3;
00078   const int kCameraRedChromaID        = 4;
00079   const int kCameraBlueChromaID       = 5;
00080   const int kCameraGainID             = 6;
00081   const int kCameraHFlipID            = 7;
00082   const int kCameraVFlipID            = 8;
00083   const int kCameraLensXID            = 9;
00084   const int kCameraLensYID            = 10;
00085   const int kCameraAutoExpositionID   = 11;
00086   const int kCameraAutoWhiteBalanceID = 12;
00087   const int kCameraAutoGainID         = 13;
00088   const int kCameraResolutionID       = 14;
00089   const int kCameraFrameRateID        = 15;
00090   const int kCameraBufferSizeID       = 16;
00091   const int kCameraExposureID         = 17;
00092   const int kCameraSelectID           = 18;
00093   const int kCameraSetDefaultParamsID = 19;
00094   const int kCameraColorSpaceID       = 20;
00095   const int kCameraExposureCorrectionID = 21;
00096   const int kCameraExposureAlgorithmID = 22;
00097   const int kCameraAecAlgorithmID     = kCameraExposureAlgorithmID; // deprecated
00098   const int kCameraFastSwitchID       = 23;
00099   const int kCameraSharpnessID        = 24;
00100   const int kCameraAwbGreenGainID     = 25;
00101   const int kCameraAblcID             = 26;
00102   const int kCameraAblcTargetID       = 27;
00103   const int kCameraAblcStableRangeID  = 28;
00104   const int kCameraBlcBlueID          = 29;
00105   const int kCameraBlcRedID           = 30;
00106   const int kCameraBlcGbID            = 31;
00107   const int kCameraBlcGrID            = 32;
00108   const int kCameraWhiteBalanceID     = 33;
00109   const int kCameraBacklightCompensationID = 34;
00110 
00111   bool isResolutionValid(const int resIndex);
00112   void setSizeFromResolution(const int resIndex, int& outWidth, int& outHeight);
00113   int getResolutionFromSize(const int width, const int height);
00114   bool isColorSpaceValid(const int colorspace);
00115   int getNumLayersInColorSpace(const int colorSpace);
00116   inline float convertAngleValToNormalizedImgVal(const float& radValue,
00117                                                  const float& imageRadMin,
00118                                                  const float& imageRadMax)
00119     { return ( radValue / (imageRadMax-imageRadMin)); }
00120 
00121   inline float convertAnglePosToNormalizedImgPos(const float& radPosition,
00122                                                  const float& imageRadMin,
00123                                                  const float& imageRadMax)
00124     { return ((radPosition-imageRadMin) / (imageRadMax-imageRadMin)); }
00125 } // namespace AL
00126 
00127 
00128 #endif  // _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
 All Classes Namespaces Files Functions Variables