FG Camera Library
1.7.0.0 (2025-06-26)
|
|
First Steps example source code
/opt/ImagoTechnologies/SDK/examples/FGExample_Linux/src/main
.c
6 #define NUM_BUFFERS 4 // number of image buffers used for the acquisition queue
11 static void sigint_handler(
int signo)
22 UINT32 x1, y1, x2, y2;
27 signal(SIGINT, sigint_handler);
36 printf(
"FG_install_camera() failed! \n - ErrorCode: %d \n - ErrorText '%s'", fgResult, ErrText);
57 printf(
"Sensor size: %u x %u\n", width, height);
61 for (UINT32 i = 0; i < NUM_BUFFERS; i++)
68 printf(
"Starting acquisition loop, press CTRL-C to stop the program.\n");
80 printf(
"100 frames received, current frame number: %u\n", currentImage.
image_number);
90 printf(
"FG_get_image() returned a broken image\n");
96 printf(
"FG_get_image() timeout occurred\n");
102 printf(
"FG_get_image() failed! \n - ErrorCode: %d \n - ErrorText '%s'", fgResult, ErrText);
108 printf(
"Closing the program...\n");
115 for (UINT32 i = 0; i < NUM_BUFFERS; i++)
UINT32 DLL_FG_API FG_get_image(FG_IMAGE *img, UINT32 TimeOut_ms)
Returns captured images to the user.
Definition: FG_CameraInterface.cpp:684
UINT32 DLL_FG_API FG_get_aoi(UINT32 *x1, UINT32 *y1, UINT32 *x2, UINT32 *y2, enum eFG_PIXEL_TYPE *pixel_type)
Returns the area of interest and the output format.
Definition: FG_CameraInterface.cpp:762
UINT32 DLL_FG_API FG_install_camera(enum eFG_CAMERA_TYPE camera_type,...)
Opens and initializes the camera.
Definition: FG_CameraInterface.cpp:283
UINT32 DLL_FG_API FG_get_last_error(char *error_sting, UINT32 max_string_size)
Returns an error description for the last failed library call.
Definition: FG_CameraInterface.cpp:600
@ FG_ERROR_CODE_GrabTimeOut
Only valid for FG_get_image(): acquisition timeout.
Definition: FG_CameraInterface.h:146
UINT32 DLL_FG_API FG_stop_image(void)
Forces the camera to stop grabbing and using any buffers.
Definition: FG_CameraInterface.cpp:721
This structure stores information associated with image buffers
Definition: FG_CameraInterface.h:164
@ FG_CAMERA_TYPE_X_X_IMAGO_Vxx_AUTO
IMAGO VisionCam/Sensor (automatic)
Definition: FG_CameraInterface.h:54
@ FG_ERROR_CODE_BrokenImage
Only valid for FG_get_image(): the returned image contents are invalid.
Definition: FG_CameraInterface.h:147
UINT32 DLL_FG_API FG_free_image(FG_IMAGE *img)
Releases an image buffer.
Definition: FG_CameraInterface.cpp:658
UINT32 DLL_FG_API FG_set_aoi(UINT32 x1, UINT32 y1, UINT32 x2, UINT32 y2, enum eFG_PIXEL_TYPE pixel_type)
Sets the area of interest and the output format.
Definition: FG_CameraInterface.cpp:750
UINT32 DLL_FG_API FG_set_shutter_time(UINT32 shutter_time_us)
Sets the exposure time in µs.
Definition: FG_CameraInterface.cpp:954
Header file for this libraray.
@ FG_TRIGGER_MODE_FREERUN
Free-run triggered mode.
Definition: FG_CameraInterface.h:156
eFG_PIXEL_TYPE
Specifies the format to use for captured images, see FG_set_scan_param() and FG_set_aoi().
Definition: FG_CameraInterface.h:121
@ FG_ERROR_CODE_NoError
The function was successful.
Definition: FG_CameraInterface.h:142
UINT32 DLL_FG_API FG_append_image(FG_IMAGE *img)
Puts an image buffer into the aquisition queue.
Definition: FG_CameraInterface.cpp:671
UINT32 DLL_FG_API FG_alloc_image(FG_IMAGE *img)
Allocates a new image buffer for storing sensor frames.
Definition: FG_CameraInterface.cpp:645
const UINT32 image_number
Image number, increments with every new image.
Definition: FG_CameraInterface.h:170
UINT32 DLL_FG_API FG_set_trigger_mode(enum eFG_TRIGGER_MODE trigger_mode)
Sets the trigger mode.
Definition: FG_CameraInterface.cpp:849
@ FG_PIXEL_TYPE_Y_8
1 byte per pixel, can be monochrome or raw bayer values (depending on the sensor)
Definition: FG_CameraInterface.h:122
UINT32 DLL_FG_API FG_uninstall_camera(void)
Closes the camera.
Definition: FG_CameraInterface.cpp:556