WPILib 2012
WPILibRoboticsLibraryforFRC
Public Member Functions | Static Public Member Functions
AxisCamera Class Reference

#include <AxisCamera.h>

Inheritance diagram for AxisCamera:
AxisCameraParams ErrorBase

List of all members.

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)

Static Public Member Functions

static AxisCameraGetInstance (const char *cameraIP=NULL)
static void DeleteInstance ()

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:


Constructor & Destructor Documentation

AxisCamera::~AxisCamera ( ) [virtual]

Destructor


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.
void AxisCamera::DeleteInstance ( ) [static]

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

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
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
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
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
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
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.

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