C SDK Programming Reference Manual
C SDK Programming Reference Manual
C SDK
Programmer's Guide
Version:V3.0.5
Date:2025-03-05
Notice
All rights reserved. No parts of this manual may be used or reproduced, in any forms or by any means,
without prior written permission of China Daheng Group, Inc. Beijing Image Vision Technology Branch.
The right is also reserved to modify or change any parts of this manual in the future without prior notification.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch
Web: www.daheng-imaging.com/en
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch I
3.3.8. Exposure Mode.................................................................................................................. 55
3.3.9. Exposure Overlap Time Max ............................................................................................. 55
3.3.10. Multi-gray Control (MGC) Mode ...................................................................................... 56
3.4. Digital I/O................................................................................................................57
3.4.1. Pin Control ......................................................................................................................... 57
3.4.2. The I/O Control of the USB2.0 Camera ............................................................................ 58
3.5. Counter and Timer Control .....................................................................................61
3.5.1. Timer .................................................................................................................................. 61
3.5.2. Counter .............................................................................................................................. 62
3.6. Analog Control ........................................................................................................63
3.6.1. Gain ................................................................................................................................... 63
3.6.2. Black Level ........................................................................................................................ 65
3.6.3. White Balance.................................................................................................................... 67
3.7. Transport Layer Control ..........................................................................................69
3.7.1. PayloadSize ....................................................................................................................... 69
3.7.2. IP Configuration ................................................................................................................. 70
3.7.3. Estimate the Bandwidth ..................................................................................................... 70
3.7.4. The Heartbeat Timeout Time of the Device....................................................................... 70
3.7.5. Packet Size ........................................................................................................................ 71
3.7.6. Packet Delay...................................................................................................................... 71
3.7.7. Link Speed ......................................................................................................................... 72
3.8. Bandwidth Control ..................................................................................................72
3.9. Event Control..........................................................................................................73
3.10. LUT (Look-up Table) Control ................................................................................74
3.11. User Configuration ................................................................................................75
3.12. Set Camera's IP Address......................................................................................76
3.12.1. Configuration Static IP Address....................................................................................... 76
3.12.2. Force IP ........................................................................................................................... 77
3.13. Other Functions ....................................................................................................78
3.13.1. Auto Exposure/ Auto Gain Related Function ................................................................... 78
3.13.2. Dead Pixel Correction...................................................................................................... 82
3.13.3. ADCLevel (DigitalShift) .................................................................................................... 82
3.13.4. Blanking Control .............................................................................................................. 84
3.13.5. User Data Encryption Area .............................................................................................. 85
3.13.6. User Data Area ................................................................................................................ 85
3.13.7. Remove Parameter Limits ............................................................................................... 87
3.13.8. Flat Field Correction ........................................................................................................ 87
4. Local Device Control .....................................................................................................89
4.1. Related Attribute .....................................................................................................89
4.2. Sample Code..........................................................................................................89
4.3. Precautions ............................................................................................................89
5. Flow Layer Control ........................................................................................................90
5.1. Statistical Attribute ..................................................................................................90
5.1.1. Related Attribute ................................................................................................................ 90
5.1.2. Precautions ........................................................................................................................ 90
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch II
5.1.3. Sample Code ..................................................................................................................... 90
5.2. Control Parameters ................................................................................................90
5.2.1. Related Parameters........................................................................................................... 90
5.2.2. Precautions ........................................................................................................................ 92
5.2.3. Sample Code ..................................................................................................................... 92
6. Functions Affected by Camera Model ..........................................................................93
7. GxIAPI Library Definitions ............................................................................................94
7.1. Type........................................................................................................................94
7.1.1. Data Type .......................................................................................................................... 94
7.1.2. Handle Type....................................................................................................................... 94
7.1.3. Callback Function Type ..................................................................................................... 95
7.2. Constant .................................................................................................................95
7.2.1. GX_STATUS_LIST ............................................................................................................ 95
7.2.2. GX_FRAME_STATUS ....................................................................................................... 96
7.2.3. GX_ACCESS_MODE ........................................................................................................ 96
7.2.4. GX_OPEN_MODE ............................................................................................................ 97
7.2.5. GX_IP_CONFIGURE_MODE_LIST .................................................................................. 97
7.2.6. GX_RESET_DEVICE_MODE ........................................................................................... 98
7.2.7. GX_TL_TYPE_LIST .......................................................................................................... 98
7.2.8. GX_NODE_ACCESS_MODE ........................................................................................... 99
7.2.9. GX_DEVICE_CLASS ........................................................................................................ 99
7.2.10. GX_LOG_TYPE_LIST ................................................................................................... 100
7.3. Structure ...............................................................................................................100
7.3.1. GX_OPEN_PARAM ......................................................................................................... 100
7.3.2. GX_FRAME_CALLBACK_PARAM ................................................................................. 101
7.3.3. GX_FRAME_DATA .......................................................................................................... 102
7.3.4. GX_FRAME_BUFFER .................................................................................................... 103
7.3.5. GX_REGISTER_STACK_ENTRY ................................................................................... 104
7.3.6. GX_INTERFACE_INFO................................................................................................... 105
7.3.7. GX_DEVICE_INFO ......................................................................................................... 107
7.3.8. GX_INT_VALUE ............................................................................................................... 111
7.3.9. GX_FLOAT_VALUE.......................................................................................................... 111
7.3.10. GX_STRING_VALUE .................................................................................................... 112
7.3.11. GX_ENUM_VALUE........................................................................................................ 112
7.3.12. GX_GIGE_ACTION_COMMAND_RESULT ................................................................. 113
7.4. Interfaces.............................................................................................................. 114
7.4.1. Get SDK Version Information .......................................................................................... 114
7.4.2. Initialization and Cancellation .......................................................................................... 114
7.4.3. Device Parameter Settings .............................................................................................. 128
7.4.4. Device Functional Interface ............................................................................................. 144
7.4.5. Device Acquisition Interface ............................................................................................ 156
7.4.6. Device Event Interface .................................................................................................... 182
7.5. Not recommended Definitions ..............................................................................192
7.5.1. Type ................................................................................................................................. 192
7.5.2. Constants......................................................................................................................... 192
7.5.3. Structure .......................................................................................................................... 194
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch III
7.5.4. Interface ........................................................................................................................... 197
8. Image Processing Interface Description ...................................................................231
8.1. Type......................................................................................................................231
8.1.1. Data Type ........................................................................................................................ 231
8.2. Constant ...............................................................................................................231
8.2.1. Status code ...................................................................................................................... 231
8.2.2. Pixel Bayer format ........................................................................................................... 232
8.2.3. Bayer conversion type ..................................................................................................... 232
8.2.4. Valid data bit .................................................................................................................... 233
8.2.5. The actual image bit depth .............................................................................................. 233
8.2.6. The image mirror and flip type ......................................................................................... 234
8.2.7. Color image RGB order ................................................................................................... 234
8.2.8. Image Format Conversion Handle .................................................................................. 234
8.2.9. System Parameter ........................................................................................................... 235
8.3. Structure ...............................................................................................................235
8.3.1. Monochrome image process function set structure ........................................................ 235
8.3.2. Color image process function set structure ..................................................................... 236
8.3.3. Flat field correction process function set structure.......................................................... 237
8.3.4. Color correction UserSet process function set struct ...................................................... 237
8.3.5. Static defect correction function set structure ................................................................. 238
8.4. Interfaces..............................................................................................................239
8.4.1. DxRaw12PackedToRaw16 .............................................................................................. 239
8.4.2. DxRaw10PackedToRaw16 .............................................................................................. 240
8.4.3. DxRaw8toRGB24 ............................................................................................................ 241
8.4.4. DxRaw8toRGB24Ex ........................................................................................................ 243
8.4.5. DxRotate90CW8B ........................................................................................................... 245
8.4.6. DxRotate90CCW8B......................................................................................................... 246
8.4.7. DxRotate90CW16B ......................................................................................................... 248
8.4.8. DxRotate90CCW16B....................................................................................................... 250
8.4.9. DxBrightness ................................................................................................................... 251
8.4.10. DxContrast ..................................................................................................................... 254
8.4.11. DxSharpen24B............................................................................................................... 256
8.4.12. DxSharpenMono8.......................................................................................................... 257
8.4.13. DxSaturation .................................................................................................................. 258
8.4.14. DxGetWhiteBalanceRatio .............................................................................................. 259
8.4.15. DxAutoRawDefectivePixelCorrect ................................................................................. 263
8.4.16. DxRaw16toRaw8 ........................................................................................................... 264
8.4.17. DxRGB48toRGB24 ........................................................................................................ 265
8.4.18. DxRaw16toRGB48 ........................................................................................................ 267
8.4.19. DxRaw8toARGB32 ........................................................................................................ 269
8.4.20. DxGetContrastLut .......................................................................................................... 270
8.4.21. DxGetGammatLut.......................................................................................................... 272
8.4.22. DxImageImprovment ..................................................................................................... 274
8.4.23. DxARGBImageImprovment ........................................................................................... 279
8.4.24. DxImageImprovmentEx ................................................................................................. 284
8.4.25. DxImageMirror ............................................................................................................... 288
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch IV
8.4.26. DxImageMirror16B ........................................................................................................ 290
8.4.27. DxGetLut........................................................................................................................ 292
8.4.28. DxCalcCCParam ........................................................................................................... 293
8.4.29. DxRaw8ImgProcess ...................................................................................................... 295
8.4.30. DxMono8ImgProcess .................................................................................................... 299
8.4.31. DxGetFFCCoefficients................................................................................................... 302
8.4.32. DxFlatFieldCorrection .................................................................................................... 304
8.4.33. DxCalcUserSetCCParam .............................................................................................. 305
8.4.34. DxImageFormatConvert ................................................................................................ 307
8.4.35. DxImageFormatConvertCreate ..................................................................................... 313
8.4.36. DxImageFormatConvertDestroy.................................................................................... 313
8.4.37. DxImageFormatConvertSetOutputPixelFormat ............................................................ 314
8.4.38. DxImageFormatConvertSetAlphaValue ........................................................................ 315
8.4.39. DxImageFormatConvertSetInterpolationType ............................................................... 316
8.4.40. DxImageFormatConvertGetBufferSizeForConversion.................................................. 317
8.4.41. DxImageFormatConvertGetOutputPixelFormat ............................................................ 319
8.4.42. DxImageFormatConvertSetValidBits ............................................................................. 320
8.4.43. DxImageFormatConvertSet3DcalibParam .................................................................... 321
8.4.44. DxImageFormatConvertSetYStep ................................................................................. 325
8.4.45. DxStaticDefectCorrection .............................................................................................. 326
8.4.46. DxCalcCameraLutBuffer................................................................................................ 327
8.4.47. DxReadLutFile ............................................................................................................... 329
8.4.48. DxSetSystem ............................................................................................................... 331
8.4.49. DxGetSystem................................................................................................................. 331
8.5. Function................................................................................................................332
8.5.1. Image Quality Enhancement Function ............................................................................ 332
9. Revision History ..........................................................................................................342
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch V
1.Camera's Work Flow
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 1
1.Camera's Work Flow
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 2
1.Camera's Work Flow
Precautions:
1) The user acquisition thread must be started after the start of the acquisition and be destroyed
before the acquisition is stopped.
2) Windows currently does not support the GXStreamOn()/GXStreamOff() interface. Use
GXSetCommandValue (hDevice, "AcquisitionStart")/GXSetCommandValue (hDevice,
"AcquisitionStop") instead.
3) After calling the GXQBuf() interface and putting the image buffer back into the GxIAPI library, you
can no longer access the image buffer pointer.
4) The GXStreamOff() interface will put all image buffers obtained by GXDQBuf back into the GxIAPI
library, and then users can no longer access these image buffers.
5) The above flowchart demonstrates the way to start the thread for image acquisition, or you can
call GXDQBuf() directly to acquire images without creating a thread.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 3
1.Camera's Work Flow
Precautions:
1) The user acquisition thread must be started after the start of the acquisition and be destroyed
before the acquisition is stopped;
2) The GXStreamOff() interface will put all image buffers obtained by GXQAllBufs() back into the
GxIAPI library, and then users can no longer access these image buffers;
3) The above process demonstrates the way to start the thread for image acquisition, or you can
call GXDQAllBufs() to acquire images without creating a thread.
Recommended scenarios:
1) In the case of having delay with image processing or display, the delay can be alleviated by only
processing or displaying the latest image in the array.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 4
1.Camera's Work Flow
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 5
1.Camera's Work Flow
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 6
1.Camera's Work Flow
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 7
2.Programming Guide
2. Programming Guide
Figure 2-1
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 8
2.Programming Guide
Select Link tab, set Category as General, fill GxIAPI.lib and DxImageProc.lib in the Object/library
modules, and see Figure 2-2:
Figure 2-2
Still stay in Link tab, set Category as Input, and fill in the directory path address (based on the actual
installation directory) of the GxIAPI.lib and DxImageProc.lib in the Additional library path, and see
Figure 2-3:
Figure 2-3
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 9
2.Programming Guide
Properties->C/C++->General, fill in the directory path address (based on the actual installation directory)
of the GxIAPI.h and DxImageProc.h in the Additional Include Directories, and see Figure 2-4:
Figure 2-4
Select Configuration Properties->Linker->General, fill in the directory path address (based on the actual
installation directory) of the GxIAPI.lib and DxImageProc.lib in the Additional Library Directories, and
see Figure 2-5:
Figure 2-5
Figure 2-6
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 10
2.Programming Guide
2.1.2. Linux
2.1.2.1. Recommended configuration
1) Support Linux kernel version: >= 3.5.0 (32 and 64 bit)
g++ version: >= 4.8
glibc version: >= 2.17
2) Recommended system release version: Ubuntu 16.04 or above, CentOS7, CentOS8
2.1.2.2. Console program
Makefile
1) Before compiling the program, you need to copy the GxIAPI. h and DxImageProc. h header files
from the include directory of the SDK library to the project directory, or add the include directory of
the SDK library to the search path by the "- I" parameter.
2) When linking the application, you must link to the libgxiapi.so (-lgxiapi).
There are a series of sample programs in the Linux package, the following contents are the generic
Makefile contents of the sample programs.
The red mark: samplename is the name of the compile and output program.
# Makefile for sample program
.PHONY : all clean
all : $(NAME)
$(NAME) : $(OBJS)
$(LD) -o $@ $^ $(CPPFLAGS) $(LDFLAGS)
%.o : %.cpp
$(CXX) $(CPPFLAGS) -c -o $@ $<
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 11
2.Programming Guide
clean :
$(RM) *.o $(NAME)
Figure 2-7
Step 2: When opening the project, if the project cannot be opened and the Kit related contents are
prompted, you need to check the configuration of the qtcreator. Select Tool -> Options -> Build & Run ->
Qt Versions to see if qmake is detected. If it is not detected automatically, you need to load it manually,
as shown in Figure 2-8. This step can be ignored if the project can be opened normally.
Figure 2-8
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 12
2.Programming Guide
Step 3: After qmake loads successfully, add qmake to the Qt Version of the build options you want to use
in the Tool -> Options -> Build & Run -> Kits tab, as shown in Figure 2-9. This step can be ignored if the
project can be opened normally.
Figure 2-9
2.1.3. macOS
2.1.3.1. Development Environment Installation
Install daheng macOS sdk
1) Double-click the package with suffix .pkg in the provided dmg to install.
2) Click Continue and select the disk to install. The galaxy. framework is installed in
the/Library/Frameworks/directory of the disk.
3) Authentication.
4) Keep clicking Continue until installation finished.
2.1.3.2. Sample program based on the Xcode
The sample program in the installation package can be compiled and run normally under Xcode version
11.3 (11C29). The installation method and configuration steps of Xcode (Xcode11.3) integrate
development environment are as follows.
MacOS platform installs Xcode based on Xcode 11.3
1) Installation
Search Xcode in APP Store and then click Install button.
2) Operation
Operate Xcode in LaunchPad.
2.1.3.3. Xcode (Xcode11.3 based) configuration environment
Step 1: After operation, create a new project through "File->New->Project", and select
"macOS->Command Line Tool".
Step 2: Add header files and library files to the project. First add the galaxy.framework to the project, the
path of the galaxy.framework is in the /Library/Frameworks/. Right-click the project name, click "Add Files
to…", you can access the path of galaxy.framework by the shortcut key Command+Shift+G. Add
galaxy.framework to the project, and by the same way add the GxIAPI.cti and libGxIAPI.dylib in the
/Library/Frameworks/galaxy.framework/Versions/A/Libraries/ to the project.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 13
2.Programming Guide
Step 3: After loading the Framework and library file successfully, click the project name, select
"TestProgram->BuildSettings->Linking->Runpath Search Paths", and add /Library/Frameworks/ to this
item (the directory of galaxy.framework).
Step 4: Reference the header file to write a simple program, compile and run it, and the successful interface
call proves that the Xcode environment configuration is successful.
//Uses GxIAPI.
//Calls GXCLoseLib() at the end of the program to release resources.
emstatus = GXCloseLib();
return 0;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 14
2.Programming Guide
If you want to enumerate the specified types of cameras, you can also use GxUpdateAllDeviceListEx() to
get the network information of the device.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32DeviceNum = 0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 15
2.Programming Guide
Sample Code:
//Get Interface information
GX_INTERFACE_INFO stInterfaceInfo = NULL;
2) You can also call GXGigEForceIp() to configurate the camera IP address, but the IP address set in
this way may effective only for this use, when the camera rebooted, the camera may use the previous IP
address. Calling this function requires the MAC address of the destination camera, which can be got by
calling GxGetDeviceIPInfo().
Sample Code:
GX_STATUS emstatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 16
2.Programming Guide
//Force Ip.
emStatus = GXGigEForceIp(chMAC, chIpAddress, chSubnetMask,
chDefaultGateway);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 17
2.Programming Guide
The GxOpenDevice() can open the camera by specifying access mode (exclusive, control, etc.), opening
mode (Via IP, SN, MAC, Index, etc.). See the explanation for the GxOpenDevice() interface later.
Figure 2-10
The following describes the access interfaces for different types of features.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 18
2.Programming Guide
Figure 2-11
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 19
2.Programming Guide
Sample Code:
GXGetEnumValue(): Read the number, value, and the description of enumeration items .
Figure 2-12
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 20
2.Programming Guide
Sample Code:
//The value corresponding to the Feature Name in the above figu re
//is the second parameter of the interface
//The value IEnumeration corresponding to Type indicates that the
//property is an enumeration corresponding to GX_ ENUM_ Value
GXGetStringValue(): Read the current value, the length of the current value of the string (bytes), and
the maximum length of the string (bytes).
GXGetRegisterLength(): Query the length of block data, use this length to apply for memory, and
then call GXGetRegisterValue() to read the data.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 21
2.Programming Guide
After the GXOpenDevice() interface is called to open the device, the GXStreamOn() interface can be called
in sequence to enable the stream acquisition and remote device acquisition. In this case, GXDQBuf() and
GXQBuf() interfaces (GXDQAllBufs(), GXQAllBufs() are similarly used, Linux only) can be used to
continuously acquire images. After calling the GXDQBuf() interface, you can get an image buffer and do
your image processing, and calling the GXQBuf() interface, put the buffer back into the capture queue.
Sample Code:
//-------------------------------
//The GXDQBuf interface acquires one frame of image at a time. This sample
//code demonstrates how to use these interfaces to get a frame of image.
//-------------------------------
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 22
2.Programming Guide
GX_OPEN_PARAM stOpenParam;
stOpenParam.accessMode = GX_ACCESS_EXCLUSIVE;
stOpenParam.openMode = GX_OPEN_INDEX;
stOpenParam.pszContent = "1";
emstatus = GXOpenDevice(&stOpenParam, &hDevice);
if (emstatus == GX_STATUS_SUCCESS)
{
//Define the incoming parameters of GXDQBuf
GX_FRAME_BUFFER pFrameBuffer;
//Start acquisition
#ifdef __linux__
emStatus = GXStreamOn(hDevice);
#else
emStatus = GXSetCommandValue(hDevice, "AcquisitionStart");
#endif
if (emStatus == GX_STATUS_SUCCESS)
{
//Calling GXDQBuf to retrieve a frame of image
emStatus = GXDQBuf(hDevice, &pFrameBuffer, 1000);
if (emStatus == GX_STATUS_SUCCESS)
{
if (pFrameBuffer-> nStatus == GX_FRAME_STATUS_SUCCESS)
{
//Image acquisition successful
//Process images
}
//Call GXQBuf to put the image buf back into the library and
//continue acquire images
emStatus = GXQBuf(hDevice, pFrameBuffer);
}
}
//Stop acquisition
#ifdef __linux__
emStatus = GXStreamOff(hDevice);
#else
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 23
2.Programming Guide
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 24
2.Programming Guide
emstatus = GXInitLib();
if (emstatus != GX_STATUS_SUCCESS)
{
return 0;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 25
2.Programming Guide
ui32PacketSize);
}
//Registers image processing callback function.
emstatus = GXRegisterCaptureCallback(hDevice, NULL,
OnFrameCallbackFun);
//---------------------
//
//In this interval, the image will be returned to the user via the
//OnFrameCallbackFun interface.
//
//---------------------
You can also call the GxGetImage() interface to get images, but this method cannot be used with the
callback mode simultaneously (see the GxGetImage() interface for details).
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 26
2.Programming Guide
including the thread which sends heartbeat packages, so when you debugging the program code in the
Debug mode, the thread will not send heartbeat packages to the device.
You can increase the heartbeat timeout time to resolve this problem. Under debugging mode, the gigabit
transfer layer software will set the timeout time as 5 minutes automatically when the device is opened. If
the environment variable GIGE_HEARTBEAT_TIMEOUT is added in the system, and the value of it is
greater than 0, then the heartbeat timeout value of the device will automatically be set to the value of the
environment variable.
You can modify the heartbeat timeout by two ways. The first way is to add the following codes to the
program when the device is opened.
//The hDevice is the device handle. The device has been opened via the
//GXOpenDevice interface.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 27
3.Camera Function Attribute Specification
DeviceVendorName STRING RO
DeviceModelName STRING RO
DeviceFirmwareVersion STRING RO
DeviceVersion STRING RO
DeviceSerialNumber STRING RO
FactorySettingVersion STRING RO
DevicePHYVersion STRING RO
DeviceISPFirmwareVersion STRING RO
DeviceUserID STRING RW
Sample Code
// To get the name of the device's vendor, for example
//Get the vendor name
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_STRING_VALUE stVendorNameValue;
pszVendorName = stVendorNameValue.strCurValue;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 28
3.Camera Function Attribute Specification
Related Attribute
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 29
3.Camera Function Attribute Specification
emStatus = GXSetCommandValue(hDevice,"DeviceReset");
SensorWidth INT RO
SensorHeight INT RO
WidthMax INT RO
HeightMax INT RO
Width INT RW
Height INT RW
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 30
3.Camera Function Attribute Specification
OffsetX INT RW
OffsetY INT RW
.
Figure 3-1 The related parameters of ROI
Effect images
Sample Code
//Sets an area with an offset of (0,0) and a size of 600x400 .
GX_STATUS emStatus = GX_STATUS_SUCCESS;
int64_t i64Width= 600;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 31
3.Camera Function Attribute Specification
Precautions
1) There are two pairs of attributes that affect the maximum ROI size: “SensorWidth” and “SensorHeight”.
The width and height of the sensor determine the effective resolution of the image sensor, and also
determine the total of the pixels available, and the values are fixed. In the default mode (no Binning, no
Decimation, no ROI), the image size is equal to “SensorWidth” * “SensorHeight”.
“WidthMax” and “HeightMax” determine the maximum size of the current ROI available, and the maximum
ROI width can be affected by binning or decimation. In the default mode (no Binning, no Decimation):
“WidthMax” * “HeightMax” = “SensorWidth” * “SensorHeight”.
2) In order to ensure that the ROI is valid, the four attributes of ROI need to follow the relational
formula, as follows:
“OffsetX” + “Width” <= “WidthMax” (the maximum width of the current image)
“OffsetY” + “Height” <= “HeightMax” (the maximum height of the current image)
Two formulas above illustrate the maximum of four attributes are dynamic changes, for example, if you
adjust the value of the width, then the adjustable maximum value of the OffsetX will be affected, the
correlation has been achieved in the GxIAPI.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 32
3.Camera Function Attribute Specification
Figure 3-5 Binning (2x2) processing Figure 3-6 The Binning processing result
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 33
3.Camera Function Attribute Specification
Sample Code
//Configures a 2×2 Binning and 2×2 Decimation.
GX_STATUS emStatus = GX_STATUS_SUCCESS;
int64_t i64BinningH = 2;
int64_t i64BinningV = 2;
int64_t i64DecimationH = 2;
int64_t i64DecimationV = 2;
Precautions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 34
3.Camera Function Attribute Specification
captured optical signal into a digital signal by a CMOS or CCD image sensor without any compression.
RAW8 indicates that the output image data bit is 8 bits, and RAW12 indicates that the output image
data bit is 12 bits.
2) Bayer color conversion: The Bayer type is the formatting of RAW image data, see Figure 3-9, when
the image data is processed or displayed, it needs to convert it to a 24 bits RGB real color image
data. A simple interpolation algorithm is as follows:
Figure 3-11
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 35
3.Camera Function Attribute Specification
Related Attribute
Data Format: The PixelFormat is 8Byte, 32bit. It gathers various of information together to form a single
amount of information. The highest two bytes represents the color type (color or monochrome), the
followed two bytes represent the data bit depth (8bit, 10bit, etc.), and the lowest four bytes represent the
coding sequence number.
Sample Code
//Use the GXGetEnumValue interface
//Query the "PixelFormat" type supported by the current camera
//Please refer to the interface descriptions, which are omitted here.
GX_STATUS emstatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 36
3.Camera Function Attribute Specification
i64PixelSize = stPixelSize.stCurValue.nCurValu e;
//Querie what type of test images the current camera supports. See
//the usage of the GXGetEnumValue interface.
//This example assumes that the current camera supports all types of test
//images.
//Sets to scroll vertical stripes test image.
emstatus = GXSetEnumValueByString(hDevice, "TestPattern",
"VerticalLineMoving");
//Closes the test image function.
emstatus = GXSetEnumValueByString(hDevice, "TestPattern", "Off");
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 37
3.Camera Function Attribute Specification
Figure 3-13 The image data before activating the frame information
PayloadSize
Chunk ID
Date
The length of date
Figure 3-14 The image data after activating the frame information
Related Attribute
//Queries which frame information types are supported by the current camera,
//see the usage of the GXGetEnumDescription interface.
//This example assumes that the current camera supports all types of frame
//information.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 38
3.Camera Function Attribute Specification
Precautions
The C software interface opens the control interface of the frame information, but does not open an
interface for acquiring frame information. If you need to analysis the frame information, you should analysis
the data from the lowest bit (tail). For the specific analysis method and the order of the frame information
of each camera, please contact technical support.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 39
3.Camera Function Attribute Specification
signal by querying the acquisition function status. AcquisitionTriggerWait: After selecting this status,
you can determine whether the camera is waiting for the trigger signal in the multi-frame acquisition
status by querying the acquisition status function. The function is only used in the trigger mode and
has no effect on the continuous acquisition mode.
6) Acquisition status: This function code is used together with the acquisition status selection function.
For details, please refer to the acquisition status selection. During non-acquisition period (before the
acquisition is started, after the acquisition is stopped), the value of the query has no meaning in the
non-trigger mode.
Related Attribute
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 40
3.Camera Function Attribute Specification
Each active trigger produces an image. Each active trigger produces an image.
Sending the stop acquisition command is not Sending the stop acquisition command is not
mandatory in the mode. mandatory in the mode.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 41
3.Camera Function Attribute Specification
Sample Code
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 42
3.Camera Function Attribute Specification
stOpenParam.pszContent = "1";
if (emStatus == GX_STATUS_SUCCESS)
{
//Setting device’s property of GevSCPSPacketSize to improve the
//acquisition performance of the network camera.
bool bImplementPacketSize = false;
uint32_t ui32PacketSize = 0;
if (bImplementPacketSize)
{
//Get Optimal PacketSize.
emStatus = GXGetOptimalPacketSize (hDevice, &ui32PacketSize);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 43
3.Camera Function Attribute Specification
//---------------------
//
//In this interval, the image will be returned to the user via the
//OnFrameCallbackFun interface.
//
//---------------------
Precautions
3.3.2. Trigger
3.3.2.1. General Function
Terms
1) Trigger Source: Select the source of the trigger signal. Software trigger or hardware trigger.
2) Trigger Mode: To determine whether the trigger signal is valid or not. On-valid; OFF-invalid.
3) Trigger Polarity: The activate mode of trigger. Rising edge valid or falling edge valid.
Related Attribute
Attribute Name Attribute Type Accessible Properties
TriggerMode ENUM RW
TriggerSoftware COMMAND WO
TriggerActivation ENUM RW
TriggerSwitch ENUM RW
TriggerSource ENUM RW
TriggerSelector ENUM RW
TriggerDelay FLOAT RW
Sample Code
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 44
3.Camera Function Attribute Specification
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 45
3.Camera Function Attribute Specification
if (emStatus == GX_STATUS_SUCCESS)
{
//Setting device’s property of GevSCPSPacketSize to improve
//the acquisition performance of the network camera
bool bImplementPacketSize = false;
uint32_t ui32PacketSize = 0;
if (bImplementPacketSize)
{
//Get Optimal PacketSize
emStatus = GXGetOptimalPacketSize (hDevice, &ui32PacketSize);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 46
3.Camera Function Attribute Specification
emStatus = GXSetCommandValue(hDevice,"AcquisitionStart");
//---------------------
//
//In this interval, the image will be returned to the user via the
//OnFrameCallbackFun interface.
//---------------------
Precautions
3.3.2.2. Advanced Function
Terms
1) Trigger filtering value at rising edge: If the pulse width at the rising edge is smaller than the trigger
filtering value, then the camera will not handle the trigger signal. When the pulse width at the rising
edge is larger or equal to the trigger filtering value, it will generate the valid trigger signal.
2) Trigger filtering value at falling edge: If the pulse width at the falling edge is smaller than the trigger
filtering value, then the camera will not handle the trigger signal. When the pulse width at the falling
edge is larger or equal to the trigger filtering value, it will generate the valid trigger signal.
Related Parameters
Attribute Name Attribute Type Accessible Properties
TriggerFilterRaisingEdge FLOAT RW
TriggerFilterFallingEdge FLOAT RW
Trigger waveform figure
Pulse width Pulse width
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 47
3.Camera Function Attribute Specification
Sample Code
//Gets the settings range of rising edge filter.
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_FLOAT_VALUE stRaisingRange;
emStatus = GXGetFloatValue(hDevice, "TriggerFilterRaisingEdge",
&stRaisingRange);
//Sets the rising edge filter to the minimum value.
emStatus = GXSetFloatValue(hDevice, "TriggerFilterRaisingEdge",
stRaisingRange.dMin);
Precautions
3.3.3. Exposure
Terms
1) Exposure Mode: Different modes of exposure, in Timed mode, you can use “ExposureTime” or
“ExposureAuto”.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 48
3.Camera Function Attribute Specification
2) Exposure Time Mode: Different modes of exposure time, including Standard mode and UltraShort
mode. “ExposureAuto” is only available in Standard mode.
3) Exposure Time: That is shutter time, refers to the time interval of the sensor shutter from open to close,
in the interval the object can be captured in the sensor. If you reduce the exposure time, the image
will darker, increase the exposure time, the image will brighter.
4) Exposure Delay: The exposure delay function can effectively solve the strobe delay problem. Most
strobes have a delay of at least tens of microseconds from trigger to light. When the camera is working
in a small exposure mode, the fill light effect of the strobe will be affected. The exposure delay is
achieved by the strobe signal and the delay of the actual exposure starting.
Related Attribute
Attribute Name Attribute Type Accessible Properties
ExposureMode ENUM RW
ExposureTimeMode ENUM RW
ExposureTime FLOAT RW
ExposureAuto ENUM RW
ExposureDelay FLOAT RW
Effect images
Figure 3-23 Reduce exposure time Figure 3-24 Increase exposure time
Sample Code
//Gets the adjustment range of exposure time.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 49
3.Camera Function Attribute Specification
Precautions
When the external light source is sunlight or direct current (DC) light source, no special requirements for
the exposure time, but when the external light source is alternating current (AC) light source, the exposure
time must synchronize with the external light source (under 50Hz light source, the exposure time must be
a multiple of 1/100s. Under 60Hz light source, the exposure time must be a multiple of 1/120s).
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 50
3.Camera Function Attribute Specification
When multi-cameras are triggered simultaneously, you can set different transmission delays for each
camera, to avoid the large instantaneous bandwidth of the switch.
Related Attribute
Attribute Name Attribute Type Accessible Properties
TransferControlMode ENUM RW
TransferOperationMode ENUM RW
TransferStart COMMAND WO
TransferBlockCount INT RW
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Set the transfer operation mode to the specified transfer frame mode.
emStatus = GXSetEnumValueByString(hDevice, "TransferOperationMode",
"MultiBlock");
//Send a software trigger signal (or external trigger) after the start
//of acquisition.
emStatus = GXSetCommandValue(hDevice, "AcquisitionStart");
emStatus = GXSetCommandValue(hDevice, "TriggerSoftware");
Precautions
The transfer control function can only work in trigger mode.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 51
3.Camera Function Attribute Specification
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 52
3.Camera Function Attribute Specification
Precautions
Because of the transfer control mode is under user control, especially when multiple frames are transmitted
at one time, the transmission is carried out according to the maximum transmission speed of the interface.
Due to the different performance of the NIC, frame dropping may occur during long operation, so the IPG
(Inter Packet Gap, default value: 0) needs to be increased. The IPG settings depend on the following
factors:
Frame settings in a single transmission
Interval between two transmissions (100ms or above recommended)
Packet Size (8164 recommended, NIC jumbo frame mode)
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 53
3.Camera Function Attribute Specification
//Send frame buffer flush command (Be careful to use this command
//while in need).
EmStatus = GXSetCommandValue(hDevice, "FrameBufferFlush ");
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 54
3.Camera Function Attribute Specification
frame rate (“ CurrentAcquisitionFrameRate ”). (The frame rate is affected by the exposure time, ROI and
etc.)
Precautions
If the TriggerWidth exposure mode is enabled, do not send trigger signals at too high a rate. Otherwise,
trigger signals will be ignored.
In the TriggerWidth exposure mode, If the Exposure Overlap Time Max parameter is available, set it to the
smallest exposure time you intend to use.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 55
3.Camera Function Attribute Specification
Sample Code
GX_STATUS emStatus = GX_EMSTATUS_SUCCESS;
Precautions
Exposure Overlap Time Max is only available in TriggerWidth exposure mode.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 56
3.Camera Function Attribute Specification
//You can set the output source to the strobe. The code is as follows.
emStatus = GXSetEnumValueByString(hDevice, "LineSource", "Strobe");
//You can set the output source to the user -defined output.
//The code is as follows.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 57
3.Camera Function Attribute Specification
//Gets the status of the line2 pin (The current pin is selected as line2).
bool bLineStatus = true;
emStatus = GXGetBoolValue(hDevice, "LineStatus", &bLineStatus);
i64AllLineStatus = stAllLineStatus.nCurValue;
The IO control of USB2.0 is special, and the "pins control" operation is not the same operation process as
shown in the previous section. The IO control of USB2.0 involves the following three functions:
Terms
1) User IO output mode: There are two modes: strobe mode and user-defined mode. In the strobe
mode, the camera sends trigger signals to activate the strobe (the trigger signal has rising edge and
falling edge). In user-defined mode, you can set the camera's output level to meet the special
demand, such as control the LED lamp (the output level is high or low).
2) Output signal polarity: When the output signal mode is strobe, the polarity means rising edge or
falling edge, and when the output signal mode is user-defined, the polarity means high level or low
level.
3) Strobe switch: The switch just works on the strobe mode. When the switch is set to open, it will
output strobe signal, if the switch is set to close, it will not output strobe signal.
Related Attribute
Accessible
Attribute Name Attribute Type Description
Properties
UserOutputMode ENUM RW USB2.0 camera specific
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 58
3.Camera Function Attribute Specification
Output configuration
management
Turn on the
strobe switch
Finish
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 59
3.Camera Function Attribute Specification
Sample Code
#include"GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 60
3.Camera Function Attribute Specification
Precautions
//Set the timer delay to 10us, the user can set according to the
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 61
3.Camera Function Attribute Specification
//actual situation.
emStatus = GXSetFloatValue(hDevice, "TimerDelay", 10.0);
3.5.2. Counter
Terms
1) Counter: Used to record internal events, I/O external events, or clock tick counts.
2) Counter event trigger source: Select the events that will be the source to increment the counter.
Currently only one mode "Frame Start" is supported.
3) Counter reset source: Select the signals that will be the source to reset the counter.
4) Counter reset signal polarity: Activation mode of the counter reset source signal. It is divided into rising
edge valid or falling edge valid.
5) Counter reset: Reset the selected counter. Only valid when set counter reset source to "Software".
Related Attribute
Attribute Name Attribute Type Accessible Properties
CounterSelector ENUM RW
CounterEventSource ENUM RW
CounterResetSource ENUM RW
CounterResetActivation ENUM RW
CounterReset COMMAND WO
CounterTriggerSource ENUM RW
CounterDuration INT RW
TimerTriggerActivation ENUM RW
Sample Code
GX_STATUS status = GX_STATUS_SUCCESS;
//For example, select Counter1 as the counter.
emStatus = GXSetEnumValueByString(hDevice, "CounterSelector",
"Counter1");
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 62
3.Camera Function Attribute Specification
"Software");
//Sends counter reset command. Only valid when set counter reset
//source to "Software".
emStatus = GXSetCommandValue(hDevice, "CounterReset");
Related Attribute
Attribute Name Attribute Type Accessible Properties
GainSelector ENUM RW
Gain FLOAT RW
GainAuto ENUM RW
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 63
3.Camera Function Attribute Specification
Effect images
Sample Code
//Manual gain control------------------------
//Use GXGetEnumValue interfaces to query "GainSelector" type
//supported by the current camera.
//Please refer to the interface descriptions, which are omitted here
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 64
3.Camera Function Attribute Specification
Precautions
For USB2.0 camera, the unit of the gain is not "dB", it is the value of the register, and it has an adjustment
range, the larger the value, the larger the magnification of the gain.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 65
3.Camera Function Attribute Specification
Sample Code
//Manual black level adjustment ------------------------
//Use GXGetEnumValue interface to query the "BlackLevelSelector" type
//supported by the current camera
//Please refer to the interface descriptions, which are omitted here
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 66
3.Camera Function Attribute Specification
Precautions
Figure 3-32 Image color shift under D65 environment Figure 3-33 After white balance adjustmen
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 67
3.Camera Function Attribute Specification
Sample Code
//The manule white balance adjustment------------------------
//Use GXGetEnumValue interface to query "BalanceRatioSelector" type
//supported by the current camera
//Please refer to the interface description, which is omitted here
//Sets the automatic white balance ROI (the user can modify the parameters
//according to their own need).
emStatus = GXSetIntValue(hDevice, "AWBROIWidth", 100);
emStatus = GXSetIntValue(hDevice, "AWBROIHeight", 100);
emStatus = GXSetIntValue(hDevice, "AWBROIOffsetX", 0);
emStatus = GXSetIntValue(hDevice, "AWBROIOffsetY", 0);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 68
3.Camera Function Attribute Specification
Precautions
If the automatic white balance function fails, it may be because the ROI of the automatic white balance is
too small to find the white spots.
Precautions
When the user allocates the buffer for image data, it is strongly recommended that the user use the value
of payloadSize.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 69
3.Camera Function Attribute Specification
3.7.2. IP Configuration
Related Attribute
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 70
3.Camera Function Attribute Specification
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Reads the current heartbeat timeout time of the device.
GX_INT_VALUE stTimeValue = 0;
emStatus = GXGetIntValue(hDevice,"GevHeartbeatTimeout",
&stTimeValue);
Precautions
It is strongly recommended that the user use the default value unless special situation allow the user to
modify the value based on the application environment.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 71
3.Camera Function Attribute Specification
Related Attribute
Attribute Name Attribute Type Accessible Properties
GevSCPD INT RW
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Reads the packet delay
int64_t i64PacketDelay = 0;
GX_INT_VALUE stValue;
emStatus = GXGetIntValue(hDevice, "GevSCPD", &stValue);
i64PacketDelay = stValue.nCurValue;
i64Value = stValue.nCurValue;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 72
3.Camera Function Attribute Specification
Related Attribute
Attribute Name Attribute Type Accessible Properties
DeviceLinkSelector INT RW
DeviceLinkThroughputLimitMode ENUM RW
DeviceLinkThroughputLimit INT RW
DeviceLinkCurrentThroughput INT RO
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
Precautions
When the device bandwidth limit mode is opened or the bandwidth of the device is changed before, you
should stop the acquisition.
Every event has a corresponding enable status, and in default all the events' enable status are disable.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 73
3.Camera Function Attribute Specification
Related Attribute
Attribute Name Attribute Type Accessible Properties
EventSelector ENUM RW
EventNotification ENUM RW
EventExposureEnd INT RO
EventExposureEndTimestamp INT RO
EventExposureEndFrameID INT RO
EventBlockDiscard INT RO
EventBlockDiscardTimestamp INT RO
EventBlockDiscardFrameID INT RO
EventOverrun INT RO
EventOverrunTimestamp INT RO
EventFrameStartOvertrigger INT RO
EventFrameStartOvertriggerTimestamp INT RO
EventFrameStartOvertriggerFrameID INT RO
EventBlockNotEmpty INT RO
EventBlockNotEmptyTimestamp INT RO
EventBlockNotEmptyFrameID INT RO
EventInternalError INT RO
EventInternalErrorTimestamp INT RO
EventFrameBurstStartOvertrigger INT RO
EventFrameBurstStartOvertriggerFrameID INT RO
EventFrameBurstStartOvertriggerTimestamp INT RO
EventFrameStartWait INT RO
EventFrameStartWaitFrameID INT RO
EventFrameStartWaitTimestamp INT RO
EventFrameBurstStartWait INT RO
EventFrameBurstStartWaitTimestamp INT RO
EventFrameBurstStartWaitFrameID INT RO
Sample Code
See GXRegisterFeatureCallbackByString() interface description.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 74
3.Camera Function Attribute Specification
linear conversion of pixel values (such as logarithmic and exponential corrections) without consuming
valuable computing resources in the system.
Related Attribute
Attribute Name Attribute Type Accessible Properties
LUTSelector ENUM RW
LUTValueAll BUFFER RW
LUTEnable BOOL RW
LUTIndex INT RW
LUTValue INT RW
Sample Code
See GXGetRegisterValue(), GXSetRegisterValue() interfaces description.
Precautions
1) Parameter type: The user selects a type of parameters (default, userset0) to save or load.
3) Save parameters: Save the camera's current parameters to the user selected parameter group.
4) Set parameters: Set the parameter group used when the device is powered on.
Related Attribute
//Assume that the current camera supports two parameter groups, such
//as the vendor default parameter group, and user parameter group 0.
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 75
3.Camera Function Attribute Specification
Precautions
//This is the MAC sample address. The actual MAC address of the
//camera can be obtained from the GXGetDeviceInfo interface.
char chArrMAC[] = "00-21-49-00-00-00";
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 76
3.Camera Function Attribute Specification
Precautions
1) Before calling this interface, you must do enumeration operation first, and to perform this operation
when the camera is not open.
2) When you select the GX_IP_CONFIGURE_STATIC_IP and GX_IP_CONFIGURE_DEFAULT
parameters to configuration the camera IP, the parameters pointers to the IP address, subnet mask,
default gateway etc. are not NULL.
3) When you select the GX_IP_CONFIGURE_LLA and GX_IP_CONFIGURE_DHCP parameters to
configuration the camera IP, the parameters pointers to the IP address, subnet mask, default gateway
etc. can be NULL.
4) The maximum length of user-defined name (UserID) is 16 characters. Configuration cameras IP in
any way, the user-defined name (UserID) parameter pointers can be NULL.
3.12.2. Force IP
Terms
Force IP: Use the Force IP mode can temporarily change the camera's IP address, only for the use of the
camera, which will restore the original IP when the camera has rebooted.
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//This is the MAC sample address. The actual MAC address of the
//camera can be obtained from the GXGetDeviceIPInfo interfa ce.
char chArrMAC[] = "00-21-49-00-00-00";
char chArrIpAddress[] = "192.168.10.10";
char chArrSubnetMask[] = "255.255.255.0";
char chArrDefaultGateway[] = "192.168.10.2";
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 77
3.Camera Function Attribute Specification
//ForceIp
emStatus = GXGigEForceIp(chArrMAC, chArrIpAddress, chArrSubnetMask,
chArrDefaultGateway);
Precautions
Before calling this interface, you must do enumeration operation first, and to perform this operation when
the camera is not open.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 78
3.Camera Function Attribute Specification
Precautions
3.13.1.2. Light Environment
Terms
Light Environment: The light environment is the external work environment of the camera, which is divided
into daylight, 50Hz AC light source and 60Hz AC light source. The automatic function can adapt better
according to the external illumination condition.
Related Attribute
AALightEnvironment ENUM RW
Sample Code
//Use GXGetEnumValue interface to query "AALightEnvironment" type
//supported by the current camera
Precaution
3.13.1.3. Statistical Area
Terms
Statistical Area: The camera supports automatic function statistics of variable area, in default, the camera
to statistics the whole image to achieve the expectation gray value. The statistical area function allows the
user to automatically select a part of the area to execute auto-function automatically, which is more flexible.
Related Attribute
AAROIWidth INT RW
AAROIHeight INT RW
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 79
3.Camera Function Attribute Specification
AAROIOffsetX INT RW
AAROIOffsetY INT RW
Left upper y
offset
Left upper x
offset
Maximum
height of image
automatic function Statistical area
statistical area height
Statistical
area width
Maximum
width of image
Sample Code
//Gets the adjustment range.
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_INT_VALUE stROIWidthRange;
GX_INT_VALUE stROIHeightRange;
GX_INT_VALUE stROIXRange;
GX_INT_VALUE stROIYRange;
emStatus = GXGetIntValue(hDevice, "AAROIWidth", &stROIWidthRange);
emStatus = GXGetIntValue(hDevice, "AAROIHeight", &stROIHeightRange);
emStatus = GXGetIntValue(hDevice, "AAROIOffsetX", &stROIXRange);
emStatus = GXGetIntValue(hDevice, "AAROIOffsetY", &stROIYRange);
Precautions
1) The statistical area only provides a statistical range for automatic exposure and automatic gain
calculation, then the camera will calculate to get the adjustment parameters according to the data
within the scope.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 80
3.Camera Function Attribute Specification
2) To ensure the effectiveness of the AAROI, the four-attribute range of AAROI can be ref as the following
formulas:
0 <AAROIOffsetX <= Width (Max. Width of the image)-AAROIWidth
0 <AAROIOffsetY <= Height (Max. Height of the image)-AAROIHeight
0 <AAROIWidth <= Width (Max. Width of the image)-AAROIOffsetX
0 <AAROIHeight <= Height (Max. Height of the image)-AAROIOffsetY
3.13.1.4. Auto Adjustment Range
Terms
1) Auto Exposure Range: When the automatic exposure mode is turned on, the camera can adjust the
exposure time dynamically in a range to adapt the current environment, and the user can adjust the
range.
2) Auto Gain Range: When the automatic gain mode is turned on, the camera can adjust the gain
dynamically in a range to adapt the current environment, and the user can adjust the range.
3) Auto Exposure: A work mode of the camera. In this mode, the camera automatically adjusts the
exposure time in a range to achieve the best image quality according to the environment.
4) Auto Gain: A work mode of the camera. In this mode, the camera automatically adjusts the gain in a
range to achieve the best image quality according to the environment.
Related Attribute
Attribute Name Attribute Type Accessible Properties
AutoGainMin FLOAT RO
AutoGainMax FLOAT RO
AutoExposureTimeMin FLOAT RW
AutoExposureTimeMax FLOAT RW
Sample Code
//Gets the adjustment range.
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_FLOAT_VALUE stAutoGainMinRange;
GX_FLOAT_VALUE stAutoGainMaxRange;
GX_FLOAT_VALUE stAutoExposureMinRange;
GX_FLOAT_VALUE stAutoExposureMaxRange;
emStatus = GXGetFloatValue(hDevice, "AutoGainMin",
&stAutoGainMinRange);
emStatus = GXGetFloatValue(hDevice, "AutoGainMax",
&stAutoGainMaxRange);
emStatus = GXGetFloatValue(hDevice, "AutoExposureTimeMin",
&stAutoExposureMinRange);
emStatus = GXGetFloatValue(hDevice, "AutoExposureTimeMax",
&stAutoExposureMaxRange);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 81
3.Camera Function Attribute Specification
Precautions
In order to ensure the correct legality of automatic functional range values, some special processing is
done for automatic function tunable:
For "AutoGainMin" (the minimum value of auto gain), the minimum value itself has the adjusting range,
the maximum of the range must not greater than the current value of the maximum auto gain value.
Similarly, for "AutoGainMax" (the maximum value of auto gain), this value also has adjustable range, the
minimum of the range must not smaller than the current value of the minimum auto gain value.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 82
3.Camera Function Attribute Specification
Assuming the current camera is 10 bits or 12 bits output, you need to select 8 bits from the 10 bits or 12
bits to display the image. When the camera output image is not 8 bits, this function can be used to select
which 8 bits image to output.
In some devices, the ADCLevel is called digital shift, that is DigitalShift.
If the current camera output 10 bits, there are three conversion level:
Level0: 0~7bit
Level1: 1~8bit
Level2: 2~9bit
If the current camera output 12 bits, there are five conversion level:
Level0: 0~7bit
Level1: 1~8bit
Level2: 2~9bit
Level3: 3~10bit
Level4: 4~11bit
ADCLevel: The lower the level, the brighter the image and the louder the noise; the higher the level,
the darker the image and the lower the noise.
DigitalShift: The lower the value, the darker the image and the lower the noise; the larger the value,
the brighter the image and the louder the noise.
Related Attribute
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 83
3.Camera Function Attribute Specification
Sample Code
//Gets the range of the ADC conversion level (The sample also applies
//to the bit output "DigitalShift")
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_INT_VALUE stADCLevelRange;
emStatus = GXGetIntValue(hDevice, "ADCLevel", &stADCLevelRange);
Precautions
If the current camera's output is 10 bits, and the user's camera setting is 10 bits, then there is no need to
select 8 bits. At this time, the ADCLevel function is disable. Only when the camera's output is 10 bits, and
the user's camera need to output 8 bits, you will need to select which 8 bits.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 84
3.Camera Function Attribute Specification
Precautions
Increasing the horizontal or vertical blanking will reduce the frame rate, conversely, it increases the frame
rate.
Precautions
Using the encryption area can improve some difficulty of decryption only, can not ensure that the program
don't be cracked, so Daheng company does not bear any legal liability for the loss of the safe.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 85
3.Camera Function Attribute Specification
The user data area is a data area reserved for the user. The area is readable and writable, and is 16K
bytes in total. It is divided into 4 data segments, and each data segment is 4K bytes. When reading and
writing data segments, you first need to set the serial number of the data segment, and then read and write
the set data segment according to the data and data size. The data is saved to the camera flash area
immediately after being written.
Related Attribute
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 86
3.Camera Function Attribute Specification
//After operating
if(NULL != pui8SetBuffer)
{
delete[] pui8SetBuffer;
pui8SetBuffer = NULL;
}
Precautions
Precautions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 87
3.Camera Function Attribute Specification
Related Attribute
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 88
4.Local Device Control
4.3. Precautions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 89
5.Flow Layer Control
ui64GetFrameCount = stValue.nCurValue;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 90
5.Flow Layer Control
ResendTimeout INT RW
MaxWaitPacketCount INT RW
ResendMode ENUM RW
BlockTimeout INT RW
MaxNumQueueBuffer INT RW
StreamBufferHandlingMode ENUM RW
“MaxPacketCountInOneBlock”: The maximum resend packet count of a block, that is the maximum resend
packet of a frame, if a frame image has send too much resend packets more than the value, then it is not
to send the resend command, but directly determine the frame is an incomplete frame. If the value is 0, it
means the function is closed.
“MaxPacketCountInOneCommand”: The maximum packet count of one resend process. The packet is
judged lost in the receiving process. If the count is too much greater than the value, then it is not to send
the resend command, but directly determine the frame is an incomplete frame. If the value is 0, it means
the function is closed.
“ResendTimeout”: The timeout time of resent packets. After the retransmission command is sent, the time
to wait for the resend packet arrives. If the resend packet does not arrive in this time, it may be an
incomplete frame.
“MaxWaitPacketCount”: The maximum count of waiting packets. If a frame has not be transferred
completed, the next frame is coming, and the next frame image has received N packets, the previous
frame still not transferred completed, then stop the previous frame, and make it as an incomplete frame. If
the value is 0, it means the function is closed.
“ResendMode”: The mode of resend, it controls the resend switch.
“BlockTimeout”: The timeout time of data block. The total time of frame receives. If the receive time is
longer than the value, you can take the frame as an incomplete one.
“MaxNumQueueBuffer”: The maximum buffer count of the acquisition queue, it can adjust the number of
the buffers which involved in data receiving underlying. When many high-resolution cameras acquisition
simultaneously fail, you can reduce the value of this parameter appropriately, so that more cameras can
acquie at the same time. If the value is too small in a high-resolution acquisition mode, some frames may
be lost. Please contact technical support for specific usage.
“StreamBufferHandlingMode”: The Buffer processing mode that the current stream channel may support.
GigE Vision supports three modes. The definition and functions of the three modes are as follows:
“StreamBufferHandlingMode” (OldestFirst): The default value. The image buffer follows the first-in-first-out
principle. After all the buffers are filled, the new image data will be discarded until the user completes the
processing of the buffer that has filled the image data. The typical application is to receive each frame of
images acquired by the camera without losing frames. In order to achieve no frame loss, the speed of
image data transmission and processing need to be as fast as possible (at least less than the frame period).
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 91
5.Flow Layer Control
“StreamBufferHandlingMode” (NewestOnly): In this mode, the user always receives the latest image
received by the SDK. Each time the SDK receives a new frame of image data, it will automatically discard
the image with the old timestamp. Therefore, when the user's image processing is not timely or the speed
is slow, frame loss will occur. In the main applications, the real-time requirements of image acquisition and
display are high, and it is not required to receive each frame of images acquired by the camera. However,
depending on the camera's frame rate, memory cache, transmission speed, and user applications, there
may be a delay between the latest image received by the SDK and the latest image exposed by the camera.
USB3 Vision camera related attribute
“StreamTransferSize”: The size of the transmission data block. For USB3 Vision series camera, it means
the size of every transmission data block.
“StreamTransferNumberUrb”: The number of transmission data block. This parameter limits the data block
number of single camera mapping to the system kernel actually. The default value is 64, if the value is too
small, it will affect the transmission efficiency; However, the number of total data block which can be
mapping to the system kernel is limited. When multiple cameras are used together, you can reduce the
value appropriately, and increase the number of acquisition device at the same time.
“StreamBufferHandlingMode”: The Buffer processing mode that the current stream channel may support.
USB3 Vision supports the same mode as GigE Vision.
5.2.2. Precautions
The above control parameters can only be modified after stopping acquisition, and the control parameters
are not allowed to be modified in the acquisition process.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 92
6.Functions Affected by Camera Model
[UC/UM] Adjust the value of “Width” will update the current value and minimum value of the
“HBlanking” automatically.
1
Formulas are as follows:
HBlanking_min=MAX(-21,0x236-Width+1);
HBlanking_cur=MAX(HBlanking_cur, HBlanking_min);
When adjusting the Binning function, the horizontal and vertical value of Decimation must be 0.
1 When adjusting the Decimation function, the horizontal and vertical value of Binning must be 0.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 93
7.GxIAPI Library Definitions
7.1. Type
7.1.1. Data Type
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 94
7.GxIAPI Library Definitions
7.2. Constant
7.2.1. GX_STATUS_LIST
typedef enum GX_STATUS_LIST
{
GX_STATUS_SUCCESS = 0,
GX_STATUS_ERROR = -1,
GX_STATUS_NOT_FOUND_TL = -2,
GX_STATUS_NOT_FOUND_DEVICE = -3,
GX_STATUS_OFFLINE = -4,
GX_STATUS_INVALID_PARAMETER = -5,
GX_STATUS_INVALID_HANDLE = -6,
GX_STATUS_INVALID_CALL = -7,
GX_STATUS_INVALID_ACCESS = -8,
GX_STATUS_NEED_MORE_BUFFER= -9,
GX_STATUS_ERROR_TYPE = -10,
GX_STATUS_OUT_OF_RANGE = -11,
GX_STATUS_NOT_IMPLEMENTED = -12,
GX_STATUS_NOT_INIT_API = -13,
GX_STATUS_TIMEOUT = -14
}GX_STATUS_LIST;
Name Description
GX_STATUS_SUCCESS Success
There is an unspecified internal error that is not expected to
GX_STATUS_ERROR
occur
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 95
7.GxIAPI Library Definitions
7.2.2. GX_FRAME_STATUS
enum GX_FRAME_STATUS_LIST
{
GX_FRAME_STATUS_SUCCESS = 0,
GX_FRAME_STATUS_INCOMPLETE = -1
};
typedef int32_t GX_FRAME_STATUS;
Name Description
7.2.3. GX_ACCESS_MODE
typedef enum GX_ACCESS_MODE
{
GX_ACCESS_READONLY =2,
GX_ACCESS_CONTROL =3,
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 96
7.GxIAPI Library Definitions
GX_ACCESS_EXCLUSIVE =4
} GX_ACCESS_MODE;
typedef int32_t GX_ACCESS_MODE_CMD;
Name Description
7.2.4. GX_OPEN_MODE
typedef enum GX_OPEN_MODE
{
GX_OPEN_SN =0,
GX_OPEN_IP =1,
GX_OPEN_MAC =2,
GX_OPEN_INDEX =3,
GX_OPEN_USERID =4
} GX_OPEN_MODE;
typedef int32_t GX_OPEN_MODE_CMD;
Name Description
GX_OPEN_INDEX Opens the device via a serial number (Start from 1, such as 1, 2, 3, 4…)
7.2.5. GX_IP_CONFIGURE_MODE_LIST
typedef enum GX_IP_CONFIGURE_MODE_LIST
{
GX_IP_CONFIGURE_DHCP ,
GX_IP_CONFIGURE_LLA ,
GX_IP_CONFIGURE_STATIC_IP ,
GX_IP_CONFIGURE_DEFAULT
}GX_IP_CONFIGURE_MODE_LIST;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 97
7.GxIAPI Library Definitions
Name Description
7.2.6. GX_RESET_DEVICE_MODE
typedef enum GX_RESET_DEVICE_MODE
{
GX_MANUFACTURER_SPECIFIC_RECONNECT = 0x1,
GX_MANUFACTURER_SPECIFIC_RESET = 0x2
}GX_RESET_DEVICE_MODE;
typedef int32_t GX_RESET_DEVICE_MODE;
Name Description
7.2.7. GX_TL_TYPE_LIST
typedef enum GX_TL_TYPE_LIST
{
GX_TL_TYPE_UNKNOWN = 0,
GX_TL_TYPE_USB = 1,
GX_TL_TYPE_GEV = 2,
GX_TL_TYPE_U3V = 4,
GX_TL_TYPE_CXP =8
}GX_TL_TYPE_LIST;
typedef int32_t GX_TL_TYPE;
Name Description
GX_TL_TYPE_USB USB2.0
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 98
7.GxIAPI Library Definitions
GX_TL_TYPE_GEV GEV
GX_TL_TYPE_U3V U3V
GX_TL_TYPE_CXP CXP
7.2.8. GX_NODE_ACCESS_MODE
typedef enum GX_NODE_ACCESS_MODE
{
GX_NODE_ACCESS_MODE_NI = 0,
GX_NODE_ACCESS_MODE_NA = 1,
GX_NODE_ACCESS_MODE_WO = 2,
GX_NODE_ACCESS_MODE_RO = 3,
GX_NODE_ACCESS_MODE_RW = 4,
GX_NODE_ACCESS_MODE_UNDEF = 5
}GX_NODE_ACCESS_MODE;
Name Description
GX_NODE_ACCESS_MODE_UNDEF Undefined
7.2.9. GX_DEVICE_CLASS
enum GX_DEVICE_CLASS_LIST
{
GX_DEVICE_CLASS_UNKNOWN = 0,
GX_DEVICE_CLASS_USB2 = 1,
GX_DEVICE_CLASS_GEV = 2,
GX_DEVICE_CLASS_U3V = 3,
GX_DEVICE_CLASS_SMART = 4,
GX_DEVICE_CLASS_CXP =5
};
typedef int32_t GX_DEVICE_CLASS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 99
7.GxIAPI Library Definitions
Name Description
7.2.10. GX_LOG_TYPE_LIST
enum GX_LOG_TYPE_LIST
{
GX_LOG_TYPE_OFF = 0x00000000,
GX_LOG_TYPE_FATAL = 0x00000001,
GX_LOG_TYPE_ERROR = 0x00000010,
GX_LOG_TYPE_WARN = 0x00000100,
GX_LOG_TYPE_INFO = 0x00001000,
GX_LOG_TYPE_DEBUG = 0x00010000,
GX_LOG_TYPE_TRACE = 0x00100000
};
typedef uint32_t GX_LOG_TYPE_LIST;
Name Description
7.3. Structure
7.3.1. GX_OPEN_PARAM
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 100
7.GxIAPI Library Definitions
Name Description
7.3.2. GX_FRAME_CALLBACK_PARAM
Related interface:GXRegisterCaptureCallback()
This is the formal parameter type of the callback function, and the formal parameter type of the callback
function that the user writes must be of this type.
typedef struct GX_FRAME_CALLBACK_PARAM
{
void* pUserParam;
GX_FRAME_STATUS status;
const void* pImgBuf;
int32_t nImgSize;
int32_t nWidth;
int32_t nHeight;
int32_t nPixelFormat;
uint64_t nFrameID;
uint64_t nTimestamp;
int32_t reserved[1];
} GX_FRAME_CALLBACK_PARAM;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 101
7.GxIAPI Library Definitions
Data size, in bytes (After the frame information is enabled, nImgsize is the sum
nImgSize
of the size of the image data and the size of the frame information)
nWidth Image width
7.3.3. GX_FRAME_DATA
Related interface:GXGetImage()
typedef struct GX_FRAME_DATA
{
GX_FRAME_STATUS nStatus;
void* pImgBuf;
int32_t nWidth;
int32_t nHeight;
int32_t nPixelFormat;
int32_t nImgSize;
uint64_t nFrameID;
uint64_t nTimestamp;
uint64_t* pUserParam;
int32_t reserved[3];
}GX_FRAME_DATA;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 102
7.GxIAPI Library Definitions
7.3.4. GX_FRAME_BUFFER
Related interface:GXDQBuf()、GXQBuf()、GXDQAllBufs()
windows:
typedef struct GX_FRAME_BUFFER
{
uint64_t nFrameID;
uint64_t nTimestamp;
uint64_t nBufID;
void_64 pImgBuf;
GX_FRAME_STATUS nStatus;
int32_t nWidth;
int32_t nHeight;
int32_t nPixelFormat;
int32_t nImgSize;
int32_t nOffsetX;
int32_t nOffsetY;
int32_t reserved[33];
}GX_FRAME_BUFFER;
typedef GX_FRAME_BUFFER* PGX_FRAME_BUFFER;
Linux:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 103
7.GxIAPI Library Definitions
uint64_t nTimestamp;
uint64_t nBufID;
int32_t nOffsetX;
int32_t nOffsetY;
int32_t reserved[16];
}GX_FRAME_BUFFER;
typedef GX_FRAME_BUFFER* PGX_FRAME_BUFFER;
Name Description
nBufID BufID
7.3.5. GX_REGISTER_STACK_ENTRY
Related interface: GXReadRemoteDevicePortStacked(), GXWriteRemoteDevicePortStacked().
The interface describes the register address and value information corresponding to the attribute value.
typedef struct GX_REGISTER_STACK_ENTRY
{
uint64_t nAddress;
void* pBuffer;
size_t nSize;
} GX_REGISTER_STACK_ENTRY;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 104
7.GxIAPI Library Definitions
7.3.6. GX_INTERFACE_INFO
Related interface: GXGetInterfaceInfo()
INTERFACE information.
typedef struct GX_INTERFACE_INFO
{
GX_TL_TYPE emTLayerType;
unsigned int nReserved[4];
union
{
GX_CXP_INTERFACE_INFO stCXPIFInfo;
GX_GEV_INTERFACE_INFO stGEVIFInfo;
GX_U3V_INTERFACE_INFO stU3VIFInfo;
GX_USB_INTERFACE_INFO stUSBIFInfo;
unsigned int nReserved[64];
}IFInfo;
}GX_INTERFACE_INFO;
Name Description
7.3.6.1. GX_CXP_INTERFACE_INFO
typedef struct GX_CXP_INTERFACE_INFO
{
unsigned char chInterfaceID[GX_INFO_LENGTH_64_BYTE];
unsigned char chDisplayName[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
unsigned int ui32InitFlag;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 105
7.GxIAPI Library Definitions
Name Description
chInterfaceID Interface ID
7.3.6.2. GX_GEV_INTERFACE_INFO
typedef struct GX_GEV_INTERFACE_INFO
{
unsigned char chInterfaceID[GX_INFO_LENGTH_64_BYTE];
unsigned char chDisplayName[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
char szDescription[GX_INFO_LENGTH_256_BYTE];
unsigned int nReserved[64];
}GX_GEV_INTERFACE_INFO;
Name Description
chInterfaceID Interface ID
szDescription Description
7.3.6.3. GX_U3V_INTERFACE_INFO
typedef struct GX_U3V_INTERFACE_INFO
{
unsigned char chInterfaceID[GX_INFO_LENGTH_64_BYTE];
unsigned char chDisplayName[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
char szDescription[GX_INFO_LENGTH_256_BYTE];
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 106
7.GxIAPI Library Definitions
Name Description
chInterfaceID Interface ID
szDescription Description
7.3.6.4. GX_USB_INTERFACE_INFO
typedef struct GX_USB_INTERFACE_INFO
{
unsigned char chInterfaceID[GX_INFO_LENGTH_64_BYTE];
unsigned char chDisplayName[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
char szDescription[GX_INFO_LENGTH_256_BYTE];
unsigned int nReserved[64];
}GX_USB_INTERFACE_INFO;
Name Description
chInterfaceID Interface ID
szDescription Description
7.3.7. GX_DEVICE_INFO
Related interface: GXGetDeviceInfo()
Description of device information.
typedef struct GX_DEVICE_INFO
{
GX_DEVICE_CLASS emDevType;
unsigned int nReserved[4];
{
GX_CXP_DEVICE_INFO stCXPDevInfo;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 107
7.GxIAPI Library Definitions
GX_GEV_DEVICE_INFO stGEVDevInfo;
GX_U3V_DEVICE_INFO stU3VDevInfo;
GX_USB_DEVICE_INFO stUSBDevInfo;
unsigned int nReserved[256];
}DevInfo;
}GX_DEVICE_INFO;
Name Description
7.3.7.1. GX_CXP_DEVICE_INFO
typedef struct GX_CXP_DEVICE_INFO
{
unsigned char chVendorName[GX_INFO_LENGTH_64_BYTE];
unsigned char chModelName[GX_INFO_LENGTH_64_BYTE];
unsigned char chManufacturerInfo[GX_INFO_LENGTH_64_BYTE];
unsigned char chDeviceVersion[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
unsigned char chUserDefinedName[GX_INFO_LENGTH_64_BYTE];
unsigned int nReserved[64];
}GX_CXP_DEVICE_INFO;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 108
7.GxIAPI Library Definitions
7.3.7.2. GX_GEV_DEVICE_INFO
typedef struct GX_GEV_DEVICE_INFO
{
unsigned int nIpCfgOption;
unsigned int nIpCfgCurrent;
unsigned int nCurrentIp;
unsigned int nCurrentSubNetMask;
unsigned int nDefultGateWay;
unsigned int nNetExport;
uint64_t nMacAddress;
unsigned char chVendorName[GX_INFO_LENGTH_64_BYTE];
unsigned char chModelName[GX_INFO_LENGTH_64_BYTE];
unsigned char chManufacturerInfo[GX_INFO_LENGTH_64_BYTE];
unsigned char chDeviceVersion[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
unsigned char chUserDefinedName[GX_INFO_LENGTH_64_BYTE];
unsigned int nReserved[64];
}GX_GEV_DEVICE_INFO;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 109
7.GxIAPI Library Definitions
7.3.7.3. GX_U3V_DEVICE_INFO
typedef struct GX_U3V_DEVICE_INFO
{
unsigned char chVendorName[GX_INFO_LENGTH_64_BYTE];
unsigned char chModelName[GX_INFO_LENGTH_64_BYTE];
unsigned char chManufacturerInfo[GX_INFO_LENGTH_64_BYTE];
unsigned char chDeviceVersion[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
unsigned char chUserDefinedName[GX_INFO_LENGTH_64_BYTE];
unsigned int nReserved[64];
}GX_U3V_DEVICE_INFO;
Name Description
7.3.7.4. GX_USB_DEVICE_INFO
typedef struct GX_USB_DEVICE_INFO
{
unsigned char chVendorName[GX_INFO_LENGTH_64_BYTE];
unsigned char chModelName[GX_INFO_LENGTH_64_BYTE];
unsigned char chManufacturerInfo[GX_INFO_LENGTH_64_BYTE];
unsigned char chDeviceVersion[GX_INFO_LENGTH_64_BYTE];
unsigned char chSerialNumber[GX_INFO_LENGTH_64_BYTE];
unsigned char chUserDefinedName[GX_INFO_LENGTH_64_BYTE];
unsigned int nReserved[64];
}GX_USB_DEVICE_INFO;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 110
7.GxIAPI Library Definitions
Name Description
7.3.8. GX_INT_VALUE
Related interface: GXGetIntValue()
Attribute value information.
typedef struct GX_INT_VALUE
{
int64_t nCurValue;
int64_t nMin;
int64_t nMax;
int64_t nInc;
int32_t reserved[16];
}GX_INT_VALUE;
Name Description
7.3.9. GX_FLOAT_VALUE
Related interface: GXGetFloatValue()
Attribute value information.
typedef struct GX_FLOAT_VALUE
{
double dCurValue;
double dMin;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 111
7.GxIAPI Library Definitions
double dMax;
double dInc;
bool bIncIsValid;
char szUnit[GX_INFO_LENGTH_8_BYTE];
int32_t reserved[16];
}GX_FLOAT_VALUE;
Name Description
szUnit Unit
7.3.10. GX_STRING_VALUE
Related interface: GXGetStringValue()
Attribute value information.
typedef struct GX_STRING_VALUE
{
char strCurValue[GX_INFO_LENGTH_256_BYTE];
int64_t nMaxLength;
int32_t reserved[4];
}GX_STRING_VALUE;
Name Description
7.3.11. GX_ENUM_VALUE
Related interface: GXGetEnumValue()
Attribute value information.
typedef struct GX_ENUM_VALUE
{
GX_ENUM_VALUE_DES stCurValue;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 112
7.GxIAPI Library Definitions
uint32_t nSupportedNum;
GX_ENUM_VALUE_DES nArrySupportedValue[128];
int32_t reserved[16];
}GX_ENUM_VALUE;
Name Description
7.3.11.1. GX_ENUM_VALUE_DES
typedef struct GX_ENUM_VALUE_DES
{
int64_t nCurValue;
char strCurSymbolic[GX_INFO_LENGTH_128_BYTE];
int32_t reserved[4];
}GX_ENUM_VALUE_DES;
Name Description
7.3.12. GX_GIGE_ACTION_COMMAND_RESULT
Described the status information returned by the Action command.
typedef struct GX_GIGE_ACTION_COMMAND_RESULT
{
char strDeviceAddress[16];
int32_t nStatus;
}GX_GIGE_ACTION_COMMAND_RESULT;
Definition Explanation
strDeviceAddress The current device IP that returns ack (Dotted Decimal Notation IPv4)
The ACTION status returned by the device, the error originates from the
GigaVision protocol
nStatus
0: Command sent successfully.
0x8013: The device is not time synchronized with the master clock. Before
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 113
7.GxIAPI Library Definitions
7.4. Interfaces
7.4.1. Get SDK Version Information
7.4.1.1. GXGetLibVersion(Linux only)
Declarations:
GX_EXTC const char* GX_STDC GXGetLibVersion()
Descriptions:
Get the interface library version.
Parameters:
Not have.
Returns:
Library version of string type.
Sample Code:
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 114
7.GxIAPI Library Definitions
Parameters:
Not have.
Returns:
GX_STATUS_SUCCESS The operation is successful, no error occurs.
GX_STATUS_NOT_FOUND_TL Can not found the library.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
Before calling the other interfaces (except GXCloseLib() / GXGetLastError()), you must to call the
GXInitLib() interface for initialization first, otherwise the error GX_STATUS_NOT_INIT_API will
return.
Sample Code:
#include "GxIAPI.h"
7.4.2.2. GXCloseLib
Declarations:
GX_API GXCloseLib()
Descriptions:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 115
7.GxIAPI Library Definitions
Close the device library to release resources. You must to call this interface to release resources
when the GxIAPI stopped all the controls of the device. Corresponding to the GXInitLib().
Parameters:
Not have.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
#include "GxIAPI.h"
int main(int argc, char* argv[])
{
GX_STATUS emStatus = GX_STATUS_SUCCESS;
7.4.2.3. GXSetLogType
Declarations:
GX_API GXSetLogType(const uint32_t ui32LogType)
Descriptions:
Set the types of logs that can be generated.
Note:
Before calling this interface, initialization must be performed first.
Parameters:
[in] ui32LogType Log type, refer to GX_LOG_TYPE_LIST
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 116
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS Operation successful with no errors
GX_STATUS_NOT_INIT_API GXInitLib() initialization library not called
GX_STATUS_INVALID_ACCESS Error accessing for configuration file
The errors that are not covered above please reference GX_STATUS_LIST。
Sample Code:
#include "GxIAPI.h"
int main(int argc, char* argv[])
{
GX_STATUS emStatus = GX_STATUS_SUCCESS;
// Call GXInitLib() at the starting position for initialization
//and request resources
emStatus = GXInitLib();
if (emStatus != GX_STATUS_SUCCESS)
{
return 0;
}
emStatus = GXSetLogType(ui32LogType);
if (emStatus != GX_STATUS_SUCCESS)
{
// Handling failure in setting log type
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 117
7.GxIAPI Library Definitions
7.4.2.4. GXGetLogType
Declarations:
GX_API GXGetLogType(uint32_t* pui32Value )
Descriptions:
Get the generated log type.
Note:
Before calling this interface, initialization must be performed first.
Parameters:
[out] pui32Value Types of logs that can be generated, refer to GX_LOG_TYPE_LIST
Returns:
GX_STATUS_SUCCESS Operation successful with no errors
GX_STATUS_NOT_INIT_API GXInitLib() initialization library not called
GX_STATUS_INVALID_ACCESS Error accessing for configuration file
GX_STATUS_INVALID_PARAMETER The pointer entered by the user is NULL
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
emStatus = GXInitLib();
uint32_t ui32LogType;
emStatus = GXGetLogType(&ui32LogType);
if (emStatus != GX_STATUS_SUCCESS)
{
// Failed to obtain the types of logs that can be generated
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 118
7.GxIAPI Library Definitions
}
...
emStatus = GXCloseLib();
7.4.2.5. GXGetLastError
Declarations:
GX_API GXGetLastError (GX_STATUS *pErrorCode,
char *pszErrText,
size_t *pnSize)
Descriptions:
To get the latest error descriptions information of the program.
Parameters:
[out] pErrorCode Return the last error code. You could set the parameter to NULL if you
don't need this value.
[out] pszErrText Return the address of the buffer allocated for error information.
[in,out] pnSize The address size of the buffer allocated for error information. Unit: byte.
If pszErrText is NULL:
[out] pnSize Return the actual required buffer size.
If pszErrText is not NULL:
[in] pnSize It is the actual allocated buffer size.
[out] pnSize Return the actual allocated buffer size.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_NEED_MORE_BUFFER The buffer that the user filled is too small.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_STATUS emerrCode = GX_STATUS_SUCCESS;
char* pszTemp = NULL;
size_t nSize = 0;
//First, the user passed the NULL pointer to get the actual size,
//followed by the request buffer to obtain the description information.
GXGetLastError(&emerrCode, NULL, &nSize);
pszTemp = new char[nSize];
emStatus = GXGetLastError(&emerrCode, pszTemp, &nSize);
//After finished
If (NULL != pszTemp)
{
delete[] pszTemp;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 119
7.GxIAPI Library Definitions
pszTemp = NULL;
}
7.4.2.6. GXUpdateAllDeviceList
Declarations:
GX_API GXUpdateAllDeviceList (uint32_t* punNumDevices, uint32_t nTimeOut)
Descriptions:
Enumerating currently all available devices in subnet and gets the number of devices.
Parameters:
[out] punNumDevices The address pointer used to return the number of devices, and the
pointer can not be NULL.
[in] nTimeOut The timeout time of enumeration (unit: ms). If the device is
successfully enumerated within the specified timeout time, the value
returns immediately. If the device is not enumerated within the
specified timeout time, then it waits until the specified timeout time is
over and then it returns.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32DeviceNum = 0;
//Enumerates to get the number of devices. The timeout time is
//decided by the user’s environment, and can be set by the user,
//1000ms is an example.
emStatus = GXUpdateAllDeviceList(&ui32DeviceNum, 1000);
7.4.2.7. GXUpdateAllDeviceListEx
Declarations:
GX_API GXUpdateAllDeviceListEx (uint64_t nTLType,
uint32_t* punNumDevices, uint32_tnTimeOut)
Descriptions:
Enumerating currently all available devices in entire network and gets the number of devices.
Parameters:
[in] nTLType Enumerate specific types of devices, refer to GX_TL_TYPE_LIST
[out] punNumDevices The address pointer used to return the number of devices, and the pointer
can not be NULL
[in] nTimeOut The timeout time of enumeration (unit: ms). If the device is successfully
enumerated within the specified timeout time, the value returns
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 120
7.GxIAPI Library Definitions
7.4.2.8. GXGetDeviceInfo
Declarations:
GX_API GXGetDeviceInfo(uint32_t nIndex, GX_DEVICE_INFO* pstDeviceInfo)
Descriptions:
Obtain basic information of nIndex devices.
Parameters:
[in] nIndex The serial number of the device.
[out] pstDeviceInfo The structure pointer of the device information.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The index that the user input is cross the border.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
You should call the GxUpdateAllDeviceList(), GXUpdateAllDeviceListEx() interface for an enumeration
before calling the function to get the device information.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32DeviceNum = 0;
emStatus = GXUpdateAllDeviceList(&ui32DeviceNum, 1000);
if (emStatus == GX_STATUS_SUCCESS && (ui32DeviceNum > 0))
{
GX_DEVICE_INFO stInfo;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 121
7.GxIAPI Library Definitions
7.4.2.9. GXOpenDevice
Declarations:
GX_API GXOpenDevice (GX_OPEN_PARAM* pOpenParam, GX_DEV_HANDLE* phDevice)
Descriptions:
Open the device by a specific unique identification, such as: SN, IP, MAC, Index etc.
Parameters:
[in] pOpenParam The open device parameter which is configurated by user.
Ref:GX_OPEN_PARAM.
[out] phDevice The device handle returned by the interface.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_NOT_FOUND_DEVICE Not found the device that matches the specific information.
GX_STATUS_INVALID_ACCESS The device can not be opened under the current access
mode.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
It is recommended that you call the GxUpdateAllDeviceList() interface to make an enumeration before
calling the function. To ensure that device list within the library is consistent with the current device.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_OPEN_PARAM stOpenParam;
//Access mode.
stOpenParam.accessMode = GX_ACCESS_EXCLUSIVE;
//stOpenParam.accessMode = GX_ACCESS_READONLY;
//stOpenParam.accessMode = GX_ACCESS_CONTROL;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 122
7.GxIAPI Library Definitions
stOpenParam.pszContent = "EA00010002";
7.4.2.10. GXCloseDevice
Declarations:
GX_API GXCloseDevice (GX_DEV_HANDLE hDevice)
Descriptions:
Specify the device handle to close the device.
Parameters:
[in] hDevice The device handle that the user specified to close. The hDevice can be get
by GXOpenDevice() interface.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The illegal handle that the user introduces, or reclose the
device.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
Close the device handle that has been closed, return the GX_STATUS_INVALID_HANDLE error.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_DEV_HANDLE hDevice = NULL;
GX_OPEN_PARAM stOpenParam;
uint32_t ui32DeviceNum = 0;
//Enumerates to get the number of devices.
//The timeout time is decided by the user’s environment, and can be
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 123
7.GxIAPI Library Definitions
7.4.2.11. GXGetInterfaceNum
Declarations:
GX_API GXGetInterfaceNum(uint32_t* punNumInterfaces);
Descriptions:
Obtain the number of interface.
Precautions:
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 124
7.GxIAPI Library Definitions
uint32_t ui32InterFaces;
emStatus = GXGetInterfaceNum(&ui32InterFaces);
7.4.2.12. GXGetInterfaceInfo
Declarations:
GX_API GXGetInterfaceInfo(uint32_t nIndex, GX_INTERFACE_INFO* pstInterfaceInfo);
Descriptions:
Get the Interface information with the specified index.
Precautions:
The purpose of this interface is to obtain the enumerated Interface Info, please call
GXUpdateAllDeviceList(), GXUpdateAllDeviceListEx() interface before calling.
Parameters:
[in] nIndex Interface order, starting from 1
[in,out] pstInterfaceInfo Pointer of the storage interface information structure
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
GX_STATUS_INVALID_PARAMETER Invalid parameter
GX_STATUS_NOT_INIT_API GXInitLib() initialization library not called
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_INTERFACE_INFO stInfo;
emStatus = GXGetInterfaceInfo(1, &stInfo);
7.4.2.13. GXGetInterfaceHandle
Declarations:
GX_API GXGetInterfaceHandle(uint32_t nIndex, GX_IF_HANDLE* phIF);
Descriptions:
Get the Interface handle with the specify index.
Precautions:
The purpose of this interface is to obtain the enumerated Handle, please call GXUpdateAllDeviceList(),
GXUpdateAllDeviceListEx() interface before calling.
Parameters:
[in] nIndex Interface order, starting from 1
[in,out] phIF Pointer to Interface handle
Returns:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 125
7.GxIAPI Library Definitions
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_IF_HANDLE hIF;
emStatus = GXGetInterfaceHandle(1, &hIF);
7.4.2.14. GXGetParentInterfaceFromDev
Declarations:
GX_API GXGetParentInterfaceFromDev(GX_DEV_HANDLE hDevice, GX_IF_HANDLE* phIF);
Descriptions:
Specify the device handle to obtain the interface handle to which it belongs.
Parameters:
[in] hDevice Device handle
[in,out] phIF Interface Handle
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
GX_STATUS_INVALID_PARAMETER Invalid parameter
GX_STATUS_INVALID_HANDLE Invalid handle passed-in by users
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_IF_HANDLE hIF = NULL;
emStatus = GXGetParentInterfaceFromDev (hDevice, &hIF);
7.4.2.15. GXGetLocalDeviceHandleFromDev
Declarations:
GX_API GXGetLocalDeviceHandleFromDev(GX_DEV_HANDLE hDevice,
GX_LOCAL_DEV_HANDLE* phLocalDev);
Descriptions:
Get local device handle.
Parameters:
[in] hDevice Device handle
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 126
7.GxIAPI Library Definitions
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_LOCAL_DEV_HANDLE hLocalDev = NULL;
emStatus = GXGetLocalDeviceHandleFromDev (hDevice, &hLocalDev);
7.4.2.16. GXGetDataStreamNumFromDev
Declarations:
GX_API GXGetDataStreamNumFromDev(GX_DEV_HANDLE hDevice, uint32_t* pnDSNum);
Descriptions:
Obtain the number of stream channels supported by the device.
Parameters:
[in] hDevice Device handle
[in,out] pnDSNum Pointer to the number of flow channels
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
GX_STATUS_INVALID_PARAMETER Invalid parameter
GX_STATUS_INVALID_HANDLE Invalid handle passed-in by users
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32DSNum = 0;
emStatus = GXGetDataStreamNumFromDev (hDevice, &ui32DSNum);
7.4.2.17. GXGetDataStreamHandleFromDev
Declarations:
GX_API GXGetDataStreamHandleFromDev(GX_DEV_HANDLE hDevice,
uint32_t nDSIndex,
GX_DS_HANDLE* phDS);
Descriptions:
Retrieve the stream channel ID handle for the specified device handle.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 127
7.GxIAPI Library Definitions
Parameters:
[in] hDevice Device handle
[in] nDSIndex Data stream order, starting from 1
[in,out] phDS Data stream handle
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
GX_STATUS_INVALID_PARAMETER Invalid parameter
GX_STATUS_INVALID_HANDLE Invalid handle passed-in by users
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_DS_HANDLE phDS = 0;
emStatus = GXGetDataStreamHandleFromDev (hDevice, 1, &hDS);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 128
7.GxIAPI Library Definitions
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_INT_VALUE stIntValue;
emStatus = GXGetIntValue(hDevice, "Width", &stIntValue);
int64_t i64Width = stIntValue.nCurValue;
GXSetIntValue
Declarations:
GX_API GXSetIntValue(GX_PORT_HANDLE hPort, const char* strName, int64_t i64Value);
Descriptions:
Set the node value of int type.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local device
handle, DataStream handle)
[in] strName XML node name.
[in] i64Value The value that the user will set.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_OUT_OF_RANGE The value that the user introduces is across the border, smaller
than the minimum, or larger than the maximum, or is not an
integer multiple of the step.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
int64_t i64Value = 200;
emStatus = GXSetIntValue(hDevice, “Width”, i64Value);
GXGetFloatValue
Declarations:
GX_API GXGetFloatValue(GX_PORT_HANDLE hPort,
const char* strName,
GX_FLOAT_VALUE* pstFloatValue);
Descriptions:
Get the node value of float type.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 129
7.GxIAPI Library Definitions
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local device handle,
DataStream handle)
[in] strName XML node name.
[out] pstFloatValue Pointer to floating-point value information structure
Refer to the definition of GX_FLOAT_Value structure.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_FLOAT_VALUE stFloatValue;
GXSetFloatValue
Declarations:
GX_API GXSetFloatValue (GX_PORT_HANDLE hPort,
const char* strName, double dValue);
Descriptions:
Set the node value of float type.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local device handle,
DataStream handle)
[in] strName XML node name.
[in] dValue User set value.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_OUT_OF_RANGE The value that the user introduces is across the border,
smaller than the minimum, or larger than the maximum.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 130
7.GxIAPI Library Definitions
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
double dValue = 3000;
GXGetEnumValue
Declarations:
GX_API GXGetEnumValue(GX_PORT_HANDLE hPort,
const char* strName,
GX_ENUM_VALUE* pstEnumValue);
Descriptions:
To get the current node value of enumeration type.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local device handle,
DataStream handle)
[in] strName XML node name.
[out] pstEnumValue Pointer to the enumeration type value information structure
Refer to the definition of GX_ENUM_VALUE structure.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_ENUM_VALUE stEnumValue;
emStatus = GXGetEnumValue(hDevice, "GainAuto", &stEnumValue);
int64_t i64GainAuto = stEnumValue.stCurValue.nCurValue;
GXSetEnumValue
GXSetEnumValue
Declarations:
GX_API GXSetEnumValue(GX_PORT_HANDLE hPort,
const char* strName,
int64_t i64Value);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 131
7.GxIAPI Library Definitions
Descriptions:
Set the node value of enumeration type.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strName XML node name.
[in] i64Value User set value.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_OUT_OF_RANGE The value that the user introduces is cross the border.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_ENUM_VALUE stEnumValue;
emStatus = GXGetEnumValue(hDevice, "GainAuto", &stEnumValue);
int64_t i64GainAuto = stEnumValue.stCurValue.nCurValue;
GXSetEnumValueByString
Declarations:
GX_API GXSetEnumValueByString(GX_PORT_HANDLE hPort,
const char* strName,
const char* strValue);
Descriptions:
Set value of the enumeration type.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strName XML node name.
[in] strValue Pointer to the value that the user will set
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 132
7.GxIAPI Library Definitions
GX_STATUS_OUT_OF_RANGE The value that the user introduces is cross the border.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
emStatus = GXSetEnumValueByString (hDevice, "GainAuto",
"Continuous");
GXGetBoolValue
Declarations:
GX_API GXGetBoolValue(GX_PORT_HANDLE hPort,
const char* strName,
bool* pbValue);
Descriptions:
Get the node value of bool type.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strName XML node name.
[out] pbValue Pointer to the returned Boolean value.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
bool bTemp = false;
emStatus = GXGetBoolValue(hDevice, "ReverseX", &bTemp);
GXSetBoolValue
Declarations:
GX_API GXSetBoolValue(GX_PORT_HANDLE hPort,
const char* strName,
bool bValue);
Descriptions:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 133
7.GxIAPI Library Definitions
GXGetStringValue
Declarations:
GX_API GXGetStringValue(GX_PORT_HANDLE hPort,
const char* strName,
GX_STRING_VALUE* pstStringValue);
Descriptions:
Get the node info of string type.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strName XML node name.
[out] pstStringValue Pointer to a string type value information structure
Refer to the definition of GX_STRING_VALUE structure.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 134
7.GxIAPI Library Definitions
GXSetStringValue
Declarations:
GX_API GXSetStringValue(GX_PORT_HANDLE hPort, const char* strName, const char* strValue);
Descriptions:
Set the content of the string type node value.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strName XML node name.
[in] strValue Pointer to the value that the user will set.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user introduces is NULL.
GX_STATUS_OUT_OF_RANGE The content written by the users exceeds the maximum
length of the string.
GX_STATUS_INVALID_ACCESS Currently inaccessible, unable to write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
char *pszText = "test";
emStatus = GXSetStringValue(hDevice, "DeviceModelName", pszText);
GXSetCommandValue
Declarations:
GX_API GXSetCommandValue(GX_PORT_HANDLE hPort, const char* strName);
Descriptions:
Send the command.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 135
7.GxIAPI Library Definitions
GXGetNodeAccessMode
Declarations:
GX_API GXGetNodeAccessMode(GX_PORT_HANDLE hPort, const char* strName,
GX_NODE_ACCESS_MODE* pemAccessMode);
Descriptions:
Get the read and write attributes of the node.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local device
handle, DataStream handle)
[in] strName XML node name.
[in,out] pemAccessMode Read and write attributes of the node.
Refer to the structure definition of GX_NODE_ACCESS_MODE
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The input parameter that the user introduces is invalid.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_NODE_ACCESS_MODE emAccessMode;
emStatus = GXGetNodeAccessMode(hDevice, "Width", &emAccessMode);
GXGetRegisterLength
Declarations:
GX_API GXGetRegisterLength(GX_PORT_HANDLE hPort,
const char* strName,
size_t* pnSize);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 136
7.GxIAPI Library Definitions
Descriptions:
Get the length of register type node data.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strName XML node name.
[in,out] pnSize Save the pointer of data length.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The input parameter that the user introduces is invalid.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
size_t nDataFieldValue;
emStatus =GXGetRegisterLength(hDevice, "DataFieldValue",
&nDataFieldValue);
GXGetRegisterValue
Declarations:
GX_API GXGetRegisterValue(GX_PORT_HANDLE hPort,
const char* strName,
uint8_t* pBuffer, size_t* pnSize);
Descriptions:
Get register type node values.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strName XML node name.
[out] pBuffer Pointer to the memory address of the data requested by the
user.
[in,out] pnSize The length of the buffer address entered by the user.
If pBuffer is NULL:
[out] pnSize The actual required buffer size.
If pBuffer isnot NULL:
[in] pnSize User allocated buffer size.
[out] pnSize Returns the actual fill buffer size.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The input parameter that the user introduces is invalid.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 137
7.GxIAPI Library Definitions
//After operation
if(NULL != pui8Buffer)
{
delete[] pui8Buffer;
pui8Buffer = NULL;
}
GXSetRegisterValue
Declarations:
GX_API GXSetRegisterValue(GX_PORT_HANDLE hPort,
const char* strName,
uint8_t* pBuffer,
size_t nSize);
Descriptions:
Set register type node values.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local device
handle, DataStream handle)
[in] strName XML node name.
[in] pBuffer Pointer to the memory address of the data requested by the user.
[in] pnSize The length of the buffer address entered by the user.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The input parameter that the user introduces is invalid.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
size_t nLength = 0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 138
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 139
7.GxIAPI Library Definitions
size_t nSize = 4;
void *pBuffer = new int;
//After finished
if (NULL != pBuffer)
{
delete pBuffer;
pBuffer = NULL;
}
GXWritePort
Declarations:
GX_API GXWritePort(GX_PORT_HANDLE hPort,
uint64_t ui64Address,
void* pBuffer, size_t* piSize);
Descriptions:
Write memory through register address.
Precautions:
1) The attribute values set for GigE cameras need to be converted to big endian first.
2) After calling the current interface, the node values obtained by using GXGetEnumValue(),
GXGetIntValue(), and GXGetBoolValue() are still the values before modification. The latest
property values can be obtained by using GXReadPort() or GXReadPortStacked().
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] ui64Address Register address of camera attributes.
[in] pBuffer Pointer address to the written memory value.
[in] piSize The length of memory to be read
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The input parameter that the user introduces is invalid.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Address corresponding to the camera attribute values
//The following addresse is only for reference, please consult technical
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 140
7.GxIAPI Library Definitions
//After operation
if (NULL != pBuffer)
{
delete[] pBuffer;
pBuffer = NULL;
}
GXReadPortStacked
Declarations:
GX_API GXReadPortStacked(GX_PORT_HANDLE hPort,
GX_REGISTER_STACK_ENTRY* pstEntries,
size_t *piSize);
Descriptions:
Batch read multiple memory addresses specified by the user.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in,out] pstEntries Point to the address structure memory that needs to obtain camera
attributes, and return the value of the attribute.
Refer to the structure definition of GX_REGISTER_STACK_ENTRY
[in,out] piSize Return the number of successfully obtained camera attribute values.
Precautions:
1) Batch read memory only supports 4 bytes per unit.
2) Gigabit/10G devices read large segments, while other devices read small segments.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The input parameter that the user introduces is invalid.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 141
7.GxIAPI Library Definitions
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//The following example is to obtain 3 attribute values
//which can be modified according to your needs
size_t nStackEntry = 3;
GX_REGISTER_STACK_ENTRY pstStackEntry[3];
char chBufferWidth[256] = {0};
char chBufferHeight[256] = {0};
char chBufferOffsetX[256] = {0};
pstStackEntry[1].nAddress = 0xFFFF;
pstStackEntry[1].nSize = 4;
pstStackEntry[1].pBuffer = chBufferHeight;
pstStackEntry[2].nAddress = 0xFFFF;
pstStackEntry[2].nSize = 4;
pstStackEntry[2].pBuffer = chBufferOffsetX;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 142
7.GxIAPI Library Definitions
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local device
handle, DataStream handle)
[in] pstEntries Point to the address structure memory that needs to obtain camera
attributes, and return the value of the attribute.
Refer to the structure definition of GX_REGISTER_STACK_ENTRY
[in,out] piSize Return the number of successfully obtained camera attribute values.
Precautions:
1) The attribute values set for GigE cameras need to be converted to big endian first.
2) After calling the current interface, the node values obtained by using GXGetEnumValue(),
GXGetIntValue(), and GXGetBoolValue() are still the values before modification. The latest
property values can be obtained by using GXReadPort() or GXReadPortStacked().
3) Batch read memory only supports 4 bytes per unit.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The input parameter that the user introduces is invalid.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 143
7.GxIAPI Library Definitions
pstStackEntry[2].nAddress = 0xFFFF;
pstStackEntry[2].nSize = 4;
pstStackEntry[2].pBuffer = chBufferOffsetX;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 144
7.GxIAPI Library Definitions
7.4.4.2. GXSetDevicePersistentIpAddress
Declarations:
GX_API GXSetDevicePersistentIpAddress(GX_DEV_HANDLE hDevice,
const char* pszIP,
const char* pszSubNetMask,
const char* pszDefaultGateWay);
Descriptions:
Set the permanent IP information of the device.
Parameters:
[in] hDevice The handle of the device.
[in] pszIP Device permanent IP string address, end with ’\0’.
[in] pszSubNetMask Device persistent subnet mask string address, end with ’\0’.
[in] pszDefaultGateWay Device permanent gateway string address, end with ’\0’.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 145
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//The IP address information in the code is only an example
//and the actual value can be set by the users
emStatus = GXSetDevicePersistentIpAddress(hDevice,
"192.168.1.2",
"255.255.255.0",
"192.168.1.1");
7.4.4.3. GXGigEIpConfiguration
Declarations:
GX_API GXGigEIpConfiguration(const char* pszDeviceMacAddress,
GX_IP_CONFIGURE_MODE emIpConfigMode,
const char* pszIpAddress,
const char* pszSubnetMask,
const char* pszDefaultGateway,
const char* pszUserID);
Descriptions:
Configure the camera's static IP address.
Parameters:
[in] pszDeviceMacAddress MAC address
[in] emIpConfigMode IP configuration mode
[in] pszIpAddress IP address to be set
[in] pszSubnetMask Subnet mask to be set
[in] pszDefaultGateway Default gateway to be set
[in] pszUserID User defined name to be set
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER Invalid parameter.
GX_STATUS_NOT_FOUND_DEVICE Found no device.
GX_STATUS_ERROR Error operation.
GX_STATUS_INVALID_ACCESS Access denied.
GX_STATUS_TIMEOUT Operation timeout.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 146
7.GxIAPI Library Definitions
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
char chMAC[] = "00-21-49-00-00-00";
char chIpAddress[] = "192.168.10.10";
char chSubnetMask[] = "255.255.255.0";
char chDefaultGateway[] = "192.168.10.2";
char chUserID[] = "Daheng Imaging";
GX_IP_CONFIGURE_MODE emIpConfigureMode = GX_IP_CONFIGURE_STATIC_IP;
emStatus = GXGigEIpConfiguration(chMAC,
emIpConfigureMode,
chIpAddress,
chSubnetMask,
chDefaultGateway,
chUserID);
7.4.4.4. GXGigEForceIp
Declarations:
GX_API GXGigEForceIp(const char* pszDeviceMacAddress,
const char* pszIpAddress,
const char* pszSubnetMask,
const char* pszDefaultGateway);
Descriptions:
Execute Force IP operation.
Parameters:
[in] pszDeviceMacAddress MAC address
[in] pszIpAddress IP address to be set
[in] pszSubnetMask Subnet mask to be set
[in] pszDefaultGateway Default gateway to be set
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER Invalid parameter.
GX_STATUS_NOT_FOUND_DEVICE Found no device.
GX_STATUS_ERROR Error operation.
GX_STATUS_INVALID_ACCESS Access denied.
GX_STATUS_TIMEOUT Operation timeout.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 147
7.GxIAPI Library Definitions
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
char chMAC[] = "00-21-49-00-00-00";
char chIpAddress[] = "192.168.10.10";
char chSubnetMask[] = "255.255.255.0";
char chDefaultGateway[] = "192.168.10.2";
emStatus = GXGigEForceIp(chMAC, chIpAddress, chSubnetMask,
chDefaultGateway);
7.4.4.5. GXGigEResetDevice
Declarations:
GX_API GXGigEResetDevice(const char* pszDeviceMacAddress,
GX_RESET_DEVICE_MODE ui32FeatureInfo);
Descriptions:
Execute device reconnection or reset operations. Please refer to section 2.3 for details.
Device reconnection is usually applied to GigE camera’s debugging process. When the program of
the opened device is abnormal, and there is an error occurs after reopen the device immediately
(because the debugging heartbeat is 5 minutes and the device is still turned on). At this time,
execute reset device operation to make the device in unopnened status, then reopen the device to
connect successfully.
Device reset is usually applied when the camera is in an abnormal state, in this situation, device
reconnection function cannot take effect, and unable to power up the device again, this moment,
you can try using the device reset function to power off and then power on the device. After resetting
the device, it is necessary to perform the enumeration and device opening operations again.
Precautions:
1) Please call the enumeration interface after at least 1s, because the device reset time takes
about 1s.
2) If the device is in acquisition mode, it is prohibited to use the device reset and reconnect
functions, otherwise it may cause the device wire dropping.
Parameters:
[in] pszDeviceMacAddress MAC address
[in] ui32FeatureInfo Reset the device mode.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER Invalid parameter.
GX_STATUS_NOT_FOUND_DEVICE Found no device.
GX_STATUS_ERROR Error operation.
GX_STATUS_INVALID_ACCESS Access denied.
GX_STATUS_TIMEOUT Operation timeout.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 148
7.GxIAPI Library Definitions
//Reset device
emStatus = GXGigEResetDevice(chMAC, GX_MANUFACTURER_SPECIFIC_RESET);
//Wait 1s to enumerate the device again
uint32_tnDeviceNum = 0;
emStatus = GXUpdateAllDeviceList(&ui32DeviceNum, 1000);
7.4.4.6. GXFeatureSave
Declarations:
GX_API GXFeatureSave(GX_PORT_HANDLE hPort, const char* strFileName);
Descriptions:
Save the current frame grabber or camera configuration parameters to a text file.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strFileName The path of the configuration files to be generated.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The unsupported event ID or the callback function is
illegal.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 149
7.GxIAPI Library Definitions
7.4.4.7. GXFeatureSaveW
Declarations:
GX_API GXFeatureSaveW(GX_PORT_HANDLE hPort, const wchar_t* strFileName);
Descriptions:
Save the current frame grabber or camera configuration parameters to a text file.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strFileName The path of the configuration files to be generated
(wide byte).
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The unsupported event ID or the callback function is
illegal.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code: Get the event of remote device
GX_STATUS emStatus = GX_STATUS_SUCCESS;
const wchar_t* pszFilePath = L"feature_save.txt";
emStatus = GXFeatureSaveW(hDevice, pszFilePath);
7.4.4.8. GXFeatureLoad
Declarations:
GX_API GXFeatureLoad(GX_PORT_HANDLE hPort, const char* strFileName, bool bVerify);
Descriptions:
Loading parameters from the configuration file to the frame grabber or camera.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strFileName The path of the configuration files.
[in] bVerify If the value is true, All imported values will be read out for
consistency verification
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The unsupported event ID or the callback function is
illegal.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 150
7.GxIAPI Library Definitions
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
7.4.4.9. GXFeatureLoadW
Declarations:
GX_API GXFeatureLoadW(GX_PORT_HANDLE hPort, const char* strFileName, bool bVerify);
Descriptions:
Loading parameters from the configuration file to the frame grabber or camera.
Parameters:
[in] hPort Handle (Interface handle, remote device handle, local
device handle, DataStream handle)
[in] strFileName The path of the configuration files (wide byte).
[in] bVerify If the value is true, All imported values will be read out for
consistency verification
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The unsupported event ID or the callback function is
illegal.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
7.4.4.10. GXExportConfigFile
Declarations:
GX_API GXExportConfigFile (GX_DEV_HANDLE hDevice, const char * pszFilePath);
Descriptions:
1) Export the current camera configuration to a text file.
2) To be used in conjunction with the import device configuration function of GalaxyView.
Parameters:
[in] hDevice Device handle
[in] pszFilePath The path to the configuration file to be generated
Returns:
GX_STATUS_SUCCESS Operation successful with no errors
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 151
7.GxIAPI Library Definitions
7.4.4.11. GXImportConfigFile
Declarations:
GX_API GXImportConfigFile(GX_DEV_HANDLE hDevice,
const char * pszFilePath, bool bVerify = false);
Descriptions:
1) Import parameters from the configuration file into the camera.
2) To be used in conjunction with the import device configuration function of the GalaxyView.
Parameters:
[in] hDevice Device handle
[in] pszFilePath The path to the configuration file to be generated
[in] bVerify If this value is true, all imported values will be read out for
verification of consistency
Returns:
GX_STATUS_SUCCESS Operation successful with no errors
GX_STATUS_NOT_INIT_API GXInitLib() initialization library not called
GX_STATUS_INVALID_HANDLE User passed in an illegal handle
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
emStatus = GXImportConfigFile(hDevice, "feature_save.txt");
7.4.4.12. GXExportConfigFileW
Declarations:
Descriptions:
1) Export the current camera configuration to a text file (UNICODE interface).
2) To be used in conjunction with the import device configuration feature of GalaxyView.
Parameters:
[in] hDevice Device handle
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 152
7.GxIAPI Library Definitions
7.4.4.13. GXImportConfigFileW
Declarations:
GX_API GXImportConfigFileW(GX_DEV_HANDLE hDevice,
const wchar_t * pszFilePath, bool bVerify = false);
Descriptions:
1) Import parameters from the configuration file into the camera (UNICODE interface).
2) To be used in conjunction with the import device configuration function of the demo.
Parameters:
[in] hDevice Device handle
[in] pszFilePath The path to the configuration file to be generated
[in] bVerify If this value is true, all imported values will be read out for
verification of consistency
Returns:
GX_STATUS_SUCCESS Operation successful with no errors
GX_STATUS_NOT_INIT_API GXInitLib() initialization library not called
GX_STATUS_INVALID_HANDLE User passed in an illegal handle
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
emStatus = GXImportConfigFileW(hDevice, L"feature_save.txt");
7.4.4.14. GXGigEIssueActionCommand
Declarations:
GX_API GXGigEIssueActionCommand(uint32_t nDeviceKey, uint32_t nGroupKey,
uint32_t nGroupMask,
const char* strBroadcastAddress,
const char* strSpecialAddress,
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 153
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 154
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 155
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 156
7.GxIAPI Library Definitions
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
1) This interface is an optional interface, not a necessary part of the acquisition process.
2) When the acquisition command is sent, it will be not allowed to set up the number of buffers,
otherwise, it will return GX_STATUS_INVALID_CALL.
3) The number of the acquisition buffers that the user set must greater than 0, and if the number
of buffers is 0, it will return GX_STATUS_INVALID_PARAMETER.
4) The user should consider the reasonableness when setting the number of acquisition buffers,
if the number is set too many, the memory that is occupied in the acquisition process is large;
if the number is set too small, the memory is small when in the acquisition process, but some
frames will be lost because of the lack of the buffer.
5) Once the user has set the number of the buffers and has captured successfully, then the
number of buffers will remain valid until the device is turned off.
Sample Code:
#include"GxIAPI.h"
#include"GxIAPI.h"
//Initialize Library
emStatus = GXInitLib();
if (emStatus != GX_STATUS_SUCCESS)
{
return 0;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 157
7.GxIAPI Library Definitions
//Open device
stOpenParam.accessMode = GX_ACCESS_EXCLUSIVE;
stOpenParam.openMode = GX_OPEN_INDEX;
stOpenParam.pszContent = "1";
emStatus = GXOpenDevice(&stOpenParam, &hDevice);
if (emStatus == GX_STATUS_SUCCESS)
{
// Set the flow channel packet length attribute of the camera
//to improve the collection performance of network cameras
bool bImplementPacketSize = false;
uint32_t ui32PacketSize = 0;
if (bImplementPacketSize)
{
//Obtain the optimal packet length for the current network
//environment
emStatus = GXGetOptimalPacketSize (hDevice, &ui32PacketSize);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 158
7.GxIAPI Library Definitions
ui32PacketSize);
}
//Set the number of collection buffers
emStatus = GXSetAcqusitionBufferNumber(hDevice, 10);
//---------------------
//
//In this interval, the image will be returned to the user
//through the OnFrameCallbackFun interface
//
//---------------------
//Stop acquisition
emStatus = GXSetCommandValue (hDevice, "AcquisitionStop");
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 159
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_ACCESS Device access mode error.
GX_STATUS_ERROR Unspecified internal errors that are not expected to occur
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
Start acquisition for all stream channels.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
emStatus = GXStreamOn(hDevice);
7.4.5.4. GXDQBuf
Declarations:
GX_API GXDQBuf(GX_DEV_HANDLE hDevice,
GX_FRAME_BUFFER* ppFrameBuffer, uint32_t nTimeOut)
Descriptions:
Zero copy method is used to capture a single frame. After obtaining the image, the GXQBuf()
interface needs to be called to return the image to the image acquisition system.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 160
7.GxIAPI Library Definitions
Parameters:
[in] hDevice The handle of the device.
[out] ppFrameBuffer Address pointer of image data output by the interface.
[in] nTimeOut Take timeout time (unit: ms).
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The pointer that the user introduces is NULL.
GX_STATUS_INVALID_CALL Acquisition is not started or the callback is registered, this
interface is not allowed to be called.
GX_STATUS_TIMEOUT Acquire image timeout error.
GX_STATUS_ERROR Unspecified internal errors that are not expected to occur.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
1) The GXDQBuf() interface is not allowed to be called until the acquisition is started. If called, it will
return GX_STATUS_INVALID_CALL error;
2) After registering the capture callback, the GXDQBuf() interface is not allowed to be called. If
called, it will return GX_STATUS_INVALID_CALL error;
3) The GXDQBuf() interface needs to be used with the GXQBuf() interface, otherwise the image
cannot be continuously acquired.
Sample Code:
//-------------------------------
//The GXDQBuf interface acquires one frame of image at a time. This sample
//code demonstrates how to use this interface to get a frame of image.
//-------------------------------
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 161
7.GxIAPI Library Definitions
//Start acquisition.
#ifdef __linux__
emStatus = GXStreamOn(hDevice);
#else
emStatus = GXSetCommandValue(hDevice, "AcquisitionStart");
#endif
if (emStatus == GX_STATUS_SUCCESS)
{
//Calls GXDQBuf to get a frame of image.
emStatus = GXDQBuf(hDevice, &pFrameBuffer, 1000);
if (emStatus == GX_STATUS_SUCCESS)
{
if (pFrameBuffer->nStatus == GX_FRAME_STATUS_SUCCESS)
{
//Successfully acquired images.
//Image processing...
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 162
7.GxIAPI Library Definitions
//Calls GXQBuf to put the image buf back into the library
//and continue to acquire images.
emStatus = GXQBuf(hDevice, pFrameBuffer);
}
}
//Sends a stop acquisition command.
#ifdef __linux__
emStatus = GXStreamOff(hDevice);
#else
emStatus = GXSetCommandValue(hDevice, "AcquisitionStop");
#endif
}
emStatus = GXCloseDevice(hDevice);
emStatus = GXCloseLib();
return 0;
}
7.4.5.5. GXQBuf
Declarations:
GX_API GXQBuf(GX_DEV_HANDLE hDevice, PGX_FRAME_BUFFER pFrameBuffer)
Descriptions:
Return the image (zero copy) obtained by GXDQBuf() to the image acquisition system.
Parameters:
[in] hDevice The handle of the device.
[in] pFrameBuffer Image data buffer pointer to be placed back into the GxIAPI library.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The user incoming pointer is NULL. / Incoming
unreasonable pointer.
GX_STATUS_INVALID_CALL Acquisition is not started or the callback is registered. It
is not allowed to call the interface.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
1) It is not allowed to call the GXQBuf() interface before starting the acquisition. If it is called, it will
return the GX_STATUS_INVALID_CALL error;
2) After registering the capture callback, the GXQBuf() interface is not allowed to be called. If it is
called, it will return GX_STATUS_INVALID_CALL error;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 163
7.GxIAPI Library Definitions
3) The GXDQBuf() interface needs to be used with the GXQBuf() interface. Otherwise, the image
cannot be continuously acquired;
4) After the GXQBuf() interface puts the image buffer back into the GxIAPI library, the image buffer
pointer can no longer be accessed.
Sample Code:
See the GXDQBuf() sample program.
7.4.5.6. GXDQAllBufs (Linux only)
Declarations:
GX_API GXDQAllBufs(GX_DEV_HANDLE hDevice,
GX_FRAME_BUFFER *ppFrameBufferArray,
uint32_t nFrameBufferArraySize,
uint32_t *pnFrameCount,
uint32_t nTimeOut)
Descriptions:
After starting the acquisition, return all image buffers (zero copy) obtained by GXDQBuf() to the
image acquisition system. The order of the stored images in the image data array is from old to new,
that is, ppFrameBufferArray[0] stores the oldest image, and ppFrameBufferArray[nFrameCount – 1]
stores the latest image.
Parameters:
[in] hDevice The handle of the device.
[out] ppFrameBufferArray Array of image data pointers.
[in] nFrameBufferArraySize The number of applications for image arrays.
[out] pnFrameCount Returns the number of actual filled images.
[in] nTimeOut Take timeout time (unit: ms).
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The pointer that the user introduces is NULL.
GX_STATUS_INVALID_CALL Acquisition is not started or the callback is registered. It is
not allowed to call the interface.
GX_STATUS_NEED_MORE_BUFFER Insufficient buffer requested by the user: When reading,
the user input buffersize is smaller than the actual need.
GX_STATUS_TIMEOUT Acquire image timeout error.
GX_STATUS_ERROR Unspecified internal errors that are not expected to occur.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
1) It is not allowed to call the GXDQAllBufs() interface before starting the acquisition. If it is called,
it will return the GX_STATUS_INVALID_CALL error;
2) After registering the capture callback, the GXDQAllBufs() interface is not allowed to be called. If
it is called, it will return GX_STATUS_INVALID_CALL error;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 164
7.GxIAPI Library Definitions
3) The GXDQAllBufs() interface needs to be used with the GXQAllBufs() interface. Otherwise, the
image cannot be continuously acquired;
4) The array size of the image data pointer should be greater than or equal to the number of image
acquire buffers (default is 5). Otherwise, GX_STATUS_NEED_MORE_BUFFER error will be
returned.
Sample Code:
#include "GxIAPI.h"
#include <stdint.h>
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 165
7.GxIAPI Library Definitions
//Stream On.
emStatus = GXStreamOn(hDevice);
if (emStatus == GX_STATUS_SUCCESS)
{
//Calls GXDQAllBufs to get all the images in the queue.
emStatus = GXDQAllBufs(hDevice, pFrameBuffer, 5, &nFrameCount,
1000);
if (emStatus == GX_STATUS_SUCCESS)
{
for (int i = 0; i < ui32FrameCount; i++)
{
if (pFrameBuffer[i] != NULL && pFrameBuffer[i]->nStatus
== GX_FRAME_EMSTATUS_SUCCESS)
{
//The image i was successfully acquired.
//Image processing...
}
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 166
7.GxIAPI Library Definitions
return 0;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 167
7.GxIAPI Library Definitions
[in] callBackFun The callback function that the user will register, for the function type,
see GXCaptureCallBack().
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The pointer that the user introduces is NULL.
GX_STATUS_INVALID_CALL After sending the start acquisition command, the user
can not register the capture callback function.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
After sending the start acquisition command, the user can not register the callback function. Otherwise,
it will return GX_STATUS_INVALID_CALL.
Sample Code:
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 168
7.GxIAPI Library Definitions
bImplementPacketSize=(emAccessMode==GX_NODE_ACCESS_MODE_RW)
? true : false;
if (bImplementPacketSize)
{
//Get Optimal PacketSize
emStatus = GXGetOptimalPacketSize (hDevice,
&ui32PacketSize);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 169
7.GxIAPI Library Definitions
ui32PacketSize);
}
//Registers image processing callback function
emStatus = GXRegisterCaptureCallback(hDevice, NULL,
OnFrameCallbackFun);
7.4.5.9. GXUnregisterCaptureCallback
Declarations:
GX_API GXUnregisterCaptureCallback(GX_DEV_HANDLE hDevice);
Descriptions:
Unregister the capture callback function, corresponding to GXRegisterCaptureCallback().
Parameters:
[in] hDevice The handle of the device.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_CALL After sending the stop acquisition command, the user can
not unregister the capture callback function.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 170
7.GxIAPI Library Definitions
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
Before sending the stop acquisition command, the user can not unregister the callback function.
Otherwise, it will return GX_STATUS_INVALID_CALL.
Sample Code:
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 171
7.GxIAPI Library Definitions
//---------------------
//
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 172
7.GxIAPI Library Definitions
//In this interval, the image will be returned to the user via the
//OnFrameCallbackFun interface.
//
//---------------------
return 0;
}
7.4.5.10. GXGetImage
Declarations:
GX_API GXGetImage(GX_DEV_HANDLE hDevice, GX_FRAME_DATA *pFrameData,
int32_t nTimeout);
Descriptions:
After starting acquisition, you can call this function to get images directly. Noting that the interface
can not be mixed with the callback capture mode.
Parameters:
[in] hDevice The handle of the device.
[in,out] pFrameData The pointer to the address that the user introduced to
receive the image data.
[in] nTimeout The timeout time of capture image (unit: ms).
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_CALL After registering the capture callback function, the user
calls the GXGetImage() to get image.
GX_STATUS_INVALID_PARAMETER User incoming image address pointer is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 173
7.GxIAPI Library Definitions
The GXGetImage() interface is not allowed to be called after the capture callback function is registered,
and the call will return GX_STATUS_INVALID_CALL error. When using high resolution cameras for
high-speed acquisition, because there is a buffer copy within the GXGetImage() interface, it will affect
the transport performance. It is recommended that users use the capture callback mode in this case.
Sample Code:
//-------------------------------
//The GXGetImage interface can take one image at a time. The implementation
//process is shown below.
//-------------------------------
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 174
7.GxIAPI Library Definitions
{
//Setting device’s property of GevSCPSPacketSize to improve
//the acquisition performance of the network camera.
bool bImplementPacketSize = false;
uint32_t ui32PacketSize = 0;
if (bImplementPacketSize)
{
//Get Optimal PacketSize.
emStatus = GXGetOptimalPacketSize (hDevice, &ui32PacketSize);
GX_INT_VALUE stPayLoadSize = 0;
//Gets the image buffer size, and then apply for dynamic memory.
emStatus = GXGetIntValue(hDevice, "PayloadSize", &stPayLoadSize);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 175
7.GxIAPI Library Definitions
if (emStatus == GX_STATUS_SUCCESS)
{
//Calls GXGetImage to get an image.
while(GXGetImage(hDevice, &stFrameData, 100) != GX_STATUS_SUCCESS)
{
Sleep(10);
}
if (stFrameData.nStatus == GX_FRAME_STATUS_SUCCESS)
{
//Acquiring image is successful.
//Image processing...
}
}
//Sends a stop acquisition command.
emStatus = GXSetCommandValue (hDevice, "AcquisitionStop");
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 176
7.GxIAPI Library Definitions
Precautions:
If the user processes the images too slow, the image of last acquisition may be remained in the queue.
Especially in the trigger mode, after the user send the trigger signal, and get the old image (last image).
If you want to get the current image that corresponding to trigger signal, you should call the
GXFlushQueue() interface before sending the trigger signal to empty the image output queue.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
emStatus = GXFlushQueue(hDevice);
7.4.5.13. GXGetPayLoadSize
Declarations:
GX_API GXGetPayLoadSize(GX_DS_HANDLE hDStream, uint32_t* punPacketSize);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 177
7.GxIAPI Library Definitions
Descriptions:
Get device stream PayLoadSize.
Parameters:
[in] hDStream Device stream handle.
[out] punPacketSize PayLoadSize pointer.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_INVALID_PARAMETER The unsupported event ID or the callback function is illegal.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32PacketSize = 0;
emStatus = GXGetPayLoadSize(hDStream, &ui32PacketSize);
7.4.5.14. GXRegisterBuffer
Declarations:
GX_API GXRegisterBuffer(GX_DEV_HANDLE hDevice,
void* pBuffer,
size_t pBufferSize,
void* pUserParam);
Descriptions:
Registering the buffer requested by user is used for image acquisition, and users can independently
manage the buffer memory.
Note:
1) The buffer size requested by the user cannot be calculated by itself and needs to be obtained
from the GXGetPayLoadSize() interface, otherwise it may cause exceptions. Products such as
POLS data frame grabber require alignment of memory size and first address for data acquisition
based on performance considerations. Therefore, user needs to align the starting address and
size according to the alignment byte requirements specified by the StreamBufferAlignment
attribute when using this interface.
2) When the number of registered buffers is small, the acquisition driver completes a single
acquisition (buffer is in the consumer queue), and no buffer available in the driver may result in
frame loss. Therefore, it is recommended to register at least 3 buffers and complete the use of
the image as soon as possible. In addition, hardware such as POLS requires a minimum
AnnounceBuffer quantity of 3 or more. If the number of buffers registered by the user is insufficient,
it will result in acquisition failure.
3) After calling the GXRegisterBuffer() interface, if the user modifies the parameters of the camera
or frame grabber, resulting in a change of PayloadSize, the registered buffer needs to be
deregistered, and memory needs to be reapplied and registered based on the new length.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 178
7.GxIAPI Library Definitions
4) GXRegisterBuffer() is an optional interface. If this interface is not called to register the buffer, the
API library will automatically allocate buffers and start acquisition during image acquisition ,
without affecting the acquisition process.
Parameters:
[in] hDevice Device handle
[in] pBuffer The buffer pointer requested by the user
[in] nSize The buffer length requested by the user
[in] pUserParam User defined parameters, which can obtained from
GX_FRAME_DATA.pUserParam after setting
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Obtain the buffer length and address alignment value registered
//by the user
uint64_t u64BufferSize = 0;
size_t uBufAddrAlignment = 0;
emStatus = GXGetPayLoadSize(hDStream, &u64BufferSize);
if(GX_STATUS_SUCCESS != emStatus)
{
//Exception handling...
}
GX_INT_VALUE stIntValue;
emStatus = GXGetIntValue(hStreamFeatureControl,
"StreamBufferAlignment", &stIntValue);
if(GX_STATUS_SUCCESS != emStatus)
{
//Exception handling...
}
uBufAddrAlignment = stIntValue.nCurValue;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 179
7.GxIAPI Library Definitions
{
//Exception handling...
}
//User defined data, NULL for no value
void* pUserParam = NULL;
//Register buffer
emStatus = GXRegisterBuffer(hDevice, pBuffer, u64BufferSize
pUserParam);
if(GX_STATUS_SUCCESS != emStatus)
{
//Exception handling...
}
//Start acquisition...
//Image processing...
//Stop acquisition...
//Free memory
if(NULL != pBuffer)
{
_aligned_free(pBuffer);
pBuffer = NULL;
}
7.4.5.15. GXUnRegisterBuffer
Declarations:
GX_API GXUnRegisterBuffer(GX_DEV_HANDLE hDevice, void* pBuffer)
Descriptions:
Unregister the buffer registered by the user throughGXRegisterBuffer() interface.
Note:
This interface needs to be called after the acquisition is stopped. Calling it during the acquisition
process will affect the normal process.
Parameters:
[in] hDevice Device handle
[in] pBuffer The buffer pointer requested by the user
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 180
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_INT_VALUE stIntValue;
emStatus = GXGetIntValue(hStreamFeatureControl,
"StreamBufferAlignment", &stIntValue);
if(GX_STATUS_SUCCESS != emStatus)
{
//Exception handling...
}
uBufAddrAlignment = stIntValue.nCurValue;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 181
7.GxIAPI Library Definitions
//Register buffer
emStatus = GXRegisterBuffer(hDevice, pBuffer, u64BufferSize ,
pUserParam);
if(GX_STATUS_SUCCESS != emStatus)
{
//Exception handling...
}
//Start acquisition...
//Image processing...
//Stop acquisition...
//Free memory
if(NULL != pBuffer)
{
_aligned_free(pBuffer);
pBuffer = NULL;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 182
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 183
7.GxIAPI Library Definitions
//---------------------
//
//The event notification will be returned to the user via the
//OnDeviceOfflineCallbackFun interface.
//
//---------------------
7.4.6.2. GXUnregisterDeviceOfflineCallback
Declarations:
GX_API GXUnregisterDeviceOfflineCallback(GX_DEV_HANDLE hDevice,
GX_EVENT_CALLBACK_HANDLE hCallBack)
Descriptions:
Unregister event handle callback function.
Parameters:
[in] hDevice The handle of the device.
[in] hCallBack The handle of device offline callback function.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 184
7.GxIAPI Library Definitions
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code: Get device offline event
#include "GxIAPI.h"
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 185
7.GxIAPI Library Definitions
//---------------------
//
//The event notification will be returned to the user via the
//OnDeviceOfflineCallbackFun interface.
//
//---------------------
7.4.6.3. GXRegisterFeatureCallbackByString
Declarations:
GX_API GXRegisterFeatureCallbackByString(GX_PORT_HANDLE hPort,
void* pUserParam,
GXFeatureCallBackByString callBackFun,
const char* strfeatureName,
GX_FEATURE_CALLBACK_BY_STRING_HANDLE *pHCallBack);
Descriptions:
Register property update callback function.
Parameters:
[in] hPort The handle of the device
[in] pUserParam User Private Parameters
[in] callBackFun User event processing callback function, please reference to
GXFeatureCallBackByString()
[in] strfeatureName Node name
[out] pHCallBack Property update callback function handle, which is used to
unregister the callback function
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The parameter is invalid.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 186
7.GxIAPI Library Definitions
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 187
7.GxIAPI Library Definitions
"ExposureEnd");
//---------------------
//
//Event notifications will be returned to users
//through the OnFeatureCallbackFun interface
//
//---------------------
}
7.4.6.4. GXUnregisterFeatureCallbackByString
Declarations:
GX_API GXUnregisterFeatureCallbackByString(GX_PORT_HANDLE hPort,
const char* strfeatureName,
GX_FEATURE_CALLBACK_BY_STRING_HANDLE hCallBack);
Descriptions:
Unregister device attribute update callback function.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 188
7.GxIAPI Library Definitions
Precautions:
Used in conjunction with GXRegisterFeatureCallback(), each registration must have a corresponding
cancellation corresponding to it.
Parameters:
[in] hPort The handle of the device
[in] strfeatureName Node name
[in] hCallBack Property update callback function handle
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The parameter is invalid.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code: Get remote device events
#include"GxIAPI.h"
GX_DEV_HANDLE hDevice = NULL;
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 189
7.GxIAPI Library Definitions
uint32_t ui32DeviceNum = 0;
emStatus = GXUpdateAllDeviceList(&ui32DeviceNum, 1000);
if ((emStatus!= GX_STATUS_SUCCESS)||(ui32DeviceNum<= 0))
{
return 0;
}
stOpenParam.accessMode = GX_ACCESS_EXCLUSIVE;
stOpenParam.openMode = GX_OPEN_INDEX;
stOpenParam.pszContent = "1";
emStatus = GXOpenDevice(&stOpenParam, &hDevice);
if (emStatus == GX_STATUS_SUCCESS)
{
//Select exposure end event
GXSetEnumValueByString(hDevice, "EventSelector",
"ExposureEnd");
//
//---------------------
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 190
7.GxIAPI Library Definitions
GXUnregisterFeatureCallbackByString(hDevice, "EventExposureEnd",
hCB);
}
emStatus = GXCloseDevice(hDevice);
GXCloseLib();
return 0;
}
7.4.6.5. GXFlushEvent
Declarations:
GX_API GXFlushEvent (GX_DEV_HANDLE hDevice)
Descriptions:
Empty the device event, such as the frame exposure to end the event data queue.
Parameters:
[in] hDevice The handle of the device.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
The library internal event data receiving and processing using caching mechanism, if the user
receiving, processing event speed is slower than the event generates, then the event data will be
accumulated in the library, it will affect the the user to get real-time event data. If you want to get
the real-time event data, you need to call the GXFlushEvent() interface to clear the event cache
data. This interface empties all the event data at once.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
emStatus = GXFlushEvent(hDevice);
7.4.6.6. GXGetEventNumInQueue
Declarations:
GX_API GXGetEventNumInQueue (GX_DEV_HANDLE hDevice,
uint32_t *pnEventNum);
Descriptions:
Get the number of the events in the current remote device event queue cache.
Parameters:
[in] hDevice The handle of the device.
[in] pnEventNum The pointer of event number.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 191
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32EventNum = 0;
emStatus = GXGetEventNumInQueue(hDevice, &ui32EventNum);
Name Description
GX_ACCESS_STATUS_UNKNOWN The device's current status is unknown
GX_ACCESS_STATUS_READWRITE The device currently supports reading and writing
GX_ACCESS_STATUS_READONLY The device currently only supports reading
The device currently does neither support reading nor
GX_ACCESS_STATUS_NOACCESS
support writing
7.5.2.2. GX_FEATURE_LEVEL
typedef enum GX_FEATURE_LEVEL
{
GX_FEATURE_LEVEL_REMOTE_DEV =0x00000000,
GX_FEATURE_LEVEL _TL =0X01000000,
GX_FEATURE_LEVEL _IF =0x02000000,
GX_FEATURE_LEVEL _DEV =0x03000000,
GX_FEATURE_LEVEL _DS =0x04000000,
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 192
7.GxIAPI Library Definitions
} GX_FEATURE_LEVEL;
Name Description
7.5.2.3. GX_FEATURE_TYPE
typedef enum GX_FEATURE_TYPE
{
GX_FEATURE_INT =0x10000000,
GX_FEATURE_FLOAT =0X20000000,
GX_FEATURE_ENUM =0x30000000,
GX_FEATURE_BOOL =0x40000000,
GX_FEATURE_STRING =0x50000000,
GX_FEATURE_BUFFER =0x60000000,
GX_FEATURE_COMMAND =0x70000000,
} GX_FEATURE_TYPE;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 193
7.GxIAPI Library Definitions
7.5.3. Structure
7.5.3.1. GX_INT_RANGE
Related interface:GXGetIntRange()
The interface describes the maximum value, minimum value and step length of the integer type.
typedef struct GX_INT_RANGE
{
int64_t nMin;
int64_t nMax;
int64_t nInc;
int32_t reserved[8];
}GX_INT_RANGE;
Name Description
7.5.3.2. GX_FLOAT_RANGE
Related interface:GXGetFloatRange()
The interface describes the maximum value, minimum value, step length and unit of the float-point type.
typedef struct GX_FLOAT_RANGE
{
double dMin;
double dMax;
double dInc;
char szUnit[GX_INFO_LENGTH_8_BYTE];
bool bIncIsValid;
int8_t reserved[31];
}GX_FLOAT_RANGE;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 194
7.GxIAPI Library Definitions
7.5.3.3. GX_ENUM_DESCRIPTION
Related interface:GXGetEnumDescription()
The interface describes the value and description information of all enumerated items.
typedef struct GX_ENUM_DESCRIPTION
{
int64_t nValue;
char szSymbolic[GX_INFO_LENGTH_64_BYTE];
int32_t reserved[8];
}GX_ENUM_DESCRIPTION;
Name Description
nValue The value of the enumeration item
7.5.3.4. GX_DEVICE_IP_INFO
Related interface: GXGetDeviceIPInfo()
This structure represents some of the GigE cameras property descriptions.
typedef struct GX_DEVICE_IP_INFO
{
char szDeviceID[GX_INFO_LENGTH_64_BYTE + 4];
char szMAC[GX_INFO_LENGTH_32_BYTE];
char szIP[GX_INFO_LENGTH_32_BYTE];
char szSubNetMask[GX_INFO_LENGTH_32_BYTE];
char szGateWay[GX_INFO_LENGTH_32_BYTE];
char szNICMAC[GX_INFO_LENGTH_32_BYTE];
char szNICIP[GX_INFO_LENGTH_32_BYTE];
char szNICSubNetMask[GX_INFO_LENGTH_32_BYTE];
char szNICGateWay[GX_INFO_LENGTH_32_BYTE];
char szNICDescription[GX_INFO_LENGTH_128_BYTE + 4];
char reserved[512];
} GX_DEVICE_IP_INFO;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 195
7.GxIAPI Library Definitions
Name Description
szDeviceID 64+4 bytes, the unique identifier of the device
szMAC 32 bytes, MAC address
szIP 32 bytes, IP address
szSubNetMask 32 bytes, subnet mask
szGateWay 32 bytes, gateway
32 bytes, the MAC address of the corresponding NIC
szNICMAC
(Network Interface Card)
szNICIP 32 bytes, the IP address of the corresponding NIC
szNICSubNetMask 32 bytes, the subnet mask of the corresponding NIC
szNICGateWay 32 bytes, the gateway of the corresponding NIC
szNICDescription 128+4 bytes, the description of the corresponding NIC
reserved 512 bytes, reserved
7.5.3.5. GX_DEVICE_BASE_INFO
Related interface:GXGetAllDeviceBaseInfo()
This structure represents the basic information of the device, whether it is a USB camera or a GigE camera.
typedef struct GX_DEVICE_BASE_INFO
{
char szVendorName[GX_INFO_LENGTH_32_BYTE];
char szModelName[GX_INFO_LENGTH_32_BYTE];
char szSN[GX_INFO_LENGTH_32_BYTE];
char szDisplayName[GX_INFO_LENGTH_128_BYTE + 4];
char szDeviceID[GX_INFO_LENGTH_64_BYTE + 4];
char szUserID[GX_INFO_LENGTH_64_BYTE + 4];
GX_ACCESS_STATUS_CMD accessStatus;
GX_DEVICE_CLASS deviceClass;
char reserved[300];
} GX_DEVICE_BASE_INFO;
Name Description
szVendorName 32 bytes, vendor name
szModelName 32 bytes, model name
szSN 32 bytes, device serial number
szDisplayName 128+4 bytes, device display name
szUserID 64+4 bytes, user-defined name
szDeviceID 64+4 bytes, the unique identifier of the device
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 196
7.GxIAPI Library Definitions
7.5.4. Interface
7.5.4.1. GXReadRemoteDevicePortStacked (Support only by Windows)
Declarations:
Read user specified cameras attribute value in batch (Support Int currently, 4 bytes).
Note:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 197
7.GxIAPI Library Definitions
//The following addresses are only for reference. Please consult our
//technical support for specific addresses.
pstStackEntry[0].nAddress = 0xFFFF;
pstStackEntry[1].nAddress = 0xFFFF;
pstStackEntry[1].nSize = 4;
pstStackEntry[1].pBuffer = new int32_t;
pstStackEntry[2].nAddress = 0xFFFF;
pstStackEntry[2].nSize = 4;
pstStackEntry[2].pBuffer = new int32_t;
Declarations:
Set user specified cameras attribute value in batch (Support Int currently, 4 bytes).
Note:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 198
7.GxIAPI Library Definitions
[in,out] piSize Used to return the number of obtained camera attribute values.
Returns:
GX_STATUS_SUCCESS Successfully operation without error.
GX_STATUS_INVALID_PARAMETER Invalid parameter.
GX_STATUS_INVALID_HANDLE Invalid handle warning.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
pstStackEntry[1].nAddress = 0xFFFF;
pstStackEntry[1].nSize = 4;
pstStackEntry[1].pBuffer = chBufferHeight ;
pstStackEntry[2].nAddress = 0xFFFF;
pstStackEntry[2].nSize = 4;
pstStackEntry[2].pBuffer = chBufferOffsetX;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 199
7.GxIAPI Library Definitions
//After finished
if (NULL != pBuffer)
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 200
7.GxIAPI Library Definitions
{
delete pBuffer;
pBuffer = NULL;
}
7.5.4.4. GXWriteRemoteDevicePort
Declarations:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 201
7.GxIAPI Library Definitions
{
delete pBuffer;
pBuffer = NULL;
7.5.4.5. GXUnregisterFeatureCallback
Declarations:
GX_API GXUnregisterFeatureCallback(GX_DEV_HANDLE hDevice,
GX_FEATURE_ID_CMD featureID,
GX_FEATURE_CALLBACK_HANDLE hCallBack)
Descriptions:
Unregister device attribute update callback function.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[in] hCallBack The attribute update callback function handle.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_INVALID_PARAMETER The unsupported event ID.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code: Get the event of remote device
#include "GxIAPI.h"
GX_DEV_HANDLE hDevice = NULL;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 202
7.GxIAPI Library Definitions
//Gets the event data such as timestamp and frame ID for the frame
//exposure end event.
int64_t i64FrameID=0;
GXGetInt(hDevice, GX_INT_EVENT_EXPOSUREEND_FRAMEID, &i64FrameID);
}
return;
}
GX_OPEN_PARAM stOpenParam;
stOpenParam.accessMode = GX_ACCESS_EXCLUSIVE;
stOpenParam.openMode = GX_OPEN_INDEX;
stOpenParam.pszContent = "1";
emStatus = GXOpenDevice(&stOpenParam, &hDevice);
if (emStatus == GX_STATUS_SUCCESS)
{
//Selects the exposure end event.
GXSetEnum(hDevice,GX_ENUM_EVENT_SELECTOR,
GX_ENUM_EVENT_SELECTOR_EXPOSUREEND);
//Enables the exposure end event.
GXSetEnum(hDevice,GX_ENUM_EVENT_NOTIFICATION,
GX_ENUM_EVENT_NOTIFICATION_ON);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 203
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 204
7.GxIAPI Library Definitions
return;
}
int main(int argc, char* argv[])
{
GXInitLib();
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_OPEN_PARAM stOpenParam;
uint32_t ui32DeviceNum = 0;
emStatus = GXUpdateAllDeviceList(&ui32DeviceNum, 1000);
if ((emStatus != GX_STATUS_SUCCESS) || (ui32DeviceNum <= 0))
{
return 0;
}
stOpenParam.accessMode = GX_ACCESS_EXCLUSIVE;
stOpenParam.openMode = GX_OPEN_INDEX;
stOpenParam.pszContent = "1";
emStatus = GXOpenDevice(&stOpenParam, &hDevice);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 205
7.GxIAPI Library Definitions
if (emStatus == GX_STATUS_SUCCESS)
{
//Selects the exposure end event.
GXSetEnum(hDevice,GX_ENUM_EVENT_SELECTOR,
GX_ENUM_EVENT_SELECTOR_EXPOSUREEND);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 206
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 207
7.GxIAPI Library Definitions
7.5.4.9. GXGetBuffer
Declarations:
GX_API GXGetBuffer(GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
uint8_t* pBuffer, size_t* pnSize);
Descriptions:
Get the Buffer data.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pBuffer The pointer that point to the buffer data memory address
that the user applied.
[in,out] pnSize The length of the buffer address that the user inputs.
If pBuffer is NULL:
[out] pnSize Return the actual size of the buffer needed.
If pBuffer is not NULL:
[in] pnSize The size of the buffer that the user allocated.
[out] pnSize Return the actual filled buffer size.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
GX_STATUS_NEED_MORE_BUFFER The buffer that the user allocates is too small.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Applies buffer.
uint8_t *pui8GetLutBuffer = new uint8_t[nLutLength];
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 208
7.GxIAPI Library Definitions
//After finished
If (NULL != pui8GetLutBuffer)
{
delete[] pui8GetLutBuffer;
pui8GetLutBuffer = NULL;
}
7.5.4.10. GXSetBuffer
Declarations:
GX_API GXSetBuffer (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
uint8_t* pBuffer, size_t nSize);
Descriptions:
Set the Buffer data.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[in] pBuffer The pointer that point to the Buffer data memory address
that the user will set.
[in] nSize The length of the buffer address that the user inputs.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user introduces is NULL.
GX_STATUS_OUT_OF_RANGE The maximum length that the content the user writes
exceeds the string size.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 209
7.GxIAPI Library Definitions
//Applies buffer.
uint8_t *pui8SetLutBuffer = new uint8_t[nLutLength];
//Sets the look-up table contents (For example, you can read a look-
//up table from the local file).
//There does not explain how to set the contents of the look -up
//table buffer. Please install the settings you need to find the
//look-up table contents.
//Sets the look-up table.
emStatus = GXSetBuffer(hDevice, GX_BUFFER_LUT_VALUEALL, pui8SetLutBuffer,
nLutLength);
//After finished
If (NULL != pui8SetLutBuffer)
{
delete[] pui8SetLutBuffer;
pui8SetLutBuffer = NULL;
}
7.5.4.11. GXGetStringMaxLength
Declarations:
GX_API GXGetStringMaxLength (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID, size_t* pnSize)
Descriptions:
Get the maximum length of the string type value. Unit: byte. The user allocates buffer according to
the length information obtained, then call the GXGetString() to get the string information. This
interface can get the maximum possible length of the string (including the terminator '\ 0'), but the
actual length of the string might not be that long, if the user wants to allocate buffer according to the
actual string length, the user can call the GXGetStringLength interface to get the actual string length.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pnSize The pointer that point to the length value returned. The
length value is end with '\0', unit: byte.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 210
7.GxIAPI Library Definitions
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 211
7.GxIAPI Library Definitions
//After finished
if(NULL != pszText)
{
delete[] pszText;
pszText = NULL;
}
7.5.4.13. GXSetString
Declarations:
GX_API GXSetString(GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
char* pszContent)
Descriptions:
Set the content of the string value.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[in] pszContent The string address that the user will set. The string is end
with '\0'.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user introduces is NULL.
GX_STATUS_OUT_OF_RANGE The maximum length that the content the user writes
exceeds the string size.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 212
7.GxIAPI Library Definitions
Declarations:
GX_API GXGetStringLength(GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
size_t* pnSize)
Descriptions:
Get the current value length of the character string type. Unit: byte. The user can allocate the buffer
size according to the length information that is get from the function, and then call the GXGetString()
to get the character string information.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pnSize The pointer that point to the length value returned. The length value is end
with '\0', unit: byte.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
size_t nSize = 0;
emStatus = GXGetStringLength(hDevice, GX_STRING_DEVICE_VENDOR_NAME, &nSize);
7.5.4.15. GXSetBool
Declarations:
GX_API GXSetBool(GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
bool bValue)
Descriptions:
Set the value of bool type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[in] bValue The bool value that the user will set.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 213
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
bool bTemp = true;
emStatus = GXSetBool(hDevice, GX_BOOL_REVERSE_X, bTemp);
7.5.4.16. GXGetBool
Declarations:
GX_API GXGetBool (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID, bool* pbValue)
Descriptions:
Get the value of bool type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pbValue The pointer that point to the bool value returned.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
bool bTemp = false;
emStatus = GXGetBool(hDevice, GX_BOOL_REVERSE_X, &bTemp);
7.5.4.17. GXSetEnum
Declarations:
GX_API GXSetEnum (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID, int64_t nValue)
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 214
7.GxIAPI Library Definitions
Descriptions:
Set the enumeration value.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[in] nValue The enumeration values that the user will set. The value
range can be got by the nValue of the
GX_ENUM_DESCRIPTION.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_OUT_OF_RANGE The value that the user introduces is cross the border.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
int64_t i64Value = GX_GAIN_AUTO_CONTINUOUS;
emStatus = GXSetEnum(hDevice, GX_ENUM_GAIN_AUTO, i64Value);
7.5.4.18. GXGetEnumEntryNums
Declarations:
GX_API GXGetEnumEntryNums (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
uint32_t* pnEntryNums)
Descriptions:
Get the number of the options for the enumeration item.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pnEntryNums The pointer that point to the number returned.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 215
7.GxIAPI Library Definitions
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32EntryNums = 0;
emStatus = GXGetEnumEntryNums(hDevice, GX_ENUM_GAIN_AUTO, &ui32EntryNums);
7.5.4.19. GXGetEnumDescription
Declarations:
GX_API GXGetEnumDescription(GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
GX_ENUM_DESCRIPTION* pEnumDescription,
size_t* pnBufferSize)
Descriptions:
To get the description information of the enumerated type values: the number of enumerated items
and the value and descriptions of each item, please reference GX_ENUM_DESCRIPTION.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pEnumDescription The array pointer, used for the enumeration description
information returned.
[in,out] pnBufferSize The size of the GX_ENUM_DESCRIPTION array that the
user introduces, unit: byte.
If pEnumDescription is NULL:
[out] pnBufferSize The actual size of the buffer needed.
If pEnumDescription is not NULL:
[in] pnBufferSize The size of the buffer that the user allocated.
[out] pnBufferSize Return the actual filled buffer size.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_NEED_MORE_BUFFER The buffer that the user allocates is too small.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32EntryNums = 0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 216
7.GxIAPI Library Definitions
&ui32EntryNums);
//After finished
If (NULL != pstEnumDescrption)
{
delete[] pstEnumDescrption;
pstEnumDescrption = NULL;
}
7.5.4.20. GXGetEnum
Declarations:
GX_API GXGetEnum (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
int64_t* pnValue)
Descriptions:
To get the current enumeration value.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pnValue The pointer that point to the return values.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
int64_t i64Value = 0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 217
7.GxIAPI Library Definitions
7.5.4.21. GXSetFloat
Declarations:
GX_API GXSetFloat (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
double dValue)
Descriptions:
Set the value of float type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[in] dValue The float value that the user will set.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_OUT_OF_RANGE The value that the user introduces is across the border,
smaller than the minimum, or larger than the maximum.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
double dValue = 3000;
emStatus = GXSetFloat(hDevice, GX_FLOAT_EXPOSURE_TIME, dValue);
7.5.4.22. GXGetFloatRange
Declarations:
GX_API GXGetFloatRange (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
GX_FLOAT_RANGE* pFloatRange)
Descriptions:
To get the minimum value, maximum value, steps and unit of the float type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pFloatRange The description structure pointer of float type. Reference
the GX_FLOAT_RANGE.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 218
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read the range of the float type.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_FLOAT_RANGE stFloatRange;
emStatus = GXGetFloatRange(hDevice, GX_FLOAT_EXPOSURE_TIME,
&stFloatRange);
7.5.4.23. GXGetFloat
Declarations:
GX_API GXGetFloat (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
double* pdValue)
Descriptions:
Get the value of float type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pdValue Point to the pointer of the float value returned.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
double dValue = 0;
emStatus = GXGetFloat(hDevice, GX_FLOAT_EXPOSURE_TIME, &dValue);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 219
7.GxIAPI Library Definitions
7.5.4.24. GXSetInt
Declarations:
GX_API GXSetInt(GX_DEV_HANDLE hDevice, GX_FEATURE_ID featureID, int64_t nValue)
Descriptions:
Set the value of int type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[in] nValue The value that the user will set.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_OUT_OF_RANGE The value that the user introduces is across the border, smaller
than the minimum, or larger than the maximum, or is not an
integer multiple of the step.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not write.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
int64_t i64Value = 200;
emStatus = GXSetInt(hDevice, GX_INT_WIDTH, i64Value);
7.5.4.25. GXGetFeatureName
Declarations:
GX_API GXGetFeatureName (GX_DEV_HANDLE hDevice, GX_FEATURE_ID featureID,
char* pszName, size_t* pnSize)
Descriptions:
Get the string description for the feature code.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pszName The character string buffer address that the user inputs. The
character string length includes the end terminator '\0'.
[in,out] pnSize The length of the character string buffer address that the user
inputs. Unit: byte.
If pszName is NULL:
[out] pnSize Return the actual size of the character string.
If pszName is not NULL:
[in] pnSize The size of the buffer that the user allocated.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 220
7.GxIAPI Library Definitions
//After finished
if(NULL != pszName)
{
delete[] pszName;
pszName = NULL;
}
7.5.4.26. GXIsImplemented
Declarations:
GX_API GXIsImplemented (GX_DEV_HANDLE hDevice, GX_FEATURE_ID featureID,
bool* pbIsImplemented)
Descriptions:
Inquire the current camera whether support a special feature. Usually the camera doesn’t support
a feature means that:
1) By inquiring the camera register, the current camera really does not support this feature.
2) There is no description of this feature in the current camera description file.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 221
7.GxIAPI Library Definitions
7.5.4.27. GXIsReadable
Declarations:
GX_API GXIsReadable(GX_DEV_HANDLE hDevice, GX_FEATURE_ID featureID,
bool* pbIsReadable)
Descriptions:
Inquire if a feature code is currently readable.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pbIsReadable To return the result whether the feature code ID is readable.
If readable, then will return true, if not readable, false will
return.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
bool bIsReadable = false;
emStatus = GXIsReadable(hDevice, GX_FLOAT_GAIN, &bIsReadable);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 222
7.GxIAPI Library Definitions
7.5.4.28. GXIsWritable
Declarations:
GX_API GXIsWritable(GX_DEV_HANDLE hDevice, GX_FEATURE_ID featureID, bool* pbIsWritable)
Descriptions:
Inquire if a feature code is currently writable.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pbIsWritable To return the result whether the feature code ID is
writable. If writable, then will return true, if not writable,
false will return.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
bool bIsWritable = false;
emStatus = GXIsWritable(hDevice, GX_FLOAT_GAIN, &bIsWritable);
7.5.4.29. GXGetIntRange
Declarations:
GX_API GXGetIntRange (GX_DEV_HANDLE hDevice, GX_FEATURE_ID featureID,
GX_INT_RANGE* pIntRange)
Descriptions:
To get the minimum value, maximum value and steps of the int type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pIntRange The structure of range description. Reference
GX_INT_RANGE.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 223
7.GxIAPI Library Definitions
7.5.4.30. GXGetInt
Declarations:
GX_API GXGetInt (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID featureID,
int64_t* pnValue)
Descriptions:
Get the current value of the int type.
Parameters:
[in] hDevice The handle of the device.
[in] featureID The feature code ID.
[out] pnValue Point to the pointer of the current value returned.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_HANDLE The handle that the user introduces is illegal.
GX_STATUS_NOT_IMPLEMENTED The feature that is not support currently.
GX_STATUS_ERROR_TYPE The featureID type that the user introduces is error.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_INVALID_ACCESS Currently inaccessible, can not read.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
int64_t i64Value = 0;
emStatus = GXGetInt(hDevice, GX_INT_WIDTH, &i64Value);
7.5.4.31. GXGetDeviceIPInfo
Declarations:
GX_API GXGetDeviceIPInfo(uint32_t nIndex, GX_DEVICE_IP_INFO* pstDeviceIPInfo)
Descriptions:
Specify the device index to obtain the network information of the device.
Parameters:
[in] nIndex The serial number of the device.
[out] pstDeviceIPInfo The structure pointer of the device information.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 224
7.GxIAPI Library Definitions
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The index that the user input is cross the border.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
You should call the GxUpdateAllDeviceList() interface for an enumeration before calling the function to get
the device information. Otherwise, the device information that the user gets is inconsistent with the device
that is currently connected.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32DeviceNum = 0;
emStatus = GXUpdateAllDeviceList(&ui32DeviceNum, 1000);
if (emStatus == GX_STATUS_SUCCESS &&(ui32DeviceNum > 0))
{
GX_DEVICE_IP_INFO stIPInfo;
7.5.4.32. GXGetAllDeviceBaseInfo
Declarations:
GX_API GXGetAllDeviceBaseInfo (GX_DEVICE_BASE_INFO* pDeviceInfo, size_t* pnBufferSize)
Descriptions:
To get the basic information of all devices.
Parameters:
[out] pDeviceInfo The structure pointer of the device information.
[in,out] pnBufferSize The buffer size of device information structure, unit: byte.
If pDeviceInfo is NULL:
[out] pnBufferSize Return the actual size of the device information.
If pDeviceInfo is not NULL:
[in] pnBufferSize The size of the buffer that the user allocated.
[out] pnBufferSize Return the actual allocated buffer size.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Precautions:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 225
7.GxIAPI Library Definitions
You should call the GxUpdateAllDeviceList() interface for an enumeration before calling the function to get
the device information. Otherwise, the device information that the user gets is inconsistent with the device
that is currently connected.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32DeviceNum = 0;
emStatus = GXUpdateAllDeviceList(&ui32DeviceNum, 1000);
if (emStatus == GX_STATUS_SUCCESS && (ui32DeviceNum > 0))
{
GX_DEVICE_BASE_INFO *pstBaseinfo =
new GX_DEVICE_BASE_INFO[ui32DeviceNum];
size_t nSize = ui32DeviceNum * sizeof(GX_DEVICE_BASE_INFO);
//After finished
If (NULL != pstBaseinfo)
{
delete[]pstBaseinfo;
pstBaseinfo = NULL;
}
}
7.5.4.33. GXOpenDeviceByIndex
Declarations:
GX_API GXOpenDeviceByIndex (uint32_t nDeviceIndex, GX_DEV_HANDLE* phDevice)
Descriptions:
Open the device by index, starting from 1.
Parameters:
[in] nDeviceIndex The index of the device starts from 1, for example: 1, 2, 3, 4...
[out] phDevice Device handle returned by the interface.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
GX_STATUS_OUT_OF_RANGE The index of the user input is bigger than the available
devices number.
The errors that are not covered above please reference GX_STATUS_LIST.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 226
7.GxIAPI Library Definitions
Precautions:
The index of the device starts from 1.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
7.5.4.34. GXUpdateDeviceList
Declarations:
GX_API GXUpdateDeviceList (uint32_t* punNumDevices,
uint32_t nTimeOut)
Descriptions:
Enumerating currently all available devices in subnet and gets the number of devices.
Parameters:
[out] punNumDevices The address pointer used to return the number of devices,
and the pointer can not be NULL.
[in] nTimeOut The timeout time of enumeration (unit: ms). If the device
is successfully enumerated within the specified timeout
time, the value returns immediately. If the device is not
enumerated within the specified timeout time, then it
waits until the specified timeout time is over and then it
returns.
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL.
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
uint32_t ui32DeviceNum = 0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 227
7.GxIAPI Library Definitions
7.5.4.35. GXGetFeatureNameList
Declarations:
GX_API GXGetFeatureNameList (GX_PORT_HANDLE hPort,
GX_FEATURE_NAME * pFeatureNameList,
uint32_t * pCount)
Descriptions:
Get all node names.
Parameters:
[in] hPort Handle
[in] pFeatureNameList Node name storage location
[in, out] pCount Given the capacity of the pFeatureNameList array, return
the actual number of writes
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs.
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called.
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL
GX_STATUS_INVALID_HANDLE The user enters an illegal handle or closes a device that has
already been shut down
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_STATUS emStatus = GX_STATUS_SUCCESS;
GX_FEATURE_NAME stFeatureNameList;
uint32_t ui32Count = 0;
7.5.4.36. GXGetFeatureName
Declarations:
GX_API GXGetFeatureName (GX_DEV_HANDLE hDevice,
GX_FEATURE_ID_CMD featureID,
char* pszName,
size_t* pnSize)
Descriptions:
Obtain the string description corresponding to the function control code.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 228
7.GxIAPI Library Definitions
Parameters:
[in] hDevice Device handle
[in] featureID Feature ID
[in] pszName The string buffer address entered by the user, the string
length including the terminator '\0'
[in, out] pnSize The length of the string buffer address entered by the user,
in bytes
If the user inputs a null pszName:
[out] pnSize returns the actual length required
If the user inputs a non NULL pszName:
[in] pnSize is the buffer size allocated to users
[out] pnSize returns the actual size of the filled buffer
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL
GX_STATUS_INVALID_HANDLE The user passed in an illegal handle
GX_STATUS_NEED_MORE_BUFFER The buffer allocated by the user is too small
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_ENUM_VALUE stEnumValue;
GX_FEATURE_ID_CMD emFeatureID = GX_INT_TIMESTAMP_TICK_FREQUENCY ;
size_t nSize =0;
//......
delete[] pFeatureName;
7.5.4.37. GXGetFeatureType
Declarations:
GX_API GXGetFeatureType(GX_PORT_HANDLE hPort,
const char * strName,
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 229
7.GxIAPI Library Definitions
GX_FEATURE_TYPE * type)
Descriptions:
Get the type of node.
Parameters:
[in] hPort Handle
[in] strName Node name
[out] type Node type
Returns:
GX_STATUS_SUCCESS The operation is successful and no error occurs
GX_STATUS_NOT_INIT_API The GXInitLib() initialization library is not called
GX_STATUS_INVALID_HANDLE The user passed in an illegal handle
GX_STATUS_INVALID_PARAMETER The pointer that the user input is NULL
The errors that are not covered above please reference GX_STATUS_LIST.
Sample Code:
GX_ENUM_VALUE stEnumValue;
GX_FEATURE_ID_CMD emFeatureID = GX _INT_TIMESTAMP_TICK_FREQUENCY ;
size_t nSize =0;
GX_FEATURE_TYPE emType;
emStatus = GXGetFeatureType (hDevice, pFeatureName, &emType);
if( NULL != pFeatureName)
{
delete[] pFeatureName;
pFeatureName = NULL;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 230
8.Image Processing Interface Description
8.1. Type
8.1.1. Data Type
Name Description
VxInt8 8-bit signed integer
VxInt16 16-bit signed integer
VxInt32 32-bit signed integer
VxInt64 64-bit signed integer
VxUint8 8-bit unsigned integer
VxUint16 16-bit unsigned integer
VxUint32 32-bit unsigned integer
8.2. Constant
8.2.1. Status code
typedef enum tagDX_STATUS
{
DX_OK = 0,
DX_PARAMETER_INVALID = -101,
DX_PARAMETER_OUT_OF_BOUND = -102,
DX_NOT_ENOUGH_SYSTEM_MEMORY = -103,
DX_NOT_FIND_DEVICE = -104,
DX_STATUS_NOT_SUPPORTED = -105,
DX_CPU_NOT_SUPPORT_ACCELERATE = -106
} DX_STATUS;
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 231
8.Image Processing Interface Description
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 232
8.Image Processing Interface Description
RAW2RGB_NEIGHBOUR = 0,
RAW2RGB_ADAPTIVE = 1,
RAW2RGB_NEIGHBOUR3 = 2,
RAW2RGB_WEIGHT = 3
} DX_BAYER_CONVERT_TYPE;
Name Description
If the original Raw image is 8 bits (0~7), you can only select the DX_BIT_0_7 algorithm; If the original
image is 10 bits (0~9), when you conversion it to 8 bits, you can select the DX_BIT_0_7, DX_BIT_1_8 and
DX_BIT_2_9 algorithms; If the original image is 12 bits (0~11), when you conversion it to 8 bits, you can
select the DX_BIT_0_7, DX_BIT_1_8, DX_BIT_2_9, DX_BIT_3_10 and DX_BIT_4_11 all the five
algorithms.
Name Description
DX_BIT_0_7 Takes the 0~7bit
DX_BIT_1_8 Takes the 1~8bit
DX_BIT_2_9 Takes the 2~9bit
DX_BIT_3_10 Takes the 3~10bit
DX_BIT_4_11 Takes the 4~11bit
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 233
8.Image Processing Interface Description
DX_ACTUAL_BITS_10 = 10,
DX_ACTUAL_BITS_12 = 12,
DX_ACTUAL_BITS_14 = 14,
DX_ACTUAL_BITS_16 = 16,
} DX_ACTUAL_BITS;
The actual bit depth of the image data, which is the number of bytes occupied by per pixel.
Name Description
DX_ACTUAL_BITS_8 8 bits
DX_ACTUAL_BITS_10 10 bits
DX_ACTUAL_BITS_12 12 bits
DX_ACTUAL_BITS_14 14 bits
DX_ACTUAL_BITS_16 16 bits
Name Description
HORIZONTAL_MIRROR Horizontal mirror
VERTICAL_MIRROR Vertical mirror
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 234
8.Image Processing Interface Description
IMAGE_CONVERT_DECLARE_HANDLE(DX_IMAGE_FORMAT_CONVERT_HANDLE);
Name Description
8.3. Structure
8.3.1. Monochrome image process function set structure
typedef struct MONO_IMG_PROCESS
{
bool bDefectivePixelCorrect;
bool bSharpness;
bool bAccelerate;
float fSharpFactor;
VxUint8 *pProLut;
VxUint16 nLutLength;
VxUint8 arrReserved[32];
} MONO_IMG_PROCESS;
Input the parameters by the DxMono8ImgProcess interface.
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 235
8.Image Processing Interface Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 236
8.Image Processing Interface Description
Name Description
float fGain10;
float fGain11;
float fGain12;
float fGain20;
float fGain21;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 237
8.Image Processing Interface Description
float fGain22;
} COLOR_TRANSFORM_FACTOR;
Input the parameters by the DxCalcUserSetCCParam interface.
Name Description
Name Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 238
8.Image Processing Interface Description
8.4. Interfaces
8.4.1. DxRaw12PackedToRaw16
Declarations:
VxInt32 DHDECL DxRaw12PackedToRaw16 (void* pInputBuffer, void* pOutputBuffer,
VxUint32 nWidth, VxUint32 nHeight)
Descriptions:
This function is used to convert the Raw12 Packed format data to Raw16 format.
Parameters:
pInputBuffer Point to the 12 bits Packed data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image, it needs to be new, not to use the
original data buffer, and the size is image width * image height * 2.
nWidth Image width.
nHeight Image height.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 600;
int32_t i32Height = 400;
BYTE *pRaw16Buf = new BYTE[i32Width * i32Height * 2];
// Open output buffer
if(pRaw16Buf == NULL)
{
return ;
}
else
{
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 239
8.Image Processing Interface Description
{
if (pRaw16Buf != NULL)
{
delete []pRaw16Buf;
pRaw16Buf = NULL;
}
return ;
}
//………………………
//Processing is complete.
if(pRaw16Buf != NULL)
{
delete []pRaw16Buf;
pRaw16Buf = NULL;
}
8.4.2. DxRaw10PackedToRaw16
Declarations:
VxInt32 DHDECL DxRaw10PackedToRaw16 (void* pInputBuffer, void* pOutputBuffer,
VxUint32 nWidth, VxUint32 nHeight)
Descriptions:
This function is used to convert the Raw10 Packed format data to Raw16 format data.
Parameters:
pInputBuffer Point to the 10 bits Packed data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image, it needs to be new, not to use the
original data buffer, and the size is image width * image height * 2.
nWidth Image width.
nHeight Image height.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 600;
int32_t i32Height = 400;
//Applies for the output buffer.
BYTE *pRaw16Buf = new BYTE[i32Width * i32Height * 2];
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 240
8.Image Processing Interface Description
if(pRaw16Buf == NULL)
{
return ;
}
else
{
//Initializes the buffer.
memset(pRaw16Buf, 0, i32Width * i32Height * 2 * sizeof(BYTE));
}
return ;
}
//Processing is complete.
if(pRaw16Buf != NULL)
{
delete []pRaw16Buf;
pRaw16Buf = NULL;
}
8.4.3. DxRaw8toRGB24
Declarations:
VxInt32 DHDECL DxRaw8toRGB24 (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 241
8.Image Processing Interface Description
if (pRGB24Buf == NULL)
{
return ;
}
else
{
//Initializes the buffer.
memset(pRGB24Buf, 0, i32Width * i32Height * 3 * sizeof(BYTE));
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 242
8.Image Processing Interface Description
return ;
}
if (pRGB24Buf != NULL)
{
delete []pRGB24Buf;
pRGB24Buf = NULL;
}
8.4.4. DxRaw8toRGB24Ex
Declarations:
VxInt32 DHDECL DxRaw8toRGB24Ex (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, DX_BAYER_CONVERT_TYPE cvtype,
DX_PIXEL_COLOR_FILTER nBayerType, bool bFlip,
DX_RGB_CHANNEL_ORDER emChannelOrder)
Descriptions:
This function is used to convert the Bayer image to RGB image, whose channel order can be selected
as RGB or BGR.
Parameters:
pInputBuffer Point to the 8 bits data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image, and the size is image width * image
height * 3.
nWidth Image width.
nHeight Image height.
cvtype The type of conversion algorithm.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 243
8.Image Processing Interface Description
if (pBGR24Buf == NULL)
{
return ;
}
else
{
//Initializes the buffer.
memset(pBGR24Buf, 0, i32Width * i32Height * 3 * sizeof(BYTE));
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 244
8.Image Processing Interface Description
{
delete []pBGR24Buf;
pBGR24Buf = NULL;
}
return ;
}
if (pBGR24Buf != NULL)
{
delete []pBGR24Buf;
pBGR24Buf = NULL;
}
8.4.5. DxRotate90CW8B
Declarations:
VxInt32 DHDECL DxRotate90CW8B (void* pInputBuffer, void* pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight)
Descriptions:
The function will rotate the 8 bits image 90 degrees clockwise. For Bayer image, the Bayer format will
be changed after the rotation. For example, rotate the raw image of BAYER_RG type clockwise, it
becomes a BAYER_GR type. After rotation, the width and height of the image are equal to those of the
original one.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image.
nWidth The width of original image.
nHeight The height of original image.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Rotates the Raw image in BAYER_RG format with a width of 1600 and a height
//of 1234.
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 245
8.Image Processing Interface Description
if(pTemp == NULL)
{
return;
}
else
{
memset(pTemp, 0, i32Width * i32Height * sizeof(BYTE));
}
return ;
}
else
{
//Copies to the Raw image buffer.
memcpy(pRaw8Buf,pTemp, i32Width * i32Height * sizeof(BYTE));
}
if(pTemp != NULL)
{
delete []pTemp;
pTemp = NULL;
}
//At this point, the bayer type in pRaw8Buf is BAYER_GR. The width
//of the image is 1234 and the height is 1600 .
8.4.6. DxRotate90CCW8B
Declarations:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 246
8.Image Processing Interface Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 247
8.Image Processing Interface Description
pTemp = NULL;
}
return ;
}
else
{
//Copies to the Raw image buffer.
memcpy(pRaw8Buf, pTemp, i32Width * i32Height * sizeof(BYTE));
}
if(pTemp != NULL)
{
delete []pTemp;
pTemp = NULL;
}
//At this point, the bayer type in pRaw8Buf is BAYER_GR. The width of the
//image is 1234 and the height is 1600.
8.4.7. DxRotate90CW16B
Declarations:
VxInt32 DHDECL DxRotate90CW16B (void* pInputBuffer, void* pOutputBuffer,
VxUint32 nWidth, VxUint32 nHeight)
Descriptions:
This function performs a ClockWise rotation of 90 degrees on a 16 bit image. For Bayer images, rotation
will change the Bayer format. For example, a Raw graph of BAYER_RG type becomes BAYER_GR type
when rotated clockwise. The width of the rotated image is equal to the height of the original image, and
the height is equal to the width of the original image.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image.
nWidth The width of original image.
nHeight The height of original image.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Rotates the Raw image in BAYER_RG format with a width of 1600 and a height
//of 1234.
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 248
8.Image Processing Interface Description
if (DxStatus != DX_OK)
{
if (pTemp != NULL)
{
delete []pTemp;
pTemp = NULL;
}
return ;
}
else
{
//Copy the original image buffer
memcpy(pRaw16Buf,pTemp,i32Width * i32Height * sizeof( BYTE)* 2);
}
if(pTemp != NULL)
{
delete []pTemp;
pTemp = NULL;
}
//At this point, the bayer type in pRaw8Buf is BAYER_GR. The width of the
//image is 1234 and the height is 1600.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 249
8.Image Processing Interface Description
8.4.8. DxRotate90CCW16B
Declarations:
VxInt32 DHDECL DxRotate90CCW16B (void* pInputBuffer, void* pOutputBuffer,
VxUint32 nWidth, VxUint32 nHeight)
Descriptions:
This function performs a Counter ClockWise rotation of 90 degrees on a 16 bit grayscale image. For Bayer
images, rotation will change the Bayer format. For example, a Raw graph of BAYER_RG type becomes
BAYER_GB type when rotated counterclockwise. The width of the rotated image is equal to the height of
the original image, and the height is equal to the width of the original image.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image.
nWidth The width of original image.
nHeight The height of original image.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Rotates the Raw image in BAYER_RG format with a width of 1600 and a height
//of 1234.
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 250
8.Image Processing Interface Description
if (pTemp != NULL)
{
delete []pTemp;
pTemp = NULL;
}
return ;
}
else
{
memcpy(pRaw16Buf, pTemp, i32Width * i32Height * sizeof( BYTE) * 2);
//Copy the original image buffer
}
if (pTemp != NULL)
{
delete []pTemp;
pTemp = NULL;
}
//At this point, the bayer type in pRaw16Buf is BAYER_GR. The width of the
//image is 1234 and the height is 1600.
8.4.9. DxBrightness
Declarations:
VxInt32 DHDECL DxBrightness (void* pInputBuffer, void* pOutputBuffer, VxUint32 nImagesize,
VxInt32 nFactor)
Descriptions:
The function will adjust the brightness of the input images, and the input images are 24 bits RGB or 8
bits gray image.
Parameters:
pInputBuffer Point to the data buffer of the original image.
POutputBuffer Point to the data buffer of the target image.
nImagesize The buffer length of input images, unit: byte. (For RGB
images, the size equal the image width * image height* 3).
nFactor The factor of brightness adjustment, range of value: -150~150.
0: The brightness has not changed.
> 0: Increase the brightness.
< 0: Reduces the brightness.
Returns:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 251
8.Image Processing Interface Description
Sample Code
//Adjusts the brightness of the 24bitRGB image.
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 252
8.Image Processing Interface Description
else
{
memset(pYOutputbuf, 0, i32Width * i32Height * sizeof(BYTE));
}
Effect images:
Figure 8-1 shows an image with no brightness adjustment. Figure 8-2 shows the image after brightness
adjustment.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 253
8.Image Processing Interface Description
8.4.10. DxContrast
Declarations:
VxInt32 DHDECL DxContrast (void* pInputBuffer, void* pOutputBuffer, VxUint32 nImagesize,
VxInt32 nFactor)
Descriptions:
The function will adjust the contrast of the input images, and the input images are 24 bits RGB or 8 bits
gray image.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image.
nImagesize The buffer length of input images, unit: byte. (For RGB images, the size
equal the image width * image height * 3).
nFactor The factor of contrast adjustment, range of value: -50~100.
0: The contrast has not changed.
> 0: Increase the contrast.
< 0: Reduces the contrast.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Adjusts the contrast of the 24bitRGB image.
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 254
8.Image Processing Interface Description
{
return ;
}
//Adjusts the contrast of the 8 bits gray image.
BYTE* pYOutputbuf = new BYTE[i32Width * i32Height];
if(pYOutputbuf == NULL)
{
return;
}
else
{
memset(pYOutputbuf, 0, i32Width * i32Height * sizeof(BYTE));
}
//pYInputBuf is the original image data
VxInt32 DxStatus = DxContrast ((BYTE*)pYInputbuf, pYOutputbuf,
i32Width*i32Height, 50);
if (DxStatus != DX_OK)
{
return ;
}
Effect images:
Figure 8-3 shows an image with no contrast adjustment. Figure 8-4 shows the image after contrast
adjustment.
Figure 8-3 Before contrast adjustment Figure 8-4 After contrast adjustment
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 255
8.Image Processing Interface Description
8.4.11. DxSharpen24B
Declarations:
VxInt32 DHDECL DxSharpen24B (void* pInputBuffer, void* pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, float fFactor)
Descriptions:
The function will sharpen the input images, and the input images are 24bitRGB images.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer The buffer of the RGB image that after being sharpened.
nWidth The width of the image.
nHeight The height of the image.
fFactor The factor of sharpness adjustment, range: 0.1~5.0.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Sharpens the 24bitRGB image.
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 256
8.Image Processing Interface Description
Effect images:
Figure 8-5 shows an image with no sharpen adjustment. Figure 8-6 shows the image after sharpen
adjustment.
8.4.12. DxSharpenMono8
Declarations:
VxInt32 DHDECL DxSharpenMono8 (void* pInputBuffer, void* pOutputBuffer,
VxUint32 nWidth, VxUint32 nHeight, float fFactor)
Descriptions:
This function sharpens the input image, which is an 8-bit RGB image.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer The buffer of the RGB image that after being sharpened.
nWidth The width of the image.
nHeight The height of the image.
fFactor The factor of sharpness adjustment, range: 0.1~5.0.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Sharpen 8-bit images
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 257
8.Image Processing Interface Description
8.4.13. DxSaturation
Declarations:
VxInt32 DHDECL DxSaturation (void* pInputBuffer, void* pOutputBuffer, VxUint32 nImagesize,
VxInt32 nFactor)
Descriptions:
The function is used to adjust the saturation of the input image, and the input image is 24bitRGB image.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer The buffer of the image that after saturation adjustment.
nImagesize The buffer length of the image, unit: byte. (For RGB image, the buffer length is
equal to the image width * image height * 3)
nFactor The factor of saturation adjustment, range: 0~128.
64: There's no change in saturation.
> 64: Increase the saturation.
< 64: Reduce the saturation.
128: The saturation is twice as the current value.
0: It is a monochrome image.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 258
8.Image Processing Interface Description
Sample Code:
//Adjusts the saturation of the 24bitRGB image.
int32_t i32Width = 1600;
int32_t i32Height = 1234;
Effect images:
Figure 8-7 shows an image with no saturation adjustment. Figure 8-8 shows the image after saturation
adjustment.
8.4.14. DxGetWhiteBalanceRatio
Declarations:
VxInt32 DHDECL DxGetWhiteBalanceRatio (void *pInputBuffer, VxUint32 nWidth, VxUint32 nHeight,
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 259
8.Image Processing Interface Description
Effect images:
Figure 8-9 shows an RGB image with no white balance adjustment:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 260
8.Image Processing Interface Description
1) If use this function to get the white balance ratio, to be accurate, you should give an objective "white"
region sub-image to the function in the RGB image. As shown in the frame area in Figure 8-10. (The
actual object in the area is the white building block). The image after white balance adjustment is
shown in Figure 8-11.
2) The use method: (pRGBBuf is the buffer of the sub-image in the frame area in Figure 8-10, nWidth is
the sub-image width, nHeight is the sub-image height), it needs to create a new buffer for the sub-
image and then pass the new buffer to DxGetWhiteBalanceRatio.
After calculating the white balance ratio of the three components of R/G/B, the white balance operation
method is as follows:
//Adds macro definitions to the header file.
int i = 0;
int j = 0;
int nPos = 0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 261
8.Image Processing Interface Description
arrRLut[i] = CLIP8(R);
arrGlut[i] = CLIP8(G);
arrBLut[i] = CLIP8(B);
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 262
8.Image Processing Interface Description
8.4.15. DxAutoRawDefectivePixelCorrect
Declarations:
VxInt32 DHDECL DxAutoRawDefectivePixelCorrect (void* pRawImgBuf, VxUint32 nWidth,
VxUint32 nHeight, VxInt32 nBitNum)
Descriptions:
The function automatically detects and corrects the bad pixel of the raw image in real time. The input
image can be 8 bits raw image or 16bits raw image. This function supports raw images in Bayer format.
The nBitNum is the actual bit depth of the data, if the image is 8 bits raw, the value is 8, and if the image
is 16bits raw, then the value is the actual bit depth of the data. For example, a raw image of a 12 bits
data, it takes two bytes (16bits), but the actual bit depth is 12, then the value is 12. This function does
not support the raw image of Packet format. For the Packet format, you should use the
DxRaw10PackedToRaw16 function or DxRaw10PackedToRaw16 function to convert it into raw16
format first. Due to the real-time detection and correction, every image must be checked and corrected
when this function is turned on.
Parameters:
pRawImgBuf The input buffer of Raw image (8 bits or 16 bits Raw image).
nWidth The width of the image.
nHeight The height of the image.
nBitNum The actual bit depth of the data.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 263
8.Image Processing Interface Description
return;
}
}
8.4.16. DxRaw16toRaw8
Declarations:
VxInt32 DHDECL DxRaw16toRaw8 (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, DX_VALID_BIT nValidBits);
Descriptions:
The function converts raw16 images (the actual bit depth is 16, effective bit depth is 10 or 12) to raw8
images (the actual bit depth and valid bit depth are 8 bits).
Parameters:
pInputBuffer The data buffer of original image.
pOutputBuffer The data buffer of target image.
nWidth The width of the image.
nHeight The height of the image.
nValidBits The valid bit of data.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 264
8.Image Processing Interface Description
return;
}
//Processing is complete.
if(pRaw8Buf != NULL)
{
delete []pRaw8Buf;
pRaw8Buf = NULL;
}
8.4.17. DxRGB48toRGB24
Declarations:
VxInt32 DHDECL DxRGB48toRGB24 (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, DX_VALID_BIT nValidBits);
Descriptions:
The function converts RGB 48 bits color image data to RGB 24 bits image data, because the three
channels process the image at the same time, each channel will convert the 16 bits (the valid bit depth
may be 12 bits, 10 bits, etc.) data to 8 bits data.
Parameters:
pInputBuffer The data buffer of original image (the buffer size is nWidth * nHeight * 3 * 2 BYTE).
pOutputBuffer The data buffer of target image (the buffer size is nWidth * nHeight * 3 * BYTE).
nWidth The width of the image.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 265
8.Image Processing Interface Description
return ;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 266
8.Image Processing Interface Description
//Processing is complete.
if(pRGB24Buf != NULL)
{
delete []pRGB24Buf;
pRGB24Buf = NULL;
}
8.4.18. DxRaw16toRGB48
Declarations:
VxInt32 DHDECL DxRaw16toRGB48 (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, DX_ACTUAL_BITS nActualBits,
DX_BAYER_CONVERT_TYPE cvtype,
DX_PIXEL_COLOR_FILTER nBayerType, bool bFlip)
Descriptions:
The function converts raw 16bits image (each pixel is 16 bits) to RGB 48 bits image data (each RGB
component is 16 bits), and you can also use the function DxRGB48toRGB24 to convert RGB 48 bits
image to RGB 24 bits image for display.
Parameters:
pInputBuffer The data buffer of original image.
pOutputBuffer The data buffer of target image.
nWidth The width of the image.
nHeight The height of the image.
nActualBits The valid bit of data.
cvtype The conversion algorithm type.
nBayerType The type of Bayer image format.
bFlip If flip, the value is true, and the image will vertical flip; otherwise, the value is
false, not flip.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 267
8.Image Processing Interface Description
{
//Initializes the buffer.
memset(pRGB48Buf, 0, i32Width * i32Height * 3 * 2 * sizeof(BYTE));
}
return ;
}
if (pRGB48Buf != NULL)
{
delete []pRGB48Buf;
pRGB48Buf = NULL;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 268
8.Image Processing Interface Description
8.4.19. DxRaw8toARGB32
Declarations:
VxInt32 DHDECL DxRaw8toARGB32 (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, int nStride,
DX_BAYER_CONVERT_TYPE cvtype,
DX_PIXEL_COLOR_FILTER nBayerType,
bool bFlip, VxUint8 nAlpha)
Descriptions:
The function is used to convert raw 8 bits image to ARGB 32 bits image data.
Parameters:
pInputBuffer The data buffer of original image.
pOutputBuffer The data buffer of target image, and the size is image width * image height * 4.
nWidth The width of the image.
nHeight The height of the image.
nStride The scan width.
cvtype The conversion algorithm type.
nBayerType The type of Bayer image format.
bFlip If flip, the value is true, and the image will vertical flip; otherwise, the value is
false, not flip.
nAlpha The value of channal Alpha, which ranges from 0 to 255
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 1600;
int32_t i32Height = 1234;
//Outputs ARGB image data.
BYTE *pARGB32Buf = new BYTE [i32Width * i32Height * 4];
if (pARGB32Buf == NULL)
{
return ;
}
else
{
//Initializes the buffer.
memset(pARGB32Buf, 0, i32Width * i32Height * sizeof(BYTE));
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 269
8.Image Processing Interface Description
return ;
}
if (pARGB32Buf!= NULL)
{
delete []pARGB32Buf;
pARGB32Buf = NULL;
}
8.4.20. DxGetContrastLut
Declarations:
VxInt32 DHDECL DxGetContrastLut (int nContrastParam, void *pContrastLut, int *pLutLength);
Descriptions:
This function is used to calculate the contrast look-up table for the input of image quality promotion
function, and only 24 bits RGB images are supported.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 270
8.Image Processing Interface Description
Parameters:
nContrastParam The parameter of contrast adjustment. You can get it by the
GX_INT_CONTRAST_PARAM code of the GxIAPI library.
pContrastLut Contrast look-up table.
pLutLength The length of contrast look-up table, unit: byte;
If the length value inputted by the user less than the current actual length value, it will return errors,
and the pLutLength returns the actual length value.
If the pContrastLut inputted by the user is NULL, it returns success, the pLutLength returns the actual
length value.
If the operation succeeds, the pLutLength returns the actual length value.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int64_t i64ContrastParam = 0;
if (bIsImplemented)
{
//Gets the contrast adjustment parameter.
emStatus = GXGetInt (hDevice, GX_INT_CONTRAST_PARAM, &i64ContrastParam);
if (emStatus != GX_STATUS_SUCCESS)
{
return;
}
}
else
{
i64ContrastParam = 0;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 271
8.Image Processing Interface Description
//Image processing.
//………………………
if (pContrastLut!= NULL)
{
delete []pContrastLut;
pContrastLut= NULL;
}
8.4.21. DxGetGammatLut
Declarations:
VxInt32 DHDECL DxGetGammatLut (double dGammaParam, void *pGammaLut, int *pLutLength);
Descriptions:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 272
8.Image Processing Interface Description
This function is used to calculate the Gamma look-up table for the input of image quality promotion
function, and only 24 bits RGB images are supported.
Parameters:
dGammaParam The parameter of Gamma adjustment. You can get it by the
GX_FLOAT_GAMMA_PARAM code of the GxIAPI library.
pGammaLut Gamma look-up table.
pLutLength The length of Gamma look-up table, unit: byte;
If the length value inputted by the user less than the current actual length value, it will return errors, and
the pLutLength returns the actual length value.
If the pGammaLut inputted by the user is NULL, it returns success, the pLutLength returns the actual
length value.
If the operation succeeds, the pLutLength returns the actual length value.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32LutLength = 0;
double dGammaParam = 0.0;
//Determines whether the current camera supports Gamma capture.
bool bIsImplemented = false;
GX_STATUS emStatus = GXIsImplemented(hDevice, GX_FLOAT_GAMMA_PARAM,
&bIsImplemented);
if (emStatus != GX_STATUS_SUCCESS)
{
return;
}
if (bIsImplemented)
{
//Gets the Gamma adjustment parameter.
emStatus = GXGetFloat (hDevice, GX_FLOAT_GAMMA_PARAM, &dGammaParam);
if (emStatus != GX_STATUS_SUCCESS)
{
return;
}
}
else
{
dGammaParam = 1;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 273
8.Image Processing Interface Description
return;
}
//Image processing
// ………………………
if (pGammaLut!= NULL)
{
delete []pGammaLut;
pGammaLut= NULL;
}
8.4.22. DxImageImprovment
Declarations:
VxInt32 DHDECL DxImageImprovment (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, VxInt64 nColorCorrectionParam, void
*pContrastLut, void *pGammaLut);
Descriptions:
This function is used for the image quality promotion of the input images, and only 24bitRGB images
are supported.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 274
8.Image Processing Interface Description
Parameters:
pInputBuffer The data buffer of original image.
pOutputBuffer The data buffer of target image.
nWidth The width of the image.
nHeight The height of the image.
nColorCorrectionParam The color correction value and can be get by the
GX_INT_COLOR_CORRECTION_PARAM code in the GxIAPI library, and
also it can be set to 0.
pContrastLut The contrast look-up table, which can be calculated by DxGetContrastLut
function, is only calculated once, and can be set to NULL.
pGammaLut The Gamma look-up table, which can be calculated by DxGetGammatLut
function, is only calculated once, and can be set to NULL.
nColorCorrectionParam, pContrastLut, pGammaLut, different combinations can be carried out to achieve
different effects. The combination is shown in Table 8-1:
NO. nColorCorrectionParam pContrastLut pGammaLut Effect
Color correction, contrast, Gamma
1 ≠ 0 ≠ NULL ≠ NULL adjustment (At this point, the image
quality is the best)
Table 8-1
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Gets the contrast adjustment parameter value.
VxInt32 DxStatus = DX_OK;
int32_t i32Width = 1600;
int32_t i32Height = 1234;
int64_t i64ContrastParam = 0;
int64_t i64ColorCorrectionParam = 0;
int32_t i32LutLength = 0;
double dGammaParam = 0.0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 275
8.Image Processing Interface Description
BYTE* pGammaLut;
BYTE* pContrastLut;
GX_STATUS emStatus = GXGetInt (hDevice, GX_INT_CONTRAST_PARAM,
& i64ContrastParam);
if (emStatus != GX_STATUS_SUCCESS)
{
return;
}
do
{
//Gets the length of the Gamma look-up table.
DxStatus= DxGetGammaLut(dGammaParam, NULL, &i32LutLength);
if (DxStatus != DX_OK)
{
break;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 276
8.Image Processing Interface Description
DxStatus = DX_NOT_ENOUGH_SYSTEM_MEMORY;
break;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 277
8.Image Processing Interface Description
{
if (pGammaLut != NULL)
{
delete[] m_pGammaLut;
pGammaLut = NULL;
}
if (pContrastLut != NULL)
{
delete[] pContrastLut;
pContrastLut = NULL;
}
return;
}
if (pGammaLut!= NULL)
{
delete []pGammaLut;
pGammaLut = NULL;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 278
8.Image Processing Interface Description
if (pContrastLut!= NULL)
{
delete []pContrastLut;
pContrastLut = NULL;
}
Effect images:
Figure 8-12 shows an image with no quality promotion. Figure 8-13 shows the image after quality
promotion.
8.4.23. DxARGBImageImprovment
Declarations:
VxInt32 DHDECL DxARGBImageImprovment (void *pInputBuffer, void *pOutputBuffer,
VxUint32 nWidth, VxUint32 nHeight,
VxInt64 nColorCorrectionParam, void *pContrastLut,
void *pGammaLut);
Descriptions:
This function is used for the image quality promotion of the input images, and only ARGB images are
supported.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 279
8.Image Processing Interface Description
Parameters:
pInputBuffer The data buffer of original image.
pOutputBuffer The data buffer of target image.
nWidth The width of the image.
nHeight The height of the image.
nColorCorrectionParam The color correction value and can be get by the
GX_INT_COLOR_CORRECTION_PARAM code in the GxIAPI library, and
also it can be set to 0.
pContrastLut The contrast look-up table, which can be calculated by DxGetContrastLut
function, is only calculated once, and can be set to NULL.
pGammaLut The Gamma look-up table, which can be calculated by DxGetGammatLut
function, is only calculated once, and can be set to NULL.
In addition, nColorCorrectionParam, pContrastLut, pGammaLut, different combinations can be carried out
to achieve different effects. The combination is shown in Figure 8-2:
Table 8-2
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
VxInt32 DxStatus = DX_OK;
int32_t i32Width = 1600;
int32_t i32Height = 1234;
int64_t i64ContrastParam = 0;
int64_t i64ColorCorrectionParam = 0;
int32_t i32LutLength = 0;
double dGammaParam = 0.0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 280
8.Image Processing Interface Description
BYTE* pGammaLut;
BYTE* pContrastLut;
// Get the contrast adjustment parameter value.
GX_STATUS emStatus = GXGetInt (hDevice, GX_INT_CONTRAST_PARAM,
&i64ContrastParam);
if (emStatus != GX_STATUS_SUCCESS)
{
return;
}
do
{
//Get the length of the Gamma look-up table.
VxInt32 DxStatus = DxGetGammaLut (dGammaParam, NULL, &i32LutLength);
if (DxStatus != DX_OK)
{
break;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 281
8.Image Processing Interface Description
{
DxStatus = DX_NOT_ENOUGH_SYSTEM_MEMORY;
break;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 282
8.Image Processing Interface Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 283
8.Image Processing Interface Description
if (pContrastLut!= NULL)
{
delete []pContrastLut;
pContrastLut = NULL;
}
8.4.24. DxImageImprovmentEx
Declarations:
VxInt32 DHDECL DxImageImprovmentEx (void *pInputBuffer, void *pOutputBuffer, VxUint32 nWidth,
VxUint32 nHeight, VxInt64 nColorCorrectionParam,
void *pContrastLut, void *pGammaLut,
DX_RGB_CHANNEL_ORDER emChannelOrder);
Descriptions:
This function is used for the image quality promotion of the input images, and only 24bitRGB images
are supported.
Parameters:
pInputBuffer The data buffer of original image.
pOutputBuffer The data buffer of target image.
nWidth The width of the image.
nHeight The height of the image.
nColorCorrectionParam The color correction value and can be get by the
GX_INT_COLOR_CORRECTION_PARAM code in the GxIAPI library, and
also it can be set to 0.
pContrastLut The contrast look-up table, which can be calculated by DxGetContrastLut
function, is only calculated once, and can be set to NULL.
pGammaLut The Gamma look-up table, which can be calculated by DxGetGammatLut
function, is only calculated once, and can be set to NULL.
emChannelOrder RGB channel order of output image.
In addition, nColorCorrectionParam, pContrastLut, pGammaLut, different combinations can be carried out
to achieve different effects. The combination is shown in Table 8-3:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 284
8.Image Processing Interface Description
Table 8-3
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
VxInt32 DxStatus = DX_OK;
int32_t i32Width = 1600;
int32_t i32Height = 1234;
int64_t i64ContrastParam = 0;
int64_t i64ColorCorrectionParam = 0;
int32_t i32LutLength = 0;
double dGammaParam = 0.0;
BYTE* pGammaLut;
BYTE* pContrastLut;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 285
8.Image Processing Interface Description
do
{
//Get the length of the Gamma look-up table.
DxStatus= DxGetGammaLut(dGammaParam, NULL, &i32LutLength);
if (DxStatus != DX_OK)
{
break;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 286
8.Image Processing Interface Description
break;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 287
8.Image Processing Interface Description
if (pGammaLut!= NULL)
{
delete []pGammaLut;
pGammaLut = NULL;
}
if (pContrastLut!= NULL)
{
delete []pContrastLut;
pContrastLut = NULL;
}
8.4.25. DxImageMirror
Declarations:
VxInt32 DHDECLDxImageMirror (void *pInputBuffer, void *pOutputBuffer,
VxUint32 nWidth, VxUint32 nHeight,
DX_IMAGE_MIRROR_MODE emMirrorMode)
Descriptions:
This function is used to generate a mirror image of the original image in the horizontal or vertical direction,
and the input image is 8 bits raw image or 8 bits monochrome image.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 288
8.Image Processing Interface Description
Parameters:
pInputBuffer The data buffer of original image.
pOutputBuffer The data buffer of target image.
nWidth The width of the image.
nHeight The height of the image.
emMirrorMode The mode of image mirror, HORIZONTAL_MIRROR and VERTICAL_MIRROR,
that is horizontal mirror flip and vertical mirror flip.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 1600;
int32_t i32Height = 1234;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 289
8.Image Processing Interface Description
i32Height, VERTICAL_MIRROR);
if (DxStatus != DX_OK)
{
return ;
}
Effect images:
Figure 8-14 shows an 8 bits monochrome image. Figure 8-15 shows the image after horizontal flip.
Figure 8-15: The image after horizontal flip shows the image after vertical flip.
8.4.26. DxImageMirror16B
Declarations:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 290
8.Image Processing Interface Description
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 291
8.Image Processing Interface Description
}
//Image vertical mirror flipping (input and output cannot be the
//same buffer)
//pIn16BitBuf is input image data
DxStatus = DxImageMirror16B((BYTE*)pIn16BitBuf, (BYTE*)pOut16BitBuf,
i32Width, i32Height, VERTICAL_MIRROR);
if (DxStatus != DX_OK)
{
return ;
}
8.4.27. DxGetLut
Declarations:
VxInt32 DHDECL DxGetLut (VxInt32 nContrastParam, double dGamma, VxInt32 nLightness,
VxUint8 *pLut, VxUint16 *pLutLength);
Descriptions:
The function is used to calculate the 8bit look-up table of image processing.
Parameters:
nContrastParam The parameter of contrast adjustment. Range: -50~100
nGamma The parameter of Gamma adjustment. Range: 0.1~10
nLightness The parameter of lightness adjustment. Range: -150~150
pLut Look-up table. If the contrast, Gamma or lightness parameters change, it
needs to be recalculated.
pLutLength The length of look-up table, unit: byte.
If the length value inputted by the user not equal to the current actual length value, it will return errors,
and the pLutLength returns the actual length value.
If the pLut inputted by the user is NULL, it returns success, the pLutLength returns the actual length
value.
If the operation succeeds, the pLutLength returns the actual length value.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
VxInt32 i32ContrastParam = 0;
VxUint16 ui16LutLength = 0;
int32_t i32Lightness = 0;
double dGamma = 0.0;
//Gets the length of the look-up table.
VxInt32 DxStatus = DxGetLut (i32ContrastParam, dGamma, i32Lightness,
NULL, &ui16LutLength);
if (DxStatus != DX_OK)
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 292
8.Image Processing Interface Description
{
return;
}
//Image processing.
//………………………
if (pLut!= NULL)
{
delete []pLut;
pLut = NULL;
}
8.4.28. DxCalcCCParam
Declarations:
VxInt32 DHDECL DxCalcCCParam (VxInt64 nColorCorrectionParam, VxInt16nSaturation,
VxInt16 *parrCC, VxUint8nLength);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 293
8.Image Processing Interface Description
Descriptions:
The function is used to calculate the array of image color correction.
Parameters:
nColorCorrectionParam The color correction value, you can get it by the
GX_INT_COLOR_CORRECTION_PARAM code of the GxIAPI library,
and you can also set it to 0.
nSaturation The parameter of saturation adjustment, range: 0~128
parrCC The address of the array.
nLength The length of array (sizeof (VxInt16 * 9)).
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
//Applies memory for the image color adjustment array .
VxInt64 nColorCorrectionParam = 0;
VxInt16 nSaturation = 0;
VxInt16* parrCC = new VxInt16[sizeof (VxInt16) * 9];
if (parrCC== NULL)
{
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 294
8.Image Processing Interface Description
//Image processing.
//………………………
if (parrCC!= NULL)
{
delete []parrCC;
parrCC= NULL;
}
8.4.29. DxRaw8ImgProcess
Declarations:
VxInt32 DHDECL DxRaw8ImgProcess (void *pRaw8Buf, void *pRgbBuf, VxInt32 nWidth,
VxInt32 nHeight,
COLOR_IMG_PROCESS *pstClrImageProc);
Descriptions:
The function is used to process the raw 8bit image.
Parameters:
pRaw8Buf Point to the original image 8-bit data buffer.
pRgbBuf Point to the target image data buffer (RGB data), the size is image width *image
height*3.
nWidth The width of the image.
nHeight The height of the image.
Note: If the current COLOR_IMG_PROCESS:: bAccelerate is set to true, to speed up, the nHeight
must be the integer multiple of 4.
pstClrImageProc The structure pointer of color image processing method, and the define as follows:
typedef struct COLOR_IMG_PROCESS
{
bool bDefectivePixelCorrect; /// The switch of bad pixel correction.
bool bDenoise; /// The switch of denoise.
bool bSharpness; /// The switch of sharpness.
bool bAccelerate; /// The switch of acceleration.
VxInt16 *parrCC; /// The array address of color processing
parameter.
VxUint8 nCCBufLength; /// The length of parrCC (sizeof (VInt16)*9).
float fSharpFactor; /// The factor of sharpness.
VxUint8 *pProLut; /// The buffer of look-up table.
VxUint16 nLutLength; /// The length of look-up table.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 295
8.Image Processing Interface Description
stClrImageProc.bAccelerate= false;
stClrImageProc.bDefectivePixelCorrect= false;
stClrImageProc.bDenoise= false;
stClrImageProc.bFlip= true;
stClrImageProc.bSharpness = false;
stClrImageProc.fSharpFactor= fSharpen;
stClrImageProc.cvType= RAW2RGB_NEIGHBOUR;
stClrImageProc.emLayOut= (DX_PIXEL_COLOR_FILTER)nPixelColorFilter;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 296
8.Image Processing Interface Description
if (DxStatus != DX_OK)
{
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 297
8.Image Processing Interface Description
return;
}
if (stClrImageProc.parrCC!= NULL)
{
delete []stClrImageProc.parrCC;
stClrImageProc.parrCC= NULL;
}
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 298
8.Image Processing Interface Description
if (stClrImageProc.pProLut!= NULL)
{
delete []stClrImageProc.pProLut;
stClrImageProc.pProLut = NULL;
}
if (stClrImageProc.parrCC!= NULL)
{
delete []stClrImageProc.parrCC;
stClrImageProc.parrCC= NULL;
}
8.4.30. DxMono8ImgProcess
Declarations:
VxInt32 DHDECL DxMono8ImgProcess(void *pInputBuf, void *pOutputBuf,
VxUint32 nWidth, VxUint32 nHeight,
MONO_IMG_PROCESS *pstGrayImgProc);
Descriptions:
The function is used to process the mono 8bit image.
Parameters:
pInputBuf Point to the 8-bit data buffer of original image.
pOutputBuf Point to the data buffer of target image, the size is image width * image height
nWidth The width of the image.
nHeight The height of the image.
Note: If the current MONO_IMG_PROCESS:: bAccelerate is set to true, to speed up, the nHeight must
be the integer multiple of 4.
pstGrayImgProc The structure pointer of mono image processing method, and the define as follows:
Typedef struct MONO_IMG_PROCESS
{
bool bDefectivePixelCorrect; /// The switch of bad pixel correction.
bool bSharpness; /// The switch of sharpness.
bool bAccelerate; /// The switch of acceleration.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 299
8.Image Processing Interface Description
stGrayImageProc.bAccelerate= false;
stGrayImageProc.bDefectivePixelCorrect= false;
stGrayImageProc.bSharpness = false;
stGrayImageProc.fSharpFactor= fSharpen;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 300
8.Image Processing Interface Description
{
return;
}
if (stGrayImageProc.pProLut!= NULL)
{
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 301
8.Image Processing Interface Description
delete []stGrayImageProc.pProLut;
stGrayImageProc.pProLut = NULL;
}
8.4.31. DxGetFFCCoefficients
Declarations:
VxInt32 DHDECL DxGetFFCCoefficients
(FLAT_FIELD_CORRECTION_PROCESS stFlatFieldCorrection,
void *pFFCCoefficients, int *pnLength,
int *pnTargetValue = NULL);
Descriptions:
This function is used to calculate the flat field correction coefficients, and only the Raw images between
the bits of 8 and 12 are supported.
Parameters:
nContrastParam The flat field correction process structure.
pFFCCoefficients The flat field correction coefficients.
pnlength The length of flat field correction coefficients, and its unit is byte.
pnTargetValue The target value of flat field correction processing, and the default is NULL.
If the length value inputted by the user less than the current actual length value, it will return errors, and
the pnLength returns the actual length value.
If the pFFCCoefficients inputted by the user is NULL, it returns success, the pnLength returns the actual
length value.
If the operation succeeds, the pnLength returns the actual length value.
The definition of the flat field correction process structure is as follows:
typedef struct FLAT_FIELD_CORRECTION_PROCESS
{
void *pBrightBuf; ///< Bright image buffer
void *pDarkBuf; ///< Dark image buffer
VxUint32 nImgWid; ///< Image width
VxUint32 nImgHei; ///< Image height
DX_ACTUAL_BITS nActualBits; ///< Image actual bits
DX_PIXEL_COLOR_FILTER emBayerType; ///< BAYER format
} FLAT_FIELD_CORRECTION_PROCESS;
Note: When calculating the flat field correction coefficient, the dark field image may not be acquired,
then the pointer to the dark field image should be set to NULL.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 302
8.Image Processing Interface Description
Sample Code:
int32_t i32Width = 1600;
int32_t i32Height = 1234;
int32_t i32FFClength = 0;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 303
8.Image Processing Interface Description
if (DxStatus != DX_OK)
{
if (pFFCCoefficients!= NULL)
{
delete []pFFCCoefficients;
pFFCCoefficients = NULL;
}
return;
}
//Image processing
//… … …… … … …… …
if (pFFCCoefficients!= NULL)
{
delete []pFFCCoefficients;
pFFCCoefficients = NULL;
}
8.4.32. DxFlatFieldCorrection
Declarations:
VxInt32 DHDECL DxFlatFieldCorrection (void *pImgBuf, DX_ACTUAL_BITS nActualBits,
VxUint32 nImgWidth, VxUint32 nImgHeight,
void *pFFCCoefficients, int *pnLength);
Descriptions:
This function performs the flat field correction operation on the images whose bits are between 8 and
12. Besides, the function supports raw images in Bayer format, and does not support the raw image of
Packet format.
Parameters:
pInputBuffer Point to the data buffer of the original image.
pOutputBuffer Point to the data buffer of the target image.
nActualBits The image actual bits.
nImgWidth The image width.
nImgHeight The image height.
pFFCCoefficients The flat field correction coefficients.
pnLength The length of flat field correction coefficients, and its unit is byte.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Sample Code:
int32_t i32Width = 1600;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 304
8.Image Processing Interface Description
8.4.33. DxCalcUserSetCCParam
Declaration:
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 305
8.Image Processing Interface Description
stColorTransformFactor.fGain00 = 1.463680;
stColorTransformFactor.fGain01 = -0.545809;
stColorTransformFactor.fGain02 = 0.082128;
stColorTransformFactor.fGain10 = -0.229388;
stColorTransformFactor.fGain11 = 1.354321;
stColorTransformFactor.fGain12 = -0.124932;
stColorTransformFactor.fGain20 = 0.097042;
stColorTransformFactor.fGain21 = -0.627857;
stColorTransformFactor.fGain22 = 1.530815;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 306
8.Image Processing Interface Description
//Image processing.
//………………………
if (parrCC!= NULL)
{
delete []parrCC;
parrCC= NULL;
}
8.4.34. DxImageFormatConvert
Declaration:
VxInt32 DHDECL DxImageFormatConvert (DX_IMAGE_FORMAT_CONVERT_HANDLE handle,
void *pInputBuffer, int nInBufferSize,
void *pOutputBuffer, int nOutBufferSize,
GX_PIXEL_FORMAT_ENTRY emInPixelFormat,
VxUint32 nImgWidth, VxUint32 nImgHeight,
bool bFlip);
Descriptions:
The function is used to execute image format conversion.
Formal parameter:
handle Image Format Conversion handle, it cannot be NULL
pInputBuffer Input Buffer Supposed unsigned char type
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 307
8.Image Processing Interface Description
GX_PIXEL_FORMAT_BAYER_RG8 GX_PIXEL_FORMAT_RGBA8
Bayer
8bit GX_PIXEL_FORMAT_BAYER_GB8 GX_PIXEL_FORMAT_BGRA8
GX_PIXEL_FORMAT_BAYER_BG8 GX_PIXEL_FORMAT_ARGB8
GX_PIXEL_FORMAT_ABGR8
GX_PIXEL_FORMAT_RGB8_PLANAR
GX_PIXEL_FORMAT_BAYER_GR10
GX_PIXEL_FORMAT_BAYER_RG10
GX_PIXEL_FORMAT_BAYER_GB10
GX_PIXEL_FORMAT_BAYER_BG10 GX_PIXEL_FORMAT_MONO16
GX_PIXEL_FORMAT_BAYER_GR12 GX_PIXEL_FORMAT_RGB16
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 308
8.Image Processing Interface Description
GX_PIXEL_FORMAT_YUV444_8
GX_PIXEL_FORMAT_YUV422_8
GX_PIXEL_FORMAT_YUV411_8
GX_PIXEL_FORMAT_YUV420_8_PLAN
GX_PIXEL_FORMAT_RGB8 AR
RGB
8bit GX_PIXEL_FORMAT_BGR8 GX_PIXEL_FORMAT_YCBCR444_8
GX_PIXEL_FORMAT_YCBCR422_8
GX_PIXEL_FORMAT_YCBCR411_8
GX_PIXEL_FORMAT_MONO8
GX_PIXEL_FORMAT_RGB8
RGB GX_PIXEL_FORMAT_RGB16
GX_PIXEL_FORMAT_MONO16
16bit GX_PIXEL_FORMAT_BGR16
GX_PIXEL_FORMAT_COORD3D_ABC3
COOR 2F
D3D_C GX_PIXEL_FORMAT_COORD3D_C16
16 GX_PIXEL_FORMAT_COORD3D_ABC3
2F_PLANAR
GX_PIXEL_FORMAT_MONO8
GX_PIXEL_FORMAT_MONO10_PACKED GX_PIXEL_FORMAT_MONO10
GX_PIXEL_FORMAT_MONO12_PACKED GX_PIXEL_FORMAT_MONO12
Mono
Packed GX_PIXEL_FORMAT_MONO10_P GX_PIXEL_FORMAT_MONO14
(GVSP) GX_PIXEL_FORMAT_MONO12_P GX_PIXEL_FORMAT_MONO16
GX_PIXEL_FORMAT_MONO14_P GX_PIXEL_FORMAT_RGB8
GX_PIXEL_FORMAT_BGR8
GX_PIXEL_FORMAT_RGB8
GX_PIXEL_FORMAT_BAYER_GR10_PACKED
GX_PIXEL_FORMAT_BGR8
GX_PIXEL_FORMAT_BAYER_RG10_PACKED
GX_PIXEL_FORMAT_BAYER_GR8
GX_PIXEL_FORMAT_BAYER_GB10_PACKED
GX_PIXEL_FORMAT_BAYER_RG8
GX_PIXEL_FORMAT_BAYER_BG10_PACKED
GX_PIXEL_FORMAT_BAYER_GR12_PACKED GX_PIXEL_FORMAT_BAYER_GB8
GX_PIXEL_FORMAT_BAYER_RG12_PACKED
GX_PIXEL_FORMAT_BAYER_BG8
GX_PIXEL_FORMAT_BAYER_GB12_PACKED
GX_PIXEL_FORMAT_BAYER_BG12_PACKED GX_PIXEL_FORMAT_BAYER_GR10
Bayer GX_PIXEL_FORMAT_BAYER_GR10_P GX_PIXEL_FORMAT_BAYER_RG10
Packed GX_PIXEL_FORMAT_BAYER_RG10_P GX_PIXEL_FORMAT_BAYER_GB10
(GVSP) GX_PIXEL_FORMAT_BAYER_GB10_P GX_PIXEL_FORMAT_BAYER_BG10
GX_PIXEL_FORMAT_BAYER_BG10_P GX_PIXEL_FORMAT_BAYER_GR12
GX_PIXEL_FORMAT_BAYER_GR12_P GX_PIXEL_FORMAT_BAYER_RG12
GX_PIXEL_FORMAT_BAYER_RG12_P GX_PIXEL_FORMAT_BAYER_GB12
GX_PIXEL_FORMAT_BAYER_GB12_P GX_PIXEL_FORMAT_BAYER_BG12
GX_PIXEL_FORMAT_BAYER_BG12_P GX_PIXEL_FORMAT_BAYER_GR14
GX_PIXEL_FORMAT_BAYER_GR14_P GX_PIXEL_FORMAT_BAYER_RG14
GX_PIXEL_FORMAT_BAYER_RG14_P GX_PIXEL_FORMAT_BAYER_GB14
GX_PIXEL_FORMAT_BAYER_GB14_P GX_PIXEL_FORMAT_BAYER_BG14
GX_PIXEL_FORMAT_BAYER_BG14_P GX_PIXEL_FORMAT_BAYER_GR16
GX_PIXEL_FORMAT_BAYER_RG16
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 309
8.Image Processing Interface Description
GX_PIXEL_FORMAT_BAYER_GB16
GX_PIXEL_FORMAT_BAYER_BG16
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Declaration handle for Image format conversion.
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
//Create handle.
DxImageFormatConvertCreate(&handle);
if (handle == NULL)
{
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 310
8.Image Processing Interface Description
handle = NULL;
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 311
8.Image Processing Interface Description
delete pszBufferIn;
pszBufferIn = NULL;
return;
}
DxImageFormatConvertDestroy(handle);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 312
8.Image Processing Interface Description
handle = NULL;
8.4.35. DxImageFormatConvertCreate
Declaration:
VxInt32 DHDECL DxImageFormatConvertCreate (DX_IMAGE_FORMAT_CONVERT_HANDLE
*phandle);
Descriptions:
The function is used to create handle for image format conversion.
Formal parameter:
phandle The handle for image format conversion
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Declaration handle for Image format conversion.
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
//Create handle.
DxStatus = (DX_STATUS)DxImageFormatConvertCreate(&handle);
8.4.36. DxImageFormatConvertDestroy
Declaration:
VxInt32 DHDECL DxImageFormatConvertDestroy (DX_IMAGE_FORMAT_CONVERT_HANDLE
handle);
Descriptions:
The function is used to destroy the handle.
Formal parameter:
handle The handle for image format conversion
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Declaration handle for Image format conversion .
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
//Create handle.
emDxStatus = (DX_STATUS)DxImageFormatConvertCreate(&handle);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 313
8.Image Processing Interface Description
if (handle == NULL)
{
return;
}
//Destroy handle.
emDxStatus = (DX_STATUS)DxImageFormatConvertDestroy(handle);
8.4.37. DxImageFormatConvertSetOutputPixelFormat
Declaration:
VxInt32 DHDECL DxImageFormatConvertSetOutputPixelFormat(
DX_IMAGE_FORMAT_CONVERT_HANDLE handle
GX_PIXEL_FORMAT_ENTRY emPixelFormat);
Descriptions:
The function is used to set Output pixel format.
Formal parameter:
handle The handle for image format conversion
emPixelFormat Output format refered to GX_PIXEL_FORMAT_ENTRY
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Declaration The handle for image format conversion.
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
//Create handle.
DxImageFormatConvertCreate(&handle);
if (handle == NULL)
{
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 314
8.Image Processing Interface Description
if (emDxStatus != DX_OK)
{
DxImageFormatConvertDestroy(handle);
handle = NULL;
return;
}
//Other operation.
//………………………
DxImageFormatConvertDestroy(handle);
handle = NULL;
8.4.38. DxImageFormatConvertSetAlphaValue
Declaration:
VxInt32 DHDECL DxImageFormatConvertSetAlphaValue (
DX_IMAGE_FORMAT_CONVERT_HANDLE handle
VxUint8 nAlphaValue);
Descriptions:
The function is used to set alpha value.
Formal parameter:
handle The handle for image format conversion
nAlphaValue The alpha value for pixel format with alpha channel,if not set, the value is 255.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Declaration the handle for image format conversion
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
//Create handle.
DxImageFormatConvertCreate(&handle);
if (handle == NULL)
{
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 315
8.Image Processing Interface Description
//Other operation.
//………………………
DxImageFormatConvertDestroy(handle);
handle = NULL;
8.4.39. DxImageFormatConvertSetInterpolationType
Declaration:
VxInt32 DHDECL DxImageFormatConvertSetInterpolationType (
DX_IMAGE_FORMAT_CONVERT_HANDLE handle
DX_BAYER_CONVERT_TYPE emCvtType);
Descriptions:
The function is used to set interpolation type to make bayer to RGB type.
Formal parameter:
handle The handle for image format conversion
emCvtType The interpolation type to make bayer to RGB type, if not set, the value is
RAW2RGB_NEIGHBOUR
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Declaration The handle for image format conversion.
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 316
8.Image Processing Interface Description
//Create handle.
DxImageFormatConvertCreate(&handle);
if (handle == NULL)
{
return;
}
//Other operation.
//………………………
DxImageFormatConvertDestroy(handle);
handle = NULL;
8.4.40. DxImageFormatConvertGetBufferSizeForConversion
Declaration:
VxInt32 DHDECL DxImageFormatConvertGetBufferSizeForConversion (
DX_IMAGE_FORMAT_CONVERT_HANDLE handle,
GX_PIXEL_FORMAT_ENTRY emPixelFormat,
VxUint32 nImgWidth, VxUint32 nImgHeight,
int *pBufferSize);
Descriptions:
The function is used to get buffer size according to image width, image height and pixel format.
Formal parameter:
handle The handle for image format conversion
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 317
8.Image Processing Interface Description
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//DeclarationThe handle for image format conversion.
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
//Create handle.
DxImageFormatConvertCreate(&handle);
if (handle == NULL)
{
return;
}
int nBufferSize = 0;
int nWidth = 720;
int nHeight = 540;
GX_PIXEL_FORMAT_ENTRY emPixelFormat = GX_PIXEL_FORMAT_MONO8;
//………………………
DxImageFormatConvertDestroy(handle);
handle = NULL;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 318
8.Image Processing Interface Description
8.4.41. DxImageFormatConvertGetOutputPixelFormat
Declaration:
VxInt32 DHDECL DxImageFormatConvertGetOutputPixelFormat (
DX_IMAGE_FORMAT_CONVERT_HANDLE handle,
GX_PIXEL_FORMAT_ENTRY *pemPixelFormat);
Descriptions:
The function is used to get Output pixel format.
Formal parameter:
handle The handle for image format conversion
pemPixelFormat Output format
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//DeclarationThe handle for image format conversion .
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
//Create handle.
DxImageFormatConvertCreate(&handle);
if (handle == NULL)
{
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 319
8.Image Processing Interface Description
//Other operation.
//………………………
DxImageFormatConvertDestroy(handle);
handle = NULL;
8.4.42. DxImageFormatConvertSetValidBits
Declaration:
VxInt32 DHDECL DxImageFormatConvertSetValidBits(
DX_IMAGE_FORMAT_CONVERT_HANDLE handle,
DX_VALID_BIT emValidBits);
Descriptions:
This function sets the number of significant digits for users when converting 10, 12, 14, and 16 bit depth
data to 8 bit. The default is the low 8 bit.
Formal parameter:
handle Image format conversion handle
emValidBits Significant digits, low 8 bits by default.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Declare image format conversion handle
DX_IMAGE_FORMAT_CONVERT_HANDLE handle;
DX_STATUS emDxStatus = DX_OK;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 320
8.Image Processing Interface Description
{
DxImageFormatConvertDestroy(handle);
handle = NULL;
return;
}
//Other operations
//………………………
DxImageFormatConvertDestroy(handle);
handle = NULL;
8.4.43. DxImageFormatConvertSet3DcalibParam
Declaration:
VxInt32 DHDECL DxImageFormatConvertSet3DCalibParam(
DX_IMAGE_FORMAT_CONVERT_HANDLE handle,
const void* pCalibParamBuffer, const int nBufferSize);
Descriptions:
This function is used to load 3D calibration parameters to the conversion handle, in order to call the
image format conversion interface to convert the height map into a point cloud map.
Formal parameter:
handle Image format conversion handle
pCalibParamBuffer 3D calibration parameter memory
nBufferSize 3D calibration parameter memory length
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
#include <iostream>
#include <fstream>
//Define tool function: Read buffer from bin file
DX_STATUS LoadCalibFile(const char* strFileName,
char*&pBuffer, int& nBufferLen)
{
if (!file)
{
return DX_FILE_OPEN_FAIL;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 321
8.Image Processing Interface Description
nBufferLen = fileSize;
GX_PIXEL_FORMAT_ENTRY emOutPixelFormat =
GX_PIXEL_FORMAT_COORD3D_ABC32F;
GX_PIXEL_FORMAT_ENTRY emInPixelFormat =
GX_PIXEL_FORMAT_COORD3D_C16;
int nBufferSizeIn = 0;
int nBufferSizeOut = 0;
int nWidth = 720;
int nHeight = 540;
unsigned char* pszBufferIn = NULL;
unsigned char* pszBufferOut = NULL;
bool bFlip = false;
DX_STATUS emDxStatus = DX_OK;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 322
8.Image Processing Interface Description
emDxStatus = (DX_STATUS)DxImageFormatConvertSet3DCalibParam (
handle,
pBuffer,
nBu ffe rL en );
if(NULL!=pBuffer)
{
delete[] pBuffer;
pBuffer=NULL;
}
if (emDxStatus != DX_OK)
{
DxImageFormatConvertDestroy(handle);
handle = NULL;
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 323
8.Image Processing Interface Description
//Apply memories
pszBufferIn = new unsigned char[nBufferSizeIn];
if (pszBufferIn == NULL)
{
DxImageFormatConvertDestroy(handle);
handle = NULL;
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 324
8.Image Processing Interface Description
delete pszBufferIn;
pszBufferIn = NULL;
return;
}
//Perform image format conversion
emDxStatus = (DX_STATUS) DxImageFormatConvert(handle, pszBufferIn,
nBufferSizeIn,
pszBufferOut,
nBufferSizeOut,
emInPixelFormat,
nWidth,
nHeight,
bFlip);
DxImageFormatConvertDestroy(handle);
handle = NULL;
8.4.44. DxImageFormatConvertSetYStep
Declaration:
VxInt32 DHDECL DxImageFormatConvertSetYStep(
DX_IMAGE_FORMAT_CONVERT_HANDLE handle,
const double dY);
Descriptions:
This function sets the Y-direction step size for converting the height map to a point cloud.
Formal parameter:
handle Image format conversion handle
dY Step size in Y direction
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 325
8.Image Processing Interface Description
Code Sample:
See DxImageFormatConvertSet3DCalibParam section.
8.4.45. DxStaticDefectCorrection
Declaration:
VxInt32 DHDECL DxStaticDefectCorrection(void *pInputBuffer, void *pOutputBuffer,
STATIC_DEFECT_CORRECTION stDefectCorrection,
void* pDefectPosBuffer, VxUint32 nDefectPosBufferSize);
Descriptions:
The function is used to realize the static defect correction.
Formal parameter:
pInputBuffer The data buffer of original image
pOutputBuffer The data buffer of target image
stDefectCorrection The image parameters for defect correction, refer to section 8.3.5
pDefectPosBuffer The data buffer of defect position
nDefectPosBufferSize The data buffer size of defect position
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
//Initializes the parameters of the defect correction data structure.
STATIC_DEFECT_CORRECTION stDefectCorrection;
stDefectCorrection.nImgWidth = nImgWidth;
stDefectCorrection.nImgHeight = nImgHeight;
stDefectCorrection.nImgOffsetX = nImgOffsetX;
stDefectCorrection.nImgOffsetY = nImgOffsetY;
stDefectCorrection.nImgWidthMax = nImgWidthMax;
stDefectCorrection.nBayerType = BAYERRG;
stDefectCorrection.emActualBits= DX_ACTUAL_BITS_8;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 326
8.Image Processing Interface Description
if(DxStatus != DX_OK)
{
return;
}
8.4.46. DxCalcCameraLutBuffer
Declaration:
VxInt32 DHDECL DxCalcCameraLutBuffer (VxInt32 nContrastParam, double dGamma,
VxUint32 *pnLutLength);
Descriptions:
This function is used to adjust the value of the camera lookup table by contrast, gamma, and brightness.
Formal parameter:
nContrastParam The parameter of Contrast adjustment, range of value: -50~100.
nGamma The parameter of Gamma adjustment, range of value: 0.1~10.
nLightness The parameter of Lightness adjustment, range of value: -150~150.
pLut Lookup table, calculate according to contrast, Gamma, or brightness parameters.
pLutLength The length of camera lookup table, unit: byte.
The length of camera lookup table is obtained through the GXGetBufferLength interface. Users apply
for memory based on the obtained length. If the lookup table pointer inputted by the user is NULL, an
error is returned.
Returns:
If success, returns DX_OK, otherwise, see the DX_STATUS definition.
Code Sample:
VxInt32 DxStatus= DX_OK;
VxInt32 nContrastParam = -20;
double dGamma = 1.0;
VxInt32 nLightness = -20;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 327
8.Image Processing Interface Description
//Set the contrast, Gamma and lightness value to adjust the lookup table value.
DxStatus = DxCalcCameraLutBuffer(nContrastParam,
dGamma,
nLightness,
pSetLutBuffer,
(VxUint32*)&nLutLength);
if(DxStatus!=DX_OK)
{
if(NULL != pSetLutBuffer)
{
delete []pSetLutBuffer;
pSetLutBuffer = NULL;
}
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 328
8.Image Processing Interface Description
return;
}
8.4.47. DxReadLutFile
Declaration:
VxInt32 DHDECL DxReadLutFile( const char *pchLutFilePath,
void *pLut,
VxUint32* pnLutLength);
Descriptions:
The function is to read the lookup table tool saved in the .lut file and parse the data into lookup table format
that can be set to the corresponding camera based on the camera lookup table length.
Formal parameter:
pchLutFilePath Lookup table file path.The lookup table file (xxx.lut) can get from the lookup
table plugin, and the path is:
GalaxyView->Menu Bar->Plugins->LUT Create Tool
pLut Lookup table, the parsed data from .lut file. needs a prior memory request
from the users, and the length is the requested pointer memory(nLutLength),
which can get via GXGetBufferLength interface:
GXGetBufferLength(hDevice, GX_BUFFER_LUT_VALUEALL,
&nLutLength)
pnLutLength Lookup table length in bytes, which can get via GXGetBufferLength:
GXGetBufferLength(hDevice, GX_BUFFER_LUT_VALUEALL,
&nLutLength)
Returns:
Returns DX_OK if successful, otherwise see the DX_STATUS related definition.
Code Sample:
VxInt32 DxStatus= DX_OK;
const char* pszchLutFilePath = “D:\\a.lut”.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 329
8.Image Processing Interface Description
//Set the contrast, gamma and brightness to adjust the lookup table value.
DxStatus = DxReadLutFile (pszLutFilePath,
pSetLutBuffer,
(VxUint32*)&nLutLength);
if(DxStatus!=DX_OK)
{
if(NULL != pSetLutBuffer)
{
delete[] pSetLutBuffer;
pSetLutBuffer = NULL;
}
return;
}
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 330
8.Image Processing Interface Description
8.4.48. DxSetSystem
Declaration:
VxInt32 DHDECL DxSetSystem(DX_SYSTEM_PARAM emSystemParam, int nValue)
Descriptions:
This function is used to set system parameters, such as the number of threads and whether SSSE3 is
enabled.
Formal parameter:
emSystemParam System parameter
nValue System parameter values
Returns:
Returns DX_OK if successful, otherwise see the DX_STATUS related definition.
Code Sample:
DX_SYSTEM_PARAM emSystemParam = THREAD_NUM;
int nValue = 6;
8.4.49. DxGetSystem
Declaration:
VxInt32 DHDECL DxGetSystem(DX_SYSTEM_PARAM emSystemParam, int *pnValue)
Descriptions:
This function is used to obtain system parameters, such as the number of threads, SSSE3 enable status,
and so on.
Formal parameter:
emSystemParam System parameter
pnValue System parameter values
Returns:
Returns DX_OK if successful, otherwise see the DX_STATUS related definition.
Code Sample:
DX_SYSTEM_PARAM emSystemParam = THREAD_NUM;
int nValue = 0;
//Get the number of threads
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 331
8.Image Processing Interface Description
8.5. Function
8.5.1. Image Quality Enhancement Function
This function can realize the color correction function, the contrast adjustment and the Gamma adjustment
function of any combination.
8.5.1.1. Related Functions
Color correction (Color transformation): Improves the color reduction of the camera to make the image
closer to human visual perception.
Color transformation mode: Sets the mode of the color transformation to be performed. 0: Set to the default
mode, the color correction factor uses the coefficient provided from factory; 1: Set to the user-defined
mode. The user can input the color correction factor according to the actual application. The user can
modify the value of this function during the acquisition.
Color transformation matrix value selection: Sets the value to be inputted in the color transformation matrix
to customize the color transformation. Note: Depending on the camera model, some values of the color
transformation matrix may be pre-set and cannot be changed. The user can modify the value of this
function during the acquisition.
Color transformation matrix value: Gets the value in the color transformation matrix, which is used to
customize the current value of color transformation.
The user expects that the camera can output the precision color, but the color world is a dynamic one,
everyone sees some difference in the color. Same to the sensor, different sensors have different
interpretations of color. But what is the precision color and who determine it? So, the user needs a color
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 332
8.Image Processing Interface Description
template. The color template contains 24 colors, and each color has fixed RGB value, as shown in Figure
8-17:
With this color template, the user can base on it to shoot the color template with a camera, the RGB value
of each color may be different from the standard RGB value of the color template, the vendor can use the
software or hardware to convert the RGB value that is read to the standard RGB value. Because the color
space is continuous, all the other RGB values read can be converted to the standard RGB values by using
the 24 colors.
Related Parameters
GX_ENUM_COLOR_TRANSFORMATION_MODE: The color transformation mode, refer to
GX_COLOR_TRANSFORMATION_MODE_ENTRY
GX_BOOL_COLOR_TRANSFORMATION_ENABLE: Color transformation enable
GX_ENUM_COLOR_TRANSFORMATION_VALUE_SELECTOR: The color transformation matrix value
selection, refer to
GX_COLOR_TRANSFORMATION_VALUE_
SELECTOR_ENTRY
GX_FLOAT_COLOR_TRANSFORMATION_VALUE: The color transformation matrix value
GX_INT_COLOR_CORRECTION_PARAM: The color correction parameter
Effect Images
Figure 8-18 Before color correction Figure 8-19 After color correction
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Enables color transformation.
emStatus = GXSetBool(hDevice, GX_BOOL_COLOR_TRANSFORMATION_ENABLE ,
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 333
8.Image Processing Interface Description
true);
Effect Images
Figure 8-20 Before contrast adjustment Figure 8-21 After contrast adjustment
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 334
8.Image Processing Interface Description
Related Parameters
GX_BOOL_GAMMA_ENABLE: Gamma enable
GX_ENUM_GAMMA_MODE: Gamma mode, refer to GX_GAMMA_MODE_ENTRY
GX_FLOAT_GAMMA: Gamma
GX_FLOAT_GAMMA_PARAM: Gamma parameter
Effect Images
Figure 8-22 Before Gamma adjustment Figure 8-23 After Gamma adjustment
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Enables Gamma.
emStatus = GXSetBool(hDevice, GX_BOOL_GAMMA_ENABLE, true);
8.5.1.5. Sharpen
Terms
Sharpen: Sharpening is to improve the definition of the image edges. The higher the definition, the clearer
the outline of the image.
Sharpness: Adjust the sharpness value to adjust the camera's sharpness to the image. The adjustment
range is 0-3.0. The larger the value, the higher the sharpness.
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 335
8.Image Processing Interface Description
Sharpen mode: Decide whether to enable the sharpening function. ON means that the sharpening function
is enabled; OFF means that the sharpening function is disabled.
Related Parameters
GX_FLOAT_SHARPNESS: Sharpness
GX_ENUM_SHARPNESS_MODE: Sharpen mode, refer to GX_SHARPNESS_MODE_ENTRY
Effect Images
Figure 8-24 Before sharpen adjustment Figure 8-25 After sharpen adjustment
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
//Enables sharpening.
GX_SHARPNESS_MODE_ENTRY emValue;
emValue = GX_SHARPNESS_MODE_ON;
emStatus = GXSetEnum(hDevice, GX_ENUM_SHARPNESS_MODE, emValue);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 336
8.Image Processing Interface Description
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 337
8.Image Processing Interface Description
8.5.1.7. Saturation
Terms
Saturation is one of the constituent elements of color. Higher saturation parameter values result in more
vivid, vibrant colors. Lower saturation parameter values result in more muted, dim colors.
Saturation: Adjusting the saturation parameter changes the colorfulness (intensity) of the colors. Enter a
value for the saturation parameter. The parameter’s value range is 0-128. By default, the parameter is set
to 64 (no saturation perform). The parameter is set higher than 64 (increase saturation) and set lower than
64 (decrease saturation). 128: Saturation is twice the current. 0: monochrome image.
Saturation mode: Decide whether to enable the saturation function. ON means that the saturation function
is enabled. OFF means that the saturation function is disabled.
Related Parameters
GX_INT_SATURATION: Saturation
GX_ENUM_SATURATION_MODE: Saturation mode, refer to: GX_ENUM_SATURATION_MODE_ENTRY
Effect Images
Figure 8-28 Before saturatuin adjustment Figure 8-29 After saturatuin adjustment
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 338
8.Image Processing Interface Description
Static defect is the defect pixel generated due to manufacturing technique during sensor manufacturing,
which will not change with time, gain, etc. If the sensor has defect pixels, it will directly affect the quality of
the image.
Static defect correction mode: Decide whether to enable the static defect correction function. ON means
that the static defect correction function is enabled. OFF means that the static defect correction function is
disabled.
Related Parameters
GX_ENUM_STATIC_DEFECT_CORRECTION: Static defect correction mode, refer to
GX_ENUM_STATIC_DEFECT_CORRECTION_ENTRY
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 339
8.Image Processing Interface Description
//emValue = GX_2D_NOISE_REDUCTION_MODE_HIGH;
emStatus =GXSetEnum(hDevice, GX_ENUM_2D_NOISE_REDUCTION_MODE, emValue);
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 340
8.Image Processing Interface Description
The HDR mode acquires two images at different exposures.Long-exposure image and short-exposure
image merged into one HDR image. The HDR image retains both dark details in the high-brightness image
and the bright details in the low-brightness image.
Model
MER-203-30GC-P-L
Related Parameters
GX_ENUM_HDR_MODE: HDR Mode, refer to GX_HDR_MODE_ENTRY
GX_INT_HDR_TARGET_LONG_VALUE: Long-exposure target gray value
GX_INT_HDR_TARGET_SHORT_VALUE: Short-exposure target gray value
GX_INT_HDR_TARGET_MAIN_VALUE: High dynamic image target gray value
Sample Code
GX_STATUS emStatus = GX_STATUS_SUCCESS;
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 341
9.Revision History
9. Revision History
No. Version API Version Changes Date
1.0.1303.x
1 V1.0.0 1) Initial release 2013-03
or above
1.0.1901.x
2 V2.0.0 1) Initial release for Windows & Linux 2019-01-11
or above
1.0.1901.x
3 V2.0.1 1) Modify a bug of Sample Code 2019-01-23
or above
1.0.1902.x
4 V2.0.2 1) Modify the mistake found in the system test 2019-02-12
or above
1.0.1902.x
5 V2.0.3 1) Modify some descriptions 2019-02-14
or above
1.0.1902.x
6 V2.0.4 1) Modify some formats 2019-02-21
or above
1.0.1902.x
7 V2.0.5 1) Add section 3.5 2019-07-17
or above
1.0.1910.x
12 V2.0.10 1) Add node information in section 3.1.1 2019-10-22
or above
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 342
9.Revision History
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 343
9.Revision History
1.0.2301.x
28 V2.1.15 1) Add 2.1.3 macOS 2023-02-03
or above
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 344
9.Revision History
2.0.2406.x
31 V3.0.2 1) Windows support DQBuf Interface 2024-07-09
or above
1) Add
2.0.2412.x 7.3.12.GX_GIGE_ACTION_COMMAND_RESULT
32 V3.0.3 2024-12-10
2) Add 7.4.4.14.GXGigEIssueActionCommand
or above
7.4.4.15.GXGigEIssueScheduledActionCommand
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 345
9.Revision History
4) Add 7.5.4.35.GXGetFeatureNameList
7.5.4.36.GXGetFeatureName
7.5.4.37.GXGetFeatureType (Not Recommended)
5) Add 8.2.7.Color image RGB order
6) Add 8.4.7.DxRotate90CW16B
8.4.8.DxRotate90CCW16B
8.4.12.DxSharpenMono8
8.4.26.DxImageMirror16B
7) Optimize section description information
© 2025 China Daheng Group, Inc. Beijing Image Vision Technology Branch 346