Class Spinnaker::CameraBase¶
ClassList > Spinnaker > CameraBase
The base class for the camera object.
#include <CameraBase.h>
Inherits the following classes: Spinnaker::ICameraBase
Inherited by the following classes: Spinnaker::Camera
Public Attributes inherited from Spinnaker::ICameraBase¶
| Type | Name |
|---|---|
| TransportLayerDevice | TLDevice |
| TransportLayerStream | TLStream |
Public Functions¶
| Type | Name |
|---|---|
| virtual void | BeginAcquisition () |
| virtual void | DeInit () |
| virtual unsigned int | DiscoverMaxPacketSize () |
| virtual void | EndAcquisition () |
| virtual void | ForceIP () |
| virtual GenApi::EAccessMode | GetAccessMode () const |
| virtual unsigned int | GetActiveNumDataStreams () |
| virtual BufferOwnership | GetBufferOwnership () const |
| virtual GenICam::gcstring | GetDeviceID () |
| GenICam::gcstring | GetDeviceSerialNumber () |
| virtual GenICam::gcstring | GetGuiXml () const |
| virtual ImagePtr | GetNextImage (uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE, uint64_t streamIndex=0) |
| virtual ImageList | GetNextImageSync (uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE) |
| virtual GenApi::INodeMap & | GetNodeMap () const |
| virtual unsigned int | GetNumDataStreams () |
| virtual unsigned int | GetNumImagesInUse () |
| virtual ProducerPtr | GetProducer () const |
| virtual GenApi::INodeMap & | GetTLDeviceNodeMap () const |
| virtual GenApi::INodeMap & | GetTLStreamNodeMap (uint64_t streamIndex=0) const |
| virtual GenICam::gcstring | GetUniqueID () |
| virtual uint64_t | GetUserBufferCount () const |
| virtual uint64_t | GetUserBufferSize () const |
| virtual uint64_t | GetUserBufferTotalSize () const |
| virtual void | Init () |
| virtual bool | IsInitialized () |
| virtual bool | IsStreaming () const |
| virtual bool | IsValid () |
| virtual void | ReadPort (uint64_t iAddress, void * pBuffer, size_t iSize) |
| virtual void | RegisterEventHandler (EventHandler & evtHandlerToRegister) |
| virtual void | RegisterEventHandler (DeviceEventHandler & evtHandlerToRegister, const GenICam::gcstring & eventName) |
| virtual void | RegisterEventHandler (ImageEventHandler & evtHandlerToRegister, uint64_t streamIndex) |
| virtual void | SetBufferOwnership (const BufferOwnership mode) |
| virtual void | SetUserBuffers (void *const pMemBuffers, uint64_t totalSize) |
| virtual void | SetUserBuffers (void **const ppMemBuffers, const uint64_t bufferCount, const uint64_t bufferSize) |
| virtual void | UnregisterAllLoggingEventHandlers () |
| virtual void | UnregisterEventHandler (EventHandler & evtHandlerToUnregister) |
| virtual void | WritePort (uint64_t iAddress, const void * pBuffer, size_t iSize) |
| virtual | ~CameraBase (void) |
Public Functions inherited from Spinnaker::ICameraBase¶
| Type | Name |
|---|---|
| virtual void | BeginAcquisition () = 0 |
| virtual void | DeInit () = 0 |
| virtual unsigned int | DiscoverMaxPacketSize () = 0 |
| virtual void | EndAcquisition () = 0 |
| virtual void | ForceIP () = 0 |
| virtual GenApi::EAccessMode | GetAccessMode () const = 0 |
| virtual unsigned int | GetActiveNumDataStreams () = 0 |
| virtual BufferOwnership | GetBufferOwnership () const = 0 |
| virtual GenICam::gcstring | GetDeviceID () = 0 |
| virtual GenICam::gcstring | GetGuiXml () const = 0 |
| virtual ImagePtr | GetNextImage (uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE, uint64_t streamIndex=0) = 0 |
| virtual ImageList | GetNextImageSync (uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE) = 0 |
| virtual GenApi::INodeMap & | GetNodeMap () const = 0 |
| virtual unsigned int | GetNumDataStreams () = 0 |
| virtual unsigned int | GetNumImagesInUse () = 0 |
| virtual ProducerPtr | GetProducer () const = 0 |
| virtual GenApi::INodeMap & | GetTLDeviceNodeMap () const = 0 |
| virtual GenApi::INodeMap & | GetTLStreamNodeMap (uint64_t streamIndex) const = 0 |
| virtual GenICam::gcstring | GetUniqueID () = 0 |
| virtual uint64_t | GetUserBufferCount () const = 0 |
| virtual uint64_t | GetUserBufferSize () const = 0 |
| virtual uint64_t | GetUserBufferTotalSize () const = 0 |
| virtual void | Init () = 0 |
| virtual bool | IsInitialized () = 0 |
| virtual bool | IsStreaming () const = 0 |
| virtual bool | IsValid () = 0 |
| virtual void | ReadPort (uint64_t iAddress, void * pBuffer, size_t iSize) = 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 | SetBufferOwnership (const BufferOwnership mode) = 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 void | UnregisterAllLoggingEventHandlers () = 0 |
| virtual void | UnregisterEventHandler (EventHandler & evtHandlerToUnregister) = 0 |
| virtual void | WritePort (uint64_t iAddress, const void * pBuffer, size_t iSize) = 0 |
| virtual | ~ICameraBase (void) |
Protected Attributes inherited from Spinnaker::ICameraBase¶
| Type | Name |
|---|---|
| CameraBaseData * | m_pCameraBaseData |
Protected Functions¶
| Type | Name |
|---|---|
| CameraBase (void) |
|
| CameraBase (const CameraBase &) |
|
| CameraBase & | operator= (const CameraBase &) |
Protected Functions inherited from Spinnaker::ICameraBase¶
| Type | Name |
|---|---|
| ICameraBase () |
|
| ICameraBase (const ICameraBase &) |
|
| ICameraBase & | operator= (const ICameraBase &) |
Public Functions Documentation¶
function BeginAcquisition¶
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.
See also: Init()
Implements Spinnaker::ICameraBase::BeginAcquisition
function DeInit¶
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.
See also: Init()
See also: UnregisterEventHandler(EventHandler & evtHandlerToUnregister)
Implements Spinnaker::ICameraBase::DeInit
function DiscoverMaxPacketSize¶
DiscoverMaxPacketSize Returns the largest packet size that can be safely used on the interface that device is connected to
Returns:
The maximum packet size returned.
Implements Spinnaker::ICameraBase::DiscoverMaxPacketSize
function EndAcquisition¶
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.
See also: Init()
See also: BeginAcquisition()
See also: GetNextImage( grabTimeout )
See also: GetNextImageSync( grabTimeout )
See also: Image::Release()
Implements Spinnaker::ICameraBase::EndAcquisition
function ForceIP¶
ForceIP Forces the camera to be on the same subnet as its corresponding interface.
Implements Spinnaker::ICameraBase::ForceIP
function GetAccessMode¶
GetAccessMode Returns the access mode that the software has on the Camera. The camera does not need to be initialized before calling this function.
See also: Init()
Returns:
An enumeration value indicating the access mode
Implements Spinnaker::ICameraBase::GetAccessMode
function GetActiveNumDataStreams¶
GetActiveNumDataStreams Returns the number of data streams that are currently active.
Returns:
The number of active data streams
Implements Spinnaker::ICameraBase::GetActiveNumDataStreams
function GetBufferOwnership¶
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.
See also: SetBufferOwnership()
See also: SetUserBuffers()
Returns:
Buffer ownership
Implements Spinnaker::ICameraBase::GetBufferOwnership
function GetDeviceID¶
GetDeviceID This returns a unique id string that identifies the camera; a unique string for USB devices, and MAC address for GEV devices.
Returns:
string that uniquely identifies the camera
Implements Spinnaker::ICameraBase::GetDeviceID
function GetDeviceSerialNumber¶
GetDeviceSerialNumber This returns a manufacturer specific serial number that identifies the camera.
Returns:
serial number string that identifies the camera
function GetGuiXml¶
GetGuiXml Returns the GUI XML that can be passed into the Spinnaker GUI framework
Returns:
GenICam::gcstring that represents the uncompressed GUI XML file
Implements Spinnaker::ICameraBase::GetGuiXml
function GetNextImage¶
virtual ImagePtr Spinnaker::CameraBase::GetNextImage (
uint64_t grabTimeout=EVENT_TIMEOUT_INFINITE,
uint64_t streamIndex=0
)
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.
See also: Init()
See also: BeginAcquisition()
See also: EndAcquisition()
Parameters:
grabTimeoutA 64bit value that represents a timeout in millisecondsstreamIndexThe index of the stream to grab the image from
Returns:
pointer to an Image object
Implements Spinnaker::ICameraBase::GetNextImage
function GetNextImageSync¶
virtual ImageList Spinnaker::CameraBase::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.
See also: Init()
See also: BeginAcquisition()
See also: EndAcquisition()
Parameters:
grabTimeoutA 64bit value that represents a timeout in milliseconds
Returns:
a list containing the Image objects
Implements Spinnaker::ICameraBase::GetNextImageSync
function GetNodeMap¶
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.
See also: Init()
Returns:
A reference to the INodeMap.
Implements Spinnaker::ICameraBase::GetNodeMap
function GetNumDataStreams¶
GetNumDataStreams Returns the total number of streams that the device supports. For configurable multistream cameras, use GetActiveNumDataStreams() to get the number of active streams.
See also: GetActiveNumDataStreams()
Returns:
The total number of data streams
Implements Spinnaker::ICameraBase::GetNumDataStreams
function GetNumImagesInUse¶
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().
Returns:
The number of images that needs to be cleaned up.
Implements Spinnaker::ICameraBase::GetNumImagesInUse
function GetProducer¶
Returns a producer from which this camera is enumerated.
Returns:
A Producer object.
Implements Spinnaker::ICameraBase::GetProducer
function GetTLDeviceNodeMap¶
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.
Returns:
A reference to the INodeMap.
Implements Spinnaker::ICameraBase::GetTLDeviceNodeMap
function GetTLStreamNodeMap¶
virtual GenApi::INodeMap & Spinnaker::CameraBase::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. The camera does not need to be initialized before acquiring this node map.
Parameters:
streamIndexThe index of the stream to grab the image from
Returns:
A reference to the INodeMap.
Implements Spinnaker::ICameraBase::GetTLStreamNodeMap
function GetUniqueID¶
GetUniqueID This returns a unique id string that identifies the camera.
Deprecated
Use GetDeviceID() instead.
Returns:
string that uniquely identifies the camera
Implements Spinnaker::ICameraBase::GetUniqueID
function GetUserBufferCount¶
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.
See also: BeginAcquisition()
See also: SetUserBuffers()
Returns:
The number of user memory buffers
Implements Spinnaker::ICameraBase::GetUserBufferCount
function GetUserBufferSize¶
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.
See also: BeginAcquisition()
See also: SetUserBuffers()
Returns:
The size of one user memory buffer (in bytes)
Implements Spinnaker::ICameraBase::GetUserBufferSize
function GetUserBufferTotalSize¶
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.
See also: GetUserBufferCount()
See also: GetUserBufferSize()
See also: SetUserBuffers()
Returns:
The total size of all the user memory buffers (in bytes)
Implements Spinnaker::ICameraBase::GetUserBufferTotalSize
function Init¶
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().
See also: BeginAcquisition()
See also: EndAcquisition()
See also: GetNodeMap()
See also: GetNextImage()
See also: GetNextImageSync()
Implements Spinnaker::ICameraBase::Init
function IsInitialized¶
IsInitialized Checks if camera is initialized. This function needs to return true in order to retrieve a valid NodeMap from the GetNodeMap() call.
See also: GetNodeMap()
Returns:
If camera is initialized or not
Implements Spinnaker::ICameraBase::IsInitialized
function IsStreaming¶
IsStreaming Returns true if the camera is currently streaming or false if it is not.
See also: Init()
Returns:
returns true if camera is streaming and false otherwise.
Implements Spinnaker::ICameraBase::IsStreaming
function IsValid¶
IsValid Checks a flag to determine if camera is still valid for use.
Returns:
If camera is valid or not
Implements Spinnaker::ICameraBase::IsValid
function ReadPort¶
ReadPort Reads a remote port on a physical Camera. This function can be used to read registers on Cameras.
Caution: Only perform direct read/write to a register if the register isn't supported in the device nodemap. Otherwise the camera and nodemap may be left in an undefined state after the register read/write.
See also: WritePort()
Parameters:
iAddressA 64 bit address to a register on the camerapBufferA pointer to a data buffer that will store resultiSizeNumber of bytes to read
Implements Spinnaker::ICameraBase::ReadPort
function RegisterEventHandler [1/3]¶
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.
See also: Init()
See also: UnregisterEventHandler()
See also: DeviceEventHandler
See also: ImageEventHandler
See also: ImageListEventHandler
Parameters:
evtHandlerToRegisterThe event handler to register for the camera
Implements Spinnaker::ICameraBase::RegisterEventHandler
function RegisterEventHandler [2/3]¶
virtual void Spinnaker::CameraBase::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. The camera has to be initialized first with a call to Init() before registering handlers for events.
Deprecated
Use GenApi::Register() and GenApi::Unregister() for handling device node callbacks instead.
See also: Init()
See also: UnregisterEventHandler()
Parameters:
evtHandlerToRegisterThe event handler to register for the cameraeventNameThe event name to register
Implements Spinnaker::ICameraBase::RegisterEventHandler
function RegisterEventHandler [3/3]¶
virtual void Spinnaker::CameraBase::RegisterEventHandler (
ImageEventHandler & evtHandlerToRegister,
uint64_t streamIndex
)
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.
See also: Init()
See also: UnregisterEventHandler()
Parameters:
evtHandlerToRegisterThe event handler to register for the camerastreamIndexThe index of the stream of where this handler will be registered to
Implements Spinnaker::ICameraBase::RegisterEventHandler
function SetBufferOwnership¶
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.
See also: GetBufferOwnership()
See also: SetUserBuffers()
Parameters:
modeBuffer ownership to set
Implements Spinnaker::ICameraBase::SetBufferOwnership
function SetUserBuffers [1/2]¶
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.
See also: GetBufferOwnership()
See also: SetBufferOwnership()
See also: GetUserBufferCount()
See also: GetUserBufferSize()
See also: GetUserBufferTotalSize()
Parameters:
pMemBuffersPointer to memory buffers to be written tototalSizeThe total size of the memory allocated for the user buffers (in bytes)
Implements Spinnaker::ICameraBase::SetUserBuffers
function SetUserBuffers [2/2]¶
virtual void Spinnaker::CameraBase::SetUserBuffers (
void **const ppMemBuffers,
const uint64_t bufferCount,
const uint64_t bufferSize
)
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.
See also: GetBufferOwnership()
See also: SetBufferOwnership()
See also: GetUserBufferCount()
See also: GetUserBufferSize()
See also: GetUserBufferTotalSize()
Parameters:
ppMemBuffersPointer to pointers that each point to a single user memory buffer to be written tobufferCountThe number of user memory buffersbufferSizeThe size of the memory allocated for each user buffer (in bytes)
Implements Spinnaker::ICameraBase::SetUserBuffers
function UnregisterAllLoggingEventHandlers¶
Unregisters all previously registered logging events.
Implements Spinnaker::ICameraBase::UnregisterAllLoggingEventHandlers
function UnregisterEventHandler¶
virtual void Spinnaker::CameraBase::UnregisterEventHandler (
EventHandler & evtHandlerToUnregister
)
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.
See also: DeInit()
See also: RegisterEventHandler()
Parameters:
evtHandlerToUnregisterThe event handler to unregister from the camera
Implements Spinnaker::ICameraBase::UnregisterEventHandler
function WritePort¶
virtual void Spinnaker::CameraBase::WritePort (
uint64_t iAddress,
const void * pBuffer,
size_t iSize
)
WritePort Writes a remote port on a physical Camera. This function can be used to write registers on Cameras.
Caution: Only perform direct read/write to a register if the register isn't supported in the device nodemap. Otherwise the camera and nodemap may be left in an undefined state after the register read/write.
See also: ReadPort()
Parameters:
iAddressA 64 bit address to a register on the camerapBufferA pointer to a data buffer that will be writteniSizeNumber of bytes to write
Implements Spinnaker::ICameraBase::WritePort
function ~CameraBase¶
Virtual Destructor
Protected Functions Documentation¶
function CameraBase [1/2]¶
Default constructor.
function CameraBase [2/2]¶
Copy constructor.
function operator=¶
Assignment operator.
The documentation for this class was generated from the following file C:/workspace/include/CameraBase.h