Spinnaker C
4.3.0.189
 
Functions | Variables
Camera Access

The functions in this section provide access to information, objects, and functionality of cameras. This includes nodemap retrieval, acquisition and init commands, event handler registration, and camera property retrieval. More...

Functions

SPINNAKERC_API spinCameraInit (spinCamera hCamera)
 Initializes a camera, allowing for much more interaction. More...
 
SPINNAKERC_API spinCameraDeInit (spinCamera hCamera)
 Deinitializes a camera, greatly reducing functionality. More...
 
SPINNAKERC_API spinCameraGetNodeMap (spinCamera hCamera, spinNodeMapHandle *phNodeMap)
 Retrieves the GenICam nodemap from a camera. More...
 
SPINNAKERC_API spinCameraGetTLDeviceNodeMap (spinCamera hCamera, spinNodeMapHandle *phNodeMap)
 Retrieves the transport layer device nodemap from a camera. More...
 
SPINNAKERC_API spinCameraGetTLStreamNodeMap (spinCamera hCamera, spinNodeMapHandle *phNodeMap)
 Retrieves the transport layer stream nodemap from a camera. More...
 
SPINNAKERC_API spinCameraGetAccessMode (spinCamera hCamera, spinAccessMode *pAccessMode)
 Retrieves the access mode of a camera (as an enum, spinAccessMode) More...
 
SPINNAKERC_API spinCameraReadPort (spinCamera hCamera, uint64_t iAddress, void *pBuffer, size_t iSize)
 
SPINNAKERC_API spinCameraWritePort (spinCamera hCamera, uint64_t iAddress, void *pBuffer, size_t iSize)
 
SPINNAKERC_API spinCameraBeginAcquisition (spinCamera hCamera)
 Has a camera start acquiring images. More...
 
SPINNAKERC_API spinCameraEndAcquisition (spinCamera hCamera)
 Has a camera stop acquiring images. More...
 
SPINNAKERC_API spinCameraGetNextImage (spinCamera hCamera, spinImage *phImage)
 Retrieves an image from a camera. More...
 
SPINNAKERC_API spinCameraGetNextImageEx (spinCamera hCamera, uint64_t grabTimeout, spinImage *phImage)
 Retrieves an image from a camera; manually set the timeout in milliseconds. More...
 
SPINNAKERC_API spinCameraGetNextImageSync (spinCamera hCamera, uint64_t grabTimeout, spinImageList *phImageList)
 If a camera supports one or more streams, this function gets one image from each of the camera's streams, and returns the images in a list. More...
 
SPINNAKERC_API spinCameraGetDeviceID (spinCamera hCamera, char *pBuf, size_t *pBufLen)
 Retrieves a unique identifier for a camera. More...
 
SPINNAKERC_API spinCameraGetDeviceSerialNumber (spinCamera hCamera, char *pBuf, size_t *pBufLen)
 Retrieves a manufacturer specific serial number that identifies the camera. More...
 
 SPINNAKERC_API_DEPRECATED ("Use spinCameraGetDeviceID() instead.", spinCameraGetUniqueID(spinCamera hCamera, char *pBuf, size_t *pBufLen);) SPINNAKERC_API spinCameraIsStreaming(spinCamera hCamera
 Retrieves a unique identifier for a camera. More...
 
SPINNAKERC_API spinCameraGetGuiXml (spinCamera hCamera, char *pBuf, size_t *pBufLen)
 Retrieves the GUI XML from a camera. More...
 
 SPINNAKERC_API_DEPRECATED ("Use spinNodeRegisterCallback() and spinNodeDeregisterCallback() for handling device node callbacks instead.", spinCameraRegisterDeviceEventHandler(spinCamera hCamera, spinDeviceEventHandler hDeviceEventHandler))
 Registers a universal device event handler (every device event type) to a camera. More...
 
 SPINNAKERC_API_DEPRECATED ("Use spinNodeRegisterCallback() and spinNodeDeregisterCallback() for handling device node callbacks instead.", spinCameraRegisterDeviceEventHandlerEx(spinCamera hCamera, spinDeviceEventHandler hDeviceEventHandler, const char *pName))
 Registers a specific device event handler (only one device event type) to a camera. More...
 
 SPINNAKERC_API_DEPRECATED ("Use spinNodeRegisterCallback() and spinNodeDeregisterCallback() for handling device node callbacks instead.", spinCameraUnregisterDeviceEventHandler(spinCamera hCamera, spinDeviceEventHandler hDeviceEventHandler))
 Unregisters a device event handler from a camera. More...
 
SPINNAKERC_API spinCameraRegisterImageEventHandler (spinCamera hCamera, spinImageEventHandler hImageEventHandler)
 Registers an image event handler to a camera. More...
 
SPINNAKERC_API spinCameraRegisterImageEventHandlerEx (spinCamera hCamera, spinImageEventHandler hImageEventHandler, uint64_t streamIndex)
 Registers an image event handler to a camera Registers a specific stream handler for the camera given a stream index. More...
 
SPINNAKERC_API spinCameraUnregisterImageEventHandler (spinCamera hCamera, spinImageEventHandler hImageEventHandler)
 Unregisters an image event handler from a camera. More...
 
SPINNAKERC_API spinCameraRegisterImageListEventHandler (spinCamera hCamera, spinImageListEventHandler hImageListEventHandler)
 Registers an image list event handler to a camera. More...
 
SPINNAKERC_API spinCameraUnregisterImageListEventHandler (spinCamera hCamera, spinImageListEventHandler hImageListEventHandler)
 Unregisters an image list event handler from a camera. More...
 
SPINNAKERC_API spinCameraRelease (spinCamera hCamera)
 Releases a camera. More...
 
SPINNAKERC_API spinCameraIsValid (spinCamera hCamera, bool8_t *pbValid)
 Checks whether a camera is still valid for use. More...
 
SPINNAKERC_API spinCameraIsInitialized (spinCamera hCamera, bool8_t *pbInit)
 Checks whether a camera is currently initialized. More...
 

Variables

bool8_tpbIsStreaming
 

Detailed Description

The functions in this section provide access to information, objects, and functionality of cameras. This includes nodemap retrieval, acquisition and init commands, event handler registration, and camera property retrieval.

Function Documentation

◆ spinCameraBeginAcquisition()

SPINNAKERC_API spinCameraBeginAcquisition ( spinCamera  hCamera)

Has a camera start acquiring images.

See also
spinError
Parameters
hCameraThe camera to begin acquiring images
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinCameraDeInit()

SPINNAKERC_API spinCameraDeInit ( spinCamera  hCamera)

Deinitializes a camera, greatly reducing functionality.

See also
spinError
Parameters
hCameraThe camera to deinitialize
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, NodeMapInfo_C.c, NodeMapInfo_C_QuickSpin.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinCameraEndAcquisition()

SPINNAKERC_API spinCameraEndAcquisition ( spinCamera  hCamera)

Has a camera stop acquiring images.

See also
spinError
Parameters
hCameraThe camera to stop acquiring images
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinCameraGetAccessMode()

SPINNAKERC_API spinCameraGetAccessMode ( spinCamera  hCamera,
spinAccessMode *  pAccessMode 
)

Retrieves the access mode of a camera (as an enum, spinAccessMode)

See also
spinError
spinAccessMode
Parameters
hCameraThe camera of the access mode to retrieve
pAccessModeThe access mode enum pointer in which the access mode is returned
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraGetDeviceID()

SPINNAKERC_API spinCameraGetDeviceID ( spinCamera  hCamera,
char *  pBuf,
size_t *  pBufLen 
)

Retrieves a unique identifier for a camera.

See also
spinError
Parameters
hCameraThe camera of the unique identifier
pBufThe c-string character buffer in which the unique identifier is returned
pBufLenThe unsigned integer pointer in which the length of the c-string is returned; the input value is the maximum length
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraGetDeviceSerialNumber()

SPINNAKERC_API spinCameraGetDeviceSerialNumber ( spinCamera  hCamera,
char *  pBuf,
size_t *  pBufLen 
)

Retrieves a manufacturer specific serial number that identifies the camera.

See also
spinError
Parameters
hCameraThe camera handle identified by the serial number
pBufThe c-string character buffer in which the device serial number is returned
pBufLenThe unsigned integer pointer in which the length of the c-string is returned; the input value is the maximum length
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
EnumerationEvents_C.c.

◆ spinCameraGetGuiXml()

SPINNAKERC_API spinCameraGetGuiXml ( spinCamera  hCamera,
char *  pBuf,
size_t *  pBufLen 
)

Retrieves the GUI XML from a camera.

See also
spinError
Parameters
hCameraThe camera of the GUI XML to retrieve
pBufThe c-string character buffer in which the GUI XML is returned
pBufLenThe unsigned integer pointer in which the length of the c-string is returned; the input value is the maximum length
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraGetNextImage()

SPINNAKERC_API spinCameraGetNextImage ( spinCamera  hCamera,
spinImage phImage 
)

Retrieves an image from a camera.

See also
spinError
Parameters
hCameraThe camera of the image to retrieve
phImageThe image handle pointer in which the image is returned
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraGetNextImageEx()

SPINNAKERC_API spinCameraGetNextImageEx ( spinCamera  hCamera,
uint64_t  grabTimeout,
spinImage phImage 
)

Retrieves an image from a camera; manually set the timeout in milliseconds.

See also
spinError
Parameters
hCameraThe camera of the image to retrieve
grabTimeoutA 64bit value that represents a timeout in milliseconds
phImageThe image handle pointer in which the image is returned
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinCameraGetNextImageSync()

SPINNAKERC_API spinCameraGetNextImageSync ( spinCamera  hCamera,
uint64_t  grabTimeout,
spinImageList phImageList 
)

If a camera supports one or more streams, this function gets one image from each of the camera's streams, and returns the images in a list.

This function will block for the specified timeout period until an image arrives on all the streams.

See also
spinCameraInit()
spinCameraBeginAcquisition()
spinCameraEndAcquisition()
Parameters
hCameraThe camera of the image to retrieve
grabTimeoutA 64bit value that represents a timeout in milliseconds
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraGetNodeMap()

SPINNAKERC_API spinCameraGetNodeMap ( spinCamera  hCamera,
spinNodeMapHandle phNodeMap 
)

Retrieves the GenICam nodemap from a camera.

See also
spinError
Parameters
hCameraThe camera from which the nodemap is retrieved
phNodeMapThe nodemap handle pointer in which the nodemap is returned
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, ImageEvents_C.c, ImageFormatControl_C.c, LookupTable_C.c, NodeMapCallback_C.c, NodeMapInfo_C.c, SaveToVideo_C.c, Sequencer_C.c, and Trigger_C.c.

◆ spinCameraGetTLDeviceNodeMap()

SPINNAKERC_API spinCameraGetTLDeviceNodeMap ( spinCamera  hCamera,
spinNodeMapHandle phNodeMap 
)

Retrieves the transport layer device nodemap from a camera.

See also
spinError
Parameters
hCameraThe camera from which the transport layer device nodemap is retrieved
phNodeMapThe nodemap handle pointer in which the nodemap is returned
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Enumeration_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, NodeMapInfo_C.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinCameraGetTLStreamNodeMap()

SPINNAKERC_API spinCameraGetTLStreamNodeMap ( spinCamera  hCamera,
spinNodeMapHandle phNodeMap 
)

Retrieves the transport layer stream nodemap from a camera.

See also
spinError
Parameters
hCameraThe camera from which the transport layer streaming nodemap is retrieved
phNodeMapThe nodemap handle pointer in which the nodemap is returned
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, NodeMapCallback_C.c, and NodeMapInfo_C.c.

◆ spinCameraInit()

SPINNAKERC_API spinCameraInit ( spinCamera  hCamera)

Initializes a camera, allowing for much more interaction.

See also
spinError
Parameters
hCameraThe camera to initialize
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
Acquisition_C.c, AcquisitionMultipleCamera_C.c, ChunkData_C.c, Exposure_C.c, Exposure_C_Quickspin.c, ImageEvents_C.c, ImageFormatControl_C.c, ImageFormatControl_C_Quickspin.c, LookupTable_C.c, NodeMapCallback_C.c, NodeMapInfo_C.c, NodeMapInfo_C_QuickSpin.c, SaveToVideo_C.c, Sequencer_C.c, Trigger_C.c, and Trigger_C_QuickSpin.c.

◆ spinCameraIsInitialized()

SPINNAKERC_API spinCameraIsInitialized ( spinCamera  hCamera,
bool8_t pbInit 
)

Checks whether a camera is currently initialized.

See also
spinError
Parameters
hCameraThe camera to check
pbInitThe boolean pointer to return whether or not the camera is initialized
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraIsValid()

SPINNAKERC_API spinCameraIsValid ( spinCamera  hCamera,
bool8_t pbValid 
)

Checks whether a camera is still valid for use.

See also
spinError
Parameters
hCameraThe camera to check
pbValidThe boolean pointer to return whether or not the camera is valid
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraReadPort()

SPINNAKERC_API spinCameraReadPort ( spinCamera  hCamera,
uint64_t  iAddress,
void *  pBuffer,
size_t  iSize 
)

◆ spinCameraRegisterImageEventHandler()

SPINNAKERC_API spinCameraRegisterImageEventHandler ( spinCamera  hCamera,
spinImageEventHandler  hImageEventHandler 
)

Registers an image event handler to a camera.

See also
spinError
Parameters
hCameraThe camera on which to register the image event handler
hImageEventHandlerThe image event handler to register
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
ImageEvents_C.c.

◆ spinCameraRegisterImageEventHandlerEx()

SPINNAKERC_API spinCameraRegisterImageEventHandlerEx ( spinCamera  hCamera,
spinImageEventHandler  hImageEventHandler,
uint64_t  streamIndex 
)

Registers an image event handler to a camera Registers a specific stream handler for the camera given a stream index.

The camera has to be initialized first with a call to spinCameraInit() before registering handlers for events.

See also
spinError
Parameters
hCameraThe camera on which to register the image event handler
hImageEventHandlerThe image event handler to register
streamIndexThe index of the stream of where this handler will be registered to
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraRegisterImageListEventHandler()

SPINNAKERC_API spinCameraRegisterImageListEventHandler ( spinCamera  hCamera,
spinImageListEventHandler  hImageListEventHandler 
)

Registers an image list event handler to a camera.

See also
spinError
Parameters
hCameraThe camera on which to register the image event handler
hImageListEventHandlerThe image list event handler to register
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraRelease()

SPINNAKERC_API spinCameraRelease ( spinCamera  hCamera)

◆ spinCameraUnregisterImageEventHandler()

SPINNAKERC_API spinCameraUnregisterImageEventHandler ( spinCamera  hCamera,
spinImageEventHandler  hImageEventHandler 
)

Unregisters an image event handler from a camera.

See also
spinError
Parameters
hCameraThe camera from which to unregister the image event handler
hImageEventHandlerThe image event handler to unregister
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error
Examples
ImageEvents_C.c.

◆ spinCameraUnregisterImageListEventHandler()

SPINNAKERC_API spinCameraUnregisterImageListEventHandler ( spinCamera  hCamera,
spinImageListEventHandler  hImageListEventHandler 
)

Unregisters an image list event handler from a camera.

See also
spinError
Parameters
hCameraThe camera from which to unregister the image event handler
hImageEventHandlerThe image event handler to unregister
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ spinCameraWritePort()

SPINNAKERC_API spinCameraWritePort ( spinCamera  hCamera,
uint64_t  iAddress,
void *  pBuffer,
size_t  iSize 
)

◆ SPINNAKERC_API_DEPRECATED() [1/4]

SPINNAKERC_API_DEPRECATED ( "Use spinCameraGetDeviceID() instead."  ,
spinCameraGetUniqueID(spinCamera hCamera, char *pBuf, size_t *pBufLen);   
)

Retrieves a unique identifier for a camera.

See also
spinError
Parameters
hCameraThe camera of the unique identifier
pBufThe c-string character buffer in which the unique identifier is returned
pBufLenThe unsigned integer pointer in which the length of the c-string is returned; the input value is the maximum length
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error Checks whether a camera is currently acquiring images
See also
spinError
Parameters
hCameraThe camera to check
pbIsStreamingThe boolean pointer to return whether or not the camera is currently streaming
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ SPINNAKERC_API_DEPRECATED() [2/4]

SPINNAKERC_API_DEPRECATED ( "Use spinNodeRegisterCallback() and spinNodeDeregisterCallback() for handling device node callbacks instead."  ,
spinCameraRegisterDeviceEventHandler(spinCamera hCamera, spinDeviceEventHandler hDeviceEventHandler)   
)

Registers a universal device event handler (every device event type) to a camera.

See also
spinError
Parameters
hCameraThe camera on which to register the universal device event handler
hDeviceEventHandlerThe device event handler to register
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ SPINNAKERC_API_DEPRECATED() [3/4]

SPINNAKERC_API_DEPRECATED ( "Use spinNodeRegisterCallback() and spinNodeDeregisterCallback() for handling device node callbacks instead."  ,
spinCameraRegisterDeviceEventHandlerEx(spinCamera hCamera, spinDeviceEventHandler hDeviceEventHandler, const char *pName)   
)

Registers a specific device event handler (only one device event type) to a camera.

See also
spinError
Parameters
hCameraThe camera on which to register the specific device event handler
hDeviceEventHandlerThe device event handler to register
pNameThe name of the device event handler to register
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

◆ SPINNAKERC_API_DEPRECATED() [4/4]

SPINNAKERC_API_DEPRECATED ( "Use spinNodeRegisterCallback() and spinNodeDeregisterCallback() for handling device node callbacks instead."  ,
spinCameraUnregisterDeviceEventHandler(spinCamera hCamera, spinDeviceEventHandler hDeviceEventHandler)   
)

Unregisters a device event handler from a camera.

See also
spinError
Parameters
hCameraThe camera from which to unregister the device event handler
hDeviceEventHandlerThe device event handler to unregister
Returns
spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error

Variable Documentation

◆ pbIsStreaming

bool8_t* pbIsStreaming