WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
AxisCamera Class Reference

Axis M1011 network camera. More...

#include <AxisCamera.h>

Inheritance diagram for AxisCamera:
ErrorBase

Public Types

enum  WhiteBalance {
  kWhiteBalance_Automatic, kWhiteBalance_Hold, kWhiteBalance_FixedOutdoor1, kWhiteBalance_FixedOutdoor2,
  kWhiteBalance_FixedIndoor, kWhiteBalance_FixedFluorescent1, kWhiteBalance_FixedFluorescent2
}
 
enum  ExposureControl { kExposureControl_Automatic, kExposureControl_Hold, kExposureControl_FlickerFree50Hz, kExposureControl_FlickerFree60Hz }
 
enum  Resolution {
  kResolution_640x480, kResolution_480x360, kResolution_320x240, kResolution_240x180,
  kResolution_176x144, kResolution_160x120
}
 
enum  Rotation { kRotation_0, kRotation_180 }
 

Public Member Functions

 AxisCamera (std::string const &cameraHost)
 AxisCamera constructor. More...
 
 AxisCamera (const AxisCamera &)=delete
 
AxisCameraoperator= (const AxisCamera &)=delete
 
bool IsFreshImage () const
 
int GetImage (Image *image)
 Get an image from the camera and store it in the provided image. More...
 
int GetImage (ColorImage *image)
 Get an image from the camera and store it in the provided image. More...
 
HSLImageGetImage ()
 Instantiate a new image object and fill it with the latest image from the camera. More...
 
int CopyJPEG (char **destImage, unsigned int &destImageSize, unsigned int &destImageBufferSize)
 Copy an image into an existing buffer. More...
 
void WriteBrightness (int brightness)
 Request a change in the brightness of the camera images. More...
 
int GetBrightness ()
 
void WriteWhiteBalance (WhiteBalance whiteBalance)
 Request a change in the white balance on the camera. More...
 
WhiteBalance GetWhiteBalance ()
 
void WriteColorLevel (int colorLevel)
 Request a change in the color level of the camera images. More...
 
int GetColorLevel ()
 
void WriteExposureControl (ExposureControl exposureControl)
 Request a change in the camera's exposure mode. More...
 
ExposureControl GetExposureControl ()
 
void WriteExposurePriority (int exposurePriority)
 Request a change in the exposure priority of the camera. More...
 
int GetExposurePriority ()
 
void WriteMaxFPS (int maxFPS)
 Write the maximum frames per second that the camera should send Write 0 to send as many as possible. More...
 
int GetMaxFPS ()
 
void WriteResolution (Resolution resolution)
 Write resolution value to camera. More...
 
Resolution GetResolution ()
 
void WriteCompression (int compression)
 Write the compression value to the camera. More...
 
int GetCompression ()
 
void WriteRotation (Rotation rotation)
 Write the rotation value to the camera. More...
 
Rotation GetRotation ()
 
- Public Member Functions inherited from ErrorBase
 ErrorBase (const ErrorBase &)=delete
 
ErrorBaseoperator= (const ErrorBase &)=delete
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef 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, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (llvm::StringRef errorMessage, Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ErrorBase
static void SetGlobalError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber)
 
static void SetGlobalWPIError (llvm::StringRef errorMessage, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber)
 
static ErrorGetGlobalError ()
 Retrieve the current global error.
 
- Protected Attributes inherited from ErrorBase
Error m_error
 
- Static Protected Attributes inherited from ErrorBase
static priority_mutex _globalErrorMutex
 
static Error _globalError
 

Detailed Description

Axis M1011 network camera.

Constructor & Destructor Documentation

AxisCamera::AxisCamera ( std::string const &  cameraHost)
explicit

AxisCamera constructor.

Parameters
cameraHostThe host to find the camera at, typically an IP address

Member Function Documentation

int AxisCamera::CopyJPEG ( char **  destImage,
unsigned int &  destImageSize,
unsigned 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.
int AxisCamera::GetBrightness ( )
Returns
The configured brightness of the camera images
int AxisCamera::GetColorLevel ( )
Returns
The configured color level of the camera images
int AxisCamera::GetCompression ( )
Returns
The configured compression level of the camera
AxisCamera::ExposureControl AxisCamera::GetExposureControl ( )
Returns
The configured exposure control mode of the camera
int AxisCamera::GetExposurePriority ( )
Returns
The configured exposure priority of the camera
int AxisCamera::GetImage ( Image *  image)

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.
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
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::GetMaxFPS ( )
Returns
The configured maximum FPS of the camera
AxisCamera::Resolution AxisCamera::GetResolution ( )
Returns
The configured resolution of the camera (not necessarily the same resolution as the most recent image, if it was changed recently.)
AxisCamera::Rotation AxisCamera::GetRotation ( )
Returns
The configured rotation mode of the camera
AxisCamera::WhiteBalance AxisCamera::GetWhiteBalance ( )
Returns
The configured white balances of the camera images
void AxisCamera::WriteBrightness ( int  brightness)

Request a change in the brightness of the camera images.

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

Request a change in the color level of the camera images.

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

Write the compression value to the camera.

Parameters
compressionValues between 0 and 100.
void AxisCamera::WriteExposureControl ( AxisCamera::ExposureControl  exposureControl)

Request a change in the camera's exposure mode.

Parameters
exposureControlA mode to write in the Exposure enum.
void AxisCamera::WriteExposurePriority ( int  exposurePriority)

Request a change in the exposure priority of the camera.

Parameters
exposurePriorityValid values are 0, 50, 100. 0 = Prioritize image quality 50 = None 100 = Prioritize frame rate
void AxisCamera::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 AxisCamera::WriteResolution ( AxisCamera::Resolution  resolution)

Write resolution value to camera.

Parameters
resolutionThe camera resolution value to write to the camera.
void AxisCamera::WriteRotation ( AxisCamera::Rotation  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 angle to rotate the camera (AxisCamera::Rotation::k0 or AxisCamera::Rotation::k180)
void AxisCamera::WriteWhiteBalance ( AxisCamera::WhiteBalance  whiteBalance)

Request a change in the white balance on the camera.

Parameters
whiteBalanceValid values from the WhiteBalance enum.

The documentation for this class was generated from the following files: