Now you can download a copy of these docs so you can use them offline! Download now

#include <AxisCameraParams.h>

Inheritance diagram for AxisCameraParams:
Collaboration diagram for AxisCameraParams:

Public Types

enum  Exposure_t { kExposure_Automatic, kExposure_Hold, kExposure_FlickerFree50Hz, kExposure_FlickerFree60Hz }
 
enum  WhiteBalance_t {
  kWhiteBalance_Automatic, kWhiteBalance_Hold, kWhiteBalance_FixedOutdoor1, kWhiteBalance_FixedOutdoor2,
  kWhiteBalance_FixedIndoor, kWhiteBalance_FixedFlourescent1, kWhiteBalance_FixedFlourescent2
}
 
enum  Resolution_t { kResolution_640x480, kResolution_640x360, kResolution_320x240, kResolution_160x120 }
 
enum  Rotation_t { kRotation_0, kRotation_180 }
 
typedef enum
AxisCameraParams::Exposure_t 
Exposure
 
typedef enum
AxisCameraParams::WhiteBalance_t 
WhiteBalance
 
typedef enum
AxisCameraParams::Resolution_t 
Resolution
 
typedef enum
AxisCameraParams::Rotation_t 
Rotation
 

Public Member Functions

void WriteBrightness (int)
 
int GetBrightness ()
 
void WriteWhiteBalance (WhiteBalance_t whiteBalance)
 
WhiteBalance_t GetWhiteBalance ()
 
void WriteColorLevel (int)
 
int GetColorLevel ()
 
void WriteExposureControl (Exposure_t)
 
Exposure_t GetExposureControl ()
 
void WriteExposurePriority (int)
 
int GetExposurePriority ()
 
void WriteMaxFPS (int)
 
int GetMaxFPS ()
 
void WriteResolution (Resolution_t)
 
Resolution_t GetResolution ()
 
void WriteCompression (int)
 
int GetCompression ()
 
void WriteRotation (Rotation_t)
 
Rotation_t GetRotation ()
 
- Public Member Functions inherited from ErrorBase
virtual ErrorGetError ()
 Retrieve the current error. Get the current error information associated with this sensor.
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (ErrorBase *rhs) const
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 

Protected Types

typedef std::vector
< IntCameraParameter * > 
ParameterVector_t
 

Protected Member Functions

 AxisCameraParams (const char *ipAddress)
 
virtual ~AxisCameraParams ()
 
virtual void RestartCameraTask ()=0
 
int CreateCameraSocket (const char *requestString)
 
int ParamTaskFunction ()
 
int UpdateCamParam (const char *param)
 
int ReadCamParams ()
 
- Protected Member Functions inherited from ErrorBase
 ErrorBase ()
 Initialize the instance status to 0 for now.
 

Static Protected Member Functions

static int s_ParamTaskFunction (AxisCameraParams *thisPtr)
 

Protected Attributes

Task m_paramTask
 
uint32_t m_ipAddress
 
SEM_ID m_paramChangedSem
 
SEM_ID m_socketPossessionSem
 
IntCameraParameterm_brightnessParam
 
IntCameraParameterm_compressionParam
 
IntCameraParameterm_exposurePriorityParam
 
IntCameraParameterm_colorLevelParam
 
IntCameraParameterm_maxFPSParam
 
EnumCameraParameterm_rotationParam
 
EnumCameraParameterm_resolutionParam
 
EnumCameraParameterm_exposureControlParam
 
EnumCameraParameterm_whiteBalanceParam
 
ParameterVector_t m_parameters
 
- Protected Attributes inherited from ErrorBase
Error m_error
 

Additional Inherited Members

- Static Public Member Functions inherited from ErrorBase
static void SetGlobalError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber)
 
static void SetGlobalWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber)
 
static ErrorGetGlobalError ()
 
- Static Protected Attributes inherited from ErrorBase
static SEM_ID _globalErrorMutex = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
 
static Error _globalError
 

Detailed Description

AxisCameraParams class. This class handles parameter configuration the Axis 206 Ethernet Camera. It starts up a tasks with an independent connection to the camera that monitors for changes to parameters and updates the camera. It is only separate from AxisCamera to isolate the parameter code from the image streaming code.

Definition at line 23 of file AxisCameraParams.h.

Constructor & Destructor Documentation

AxisCameraParams::AxisCameraParams ( const char *  ipAddress)
protected

AxisCamera constructor

Definition at line 32 of file AxisCameraParams.cpp.

AxisCameraParams::~AxisCameraParams ( )
protectedvirtual

Destructor

Definition at line 108 of file AxisCameraParams.cpp.

Member Function Documentation

int AxisCameraParams::GetBrightness ( )

Get the brightness value.

Returns
Brightness value from the camera.

Definition at line 189 of file AxisCameraParams.cpp.

int AxisCameraParams::GetColorLevel ( )

Retrieve the color level from the camera. the camera color level.

Definition at line 227 of file AxisCameraParams.cpp.

int AxisCameraParams::GetCompression ( )

Get the compression value from the camera.

Returns
The cached compression value from the camera.

Definition at line 323 of file AxisCameraParams.cpp.

AxisCameraParams::Exposure_t AxisCameraParams::GetExposureControl ( )

Get the exposure value from the camera.

Returns
the exposure value from the camera.

Definition at line 246 of file AxisCameraParams.cpp.

int AxisCameraParams::GetMaxFPS ( )

Get the max number of frames per second that the camera will send

Returns
Maximum frames per second.

Definition at line 343 of file AxisCameraParams.cpp.

AxisCameraParams::Resolution_t AxisCameraParams::GetResolution ( )

Get the resolution value from the camera.

Returns
resultion value for the camera.

Definition at line 265 of file AxisCameraParams.cpp.

AxisCameraParams::Rotation_t AxisCameraParams::GetRotation ( )

Get the rotation value from the camera.

Returns
The rotation value from the camera (Rotation_t).

Definition at line 303 of file AxisCameraParams.cpp.

AxisCameraParams::WhiteBalance_t AxisCameraParams::GetWhiteBalance ( )

Retrieve the current white balance parameter.

Returns
The white balance value.

Definition at line 208 of file AxisCameraParams.cpp.

int AxisCameraParams::ParamTaskFunction ( )
protected

Main loop of the parameter task. This loop runs continuously checking parameters from the camera for posted changes and updating them if necessary.

Definition at line 140 of file AxisCameraParams.cpp.

int AxisCameraParams::ReadCamParams ( )
protected

Read the full param list from camera, use regular expressions to find the bits we care about assign values to member variables.

Definition at line 379 of file AxisCameraParams.cpp.

int AxisCameraParams::s_ParamTaskFunction ( AxisCameraParams thisPtr)
staticprotected

Static function to start the parameter updating task

Definition at line 129 of file AxisCameraParams.cpp.

int AxisCameraParams::UpdateCamParam ( const char *  param)
protected

Update a camera parameter. Write a camera parameter to the camera when it has bene changed.

Parameters
paramthe string to insert into the http request.
Returns
0 if it failed, otherwise nonzero.

Definition at line 354 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteBrightness ( int  brightness)

Write the brightness value to the camera.

Parameters
brightnessvalid values 0 .. 100

Definition at line 179 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteColorLevel ( int  colorLevel)

Write the color level to the camera.

Parameters
colorLevelvalid values are 0 .. 100

Definition at line 217 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteCompression ( int  compression)

Write the compression value to the camera.

Parameters
compressionValues between 0 and 100.

Definition at line 313 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteExposureControl ( Exposure_t  exposureControl)

Write the exposure control value to the camera.

Parameters
exposureControlA mode to write in the Exposure_t enum.

Definition at line 236 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteExposurePriority ( int  exposurePriority)

Write the exposre priority value to the camera.

Parameters
exposurePriorityValid values are 0, 50, 100. 0 = Prioritize image quality 50 = None 100 = Prioritize frame rate

Definition at line 277 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteMaxFPS ( int  maxFPS)

Write the maximum frames per second that the camera should send Write 0 to send as many as possible.

Parameters
maxFPSThe number of frames the camera should send in a second, exposure permitting.

Definition at line 333 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteResolution ( Resolution_t  resolution)

Write resolution value to camera.

Parameters
resolutionThe camera resolution value to write to the camera. Use the Resolution_t enum.

Definition at line 255 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteRotation ( Rotation_t  rotation)

Write the rotation value to the camera. If you mount your camera upside down, use this to adjust the image for you.

Parameters
rotationThe image from the Rotation_t enum in AxisCameraParams (kRotation_0 or kRotation_180)

Definition at line 293 of file AxisCameraParams.cpp.

void AxisCameraParams::WriteWhiteBalance ( WhiteBalance_t  whiteBalance)

Set the white balance value.

Parameters
whiteBalanceValid values from the WhiteBalance_t enum.

Definition at line 198 of file AxisCameraParams.cpp.


The documentation for this class was generated from the following files:

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