WPILib 2012
WPILibRoboticsLibraryforFRC
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
AxisCameraParams Class Reference

#include <AxisCameraParams.h>

Inheritance diagram for AxisCameraParams:
ErrorBase AxisCamera

List of all members.

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 }

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 ()

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 ()

Static Protected Member Functions

static int s_ParamTaskFunction (AxisCameraParams *thisPtr)

Protected Attributes

Task m_paramTask
UINT32 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

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.


Constructor & Destructor Documentation

AxisCameraParams::AxisCameraParams ( const char *  ipAddress) [protected]

AxisCamera constructor

AxisCameraParams::~AxisCameraParams ( ) [protected, virtual]

Destructor


Member Function Documentation

int AxisCameraParams::GetBrightness ( )

Get the brightness value.

Returns:
Brightness value from the camera.
int AxisCameraParams::GetColorLevel ( )

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

int AxisCameraParams::GetCompression ( )

Get the compression value from the camera.

Returns:
The cached compression value from the camera.
AxisCameraParams::Exposure_t AxisCameraParams::GetExposureControl ( )

Get the exposure value from the camera.

Returns:
the exposure value from the camera.
int AxisCameraParams::GetMaxFPS ( )

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

Returns:
Maximum frames per second.
AxisCameraParams::Resolution_t AxisCameraParams::GetResolution ( )

Get the resolution value from the camera.

Returns:
resultion value for the camera.
AxisCameraParams::Rotation_t AxisCameraParams::GetRotation ( )

Get the rotation value from the camera.

Returns:
The rotation value from the camera (Rotation_t).
AxisCameraParams::WhiteBalance_t AxisCameraParams::GetWhiteBalance ( )

Retrieve the current white balance parameter.

Returns:
The white balance value.
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.

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.

int AxisCameraParams::s_ParamTaskFunction ( AxisCameraParams thisPtr) [static, protected]

Static function to start the parameter updating task

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.
void AxisCameraParams::WriteBrightness ( int  brightness)

Write the brightness value to the camera.

Parameters:
brightnessvalid values 0 .. 100
void AxisCameraParams::WriteColorLevel ( int  colorLevel)

Write the color level to the camera.

Parameters:
colorLevelvalid values are 0 .. 100
void AxisCameraParams::WriteCompression ( int  compression)

Write the compression value to the camera.

Parameters:
compressionValues between 0 and 100.
void AxisCameraParams::WriteExposureControl ( Exposure_t  exposureControl)

Write the exposure control value to the camera.

Parameters:
exposureControlA mode to write in the Exposure_t enum.
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
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.
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.
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)
void AxisCameraParams::WriteWhiteBalance ( WhiteBalance_t  whiteBalance)

Set the white balance value.

Parameters:
whiteBalanceValid values from the WhiteBalance_t enum.

The documentation for this class was generated from the following files:
 All Classes Functions Variables