The base class for the camera object. More...
#include <CameraBase.h>
Public Member Functions | |
virtual | ~CameraBase (void) |
Virtual Destructor. | |
void | Init () |
Init Connects to camera with read and write access, retrieves remote device and GUI XML and generates node map references. | |
void | DeInit () |
DeInit Disconnects camera port, resets camera back to read access and frees GenICam node map and GUI XML. | |
bool | IsInitialized () |
IsInitialized Checks if camera is initialized. | |
bool | IsValid () |
IsValid Checks a flag to determine if camera is still valid for use. | |
GenApi::INodeMap & | GetNodeMap () const |
GetNodeMap Gets a reference to the node map that is generated from a GenICam XML file. | |
GenApi::INodeMap & | GetTLDeviceNodeMap () const |
GetTLDeviceNodeMap Gets a reference to the node map that is generated from a GenICam XML file for the GenTL Device module. | |
GenApi::INodeMap & | GetTLStreamNodeMap (uint64_t streamIndex=0) const |
GetTLStreamNodeMap Gets a reference to the node map that is generated from a GenICam XML file for the GenTL Stream module. | |
GenApi::EAccessMode | GetAccessMode () const |
GetAccessMode Returns the access mode that the software has on the Camera. | |
void | ReadPort (uint64_t iAddress, void *pBuffer, size_t iSize) |
void | WritePort (uint64_t iAddress, const void *pBuffer, size_t iSize) |
void | BeginAcquisition () |
BeginAcquisition Starts the image acquisition engine. | |
void | EndAcquisition () |
EndAcquisition Stops the image acquisition engine. | |
BufferOwnership | GetBufferOwnership () const |
GetBufferOwnership Gets data buffer ownership. | |
void | SetBufferOwnership (const BufferOwnership mode) |
SetBufferOwnership Sets data buffer ownership. | |
uint64_t | GetUserBufferCount () const |
GetUserBufferCount Gets the number of user memory buffers. | |
uint64_t | GetUserBufferSize () const |
GetUserBufferSize Gets the size of one user memory buffer (in bytes). | |
uint64_t | GetUserBufferTotalSize () const |
GetUserBufferTotalSize Gets the total size of all the user memory buffers (in bytes). | |
void | SetUserBuffers (void *const pMemBuffers, uint64_t totalSize) |
SetUserBuffers Specify contiguous user allocated memory to use as data buffers. | |
void | SetUserBuffers (void **const ppMemBuffers, const uint64_t bufferCount, const uint64_t bufferSize) |
SetUserBuffers Specify non-contiguous user allocated memory to use as data buffers. | |
ImagePtr | GetNextImage (uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE, uint64_t streamIndex=0) |
GetNextImage Gets the next image that was received by the transport layer. | |
ImageList | GetNextImageSync (uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE) |
GetNextImageSync If a camera supports one or more streams, this function gets one image from each of the camera's streams, and returns the image(s) in a list. | |
GenICam::gcstring | GetDeviceID () |
GetDeviceID This returns a unique id string that identifies the camera; a unique string for USB devices, and MAC address for GEV devices. | |
DEPRECATED_FUNC ("Use GetDeviceID() instead.", GenICam::gcstring GetUniqueID();) | |
GetUniqueID This returns a unique id string that identifies the camera. | |
bool | IsStreaming () const |
IsStreaming Returns true if the camera is currently streaming or false if it is not. | |
GenICam::gcstring | GetGuiXml () const |
Returns the GUI XML that can be passed into the Spinnaker GUI framework. | |
void | RegisterEventHandler (EventHandler &evtHandlerToRegister) |
RegisterEventHandler(EventHandler &) Registers a generic device, image or image list event handler for the camera. | |
void | RegisterEventHandler (DeviceEventHandler &evtHandlerToRegister, const GenICam::gcstring &eventName) |
RegisterEventHandler(DeviceEventHandler &, const GenICam::gcstring &) Registers a specific device event handler for the camera given a device event name. | |
void | RegisterEventHandler (ImageEventHandler &evtHandlerToRegister, uint64_t streamIndex) |
RegisterEventHandler(ImageEventHandler &, uint64_t) Registers a specific stream handler for the camera given a stream index. | |
void | UnregisterEventHandler (EventHandler &evtHandlerToUnregister) |
UnregisterEventHandler Unregisters any type of event handler for the camera. | |
unsigned int | GetNumImagesInUse () |
GetNumImagesInUse Returns the number of images that are currently in use. | |
unsigned int | GetActiveNumDataStreams () |
GetActiveNumDataStreams Returns the number of data streams that are currently active. | |
unsigned int | GetNumDataStreams () |
GetNumDataStreams Returns the total number of streams that the device supports. | |
unsigned int | DiscoverMaxPacketSize () |
DiscoverMaxPacketSize Returns the largest packet size that can be safely used on the interface that device is connected to. | |
void | ForceIP () |
ForceIP Forces the camera to be on the same subnet as its corresponding interface. | |
Public Member Functions inherited from ICameraBase | |
virtual | ~ICameraBase (void) |
virtual void | Init ()=0 |
virtual void | DeInit ()=0 |
virtual bool | IsInitialized ()=0 |
virtual bool | IsValid ()=0 |
virtual GenApi::INodeMap & | GetNodeMap () const =0 |
virtual GenApi::INodeMap & | GetTLDeviceNodeMap () const =0 |
virtual GenApi::INodeMap & | GetTLStreamNodeMap (uint64_t streamIndex) const =0 |
virtual GenApi::EAccessMode | GetAccessMode () const =0 |
virtual void | ReadPort (uint64_t iAddress, void *pBuffer, size_t iSize)=0 |
virtual void | WritePort (uint64_t iAddress, const void *pBuffer, size_t iSize)=0 |
virtual void | BeginAcquisition ()=0 |
virtual void | EndAcquisition ()=0 |
virtual BufferOwnership | GetBufferOwnership () const =0 |
virtual void | SetBufferOwnership (const BufferOwnership mode)=0 |
virtual uint64_t | GetUserBufferCount () const =0 |
virtual uint64_t | GetUserBufferSize () const =0 |
virtual uint64_t | GetUserBufferTotalSize () const =0 |
virtual void | SetUserBuffers (void *const pMemBuffers, uint64_t totalSize)=0 |
virtual void | SetUserBuffers (void **const ppMemBuffers, const uint64_t bufferCount, const uint64_t bufferSize)=0 |
virtual ImagePtr | GetNextImage (uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE, uint64_t streamIndex=0)=0 |
virtual GenICam::gcstring | GetDeviceID ()=0 |
virtual GenICam::gcstring | GetUniqueID ()=0 |
virtual bool | IsStreaming () const =0 |
virtual GenICam::gcstring | GetGuiXml () const =0 |
virtual void | RegisterEventHandler (EventHandler &evtHandlerToRegister)=0 |
virtual void | RegisterEventHandler (DeviceEventHandler &evtHandlerToRegister, const GenICam::gcstring &eventName)=0 |
virtual void | RegisterEventHandler (ImageEventHandler &evtHandlerToRegister, uint64_t streamIndex)=0 |
virtual void | UnregisterEventHandler (EventHandler &evtHandlerToUnregister)=0 |
virtual unsigned int | GetNumImagesInUse ()=0 |
virtual unsigned int | GetActiveNumDataStreams ()=0 |
virtual unsigned int | GetNumDataStreams ()=0 |
virtual unsigned int | DiscoverMaxPacketSize ()=0 |
virtual void | ForceIP ()=0 |
Protected Member Functions | |
CameraBase (void) | |
Default constructor. | |
CameraBase (const CameraBase &) | |
Copy constructor. | |
CameraBase & | operator= (const CameraBase &) |
Assignment operator. | |
Protected Member Functions inherited from ICameraBase | |
ICameraBase () | |
ICameraBase (const ICameraBase &) | |
ICameraBase & | operator= (const ICameraBase &) |
Friends | |
class | InterfaceImpl |
Additional Inherited Members | |
Public Attributes inherited from ICameraBase | |
TransportLayerDevice | TLDevice |
Gets vital camera information by connecting to the camera's bootstrap registers. | |
TransportLayerStream | TLStream |
Gets information about the stream data by connecting to the camera's bootstrap registers. | |
Protected Attributes inherited from ICameraBase | |
CameraBaseData * | m_pCameraBaseData |
The base class for the camera object.
|
virtual |
Virtual Destructor.
|
protected |
Default constructor.
|
protected |
Copy constructor.
|
virtual |
BeginAcquisition Starts the image acquisition engine.
The camera must be initialized via a call to Init() before starting an acquisition.
Note that an error SPINNAKER_ERR_NOT_IMPLEMENTED will be thrown if an unsupported combination of stream mode and buffer ownership is set.
Implements ICameraBase.
|
virtual |
DeInit Disconnects camera port, resets camera back to read access and frees GenICam node map and GUI XML.
Do not call more functions that access the remote device such as WritePort/ReadPort after calling DeInit(). Events should also be unregistered before calling camera DeInit(). Otherwise an exception will be thrown in the DeInit() call and require the user to unregister events before the camera can be re-initialized again.
Implements ICameraBase.
DEPRECATED_FUNC | ( | "Use GetDeviceID() instead." | , |
GenICam::gcstring GetUniqueID(); | |||
) |
GetUniqueID This returns a unique id string that identifies the camera.
|
virtual |
DiscoverMaxPacketSize Returns the largest packet size that can be safely used on the interface that device is connected to.
Implements ICameraBase.
|
virtual |
EndAcquisition Stops the image acquisition engine.
If EndAcquisition() is called without a prior call to BeginAcquisition() an error message "Camera is not started" will be thrown. All Images that were acquired using GetNextImage() or GetNextImageSync() need to be released first using image->Release() or imageList->Release() before calling EndAcquisition(). All buffers in the input pool and output queue will be discarded when EndAcquisition() is called.
Implements ICameraBase.
|
virtual |
ForceIP Forces the camera to be on the same subnet as its corresponding interface.
Implements ICameraBase.
|
virtual |
GetAccessMode Returns the access mode that the software has on the Camera.
The camera does not need to be initialized before calling this function.
Implements ICameraBase.
|
virtual |
GetActiveNumDataStreams Returns the number of data streams that are currently active.
Implements ICameraBase.
|
virtual |
GetBufferOwnership Gets data buffer ownership.
The data buffers can be owned by System or User. If the system owns the buffers, the memory required for the buffers are allocated and freed by the library. If user owns the buffers, the user is responsible for allocating and ultimately freeing the memory. By default, data buffers are owned by the System.
Implements ICameraBase.
|
virtual |
GetDeviceID This returns a unique id string that identifies the camera; a unique string for USB devices, and MAC address for GEV devices.
Implements ICameraBase.
|
virtual |
Returns the GUI XML that can be passed into the Spinnaker GUI framework.
Implements ICameraBase.
|
virtual |
GetNextImage Gets the next image that was received by the transport layer.
This function will block for the specified timeout period until an image arrives. Most cameras support one stream so the default streamIndex is 0, but if a camera supports multiple streams the user can input the streamIndex to select from which stream to grab images.
grabTimeout | A 64bit value that represents a timeout in milliseconds |
streamIndex | The index of the stream to grab the image from |
Implements ICameraBase.
ImageList GetNextImageSync | ( | uint64_t | grabTimeout = EVENT_TIMEOUT_INFINITE | ) |
GetNextImageSync If a camera supports one or more streams, this function gets one image from each of the camera's streams, and returns the image(s) in a list.
This function will block for the specified timeout period until an image arrives on all the streams.
Note: This function should not be used together with GetNextImage. Results will be undeterministic and could lead to missing or lost of images.
grabTimeout | A 64bit value that represents a timeout in milliseconds |
|
virtual |
GetNodeMap Gets a reference to the node map that is generated from a GenICam XML file.
The camera must be initialized by a call to Init() first before a node map reference can be successfully acquired.
Implements ICameraBase.
|
virtual |
GetNumDataStreams Returns the total number of streams that the device supports.
For configurable multistream cameras, use GetActiveNumDataStreams() to get the number of active streams.
Implements ICameraBase.
|
virtual |
GetNumImagesInUse Returns the number of images that are currently in use.
Each of the images that are currently in use must be cleaned up with a call to image->Release() before calling system->ReleaseInstance().
Implements ICameraBase.
|
virtual |
GetTLDeviceNodeMap Gets a reference to the node map that is generated from a GenICam XML file for the GenTL Device module.
The camera does not need to be initialized before acquiring this node map.
Implements ICameraBase.
|
virtual |
GetTLStreamNodeMap Gets a reference to the node map that is generated from a GenICam XML file for the GenTL Stream module.
The camera does not need to be initialized before acquiring this node map.
streamIndex | The index of the stream to grab the image from |
Implements ICameraBase.
|
virtual |
GetUserBufferCount Gets the number of user memory buffers.
This will throw an exception if user memory buffer has not been set. If the user memory is contiguous, this will throw an exception unless BeginAcquisition() has been called.
Implements ICameraBase.
|
virtual |
GetUserBufferSize Gets the size of one user memory buffer (in bytes).
This will throw an exception if user memory buffer has not been set. If the user memory is contiguous, this will throw an exception unless BeginAcquisition() has been called. To prevent image tearing when working with USB3 cameras, the size of each buffer should be equal to: ((unsigned int) (bufferSize + 1024 - 1) / 1024) * 1024 where 1024 is the USB3 packet size.
Implements ICameraBase.
|
virtual |
GetUserBufferTotalSize Gets the total size of all the user memory buffers (in bytes).
This will throw an exception if user memory buffer has not been set. The total size should be GetUserBufferSize() multiplied by GetUserBufferCount() or larger.
Implements ICameraBase.
|
virtual |
Init Connects to camera with read and write access, retrieves remote device and GUI XML and generates node map references.
This function needs to be called before any camera related API calls such as BeginAcquisition(), EndAcquisition(), GetNodeMap(), GetNextImage() and GetNextImageSync().
Implements ICameraBase.
|
virtual |
IsInitialized Checks if camera is initialized.
This function needs to return true in order to retrieve a valid NodeMap from the GetNodeMap() call.
Implements ICameraBase.
|
virtual |
IsStreaming Returns true if the camera is currently streaming or false if it is not.
Implements ICameraBase.
|
virtual |
IsValid Checks a flag to determine if camera is still valid for use.
Implements ICameraBase.
|
protected |
Assignment operator.
|
virtual |
Implements ICameraBase.
|
virtual |
RegisterEventHandler(DeviceEventHandler &, const GenICam::gcstring &) Registers a specific device event handler for the camera given a device event name.
The camera has to be initialized first with a call to Init() before registering handlers for events.
evtHandlerToRegister | The event handler to register for the camera |
eventName | The event name to register |
Implements ICameraBase.
|
virtual |
RegisterEventHandler(EventHandler &) Registers a generic device, image or image list event handler for the camera.
The camera has to be initialized first with a call to Init() before registering handlers for events.
evtHandlerToRegister | The event handler to register for the camera |
Implements ICameraBase.
|
virtual |
RegisterEventHandler(ImageEventHandler &, uint64_t) Registers a specific stream handler for the camera given a stream index.
The camera has to be initialized first with a call to Init() before registering handlers for events.
evtHandlerToRegister | The event handler to register for the camera |
streamIndex | The index of the stream of where this handler will be registered to |
Implements ICameraBase.
|
virtual |
SetBufferOwnership Sets data buffer ownership.
The data buffers can be owned by System or User. If the system owns the buffers, the memory required for the buffers are allocated and freed by the library. If user owns the buffers, the user is responsible for allocating and ultimately freeing the memory. By default, data buffers are owned by the library.
Note that an error SPINNAKER_ERR_NOT_IMPLEMENTED will be thrown during BeginAcquisition() if an unsupported combination of stream mode and buffer ownership is set.
mode | Buffer ownership to set |
Implements ICameraBase.
|
virtual |
SetUserBuffers Specify non-contiguous user allocated memory to use as data buffers.
Each pointer to a buffer must have enough memory to hold one image. To prevent image tearing when working with USB3 cameras, the size of each buffer should be equal to: ((unsigned int) (bufferSize + 1024 - 1) / 1024) * 1024 where 1024 is the USB3 packet size.
ppMemBuffers | Pointer to pointers that each point to a single user memory buffer to be written to |
bufferCount | The number of user memory buffers |
bufferSize | The size of the memory allocated for each user buffer (in bytes) |
Implements ICameraBase.
|
virtual |
SetUserBuffers Specify contiguous user allocated memory to use as data buffers.
To prevent image tearing when working with USB3 cameras, the size of each buffer should be equal to: ((unsigned int) (bufferSize + 1024 - 1) / 1024) * 1024 where 1024 is the USB3 packet size.
When working with GigE cameras, allocate memory and set at least 2 buffers for OldestFirst and NewestFirst stream modes, and 3 buffers for OldestFirstOverwrite and NewestOnly modes
Note that an error SPINNAKER_ERR_NOT_IMPLEMENTED will be thrown during BeginAcquisition() if an unsupported combination of stream mode and buffer ownership is set.
pMemBuffers | Pointer to memory buffers to be written to |
totalSize | The total size of the memory allocated for the user buffers (in bytes) |
Implements ICameraBase.
|
virtual |
UnregisterEventHandler Unregisters any type of event handler for the camera.
Event handlers should be unregistered first before calling camera DeInit(). Otherwise an exception will be thrown in the DeInit() call and require the user to unregister event handlers before the camera can be re-initialized again.
evtHandlerToUnregister | The event handler to unregister from the camera |
Implements ICameraBase.
|
virtual |
Implements ICameraBase.
|
friend |