Spinnaker C
4.3.0.189
 
ChunkData_C.c

ChunkData_C.c shows how to get chunk data on an image, either from the nodemap or from the image itself. It relies on information provided in the Enumeration_C, Acquisition_C, and NodeMapInfo_C examples.

It can also be helpful to familiarize yourself with the ImageFormatControl_C and Exposure_C examples. As they are somewhat shorter and simpler, either provides a strong introduction to camera customization.

Chunk data provides information on various traits of an image. This includes identifiers such as frame ID, properties such as black level, and more. This information can be acquired from either the nodemap or the image itself.

It may be preferable to grab chunk data from each individual image, as it can be hard to verify whether data is coming from the correct image when using the nodemap. This is because chunk data retrieved from the nodemap is only valid for the current image; when spinCameraGetNextImage() or spinCameraGetNextImageEx() is called, chunk data will be updated to that of the new current image.

Please leave us feedback at: https://www.surveymonkey.com/r/TDYMVAPI More source code examples at: https://github.com/Teledyne-MV/Spinnaker-Examples Need help? Check out our forum at: https://teledynevisionsolutions.zendesk.com/hc/en-us/community/topics

//=============================================================================
// Copyright (c) 2025 FLIR Integrated Imaging Solutions, Inc. All Rights Reserved.
//
// This software is the confidential and proprietary information of FLIR
// Integrated Imaging Solutions, Inc. ("Confidential Information"). You
// shall not disclose such Confidential Information and shall use it only in
// accordance with the terms of the license agreement you entered into
// with FLIR Integrated Imaging Solutions, Inc. (FLIR).
//
// FLIR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE, OR NON-INFRINGEMENT. FLIR SHALL NOT BE LIABLE FOR ANY DAMAGES
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
// THIS SOFTWARE OR ITS DERIVATIVES.
//=============================================================================
#include "SpinnakerC.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
// This macro helps with C-strings.
#define MAX_BUFF_LEN 256
// Helper for getting error messages
{
// Note: lastErrorMessage is shared across multiple threads; a different thread could overwrite the last error
// message before this function is called to grab the latest message
}
// This function helps to check if a node is readable
bool8_t IsReadable(spinNodeHandle hNode, char nodeName[])
{
spinError err = SPINNAKER_ERR_SUCCESS;
bool8_t pbReadable = False;
err = spinNodeIsReadable(hNode, &pbReadable);
{
printf(
"Unable to retrieve node readability (%s node) with error: %s [%d]\n\n",
nodeName,
err);
}
return pbReadable;
}
// This function helps to check if a node is writable
bool8_t IsWritable(spinNodeHandle hNode, char nodeName[])
{
spinError err = SPINNAKER_ERR_SUCCESS;
bool8_t pbWritable = False;
err = spinNodeIsWritable(hNode, &pbWritable);
{
printf(
"Unable to retrieve node writability (%s node) with error: %s [%d]\n\n",
nodeName,
err);
}
return pbWritable;
}
// Use the following enum and global constant to select whether chunk data is
// displayed from the image or the nodemap.
typedef enum _chunkDataType
{
} chunkDataType;
const chunkDataType chosenChunkData = IMAGE;
// This function configures the camera to add chunk data to each image. It does
// this by enabling each type of chunk data after enabling chunk data mode.
// When chunk data mode is turned on, the data is made available in both the nodemap
// and each image.
{
spinError err = SPINNAKER_ERR_SUCCESS;
unsigned int i = 0;
printf("\n\n*** CONFIGURING CHUNK DATA ***\n\n");
//
// Activate chunk mode
//
// *** NOTES ***
// Once enabled, chunk data will be available at the end of hte payload of
// every image captured until it is disabled. Chunk data can also be
// retrieved from the nodemap.
//
spinNodeHandle hChunkModeActive = NULL;
err = spinNodeMapGetNode(hNodeMap, "ChunkModeActive", &hChunkModeActive);
{
printf("Unable to activate chunk mode. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Check if available and writable
if (IsWritable(hChunkModeActive, "ChunkModeActive"))
{
err = spinBooleanSetValue(hChunkModeActive, True);
{
printf("Unable to activate chunk mode. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
}
else
{
printf("Unable to write to chunk mode. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("Chunk mode activated...\n");
//
// Enable all types of chunk data
//
// *** NOTES ***
// Enabling chunk data requires working with nodes: "ChunkSelector" is an
// enumeration selector node and "ChunkEnable" is a boolean. It requires
// retrieving the selector node (which is of enumeration node type),
// selecting the entry of the chunk data to be enabled, retrieving the
// corresponding boolean, and setting it to true.
//
// In this example, all chunk data is enabled, so these steps are performed
// in a loop. Once this is complete, chunk mode still needs to be activated.
//
spinNodeHandle hChunkSelector = NULL;
size_t numEntries = 0;
// Retrieve selector node, check if available and readable and writable
err = spinNodeMapGetNode(hNodeMap, "ChunkSelector", &hChunkSelector);
{
printf(
"Unable to retrieve chunk selector entries. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Retrieve number of entries
if (IsReadable(hChunkSelector, "ChunkSelector"))
{
err = spinEnumerationGetNumEntries(hChunkSelector, &numEntries);
{
printf(
"Unable to retrieve number of entries. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
}
else
{
printf("Unable to read number of entries. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("Enabling entries...\n");
for (i = 0; i < numEntries; i++)
{
// Retrieve entry node
spinNodeHandle hEntry = NULL;
err = spinEnumerationGetEntryByIndex(hChunkSelector, i, &hEntry);
{
printf("\tUnable to enable chunk entry (error %d)...\n\n", err);
continue;
}
// Check if readable, retrieve entry name
char entryName[MAX_BUFF_LEN];
size_t lenEntryName = MAX_BUFF_LEN;
if (IsReadable(hEntry, "ChunkEntry"))
{
err = spinNodeGetDisplayName(hEntry, entryName, &lenEntryName);
{
printf("\t%s: unable to retrieve chunk entry display name (error %d)...\n", entryName, err);
}
}
else
{
continue;
}
// Retrieve enum entry integer value
int64_t value = 0;
err = spinEnumerationEntryGetIntValue(hEntry, &value);
{
printf("\t%s: unable to get chunk entry value (error %d)...\n", entryName, err);
continue;
}
// Set integer value
if (IsWritable(hChunkSelector, "ChunkSelector"))
{
err = spinEnumerationSetIntValue(hChunkSelector, value);
{
printf("\t%s: unable to set chunk entry value (error %d)...\n", entryName, err);
continue;
}
}
else
{
printf("\t%s: unable to write to chunk entry value (error %d)...\n", entryName, err);
return err;
}
// Retrieve corresponding chunk enable node
spinNodeHandle hChunkEnable = NULL;
err = spinNodeMapGetNode(hNodeMap, "ChunkEnable", &hChunkEnable);
{
printf("\t%s: unable to get entry from nodemap (error %d)...\n", entryName, err);
continue;
}
// Retrieve chunk enable value and set to true if necessary
bool8_t isEnabled = False;
if (IsReadable(hChunkEnable, "ChunkEnable"))
{
err = spinBooleanGetValue(hChunkEnable, &isEnabled);
{
printf("\t%s: unable to get chunk entry boolean value (error %d)...\n", entryName, err);
continue;
}
}
else
{
printf("\t%s: not writable\n", entryName);
continue;
}
// Consider the case in which chunk data is enabled but not writable
if (!isEnabled || !IsWritable(hChunkEnable, "ChunkEnable"))
{
// Set chunk enable value to true
err = spinBooleanSetValue(hChunkEnable, True);
{
printf("\t%s: unable to set chunk entry boolean value (error %d)...\n", entryName, err);
continue;
}
}
printf("\t%s: enabled\n", entryName);
}
return err;
}
void printBytesAsHex(uint8_t* array, int64_t length)
{
printf("\n\t\t");
for (int64_t i = 0; i < length - 1; ++i)
{
if (i != 0 && i % 8 == 0)
{
printf("\n\t\t");
}
printf("0x%02x ", (unsigned int)(array[i]));
}
printf("\n");
}
// This function displays a select amount of chunk data from the image. Unlike
// accessing chunk data via the nodemap, there is no way to loop through all
// available data.
{
spinError err = SPINNAKER_ERR_SUCCESS;
printf("Print chunk data from image...\n");
//
// Retrieve exposure time; exposure time recorded in microseconds
//
// *** NOTES ***
// Floating point numbers are returned as a double
//
double exposureTime = 0.0;
err = spinImageChunkDataGetFloatValue(hImage, "ChunkExposureTime", &exposureTime);
{
printf(
"Unable to retrieve exposure time from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tExposure time: %f\n", exposureTime);
//
// Retrieve compression ratio
//
// *** NOTES ***
// Floating point numbers are returned as a double
//
double compressionRatio = 0.0;
err = spinImageChunkDataGetFloatValue(hImage, "ChunkCompressionRatio", &compressionRatio);
{
printf(
"Unable to retrieve compression ratio from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tCompression ratio: %f\n", compressionRatio);
//
// Retrieve frame ID
//
// *** NOTES ***
// Integers are returned as an int64_t.
//
int64_t frameID = 0;
err = spinImageChunkDataGetIntValue(hImage, "ChunkFrameID", &frameID);
{
printf(
"Unable to retrieve frame ID from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tFrame ID: %d\n", (int)frameID);
// Retrieve gain; gain recorded in decibels
double gain = 0.0;
err = spinImageChunkDataGetFloatValue(hImage, "ChunkGain", &gain);
{
printf(
"Unable to retrieve gain from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tGain: %f\n", gain);
// Retrieve height; height recorded in pixels
int64_t height = 0;
err = spinImageChunkDataGetIntValue(hImage, "ChunkHeight", &height);
{
printf(
"Unable to retrieve height from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tHeight: %d\n", (int)height);
// Retrieve offset X; offset X recorded in pixels
int64_t offsetX = 0;
err = spinImageChunkDataGetIntValue(hImage, "ChunkOffsetX", &offsetX);
{
printf(
"Unable to retrieve offset X from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tOffset X: %d\n", (int)offsetX);
// Retrieve offset Y; offset Y recorded in pixels
int64_t offsetY = 0;
err = spinImageChunkDataGetIntValue(hImage, "ChunkOffsetY", &offsetY);
{
printf(
"Unable to retrieve offset Y from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tOffset Y: %d\n", (int)offsetY);
// Retrieve width; width recorded in pixels
int64_t width = 0;
err = spinImageChunkDataGetIntValue(hImage, "ChunkWidth", &width);
{
printf(
"Unable to retrieve width from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tWidth: %d\n", (int)width);
// Retrieve Serial Data
int64_t serialDataLength = 0;
err = spinImageChunkDataGetIntValue(hImage, "ChunkSerialDataLength", &serialDataLength);
{
printf(
"Unable to retrieve serial data length from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
if (serialDataLength > 0)
{
printf("\tSerial Data (%lld) Bytes:", serialDataLength);
bool8_t serialReceiveOverFlow = 0;
err = spinImageChunkDataGetBoolValue(hImage, "ChunkSerialReceiveOverflow", &serialReceiveOverFlow);
{
printf(
"Unable to retrieve serial receive overflow value from image chunk data. Aborting with error: %s "
"[%d]\n\n",
err);
return err;
}
if (serialReceiveOverFlow)
{
printf("\t Warning: Device serial data buffer overflow\n");
}
uint8_t* pSerialData = 0;
err = spinImageChunkDataGetRawData(hImage, "ChunkSerialData", &pSerialData);
if (err != SPINNAKER_ERR_SUCCESS || pSerialData == NULL)
{
if (pSerialData == NULL)
{
printf("Unable to retrieve serial data from image chunk data. Serial data was null\n\n");
}
printf(
"Unable to retrieve serial data from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printBytesAsHex(pSerialData, serialDataLength);
}
// Retrieve black level; black level recorded as a percentage
double blackLevel = 0.0;
err = spinImageChunkDataGetFloatValue(hImage, "ChunkBlackLevel", &blackLevel);
{
printf(
"Unable to retrieve black level from image chunk data. Aborting with error: %s [%d]\n\n",
err);
return err;
}
printf("\tBlack level: %f\n", blackLevel);
return err;
}
// This function displays all available chunk data by looping through the chunk
// data category node on the nodemap.
{
spinError err = SPINNAKER_ERR_SUCCESS;
unsigned int i = 0;
//
// Retrieve chunk data information nodes
//
// *** NOTES ***
// As well as being written into the payload of the image, chunk data is
// accessible on the GenICam nodemap. Insofar as chunk data is
// enabled, it is available from both sources.
//
spinNodeHandle hChunkDataControl = NULL;
size_t numFeatures = 0;
err = spinNodeMapGetNode(hNodeMap, "ChunkDataControl", &hChunkDataControl);
{
printf("Unable to retrieve chunk data control. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
if (!IsReadable(hChunkDataControl, "ChunkDataControl"))
{
printf("Unable to retrieve chunk data control. Aborting...\n\n");
}
err = spinCategoryGetNumFeatures(hChunkDataControl, &numFeatures);
{
printf("Unable to retrieve number of nodes (error %d)...\n\n", err);
return err;
}
// Iterate through children
printf("Printing chunk data from nodemap...\n");
for (i = 0; i < numFeatures; i++)
{
spinNodeHandle hFeatureNode = NULL;
spinNodeType featureType = UnknownNode;
char featureName[MAX_BUFF_LEN];
size_t lenFeatureName = MAX_BUFF_LEN;
// Retrieve node
if (IsReadable(hChunkDataControl, "ChunkDataControl"))
{
err = spinCategoryGetFeatureByIndex(hChunkDataControl, i, &hFeatureNode);
{
printf("Unable to retrieve node (error %d)...\n\n", err);
continue;
}
}
else
{
printf("Unable to retrieve node (error %d)...\n\n", err);
continue;
}
// Retrieve node name
err = spinNodeGetName(hFeatureNode, featureName, &lenFeatureName);
{
strcpy(featureName, "Unknown name");
}
if (IsReadable(hFeatureNode, featureName))
{
err = spinNodeGetType(hFeatureNode, &featureType);
{
printf("Unable to retrieve node type. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
continue;
}
}
else
{
printf("Unable to retrieve node type. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
continue;
}
// Print integer node type value
if (featureType == IntegerNode)
{
int64_t featureValue = 0;
err = spinIntegerGetValue(hFeatureNode, &featureValue);
printf("\t%s: %d\n", featureName, (int)featureValue);
}
// Print float node type value
else if (featureType == FloatNode)
{
double featureValue = 0.0;
err = spinFloatGetValue(hFeatureNode, &featureValue);
printf("\t%s: %f\n", featureName, featureValue);
}
//
// Print boolean node type value
//
// *** NOTES ***
// Boolean information is manipulated to output the more-easily
// identifiable 'true' and 'false' as opposed to '1' and '0'.
//
else if (featureType == BooleanNode)
{
bool8_t featureValue = False;
err = spinBooleanGetValue(hFeatureNode, &featureValue);
if (featureValue)
{
printf("\t%s: true\n", featureName);
}
else
{
printf("\t%s: false\n", featureName);
}
}
}
return err;
}
// This function prints the device information of the camera from the transport
// layer; please see NodeMapInfo_C example for more in-depth comments on
// printing device information from the nodemap.
{
spinError err = SPINNAKER_ERR_SUCCESS;
unsigned int i = 0;
printf("\n*** DEVICE INFORMATION ***\n\n");
// Retrieve device information category node
spinNodeHandle hDeviceInformation = NULL;
err = spinNodeMapGetNode(hNodeMap, "DeviceInformation", &hDeviceInformation);
{
printf("Unable to retrieve node. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Retrieve number of nodes within device information node
size_t numFeatures = 0;
if (IsReadable(hDeviceInformation, "DeviceInformation"))
{
err = spinCategoryGetNumFeatures(hDeviceInformation, &numFeatures);
{
printf("Unable to retrieve number of nodes. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
}
else
{
printf("Unable to read device information. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Iterate through nodes and print information
for (i = 0; i < numFeatures; i++)
{
spinNodeHandle hFeatureNode = NULL;
err = spinCategoryGetFeatureByIndex(hDeviceInformation, i, &hFeatureNode);
{
printf("Unable to retrieve node. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
continue;
}
spinNodeType featureType = UnknownNode;
// Get feature node name
char featureName[MAX_BUFF_LEN];
size_t lenFeatureName = MAX_BUFF_LEN;
err = spinNodeGetName(hFeatureNode, featureName, &lenFeatureName);
{
strcpy(featureName, "Unknown name");
}
if (IsReadable(hFeatureNode, featureName))
{
err = spinNodeGetType(hFeatureNode, &featureType);
{
printf("Unable to retrieve node type. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
continue;
}
}
else
{
printf("%s: Node not readable\n", featureName);
continue;
}
char featureValue[MAX_BUFF_LEN];
size_t lenFeatureValue = MAX_BUFF_LEN;
err = spinNodeToString(hFeatureNode, featureValue, &lenFeatureValue);
{
strcpy(featureValue, "Unknown value");
}
printf("%s: %s\n", featureName, featureValue);
}
printf("\n");
return err;
}
// This function acquires and saves 10 images from a device; please see
// Acquisition_C example for more in-depth comments on the acquisition of
// images.
spinError AcquireImages(spinCamera hCam, spinNodeMapHandle hNodeMap, spinNodeMapHandle hNodeMapTLDevice)
{
spinError err = SPINNAKER_ERR_SUCCESS;
printf("\n*** IMAGE ACQUISITION ***\n\n");
// Set acquisition mode to continuous
spinNodeHandle hAcquisitionMode = NULL;
spinNodeHandle hAcquisitionModeContinuous = NULL;
int64_t acquisitionModeContinuous = 0;
err = spinNodeMapGetNode(hNodeMap, "AcquisitionMode", &hAcquisitionMode);
{
printf(
"Unable to set acquisition mode to continuous (node retrieval). Aborting with error: %s [%d]\n\n",
err);
return err;
}
if (IsReadable(hAcquisitionMode, "AcquisitionMode"))
{
err = spinEnumerationGetEntryByName(hAcquisitionMode, "Continuous", &hAcquisitionModeContinuous);
{
printf(
"Unable to set acquisition mode to continuous (entry 'continuous' retrieval). Aborting with error "
"%d...\n\n",
err);
return err;
}
}
else
{
printf("Unable to read acquisition mode. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
if (IsReadable(hAcquisitionModeContinuous, "AcquisitionModeContinuous"))
{
err = spinEnumerationEntryGetIntValue(hAcquisitionModeContinuous, &acquisitionModeContinuous);
{
printf(
"Unable to set acquisition mode to continuous (entry int value retrieval). Aborting with error "
"%d...\n\n",
err);
return err;
}
}
else
{
printf(
"Unable to read acquisition mode continuous. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// set acquisition mode to continuous
if (IsWritable(hAcquisitionMode, "AcquisitionMode"))
{
err = spinEnumerationSetIntValue(hAcquisitionMode, acquisitionModeContinuous);
{
printf(
"Unable to set acquisition mode to continuous (entry int value setting). Aborting with error %d...\n\n",
err);
return err;
}
printf("Acquisition mode set to continuous...\n");
}
else
{
printf("Unable to write to acquisition mode. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Begin acquiring images
{
printf("Unable to begin image acquisition. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("Acquiring images...\n");
// Retrieve device serial number for filename
spinNodeHandle hDeviceSerialNumber = NULL;
char deviceSerialNumber[MAX_BUFF_LEN];
size_t lenDeviceSerialNumber = MAX_BUFF_LEN;
err = spinNodeMapGetNode(hNodeMapTLDevice, "DeviceSerialNumber", &hDeviceSerialNumber);
{
strcpy(deviceSerialNumber, "");
lenDeviceSerialNumber = 0;
}
else
{
if (IsReadable(hDeviceSerialNumber, "DeviceSerialNumber"))
{
err = spinStringGetValue(hDeviceSerialNumber, deviceSerialNumber, &lenDeviceSerialNumber);
{
printf("Unable to get device serial number. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
strcpy(deviceSerialNumber, "");
lenDeviceSerialNumber = 0;
}
printf("Device serial number retrieved as %s...\n", deviceSerialNumber);
}
else
{
printf("Unable to get device serial number. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
strcpy(deviceSerialNumber, "");
lenDeviceSerialNumber = 0;
}
}
printf("\n");
// Retrieve, convert, and save images
const unsigned int k_numImages = 10;
unsigned int imageCnt = 0;
//
// Create Image Processor context for post processing images
//
spinImageProcessor hImageProcessor = NULL;
err = spinImageProcessorCreate(&hImageProcessor);
{
printf("Unable to create image processor. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
//
// Set default image processor color processing method
//
// *** NOTES ***
// By default, if no specific color processing algorithm is set, the image
// processor will default to NEAREST_NEIGHBOR method.
//
{
printf(
"Unable to set image processor color processing method. Non-fatal error: %s [%d]\n\n",
err);
}
for (imageCnt = 0; imageCnt < k_numImages; imageCnt++)
{
// Retrieve next received image
spinImage hResultImage = NULL;
err = spinCameraGetNextImageEx(hCam, 1000, &hResultImage);
{
printf("Unable to get next image. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
continue;
}
// Ensure image completion
bool8_t isIncomplete = False;
bool8_t hasFailed = False;
err = spinImageIsIncomplete(hResultImage, &isIncomplete);
{
printf("Unable to determine image completion. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
hasFailed = True;
}
if (isIncomplete)
{
spinImageStatus imageStatus = SPINNAKER_IMAGE_STATUS_NO_ERROR;
err = spinImageGetStatus(hResultImage, &imageStatus);
{
printf("Unable to retrieve image status. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
else
{
printf("Image incomplete with image status %d...\n", imageStatus);
}
hasFailed = True;
}
// Release incomplete or failed image
if (hasFailed)
{
err = spinImageRelease(hResultImage);
{
printf("Unable to release image. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
continue;
}
// Print image information
size_t width = 0;
size_t height = 0;
err = spinImageGetWidth(hResultImage, &width);
{
printf("Unable to retrieve image width. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
err = spinImageGetHeight(hResultImage, &height);
{
printf("Unable to retrieve image height. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
printf("Grabbed image %u, width = %u, height = %u\n", imageCnt, (unsigned int)width, (unsigned int)height);
// Convert image to mono 8
spinImage hConvertedImage = NULL;
err = spinImageCreateEmpty(&hConvertedImage);
{
printf("Unable to create image. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
hasFailed = True;
}
err = spinImageProcessorConvert(hImageProcessor, hResultImage, hConvertedImage, PixelFormat_Mono8);
{
printf("Unable to convert image. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
hasFailed = True;
}
// Create unique file name and save image
char filename[MAX_BUFF_LEN];
if (lenDeviceSerialNumber == 0)
{
sprintf(filename, "ChunkData-C-%d.jpg", imageCnt);
}
else
{
sprintf(filename, "ChunkData-C-%s-%d.jpg", deviceSerialNumber, imageCnt);
}
err = spinImageSave(hConvertedImage, filename, SPINNAKER_IMAGE_FILE_FORMAT_JPEG);
{
printf("Unable to save image. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
else
{
printf("Image saved at %s\n", filename);
}
// Display chunk data
{
err = DisplayChunkDataFromImage(hResultImage);
{
return err;
}
}
else if (chosenChunkData == NODEMAP)
{
err = DisplayChunkDataFromNodeMap(hNodeMap);
{
return err;
}
}
printf("\n");
// Destroy converted image
err = spinImageDestroy(hConvertedImage);
{
printf("Unable to destroy image. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
// Release image
err = spinImageRelease(hResultImage);
{
printf("Unable to release image. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
}
//
// Destroy Image Processor context
//
// *** NOTES ***
// Image processor context needs to be destroyed after all image processing
// are complete to avoid memory leaks.
//
err = spinImageProcessorDestroy(hImageProcessor);
{
printf("Unable to destroy image processor. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
// End Acquisition
{
printf("Unable to end acquisition. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
return err;
}
// This function disables each type of chunk data before disabling chunk data mode.
{
spinError err = SPINNAKER_ERR_SUCCESS;
spinNodeHandle hChunkSelector = NULL;
size_t numEntries = 0;
unsigned int i = 0;
// Retrieve selector node
err = spinNodeMapGetNode(hNodeMap, "ChunkSelector", &hChunkSelector);
{
printf(
"Unable to retrieve chunk selector entries. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Retrieve number of entries, check if readable
if (IsReadable(hChunkSelector, "ChunkSelector"))
{
err = spinEnumerationGetNumEntries(hChunkSelector, &numEntries);
{
printf(
"Unable to retrieve number of entries. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
}
else
{
printf("Unable to read number of entries. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("Disabling entries...\n");
for (i = 0; i < numEntries; i++)
{
// Retrieve entry node
spinNodeHandle hEntry = NULL;
err = spinEnumerationGetEntryByIndex(hChunkSelector, i, &hEntry);
// Go to next node if problem occurs
{
continue;
}
// Retrieve entry name
char entryName[MAX_BUFF_LEN];
size_t lenEntryName = MAX_BUFF_LEN;
if (IsReadable(hEntry, "ChunkEntry"))
{
err = spinNodeGetDisplayName(hEntry, entryName, &lenEntryName);
{
printf("\t%s: unable to retrieve chunk entry by display name (error %d)...\n", entryName, err);
}
}
else
{
continue;
}
// Retrieve enum entry integer value
int64_t value = 0;
err = spinEnumerationEntryGetIntValue(hEntry, &value);
{
printf("\t%s: unable to get chunk entry value (error %d)...\n", entryName, err);
continue;
}
// Set integer value
if (IsWritable(hChunkSelector, "ChunkSelector"))
{
err = spinEnumerationSetIntValue(hChunkSelector, value);
{
printf("\t%s: unable to set chunk entry value (error %d)...\n", entryName, err);
continue;
}
}
else
{
printf("\t%s: unable to set chunk entry value (error %d)...\n", entryName, err);
return err;
}
// Retrieve corresponding chunk enable node
spinNodeHandle hChunkEnable = NULL;
err = spinNodeMapGetNode(hNodeMap, "ChunkEnable", &hChunkEnable);
{
printf("\t%s: unable to get entry from nodemap (error %d)...\n", entryName, err);
continue;
}
// Retrieve chunk enable value and set to false if necessary
bool8_t isEnabled = False;
if (IsWritable(hChunkEnable, "ChunkEnable"))
{
err = spinBooleanGetValue(hChunkEnable, &isEnabled);
{
printf("\t%s: unable to get chunk entry boolean value (error %d)...\n", entryName, err);
continue;
}
}
else
{
printf("\t%s: not writable\n", entryName);
continue;
}
// Consider the case in which chunk data is enabled but not writable
if (isEnabled)
{
// Set chunk enable value to false
err = spinBooleanSetValue(hChunkEnable, False);
{
printf("\t%s: unable to set chunk entry boolean value (error %d)...\n", entryName, err);
continue;
}
}
printf("\t%s: disabled\n", entryName);
}
printf("\n");
// Disabling ChunkModeActive
spinNodeHandle hChunkModeActive = NULL;
err = spinNodeMapGetNode(hNodeMap, "ChunkModeActive", &hChunkModeActive);
{
printf("Unable to get ChunkModeActive node. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
if (IsWritable(hChunkModeActive, "ChunkModeActive"))
{
err = spinBooleanSetValue(hChunkModeActive, False);
{
printf("Unable to deactivate chunk mode. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
}
else
{
printf("Unable to write to chunk mode. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("Chunk mode deactivated...\n");
return err;
}
// This function acts as the body of the example; please see NodeMapInfo_C
// example for more in-depth comments on setting up cameras.
spinError RunSingleCamera(spinCamera hCam)
{
spinError err = SPINNAKER_ERR_SUCCESS;
// Retrieve TL device nodemap and print device information
spinNodeMapHandle hNodeMapTLDevice = NULL;
err = spinCameraGetTLDeviceNodeMap(hCam, &hNodeMapTLDevice);
{
printf("Unable to retrieve TL device nodemap. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
else
{
err = PrintDeviceInfo(hNodeMapTLDevice);
{
return err;
}
}
// This example is not compatible with BX (Bumblebee) stereo cameras, see StereoAcquisiton (C++ only) for this camera.
spinNodeHandle hDeviceModelName = NULL;
char deviceModelName[MAX_BUFF_LEN] = {0};
size_t modelNameLen = MAX_BUFF_LEN;
spinNodeMapGetNode(hNodeMapTLDevice, "DeviceModelName", &hDeviceModelName);
if (hDeviceModelName != NULL && IsReadable(hDeviceModelName, "DeviceModelName"))
{
err = spinStringGetValue(hDeviceModelName, deviceModelName, &modelNameLen);
{
return err;
}
if (strstr(deviceModelName, "BX") != NULL)
{
printf("This example is not compatible with BX (Bumblebee) stereo cameras. Please see "
"StereoAcquisition (C++ Only) Example for ChunkData usage with this camera.\n");
}
}
// Initialize camera
err = spinCameraInit(hCam);
{
printf("Unable to initialize camera. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Retrieve GenICam nodemap
spinNodeMapHandle hNodeMap = NULL;
err = spinCameraGetNodeMap(hCam, &hNodeMap);
{
printf("Unable to retrieve GenICam nodemap. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Configure chunk data
err = ConfigureChunkData(hNodeMap);
{
return err;
}
// Acquire images and display chunk data
err = AcquireImages(hCam, hNodeMap, hNodeMapTLDevice);
{
return err;
}
// Disable chunck data
err = DisableChunkData(hNodeMap);
{
return err;
}
// Deinitialize camera
err = spinCameraDeInit(hCam);
{
printf("Unable to deinitialize camera. Non-fatal error: %s [%d]\n\n", GetLastErrorMessage(), err);
}
return err;
}
// Example entry point; please see Enumeration_C example for more in-depth
// comments on preparing and cleaning up the system.
int main(/*int argc, char** argv*/)
{
spinError errReturn = SPINNAKER_ERR_SUCCESS;
spinError err = SPINNAKER_ERR_SUCCESS;
unsigned int i = 0;
// Since this application saves images in the current folder
// we must ensure that we have permission to write to this folder.
// If we do not have permission, fail right away.
FILE* tempFile;
tempFile = fopen("test.txt", "w+");
if (tempFile == NULL)
{
printf("Failed to create file in current folder. Please check "
"permissions.\n");
printf("Press Enter to exit...\n");
getchar();
return -1;
}
fclose(tempFile);
remove("test.txt");
// Print application build information
printf("Application build date: %s %s \n\n", __DATE__, __TIME__);
// Retrieve singleton reference to system
spinSystem hSystem = NULL;
err = spinSystemGetInstance(&hSystem);
{
printf("Unable to retrieve system instance. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Print out current library version
spinLibraryVersion hLibraryVersion;
spinSystemGetLibraryVersion(hSystem, &hLibraryVersion);
printf(
"Spinnaker library version: %d.%d.%d.%d\n\n",
hLibraryVersion.major,
hLibraryVersion.minor,
hLibraryVersion.type,
hLibraryVersion.build);
// Retrieve list of cameras from the system
spinCameraList hCameraList = NULL;
err = spinCameraListCreateEmpty(&hCameraList);
{
printf("Unable to create camera list. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
err = spinSystemGetCameras(hSystem, hCameraList);
{
printf("Unable to retrieve camera list. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Retrieve number of cameras
size_t numCameras = 0;
err = spinCameraListGetSize(hCameraList, &numCameras);
{
printf("Unable to retrieve number of cameras. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("Number of cameras detected: %u\n\n", (unsigned int)numCameras);
// Finish if there are no cameras
if (numCameras == 0)
{
// Clear and destroy camera list before releasing system
err = spinCameraListClear(hCameraList);
{
printf("Unable to clear camera list. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
err = spinCameraListDestroy(hCameraList);
{
printf("Unable to destroy camera list. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Release system
err = spinSystemReleaseInstance(hSystem);
{
printf("Unable to release system instance. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("Not enough cameras!\n");
printf("Done! Press Enter to exit...\n");
getchar();
return -1;
}
// Run example on each camera
for (i = 0; i < numCameras; i++)
{
printf("\nRunning example for camera %d...\n", i);
// Select camera
spinCamera hCamera = NULL;
err = spinCameraListGet(hCameraList, i, &hCamera);
{
printf("Unable to retrieve camera from list. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
errReturn = err;
}
else
{
// Run example
err = RunSingleCamera(hCamera);
{
errReturn = err;
}
}
// Release camera
err = spinCameraRelease(hCamera);
{
errReturn = err;
}
printf("Camera %d example complete...\n\n", i);
}
// Clear and destroy camera list before releasing system
err = spinCameraListClear(hCameraList);
{
printf("Unable to clear camera list. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
err = spinCameraListDestroy(hCameraList);
{
printf("Unable to destroy camera list. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
// Release system
err = spinSystemReleaseInstance(hSystem);
{
printf("Unable to release system instance. Aborting with error: %s [%d]\n\n", GetLastErrorMessage(), err);
return err;
}
printf("\nDone! Press Enter to exit...\n");
getchar();
return errReturn;
}
spinCameraRelease
SPINNAKERC_API spinCameraRelease(spinCamera hCamera)
Releases a camera.
chosenChunkData
const chunkDataType chosenChunkData
Definition: ChunkData_C.c:107
spinCameraGetNodeMap
SPINNAKERC_API spinCameraGetNodeMap(spinCamera hCamera, spinNodeMapHandle *phNodeMap)
Retrieves the GenICam nodemap from a camera.
spinImageGetWidth
SPINNAKERC_API spinImageGetWidth(spinImage hImage, size_t *pWidth)
Retrieves the width of an image.
spinBooleanGetValue
SPINNAKERC_API spinBooleanGetValue(spinNodeHandle hNode, bool8_t *pbValue)
Retrieves the value of a boolean node; boolean values are represented by 'True' (which equals '0') an...
SPINNAKER_COLOR_PROCESSING_ALGORITHM_HQ_LINEAR
@ SPINNAKER_COLOR_PROCESSING_ALGORITHM_HQ_LINEAR
Well-balanced speed and quality.
Definition: SpinnakerDefsC.h:322
spinCameraListClear
SPINNAKERC_API spinCameraListClear(spinCameraList hCameraList)
Clears a camera list.
MAX_BUFF_LEN
#define MAX_BUFF_LEN
Definition: ChunkData_C.c:51
spinImageIsIncomplete
SPINNAKERC_API spinImageIsIncomplete(spinImage hImage, bool8_t *pbIsIncomplete)
Checks whether an image is incomplete.
spinCameraEndAcquisition
SPINNAKERC_API spinCameraEndAcquisition(spinCamera hCamera)
Has a camera stop acquiring images.
spinImageChunkDataGetIntValue
SPINNAKERC_API spinImageChunkDataGetIntValue(spinImage hImage, const char *pName, int64_t *pValue)
BooleanNode
@ BooleanNode
Definition: SpinnakerGenApiDefsC.h:76
spinCameraBeginAcquisition
SPINNAKERC_API spinCameraBeginAcquisition(spinCamera hCamera)
Has a camera start acquiring images.
spinEnumerationGetEntryByIndex
SPINNAKERC_API spinEnumerationGetEntryByIndex(spinNodeHandle hEnumNode, size_t index, spinNodeHandle *phEntry)
Retrieves an entry node from an enum node using an index.
DisplayChunkDataFromImage
spinError DisplayChunkDataFromImage(spinImage hImage)
Definition: ChunkData_C.c:323
spinImageCreateEmpty
SPINNAKERC_API spinImageCreateEmpty(spinImage *phImage)
Creates an empty image; images created this way must be destroyed.
spinSystemReleaseInstance
SPINNAKERC_API spinSystemReleaseInstance(spinSystem hSystem)
Releases the system; make sure handle is cleaned up properly by setting it to NULL after system is re...
NODEMAP
@ NODEMAP
Definition: ChunkData_C.c:104
IsWritable
bool8_t IsWritable(spinNodeHandle hNode, char nodeName[])
Definition: ChunkData_C.c:83
spinImage
void * spinImage
Handle for image functionality.
Definition: SpinnakerDefsC.h:91
spinErrorGetLastMessage
SPINNAKERC_API spinErrorGetLastMessage(char *pBuf, size_t *pBufLen)
Retrieves the error message of the last error.
spinSystemGetCameras
SPINNAKERC_API spinSystemGetCameras(spinSystem hSystem, spinCameraList hCameraList)
Retrieves a list of detected (and enumerable) cameras on the system; camera lists must be created and...
DisplayChunkDataFromNodeMap
spinError DisplayChunkDataFromNodeMap(spinNodeMapHandle hNodeMap)
Definition: ChunkData_C.c:533
spinStringGetValue
SPINNAKERC_API spinStringGetValue(spinNodeHandle hNode, char *pBuf, size_t *pBufLen)
Retrieves the value of a string node as a c-string.
spinNodeMapHandle
void * spinNodeMapHandle
Handle for nodemap functionality.
Definition: SpinnakerGenApiDefsC.h:39
spinImageChunkDataGetRawData
SPINNAKERC_API spinImageChunkDataGetRawData(spinImage hImage, const char *pName, uint8_t **pData)
SpinnakerC.h
spinEnumerationSetIntValue
SPINNAKERC_API spinEnumerationSetIntValue(spinNodeHandle hEnumNode, int64_t value)
Sets a new entry using its integer value retrieved from a call to spinEnumerationEntryGetIntValue(); ...
spinBooleanSetValue
SPINNAKERC_API spinBooleanSetValue(spinNodeHandle hNode, bool8_t value)
Sets the value of a boolean node; boolean values are represented by 'True' (which equals '0') and 'Fa...
spinNodeGetType
SPINNAKERC_API spinNodeGetType(spinNodeHandle hNode, spinNodeType *pType)
Retrieves the type of a node (as an enum, spinNodeType)
spinNodeGetName
SPINNAKERC_API spinNodeGetName(spinNodeHandle hNode, char *pBuf, size_t *pBufLen)
Retrieves the name of a node (no whitespace)
spinIntegerGetValue
SPINNAKERC_API spinIntegerGetValue(spinNodeHandle hNode, int64_t *pValue)
Retrieves the value of an integer node.
spinCategoryGetNumFeatures
SPINNAKERC_API spinCategoryGetNumFeatures(spinNodeHandle hCategoryNode, size_t *pValue)
Retrieves the number of a features (or child nodes) or a category node.
spinFloatGetValue
SPINNAKERC_API spinFloatGetValue(spinNodeHandle hNode, double *pValue)
Retrieves the value of a float node.
spinEnumerationEntryGetIntValue
SPINNAKERC_API spinEnumerationEntryGetIntValue(spinNodeHandle hNode, int64_t *pValue)
Retrieves the integer value of an entry node; note that enumeration entry int and enum values are dif...
spinImageGetHeight
SPINNAKERC_API spinImageGetHeight(spinImage hImage, size_t *pHeight)
Retrieves the height of an image.
spinImageDestroy
SPINNAKERC_API spinImageDestroy(spinImage hImage)
Destroys an image.
spinSystemGetLibraryVersion
SPINNAKERC_API spinSystemGetLibraryVersion(spinSystem hSystem, spinLibraryVersion *hLibraryVersion)
Get current library version of Spinnaker.
main
int main()
Definition: ChunkData_C.c:1345
SPINNAKER_ERR_ACCESS_DENIED
@ SPINNAKER_ERR_ACCESS_DENIED
Definition: SpinnakerDefsC.h:243
spinSystem
void * spinSystem
Handle for system functionality.
Definition: SpinnakerDefsC.h:51
spinImageProcessor
void * spinImageProcessor
Handle for image processor functionality.
Definition: SpinnakerDefsC.h:107
spinNodeGetDisplayName
SPINNAKERC_API spinNodeGetDisplayName(spinNodeHandle hNode, char *pBuf, size_t *pBufLen)
Retrieves the display name of a node (whitespace possible)
spinCameraInit
SPINNAKERC_API spinCameraInit(spinCamera hCamera)
Initializes a camera, allowing for much more interaction.
ConfigureChunkData
spinError ConfigureChunkData(spinNodeMapHandle hNodeMap)
Definition: ChunkData_C.c:113
False
static const bool8_t False
Definition: SpinnakerDefsC.h:36
printBytesAsHex
void printBytesAsHex(uint8_t *array, int64_t length)
Definition: ChunkData_C.c:306
spinImageProcessorConvert
SPINNAKERC_API spinImageProcessorConvert(spinImageProcessor hImageProcessor, spinImage hSrcImage, spinImage hDestImage, spinPixelFormatEnums destFormat)
Converts the source image buffer to the specified destination pixel format and stores the result in t...
IMAGE
@ IMAGE
Definition: ChunkData_C.c:103
spinImageProcessorSetColorProcessing
SPINNAKERC_API spinImageProcessorSetColorProcessing(spinImageProcessor hImageProcessor, spinColorProcessingAlgorithm colorAlgorithm)
Sets the color processing algorithm used at the time of the spinImageProcessorConvert() call,...
spinCameraListDestroy
SPINNAKERC_API spinCameraListDestroy(spinCameraList hCameraList)
Destroys a camera list.
SPINNAKER_ERR_ERROR
@ SPINNAKER_ERR_ERROR
The error codes in the range of -1000 to -1999 are reserved for Spinnaker exceptions.
Definition: SpinnakerDefsC.h:239
spinImageChunkDataGetFloatValue
SPINNAKERC_API spinImageChunkDataGetFloatValue(spinImage hImage, const char *pName, double *pValue)
UnknownNode
@ UnknownNode
Definition: SpinnakerGenApiDefsC.h:85
_chunkDataType
_chunkDataType
Definition: ChunkData_C.c:101
spinNodeIsWritable
SPINNAKERC_API spinNodeIsWritable(spinNodeHandle hNode, bool8_t *pbResult)
Checks whether a node is writable.
spinCameraList
void * spinCameraList
Handle for interface functionality.
Definition: SpinnakerDefsC.h:75
spinImageProcessorDestroy
SPINNAKERC_API spinImageProcessorDestroy(spinImageProcessor hImageProcessor)
Destroys a image list.
spinSystemGetInstance
SPINNAKERC_API spinSystemGetInstance(spinSystem *phSystem)
Retrieves an instance of the system object; the system is a singleton, so there will only ever be one...
SPINNAKER_IMAGE_FILE_FORMAT_JPEG
@ SPINNAKER_IMAGE_FILE_FORMAT_JPEG
JPEG.
Definition: SpinnakerDefsC.h:355
SPINNAKER_IMAGE_STATUS_NO_ERROR
@ SPINNAKER_IMAGE_STATUS_NO_ERROR
Image is returned from GetNextImage() call without any errors.
Definition: SpinnakerDefsC.h:388
spinCameraGetNextImageEx
SPINNAKERC_API spinCameraGetNextImageEx(spinCamera hCamera, uint64_t grabTimeout, spinImage *phImage)
Retrieves an image from a camera; manually set the timeout in milliseconds.
spinCameraListGet
SPINNAKERC_API spinCameraListGet(spinCameraList hCameraList, size_t index, spinCamera *phCamera)
Retrieves a camera from a camera list using an index.
bool8_t
uint8_t bool8_t
Definition: SpinnakerDefsC.h:35
spinCamera
void * spinCamera
Handle for camera functionality.
Definition: SpinnakerDefsC.h:82
PrintDeviceInfo
spinError PrintDeviceInfo(spinNodeMapHandle hNodeMap)
Definition: ChunkData_C.c:667
spinNodeHandle
void * spinNodeHandle
Handle for node functionality.
Definition: SpinnakerGenApiDefsC.h:45
spinNodeIsReadable
SPINNAKERC_API spinNodeIsReadable(spinNodeHandle hNode, bool8_t *pbResult)
Checks whether a node is readable.
GetLastErrorMessage
char * GetLastErrorMessage()
Definition: ChunkData_C.c:57
FloatNode
@ FloatNode
Definition: SpinnakerGenApiDefsC.h:77
spinEnumerationGetEntryByName
SPINNAKERC_API spinEnumerationGetEntryByName(spinNodeHandle hEnumNode, const char *pName, spinNodeHandle *phEntry)
Retrieves an entry node from an enum node using the entry's symbolic.
lenLastErrorMessage
size_t lenLastErrorMessage
Definition: ChunkData_C.c:54
IsReadable
bool8_t IsReadable(spinNodeHandle hNode, char nodeName[])
Definition: ChunkData_C.c:66
spinImageSave
SPINNAKERC_API spinImageSave(spinImage hImage, const char *pFilename, spinImageFileFormat format)
Saves an image using a specified file format (using an enum, spinImageFileFormat)
spinNodeMapGetNode
SPINNAKERC_API spinNodeMapGetNode(spinNodeMapHandle hNodeMap, const char *pName, spinNodeHandle *phNode)
Retrieves a node from the nodemap by name.
spinCameraListGetSize
SPINNAKERC_API spinCameraListGetSize(spinCameraList hCameraList, size_t *pSize)
Retrieves the number of cameras on a camera list.
AcquireImages
spinError AcquireImages(spinCamera hCam, spinNodeMapHandle hNodeMap, spinNodeMapHandle hNodeMapTLDevice)
Definition: ChunkData_C.c:761
spinCameraDeInit
SPINNAKERC_API spinCameraDeInit(spinCamera hCamera)
Deinitializes a camera, greatly reducing functionality.
spinCameraGetTLDeviceNodeMap
SPINNAKERC_API spinCameraGetTLDeviceNodeMap(spinCamera hCamera, spinNodeMapHandle *phNodeMap)
Retrieves the transport layer device nodemap from a camera.
spinImageProcessorCreate
SPINNAKERC_API spinImageProcessorCreate(spinImageProcessor *phImageProcessor)
Creates an image processor.
lastErrorMessage
char lastErrorMessage[MAX_BUFF_LEN]
Definition: ChunkData_C.c:53
spinImageChunkDataGetBoolValue
SPINNAKERC_API spinImageChunkDataGetBoolValue(spinImage hImage, const char *pName, bool8_t *pValue)
RunSingleCamera
spinError RunSingleCamera(spinCamera hCam)
Definition: ChunkData_C.c:1253
spinEnumerationGetNumEntries
SPINNAKERC_API spinEnumerationGetNumEntries(spinNodeHandle hEnumNode, size_t *pValue)
Retrieves the number of entries of an enum node.
IntegerNode
@ IntegerNode
Definition: SpinnakerGenApiDefsC.h:75
True
static const bool8_t True
Definition: SpinnakerDefsC.h:37
spinCategoryGetFeatureByIndex
SPINNAKERC_API spinCategoryGetFeatureByIndex(spinNodeHandle hCategoryNode, size_t index, spinNodeHandle *phFeature)
Retrieves a node from a category node using an index.
spinImageRelease
SPINNAKERC_API spinImageRelease(spinImage hImage)
Releases an image.
spinImageGetStatus
SPINNAKERC_API spinImageGetStatus(spinImage hImage, spinImageStatus *pStatus)
Retrieves the image status of an image.
SPINNAKER_ERR_SUCCESS
@ SPINNAKER_ERR_SUCCESS
An error code of 0 means that the function has run without error.
Definition: SpinnakerDefsC.h:233
spinCameraListCreateEmpty
SPINNAKERC_API spinCameraListCreateEmpty(spinCameraList *phCameraList)
Creates an empty camera list (camera lists created this way must be destroyed)
spinNodeToString
SPINNAKERC_API spinNodeToString(spinNodeHandle hNode, char *pBuf, size_t *pBufLen)
Retrieves the value of any node type as a c-string.
PixelFormat_Mono8
@ PixelFormat_Mono8
Definition: CameraDefsC.h:732
DisableChunkData
spinError DisableChunkData(spinNodeMapHandle hNodeMap)
Definition: ChunkData_C.c:1084