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

#include <AxisCamera.h>

Inheritance diagram for AxisCamera:
Collaboration diagram for AxisCamera:

Public Member Functions

virtual ~AxisCamera ()
 
bool IsFreshImage ()
 
SEM_ID GetNewImageSem ()
 
int GetImage (Image *imaqImage)
 
int GetImage (ColorImage *image)
 
HSLImageGetImage ()
 
int CopyJPEG (char **destImage, int &destImageSize, int &destImageBufferSize)
 
- Public Member Functions inherited from AxisCameraParams
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...
 

Static Public Member Functions

static AxisCameraGetInstance (const char *cameraIP=NULL)
 
static void DeleteInstance ()
 
- 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 ()
 

Additional Inherited Members

- Public Types inherited from AxisCameraParams
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
 
- Protected Types inherited from AxisCameraParams
typedef std::vector
< IntCameraParameter * > 
ParameterVector_t
 
- Protected Member Functions inherited from AxisCameraParams
 AxisCameraParams (const char *ipAddress)
 
virtual ~AxisCameraParams ()
 
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 inherited from AxisCameraParams
static int s_ParamTaskFunction (AxisCameraParams *thisPtr)
 
- Protected Attributes inherited from AxisCameraParams
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
 
- 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

AxisCamera class. This class handles everything about the Axis 206 FRC Camera. It starts up 2 tasks each using a different connection to the camera:

  • image reading task that reads images repeatedly from the camera
  • parameter handler task in the base class that monitors for changes to parameters and updates the camera

Definition at line 34 of file AxisCamera.h.

Constructor & Destructor Documentation

AxisCamera::~AxisCamera ( )
virtual

Destructor

Definition at line 51 of file AxisCamera.cpp.

Member Function Documentation

int AxisCamera::CopyJPEG ( char **  destImage,
int &  destImageSize,
int &  destImageBufferSize 
)

Copy an image into an existing buffer. This copies an image into an existing buffer rather than creating a new image in memory. That way a new image is only allocated when the image being copied is larger than the destination. This method is called by the PCVideoServer class.

Parameters
imageDataThe destination image.
numBytesThe size of the destination image.
Returns
0 if failed (no source image or no memory), 1 if success.

Definition at line 172 of file AxisCamera.cpp.

void AxisCamera::DeleteInstance ( )
static

Called by Java to delete the camera... how thoughtful

Definition at line 90 of file AxisCamera.cpp.

int AxisCamera::GetImage ( Image *  imaqImage)

Get an image from the camera and store it in the provided image.

Parameters
imageThe imaq image to store the result in. This must be an HSL or RGB image This function is called by Java.
Returns
1 upon success, zero on a failure

Definition at line 126 of file AxisCamera.cpp.

int AxisCamera::GetImage ( ColorImage image)

Get an image from the camera and store it in the provided image.

Parameters
imageThe image to store the result in. This must be an HSL or RGB image
Returns
1 upon success, zero on a failure

Definition at line 143 of file AxisCamera.cpp.

HSLImage * AxisCamera::GetImage ( )

Instantiate a new image object and fill it with the latest image from the camera.

The returned pointer is owned by the caller and is their responsibility to delete.

Returns
a pointer to an HSLImage object

Definition at line 154 of file AxisCamera.cpp.

AxisCamera & AxisCamera::GetInstance ( const char *  cameraIP = NULL)
static

Get a pointer to the AxisCamera object, if the object does not exist, create it To use the camera on port 2 of a cRIO-FRC, pass "192.168.0.90" to the first GetInstance call.

Returns
reference to AxisCamera object

Definition at line 75 of file AxisCamera.cpp.

SEM_ID AxisCamera::GetNewImageSem ( )

Get the semaphore to be used to synchronize image access with camera acquisition

Call semTake on the returned semaphore to block until a new image is acquired.

The semaphore is owned by the AxisCamera class and will be deleted when the class is destroyed.

Returns
A semaphore to notify when new image is received

Definition at line 113 of file AxisCamera.cpp.

bool AxisCamera::IsFreshImage ( )

Return true if the latest image from the camera has not been retrieved by calling GetImage() yet.

Returns
true if the image has not been retrieved yet.

Definition at line 100 of file AxisCamera.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