Now you can download a copy of these docs so you can use them offline! Download now
AxisCameraParams.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 #ifndef __AXIS_CAMERA_PARAMS_H__
8 #define __AXIS_CAMERA_PARAMS_H__
9 
10 #include "EnumCameraParameter.h"
11 #include "ErrorBase.h"
12 #include "IntCameraParameter.h"
13 #include "Task.h"
14 #include <vector>
15 
24 {
25 public:
26  typedef enum Exposure_t {kExposure_Automatic, kExposure_Hold, kExposure_FlickerFree50Hz, kExposure_FlickerFree60Hz} Exposure;
27  typedef enum WhiteBalance_t {kWhiteBalance_Automatic, kWhiteBalance_Hold, kWhiteBalance_FixedOutdoor1, kWhiteBalance_FixedOutdoor2, kWhiteBalance_FixedIndoor, kWhiteBalance_FixedFlourescent1, kWhiteBalance_FixedFlourescent2} WhiteBalance;
28  typedef enum Resolution_t {kResolution_640x480, kResolution_640x360, kResolution_320x240, kResolution_160x120} Resolution;
29  typedef enum Rotation_t {kRotation_0, kRotation_180} Rotation;
30 
31 protected:
32  AxisCameraParams(const char* ipAddress);
33  virtual ~AxisCameraParams();
34 
35 public:
36  // Mid-stream gets & writes
37  void WriteBrightness(int);
38  int GetBrightness();
39  void WriteWhiteBalance(WhiteBalance_t whiteBalance);
40  WhiteBalance_t GetWhiteBalance();
41  void WriteColorLevel(int);
42  int GetColorLevel();
43  void WriteExposureControl(Exposure_t);
44  Exposure_t GetExposureControl();
45  void WriteExposurePriority(int);
46  int GetExposurePriority();
47  void WriteMaxFPS(int);
48  int GetMaxFPS();
49 
50  // New-Stream gets & writes (i.e. require restart)
51  void WriteResolution(Resolution_t);
52  Resolution_t GetResolution();
53  void WriteCompression(int);
54  int GetCompression();
55  void WriteRotation(Rotation_t);
56  Rotation_t GetRotation();
57 
58 protected:
59  virtual void RestartCameraTask() = 0;
60  int CreateCameraSocket(const char *requestString);
61 
62  static int s_ParamTaskFunction(AxisCameraParams* thisPtr);
63  int ParamTaskFunction();
64 
65  int UpdateCamParam(const char *param);
66  int ReadCamParams();
67 
68  Task m_paramTask;
69  uint32_t m_ipAddress; // IPv4
70  SEM_ID m_paramChangedSem;
71  SEM_ID m_socketPossessionSem;
72 
73  //Camera Properties
74  IntCameraParameter *m_brightnessParam;
75  IntCameraParameter *m_compressionParam;
76  IntCameraParameter *m_exposurePriorityParam;
77  IntCameraParameter *m_colorLevelParam;
78  IntCameraParameter *m_maxFPSParam;
79  EnumCameraParameter *m_rotationParam;
80  EnumCameraParameter *m_resolutionParam;
81  EnumCameraParameter *m_exposureControlParam;
82  EnumCameraParameter *m_whiteBalanceParam;
83 
84  // A vector to access all properties simply.
85  typedef std::vector<IntCameraParameter*> ParameterVector_t;
86  ParameterVector_t m_parameters;
87 };
88 
89 
90 #endif
void WriteExposurePriority(int)
Resolution_t GetResolution()
AxisCameraParams(const char *ipAddress)
void WriteExposureControl(Exposure_t)
static int s_ParamTaskFunction(AxisCameraParams *thisPtr)
Exposure_t GetExposureControl()
WhiteBalance_t GetWhiteBalance()
void WriteResolution(Resolution_t)
Rotation_t GetRotation()
Definition: Task.h:17
void WriteWhiteBalance(WhiteBalance_t whiteBalance)
int UpdateCamParam(const char *param)
void WriteRotation(Rotation_t)

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6