#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) |
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 Error & | GetError () |
Retrieve the current error. Get the current error information associated with this sensor. | |
virtual const Error & | GetError () 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 AxisCamera & | GetInstance (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 Error & | GetGlobalError () |
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 |
IntCameraParameter * | m_brightnessParam |
IntCameraParameter * | m_compressionParam |
IntCameraParameter * | m_exposurePriorityParam |
IntCameraParameter * | m_colorLevelParam |
IntCameraParameter * | m_maxFPSParam |
EnumCameraParameter * | m_rotationParam |
EnumCameraParameter * | m_resolutionParam |
EnumCameraParameter * | m_exposureControlParam |
EnumCameraParameter * | m_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 |
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:
Definition at line 34 of file AxisCamera.h.
|
virtual |
Destructor
Definition at line 51 of file AxisCamera.cpp.
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. |
Definition at line 172 of file AxisCamera.cpp.
|
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.
image | The imaq image to store the result in. This must be an HSL or RGB image This function is called by Java. |
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.
image | The image to store the result in. This must be an HSL or RGB image |
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.
Definition at line 154 of file AxisCamera.cpp.
|
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.
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.
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.
Definition at line 100 of file AxisCamera.cpp.