|
WPILib 2012
WPILibRoboticsLibraryforFRC
|
#include <AxisCamera.h>
Public Member Functions | |
| virtual | ~AxisCamera () |
| bool | IsFreshImage () |
| SEM_ID | GetNewImageSem () |
| int | GetImage (Image *imaqImage) |
| int | GetImage (ColorImage *image) |
| HSLImage * | GetImage () |
| int | CopyJPEG (char **destImage, int &destImageSize, int &destImageBufferSize) |
Static Public Member Functions | |
| static AxisCamera & | GetInstance (const char *cameraIP=NULL) |
| static void | DeleteInstance () |
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:
| AxisCamera::~AxisCamera | ( | ) | [virtual] |
Destructor
| 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.
| imageData | The destination image. |
| numBytes | The size of the destination image. |
| 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.
| int AxisCamera::GetImage | ( | Image * | imaqImage | ) |
Get an image from the camera and store it in the provided image.
| image | The imaq image to store the result in. This must be an HSL or RGB image This function is called by Java. |
| int AxisCamera::GetImage | ( | ColorImage * | image | ) |
Get an image from the camera and store it in the provided image.
| image | The image to store the result in. This must be an HSL or RGB image |
| 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.
| 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.
| bool AxisCamera::IsFreshImage | ( | ) |
Return true if the latest image from the camera has not been retrieved by calling GetImage() yet.
1.7.4