|
AxsunOCTCapture
3.6.0.0
Captures and buffers streamed imaged data from the Axsun Ethernet/PCIe DAQ and displays or retrieves images to a client application on request.
|
This is example source code showing how to use the image capture functionality of AxsunOCTCapture in a ANSI C client application (Windows OS).
#include <stdio.h>
#include <windows.h>
#include <conio.h>
int main()
{
printf("Welcome to the AxsunOCTCapture Example Console Application (ANSI C version).\n");
AxErr retval = NO_AxERROR;
char message[512];
#ifdef PCIEMODE
#else
#endif
printf(message); printf("\n");
if (retval =
axSetupDisplay(session, 0, 0, 0, 1024, 512, 0))
goto axerror;
#ifdef PCIEMODE
#endif
uint32_t imaging, last_packet, last_frame, last_image, dropped_packets, frames_since_sync;
request_prefs_t prefs = { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
int32_t counter = 0;
while (!_kbhit()) {
#ifdef _WIN32
MSG msg;
if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
#endif // _WIN32
if (retval =
axGetStatus(session, &imaging, &last_packet, &last_frame, &last_image, &dropped_packets, &frames_since_sync))
goto axerror;
if (imaging) {
printf("axGetImageInfo() returned %d ", retval);
printf(message); printf("\n");
}
else {
if (!(counter % 25)) {
printf(
"Image number: %d, Width: %d, Dropped Packets: %d", info.
image_number, info.
width, dropped_packets);
if (info.
force_trig) printf(
" *** TRIGGER TOO SLOW, FORCE TRIGGERED ***");
printf("\n");
}
}
}
else {
if (!(counter % 50)) {
printf("Imaging is off. Turn on laser emission and set DAQ to Imaging On mode.\n");
}
}
counter++;
Sleep(33);
}
#ifdef PCIEMODE
#endif
axerror:
if (retval) {
printf("Error %d: ", retval);
printf(message); printf("\n");
}
printf("Quitting...\n\n");
}
AxErr axGetImageInfo(AOChandle session, uint32_t requested_image, image_info_t *image_info)
Get information on an image in the Main Image Buffer.
uint32_t image_number
Definition: AxsunOCTCapture.h:394
AxErr axSetupDisplay(AOChandle session, uint8_t window_style, int32_t w_left, int32_t w_top, int32_t w_width, int32_t w_height, uintptr_t parent_window_handle)
Setup an OpenGL display window for direct rendering of image data. (WINDOWS ONLY)
struct CaptureSession * AOChandle
Axsun OCT Capture handle - a pointer to the opaque structure used to manage created capture sessions.
Definition: AxsunOCTCapture.h:132
@ CHAN_1
Definition: AxsunCommonEnums.h:212
@ EIGHT_BIT
Definition: AxsunCommonEnums.h:201
AxErr axPipelineMode(AOChandle session, AxPipelineMode mode, AxChannelMode channels)
Configures FPGA registers to output the desired data type & location from the processing pipeline via...
AxErr axStopSession(AOChandle session)
Stop a capture session and deallocate all resources, including Main Image Buffer and interfaces.
AxErr axAdjustBrightnessContrast(AOChandle session, int32_t which_window, float brightness, float contrast)
Change the brightness and contrast of images displayed in an OpenGL window. (WINDOWS ONLY)
int32_t width
Definition: AxsunOCTCapture.h:398
AxRequestMode request_mode
Definition: AxsunOCTCapture.h:329
void axGetErrorString(AxErr errorcode, char *message_out)
Get a description of a specific AxErr error code.
AxErr axGetMessage(AOChandle session, char *message_out)
Get a description of the capture session's interface status.
AxErr axGetStatus(AOChandle session, uint32_t *imaging, uint32_t *last_packet_in, uint32_t *last_frame_in, uint32_t *last_image_in, uint32_t *dropped_packets, uint32_t *frames_since_sync)
Get imaging mode status and Main Image Buffer statistics.
Structure for conveying metadata information about an image.
Definition: AxsunOCTCapture.h:392
uint8_t trig_too_fast
Definition: AxsunOCTCapture.h:416
AxErr axRequestImage(AOChandle session, uint32_t requested_image, request_prefs_t prefs, uint32_t output_buf_len, uint8_t *image_data_out, image_info_t *image_info)
Retrieve and/or display an image from the Main Image Buffer.
AxErr
Error codes returned from AxsunOCTCapture or AxsunOCTControl_LW functions. Use axGetErrorString() in ...
Definition: AxsunCommonEnums.h:34
AxErr axSelectInterface(AOChandle session, AxInterface which_interface)
Select the data interface (Ethernet, PCIe, or none) for the capture session.
@ DISPLAY_ONLY
Definition: AxsunOCTCapture.h:189
This header file contains all exported function prototypes, structures, and enums necessary for integ...
AxErr axStartSession(AOChandle *session, float capacity_MB)
Start an Axsun DAQ imaging session by allocating memory for the Main Image Buffer.
@ PCI_EXPRESS
Definition: AxsunOCTCapture.h:229
AxErr axImagingCntrlPCIe(AOChandle session, int16_t number_of_images)
Control the image streaming behavior of the Axsun PCIe DAQ between Live Imaging, Burst Recording,...
Structure for image request preferences.
Definition: AxsunOCTCapture.h:326
int32_t which_window
Definition: AxsunOCTCapture.h:331
uint8_t force_trig
Definition: AxsunOCTCapture.h:414
@ GIGABIT_ETHERNET
Definition: AxsunOCTCapture.h:227