Toupcam API Manual


1. Version & Platform



2. Introduction


Toupcam cameras support various kinds of APIs (Application Program Interface), namely Native C/C++, .NET (C# & VB.NET), Python, Java, DirectShow, Twain, LabView, MabLab and so on. Compared with other APIs, Native C/C++ API, as a low level API, don't depend any other runtime libraries. Besides, this interface is simple, flexible and easy to be integrated into the customized applications. The SDK zip file contains all of the necessary resources and information:

toupcam.h, C/C++ head file


3. Concepts & Terminology


a. Camera ID (camId) vs Camera SN (Serial Number)

Please distinguish between camera ID (camId) and camera SN:
(a) SN is unique and persistent, fixed inside the camera and remains unchanged, and does not change with connection or system restart.
(b) Camera ID (camId) may change due to connection or system restart. Enumerate the cameras to get the camera ID, and then call the Open function to pass in the camId parameter to open the camera.

b. Modes for accessing image data: "ImagePtr" mode vs "Frame memory copy" Mode

1. ImagePtr mode

The application obtains a pointer to the frame buffer directly from the SDK, eliminating the need to copy frame data and thus improving performance. It calls Toupcam_PullImagePtr to retrieve the frame buffer and Toupcam_PushImagePtr to return it.

typedef struct {
    unsigned id;                    /* Each frame buffer is assigned a unique ID, 0 is reserved as an invalid id */
    unsigned char pixelFormat;      /* TOUPCAM_PIXELFORMAT_xxxx */
    unsigned char ergb;             /* see TOUPCAM_OPTION_RGB */
    unsigned char snapR;            /* see Toupcam_SnapR */
    unsigned char infoVer;          /* ToupcamFrameInfo version, >= 4 */
    unsigned reserved;
    unsigned strideRaw;             /* RAW data stride, 0 means no padding */
    ToupcamFrameInfoV4* ptrInfo;
    void* snapCtx;
    void* ptrRaw;                   /* RAW, see TOUPCAM_OPTION_IMAGEPTRRAW */
    unsigned char* ptr8;            /* 8bits, RGB24, RGB32, Grey8 */
    unsigned short* ptr16;          /* 16bits RGB48, RGB64, Grey16 */
} ToupcamImagePtr;

2. Frame memory copy (memcpy) mode

Frame data is memcpy from the SDK internal buffer to the user-provided buffer. Compared to the ImagePtr mode, this introduces an extra copy and results in a performance penalty.

"Pull mode" and "Push Mode" are Functionally equivalent. The former is recommended since it's simpler and the application seldom gets stuck in multithreading conditions, especially when using windows message to notify the events.

There are to ways to notify applications:

a) Use Windows message: Start pull mode by using the function Toupcam_StartPullModeWithWndMsg. When event occurs, toupcam will post message (PostMessage) to the specified window. Parameter WPARAM is the event type, refer to the definition of TOUPCAM_EVENT_xxxx. This model avoids the multithreading issues, so it's the most simple way. (Obviously, this is only supported in Windows systems, and not supported in Linux and macOS.)

b) Use Callback function: Start pull mode by using the function Toupcam_StartPullModeWithCallback. When event occurs, toupcam will callback the function PTOUPCAM_EVENT_CALLBACK.

c. Event Notify

Event Source Description
TOUPCAM_EVENT_EXPOSURE Software exposure time changed
TOUPCAM_EVENT_TEMPTINT white balance changed. Temp/Tint Mode, please see here.
TOUPCAM_EVENT_WBGAIN white balance changed. RGB Gain Mode, please see here.
TOUPCAM_EVENT_IMAGE Video image data arrives. Use Toupcam_PullImageXXXX to 'pull' the image data
TOUPCAM_EVENT_STILLIMAGE Still image which is triggered by function Toupcam_Snap or Toupcam_SnapN or Toupcam_SnapR arrives. Use Toupcam_PullImageXXXX to 'pull' the image data
TOUPCAM_EVENT_ERROR Generic error, data acquisition cannot continue
TOUPCAM_EVENT_DISCONNECTED Camera disconnected, maybe has been pulled out
TOUPCAM_EVENT_NOFRAMETIMEOUT No frame was not captured within the specified time. see TOUPCAM_OPTION_NOFRAME_TIMEOUT
TOUPCAM_EVENT_NOPACKETIMEOUT No packet was not captured within the specified time. see TOUPCAM_OPTION_NOPACKET_TIMEOUT
TOUPCAM_EVENT_TRIGGERFAIL trigger failed (for example, bad frame data or timeout)
TOUPCAM_EVENT_BLACK black balance changed
TOUPCAM_EVENT_FFC flat field correction status changed
TOUPCAM_EVENT_DFC dark field correction status changed
TOUPCAM_EVENT_FPNC fixed pattern noise correction status changed
TOUPCAM_EVENT_FRONT_OVERFLOW front buffer overflow
TOUPCAM_EVENT_BACK_OVERFLOW back buffer overflow
TOUPCAM_EVENT_ROI roi changed
TOUPCAM_EVENT_LEVELRANGE level range changed
TOUPCAM_EVENT_AUTOEXPO_CONV auto exposure convergence
TOUPCAM_EVENT_AUTOEXPO_CONVFAIL auto exposure once mode convergence failed
TOUPCAM_EVENT_FACTORY restore factory settings. Please note that restoring factory settings may cause resolution changes.
TOUPCAM_EVENT_EXPO_START Hardware exposure start
TOUPCAM_EVENT_EXPO_STOP exposure stop
TOUPCAM_EVENT_TRIGGER_ALLOW next trigger allow
TOUPCAM_EVENT_TRIGGER_IN trigger in
TOUPCAM_EVENT_TRIGGER_FAIL trigger fail
TOUPCAM_EVENT_HEARTBEAT heartbeat, can be used to monitor whether the camera is alive. see TOUPCAM_OPTION_HEARTBEAT

d. Still Capture (Still Image)

Most cameras support the so-called still capture capability. This function switches the camera to another resolution temporarily when the camera is in preview mode, after a "still" image in the new resolution is captured and then switch back to the original resolution and resume preview mode.

For example, UCMOS05100KPA support 3 resolutions and the current one in preview mode is 1280 * 960. Call Toupcam_Snap(h, 0) to "still capture" an image in 2592 * 1944 resolution. To realize this function, the camera will temporarily switch to 2592 * 1944 firstly, get an image in 2592 * 1944 resolution and then switch back to 1280 * 960 and resume preview.

a) In pull mode operation, after the still capture, TOUPCAM_EVENT_STILLIMAGE will be sent out for external acknowledgement. The external application should call Toupcam_PullImageV4(V3) or Toupcam_PullStillImage(V2) to get the still captured image.
b) In push mode operation, after the still capture, the callback function PTOUPCAM_DATA_CALLBACK_V4/V3 will be called with bSnap parameter setting TRUE. The image information including the resolution information will be obtained via the parameter pHeader.

To check whether the camera have the still capture capability, call Toupcam_get_StillResolutionNumber function or check the still field of the struct ToupcamModelV2.

e. Data format: RGB vs RAW

Toupcam supports two data formats: RGB format (default) and RAW format. RAW format could be enabled by assigning TOUPCAM_OPTION_RAW parameter to 1 when calling Toupcam_put_Option function.

Users could switch these two format by calling Toupcam_put_Option function with different value setting to TOUPCAM_OPTION_RAW. You change this option only when camera is NOT running.

Users could change RGB bits by calling Toupcam_put_Option with different value setting to TOUPCAM_OPTION_RGB. You change this option only when camera is NOT running.

f. White Balance and Auto White Balance: Temp/Tint mode vs RGB Gain mode

1. Toupcam sdk supports two independent modes for white balance: a) Temp/Tint Mode; b) RGB Gain Mode

a) Temp/Tint mode is the default white balance mode. In this mode, temp and tint are the parameters that could be used to control the white balance. Toupcam_get_TempTint function is used to acquire the temp and tint values and Toupcam_put_TempTint is used to set the temp and tint values. Function Toupcam_AwbOnce is used to execute the auto white balance. When the white balance parameters change, TOUPCAM_EVENT_TEMPTINT event will be notified for external use.

b) In RGB Gain mode, the while balace is controled by the gain values of the R,G,B channels. Toupcam_get_WhiteBalanceGain is used to acquire the parameters and Toupcam_put_WhiteBalanceGain is used to set the white balance parameters. Toupcam_AwbInit is used to execute the execute the auto white balance. When the white balance parameters change, TOUPCAM_EVENT_WBGAIN event will be notified for external use.

The functions for these two modes cannot be misused:

a) In Temp/Tint mode, please use Toupcam_get_TempTint and Toupcam_put_TempTint and Toupcam_AwbOnce. Toupcam_get_WhiteBalanceGain and Toupcam_put_WhiteBalanceGain and Toupcam_AwbInit cannot be used, they always return E_NOTIMPL.
b) In RGB Gain mode, please use Toupcam_get_WhiteBalanceGain and Toupcam_put_WhiteBalanceGain and Toupcam_AwbInit. Toupcam_get_TempTint and Toupcam_put_TempTint and Toupcam_AwbOnce cannot be used, they always return E_NOTIMPL

This mode is specified when the camera is opened and cannot be changed unless the camera is closed and opened again. Please see here.

2. There are two auto white balance mechanisms available in this field: one is continuous auto white balance and the other is a "once" auto white balance. The white balance parameters will be always calculated and updated for the continuous auto white balance mechanism. For "once" auto white balance mechanism, the white balance parameters will be calculated and updated only when triggered. Toupcam cameras support "once" auto white balance mechanism since it is more accurate and propriate for the microscope application, especially when the background is in pure color. Continuous white balance mechanism will encounter some problem in some cases.

3. Monochromatic camera does not support white balance. The functions metioned above always return E_NOTIMPL.

g. Trigger Mode

1. What is Trigger Mode

Toupcam camera has two working modes: video mode and trigger mode. When in trigger mode, no images will be available until the trigger conditions are met. Cameras have 2 types for triggering according to the types of trigger source, including software trigger mode, external trigger mode and simulated trigger mode.

2. The Difference between Trigger and Snap

Trigger mode is designed for accurate control of the camera and images would be acquired only when the conditions are met. Users could get the images by controlling the trigger conditions. Trigger mode must be pre-specified. Once the trigger mode is entered, no images will come out from the camera until the trigger conditions are met. The triggered images will stay the same property as the pre-specified resolution. Snap is designed to acquire the images from the camera in video mode. The resolution of the snapped image could be the same resolution as the video or could be different.

3. Software Trigger Mode

Camera could be triggered by software. In software trigger mode, images burst out only when users trigger the camera from the software. Numbers of the images of the triggering could also be controlled by software.

4. External Trigger Mode

Camera could be triggered by external trigger signal. By now Toupcam camera only supports positive-edge trigger mode.

5. Mix Trigger Mode

Both external and software trigger are enabled.

6. Simulated Trigger Mode

For cameras that do not support software trigger and external trigger, simulated trigger mode could be available. When in simulated trigger mode, the camera hardware actually works in the same mode as the video mode. But the up-level software will not obtain any images from the camera. The software buffer will stay empty until the user set the trigger conditions by software.

7. How to Enter the Trigger Mode

After the numeration of the connected camera, you can check the flag and find out what trigger mode does the camera support according to the following definition.
#define TOUPCAM_FLAG_TRIGGER_SOFTWARE   0x00080000  /* support software trigger */
#define TOUPCAM_FLAG_TRIGGER_EXTERNAL   0x00100000  /* support external trigger */
#define TOUPCAM_FLAG_TRIGGER_SINGLE     0x00200000  /* only support trigger single: one trigger, one image */
Function Toupcam_put_Option(HToupcam h, unsigned iOption, int iValue) could be used to set the camera to trigger mode when assign TOUPCAM_OPTION_TRIGGER to the iOption parameter. iValue is used to specify the types of the trigger modes. Please see the following for reference.
#define TOUPCAM_OPTION_TRIGGER   0x0b    /* 0 = video mode, 1 = software or simulated trigger mode, 2 = external trigger mode, 3 = external + software trigger, default value = 0 */
Function Toupcam_get_Option(HToupcam h, unsigned iOption, int* piValue) could be used to get what type of trigger mode the camera is in.

8. How to Trigger the camera

Function Toupcam_Trigger(HToupcam h, unsigned short nNumber) could be used to trigger the camera. Assigning different value to nNumber means different:
nNumber = 0 means stop the trigger.
nNumber = 0xFFFF means trigger continuously, the same as video mode;
nNumber = other valid values means nNumber images will come out from the camera.
If the TOUPCAM_FLAG_TRIGGER_SINGLE flag is checked, the nNumber parameter must be assigned to 1 and 1 image will come out from the camera when Toupcam_Trigger is called.
Enter the trigger mode first and then call Toupcam_Trigger function to trigger the camera.

9. Trigger timeout

The timeout is recommended for not less than (Exposure Time * 102% + 4 Seconds).

h. Thread safe

We use a "thread-safety neutral" policy (similar to C++ standard library), which means:

a) A camera object is thread-safe for reading from multiple threads. For example, given a camera object A, it is safe to read A from thread 1 and from thread 2 simultaneously.

b) If a camera object is being written to by one thread, then all reads and writes to that object on the same or other threads must be protected. For example, given a camera object A, if thread 1 is writing to A, then thread 2 must be prevented from reading from or writing to A.

c) It's safe to read and write to one camera object even if another thread is reading or writing to a different camera object. For example, given camera objects A and B, it's safe when A is being written in thread 1 and B is being read or write in thread 2.

d) It's safe to pull image from multi threads

i. Log file

The SDK does not output logs by default. If there is a file with the same name and extension *.log in the directory where the SDK library file is located and it has write permission, the log will be enabled and recorded in this file:

a) The log file name is exactly the same as the library file, and the extension is changed to *.log (e.g. toupcam.dll corresponds to the log file toupcam.log; xyz.dll to xyz.log; libxyz.so to libxyz.log)

b) The log file time uses relative time by default, and the SDK startup time is recorded as [00:00:00.000]. If you want to use local time (e.g. [0923 17:11:01.491]), add the letter "l" to *.log (i.e. *.llog)

c) By default, the log file content is automatically cleared every time SDK is started, and the log is written from the beginning. Adding the letter "a" to *.log means that the append mode is used, and the log file content is not cleared when SDK is restarted (i.e. *.alog)

d) By default, logging is written to file synchronously. If logging is suspected to block normal operations, append the letter “s” to the *.log file name to enable asynchronous logging (i.e. *.slog)

e) Please make sure that the program has write permission to the log file(For example, if the program is installed in the Program Files directory, it often happens that the log file cannot be written in non-administrator mode. It is recommended to run the program in administrator mode or modify the permission of the log file.)


4. Functions


Image Format Control (ImageFormatControl)

Resolution, output format, bit depth, binning and ROI.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
SensorWidthIntRO Effective width of the sensor in pixels. NA NA
SensorHeightIntRO Effective height of the sensor in pixels. NA NA
FrameLineCountIntRW Lines per frame for cameras supporting a variable line count. Query FrameLineCountMin/Max/Def for limits and default. Model specificNo
PreviewResolutionIntRW Resolution of the camera in video mode. NA No
ResolutionEnumRW Preview resolution index. Toupcam_get_Enum returns indices and resolution names. ResolutionMax is the resolution count; valid indices are [0, ResolutionMax - 1]. Corresponds to Toupcam_put_eSize/get_eSize. Model specificNo
StillResolutionIntRW The resolution during static capture by the camera refers to the process where the camera temporarily switches to another resolution during continuous video preview, captures a frame of static image, and then immediately switches the resolution back to the original one.
Corresponding function: Toupcam_get_StillResolution
0 Yes
WidthMaxIntRO Maximum image width in pixels after horizontal binning, decimation, or other processing that changes the horizontal image dimension. The current ROI settings Width and OffsetX are not included. NA NA
HeightMaxIntRO Maximum image height in pixels after vertical binning, decimation, or other processing that changes the vertical image dimension. The current ROI settings Height and OffsetY are not included. NA NA
OutputFormatEnumRW Output image format, combining the Raw mode and RGB format into one enumeration option.
Values and meanings:
0: "RGB24", Raw = 0, RGB = 0, 24-bit RGB
1: "RGB48", Raw = 0, RGB = 1, 48-bit RGB (requires bit depth greater than 8)
2: "RGB32", Raw = 0, RGB = 2, 32-bit RGB
3: "Grey8", Raw = 0, RGB = 3, 8-bit grayscale (monochrome cameras only)
4: "Grey16", Raw = 0, RGB = 4, 16-bit grayscale (monochrome cameras with bit depth greater than 8 only)
5: "RGB64", Raw = 0, RGB = 5, 64-bit RGB (requires bit depth greater than 8)
254 (0xfe): "Raw", Raw = 1, direct sensor data output
253 (0xfd): "Raw2", Raw = -1, RAW output with FFC, DFC, FPNC, black balance and white balance applied
Setting: Selecting an RGB or grayscale format first sets Raw = 0, then sets the corresponding RGB value. Selecting Raw or Raw2 only sets Raw = 1 or -1 and preserves the stored RGB value. For example, Toupcam_put_Str(h, "OutputFormat", "RGB24") is equivalent to setting Raw = 0 followed by RGB = 0; selecting "Raw2" is equivalent to setting Raw = -1.
Reading: Raw = 1 returns 254 / "Raw"; Raw = -1 returns 253 / "Raw2"; Raw = 0 returns the integer value or string name of the current RGB setting. OutputFormat uses its own enumeration codes: the Raw option values 1 and -1 are not its RAW format values.
Use Toupcam_get_Enum(h, "OutputFormat", ...) to query formats supported by the current camera. RGB48, RGB64 and Grey16 depend on the bit depth of the current PixelFormat; Grey8 and Grey16 are available only for monochrome cameras. PixelFormat controls the sensor data format and bit depth, while OutputFormat controls the output format delivered to the application. Setting restrictions while running are the same as for the corresponding Raw and RGB options.
NA No
OutputFormatStillEnumRW Still image output format, using the integer codes of OutputFormat. Requires still capture support; get_Int returns E_UNEXPECTED when RGB still output is inactive. Model specificYes
RawEnumRW 0: RGB mode
1: RAW mode, read the CMOS or CCD raw data
-1: RAW mode, the difference from 1 is the execution of FFC, DFC, FPNC, black balance, and white balance
0 No
(When the camera is in running state, changing between RAW and non-RAW returns E_UNEXPECTED)
Yes(changing between 1 and -1)
RAW
RGBEnumRW 0: RGB24
1: RGB48 format when bitdepth > 8
2: RGB32
3: 8 bits grey (only for mono camera)
4: 16 bits grey (only for mono camera and bitdepth > 8)
5: RGB64 format when bitdepth > 8
0 No
(The return value is E_UNEXPECTED when set this option while camera is running)
RGB
ImagePtrRawEnumRW 0: Do not include RAW data (default)
1: Even if the current format is not RAW, ptrRaw in the ToupcamImagePtr returned by Toupcam_PullImagePtr/WaitImagePtr will also contain RAW data
0NoIMAGEPTRRAW
ImagePtrBothEnumRW Dual bit-depth image pointer output:
0: disabled
1: enabled. When the output format is 8 bit and the sensor actually outputs more than 8 bits, the returned ToupcamImagePtr structure provides both ptr8 and ptr16 pointers.
Set only while the camera is stopped.
0NoIMAGEPTRBOTH
PixelFormatEnumRW TOUPCAM_PIXELFORMAT_RAW8
TOUPCAM_PIXELFORMAT_RAW10
TOUPCAM_PIXELFORMAT_RAW12
TOUPCAM_PIXELFORMAT_RAW14
TOUPCAM_PIXELFORMAT_RAW16
TOUPCAM_PIXELFORMAT_YUV411
TOUPCAM_PIXELFORMAT_VUYY
TOUPCAM_PIXELFORMAT_YUV444
TOUPCAM_PIXELFORMAT_RGB888
TOUPCAM_PIXELFORMAT_GMCY8 (map to RGGB 8 bits)
TOUPCAM_PIXELFORMAT_GMCY12 (map to RGGB 12 bits)
TOUPCAM_PIXELFORMAT_UYVY
TOUPCAM_PIXELFORMAT_RAW12PACK
TOUPCAM_PIXELFORMAT_RAW11
TOUPCAM_PIXELFORMAT_HDR8HL (HDR, Bitdepth: 8, Conversion Gain: High + Low)
TOUPCAM_PIXELFORMAT_HDR10HL (HDR, Bitdepth: 10, Conversion Gain: High + Low)
TOUPCAM_PIXELFORMAT_HDR11HL (HDR, Bitdepth: 11, Conversion Gain: High + Low)
TOUPCAM_PIXELFORMAT_HDR12HL (HDR, Bitdepth: 12, Conversion Gain: High + Low)
TOUPCAM_PIXELFORMAT_HDR14HL (HDR, Bitdepth: 14, Conversion Gain: High + Low)
TOUPCAM_PIXELFORMAT_RAW10PACK
Model Specific Yes.
But not recommended to modify too frequently while camera is running, it's relatively heavy operation.
PIXEL_FORMAT
PixelSizeEnumRO Bits-per-pixel query. NANA
BitDepthEnumRW Some cameras support the bitdepth which is more than 8 such as 10, 12, 14, 16.
0: use 8 bitdepth.
1: use the maximum bitdepth of this camera.
Model Specific Yes.
But not recommended to modify too frequently while camera is running, it's relatively heavy operation.
BITDEPTH
BitRangeIntRW Bit range: [0, 8], see: snapshot 0 YesBITRANGE
ByteOrderEnumRW Byte order:
1: BGR
0: RGB
Win: 1
Linux/MacOS/Android: 0
Yes.
But not recommended to modify too frequently while camera is running, it's relatively heavy operation.
BYTEORDER
ZeroPaddingEnumRW Zero padding method when bitdepth is greater than 8 and less than
16:
0: high-odrder
1: low-order
0 YesZERO_PADDING
BinningModeEnumRW Sets the hardware binning mode:
1: average
2: additive
3: skip.
NA No
BinningIntRW Controls the hardware binning factor by combining adjacent photosensitive pixels to reduce image resolution. A value of 1 disables binning; the combination method is controlled by BinningMode.
Corresponding function: Toupcam_get/put_Binning
NA No
DigitalBinningIntRW digital binning:
0x01 (no binning)
n: (saturating add, n*n), 0x02(2*2), 0x03(3*3), 0x04(4*4), 0x05(5*5), 0x06(6*6), 0x07(7*7), 0x08(8*8). The Bitdepth of the data remains unchanged.
0x40 | n: (unsaturated add, n*n, works only in RAW mode), 0x42(2*2), 0x43(3*3), 0x44(4*4), 0x45(5*5), 0x46(6*6), 0x47(7*7), 0x48(8*8). The Bitdepth of the data is increased. For example, the original data with bitdepth of 12 will increase the bitdepth by 2 bits and become 14 after 2*2 binning.
0x80 | n: (average, n*n), 0x82(2*2), 0x83(3*3), 0x84(4*4), 0x85(5*5), 0x86(6*6), 0x87(7*7), 0x88(8*8). The Bitdepth of the data remains unchanged.
The final image size is rounded down to an even number, such as 640/3 to get 212
1 YesBINNING
WidthIntRW Width of the image provided by the device, in pixels. This value reflects the current region of interest (ROI). Range: [8, WidthMax-OffsetX]; step: 2; default: WidthMax. WidthMax No
HeightIntRW Height of the image provided by the device, in pixels. This value reflects the current region of interest (ROI). Range: [8, HeightMax-OffsetY]; step: 2; default: HeightMax. HeightMax No
FinalWidthIntRO Final image width in pixels after ROI, binning, rotation and other processing.
Corresponding function: the width output of Toupcam_get_FinalSize
NANA
FinalHeightIntRO Final image height in pixels after ROI, binning, rotation and other processing.
Corresponding function: the height output of Toupcam_get_FinalSize
NANA
OffsetXIntRW Horizontal offset, in pixels, from the image origin to the region of interest (ROI). Range: [0, WidthMax-Width]; step: 2; default: 0. 0 No
OffsetYIntRW Vertical offset, in pixels, from the image origin to the region of interest (ROI). Range: [0, HeightMax-Height]; step: 2; default: 0. 0 No
PayloadSizeIntRO Current image payload size in bytes. NANA

Device Control (DeviceControl)

Device information, thermal control, networking, peripherals and configuration management.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
DeviceScanTypeEnumRW Scan Type:
0: areascan
1: linescan
Model Specific YesSCANTYPE
DeviceModelNameStrRO Manufacturers use it to uniquely identify the camera model for product differentiation.
Equal to ToupcamModelV2::name returned by Toupcam_query_Model
NA NA
ClsNameStrRO Internal camera class name. NANA
HidEnumRO Whether the device uses HID:
0: no
1: yes.
NANA
RevisionIntRO Camera hardware revision number; corresponds to Toupcam_get_Revision. NANA
DeviceIDStrRO Used to represent the unique identifier (serial number) of the device.
Corresponding function: Toupcam_get_SerialNumber
NA NA
DeviceUserIDStrRW User-programmable device identifier. The value should be writable and persistent; default is an empty string.
Corresponding function: Toupcam_query_Name/set_Name
NA Yes
FPGAVersionStrRO Version of the camera's FPGA firmware.
Corresponding function: Toupcam_get_FpgaVersion
NA NA
FirmwareVersionStrRO Version of the camera firmware.
Corresponding function: Toupcam_get_FwVersion
NA NA
HardwareVersionStrRO Design revision identifier of the camera's physical circuit boards and components.
Corresponding function: Toupcam_get_HwVersion
NA NA
ProductionDateStrRO Date the camera left the factory.
Corresponding function: Toupcam_get_ProductionDate
NA NA
MCUVersionStrRO Version of the firmware flashed on the camera's microcontroller unit. NA NA
CameraIPStrRW Logical address of the GigE camera on the network.
Toupcam_put_Str can set the IP address in builds with GigE support.
NAModel dependent
CameraMACStrRO Physical address of the GigE camera network interface, used for unique identification on the LAN. NA NA
HostAdapterStrRO Network adapter on the host used to connect the network camera. NA NA
AdapterSpeedIntRO Speed of the network adapter(Receive/Transmit). NA NA
HostIPStrRO Network card IP address for GigE camera connection. NA NA
HostMACStrRO MAC address of the network card connected to the GigE camera. NA NA
PacketSizeIntRO Bytes of image payload data carried in a single network packet of the GigE camera. NA NA
GvcpTimeoutIntRW GVCP Timeout, millisecond, range: [5, 150]
Unless in very special circumstances, generally no modification is required, just use the default value
15(wire)
30(wireless)
YesGVCP_TIMEOUT
GvcpRetryIntRW GVCP Retry, range: [2, 16]
Unless in very special circumstances, generally no modification is required, just use the default value
4(wire)
8(wireless)
YesGVCP_RETRY
GvspWaitPercentIntRW GVSP wait percent: range = [0, 100] trigger mode: 100
realtime: 0
other: 1
YesGVSP_WAIT_PERCENT
GigeTimeoutEnumRW For GigE cameras, the application periodically sends heartbeat signals to the camera to keep the connection to the camera alive. If the camera doesn't receive heartbeat signals within the time period specified by the heartbeat timeout counter, the camera resets the connection. When the application is stopped by the debugger, the application cannot create the heartbeat signals.
0: auto: when the camera is opened, disable if debugger is present or enable if no debugger is present
1: enable
2: disable
0 YesGIGETIMEOUT
HeartbeatIntRW Heartbeat interval in millisecond
range: [TOUPCAM_HEARTBEAT_MIN, TOUPCAM_HEARTBEAT_MAX]
0: disable
disableYesHEARTBEAT
NoPacketTimeoutIntRW Timeout for grabbing no packet. Trigger an event when no packet is acquired within the set time, see TOUPCAM_EVENT_NOPACKETTIMEOUT
0: disable
positive value (>=TOUPCAM_NOPACKET_TIMEOUT_MIN) => timeout milliseconds
0 YesNOPACKET_TIMEOUT
SensorTypeEnumRO Type of the image sensor chip. NA NA
PhysicalPixelWidthIntRO Physical pixel pitch along X, in 0.001 micrometers; get_Int returns xpixsz multiplied by 1000 as an integer. NANA
PhysicalPixelHeightIntRO Physical pixel pitch along Y, in 0.001 micrometers; get_Int returns ypixsz multiplied by 1000 as an integer. NANA
UptimeIntRO device uptime in millisecond NA NAUPTIME
GPSEnumRO GPS status
0: not supported
-1: gps device offline
1: gps device online
NA NAGPS
TECEnableEnumRW Some cameras support to turn on or off the thermoelectric cooler.
0: turn off the thermoelectric cooler
1: turn on the thermoelectric cooler
1 YesTEC
TECTargetIntRW get or set the target temperature of the thermoelectric cooler, in 0.1℃. For example, 125 means 12.5℃, -35 means -3.5℃.
Set the target temperature to "-2730" or below means using the default for that model.
Model Specific YesTECTARGET
TECTargetRangeIntRO get the range of target temperature of the thermoelectric cooler, in 0.1℃. For example, 125 means 12.5℃, -35 means -3.5℃.
min(low 16 bits) = (short)(val & 0xffff)
max(high 16 bits) = (short)((val >> 16) & 0xffff)
Model Specific YesTECTARGET_RANGE
TECVoltageMaxIntRW TEC maximum voltage in 0.1V, such as: 59 means 5.9V NA NATEC_VOLTAGE_MAX
TECVoltageMaxRangeIntRO get the TEC maximum voltage range in 0.1V
high 16 bits: max
low 16 bits: min
NA NATEC_VOLTAGE_MAX_RANGE
TECVoltageIntRO get the current TEC voltage in 0.1V, 59 mean 5.9V;
Please do not get this value too frequently, the recommended interval is 2 seconds or more
NA NATEC_VOLTAGE
FanIntRW Some cameras support the cooling fan.
0: turn off the cooling fan
[1, max]: fan speed
set to "-1" means to use default fan speed
Model Specific YesFAN
FanSpeedIntRO Read actual fan speed; units depend on the camera model. This differs from the configured Fan setting. NANA
HeatIntRW heat to prevent fogging up Model Specific YesHEAT
HeatMaxIntRO get maximum level: heat to prevent fogging up
[0, max], 0 means off
NA NAHEAT_MAX
SensorTemperatureIntRO Current measured operating temperature of the image sensor, same as Toupcam_get_Temperature. NA NA
ChamberTemperatureIntRO Temperature inside the camera's sealed chamber, in 0.1℃. For example, 32 means 3.2℃. Read by strName it returns the temperature value; corresponds to the low 16 bits of TOUPCAM_OPTION_CHAMBER_HT. NA NA
ChamberHumidityIntRO Humidity inside the camera's sealed chamber, in 0.1%. For example, 325 means 32.5%. Read by strName it returns the humidity value; corresponds to the high 16 bits of TOUPCAM_OPTION_CHAMBER_HT. NA NA
IntRO get chamber humidity & temperature:
high 16 bits: humidity, in 0.1%, such as: 325 means humidity is 32.5%
low 16 bits: temperature, in 0.1 degrees Celsius, such as: 32 means 3.2 degrees Celsius
NA NACHAMBER_HT
EnvironmentTemperatureIntRO Measured air temperature of the camera's external environment, in 0.1℃. For example, 32 means 3.2℃. Read by strName it returns the temperature value; corresponds to the low 16 bits of TOUPCAM_OPTION_ENV_HT. NA NA
EnvironmentHumidityIntRO Measured air humidity of the camera's external environment, in 0.1%. For example, 325 means 32.5%. Read by strName it returns the humidity value; corresponds to the high 16 bits of TOUPCAM_OPTION_ENV_HT. NA NA
IntRO get environment humidity & temperature NA NAENV_HT
PowerConsumptionIntRO get power consumption, unit: milliwatt NA NAPOWER
PowerIntRO Power consumption in milliwatts. NANA
ScanDirectionEnumRW Scan direction:
0: forward
1: reverse
2: alternate
0 YesSCAN_DIRECTION
TestPatternEnumRW test pattern:
0: off
3: monochrome diagonal stripes
5: monochrome vertical stripes
7: monochrome horizontal stripes
9: chromatic diagonal stripes
0 YesTESTPATTERN
MechanicalShutterEnumRW Mechanical shutter:
0: open
1: close
0 YesMECHANICALSHUTTER
ShutterTriggerEnumRW Shutter trigger mode:
0: pulse trigger
1: level trigger.
Model specificModel dependent
ResetSeqTimestampModeEnumRW Selects what to reset for camera output frames:
1: the sequence number
2: the timestamp
3: both the sequence number and timestamp.
2 Yes
ResetSeqTimestampEnumWO Reset seq, timestamp:
1: seq
2: timestamp
3: both
NA YesRESET_SEQ_TIMESTAMP
ModeSeqTimestampEnumRW Mode of seq & timestamp:
0: reset to 0 automatically
1: never reset automatically
0 YesMODE_SEQ_TIMESTAMP
TailLightEnumRW Turn on/off tail Led light:
0: off
1: on
1 YESTAILLIGHT
EventHardwareEnumRW enable or disable hardware event notify:
0: disable
1: enable
(1) iOption = TOUPCAM_OPTION_EVENT_HARDWARE, master switch for notification of all hardware events
(2) iOption = TOUPCAM_OPTION_EVENT_HARDWARE | (event type), a specific type of sub-switch
Only if both the master switch and the sub-switch of a specific type remain on are actually enabled for that type of event notification.
see here and here
disable Master switch: No
Sub-switch: Yes
EVENT_HARDWARE
EventHardwareSelectorIntWO Select the event accessed by EventHardware without a suffix; 0 selects the master switch and other values select a hardware event type. 0Yes
EventHardwareNEnumRW Hardware event notification switch for event N:
0: disabled
1: enabled; N=0 is the master switch.
NAModel dependent
LightSourceIntRW light source level 50% max level YesLIGHTSOURCE
LightSourceMaxIntRO get maximum level: light source
[0, max], 0 means off
NA NALIGHTSOURCE_MAX
FilterWheelSlotIntRW filter wheel slot number 7 YesFILTERWHEEL_SLOT
FilterWheelPositionIntRW filter wheel position:
set:
-1: calibrate
val & 0xff: position between 0 and N-1, where N is the number of filter slots
(val >> 8) & 0x1: direction, 0: clockwise spinning, 1: auto direction spinning
get:
-1: in motion
val: position arrived
NA YesFILTERWHEEL_POSITION
FilterWheelSpeedIntRW Filter wheel rotation speed; units and range depend on the filter wheel. Model specificModel dependent
FilterWheelSlotNameNStrRW Name of slot N on an HID filter wheel, where N is [0, 15], for example FilterWheelSlotName0. NAModel dependent
MotorNumberIntRW Range: [1, 20] MOTOR_NUMBER
MotorPosIntRW Motor position, range [1, 702]. Use MotorPosN to specify motor index N, for example MotorPos1; each name accesses one position. MOTOR_POS
MotorPosNIntRW Position of motor N, for example MotorPos1, range [1, 702]; the motor index depends on MotorNumber. NAModel dependent
FocusPosIntRW focus positon NA YesFOCUSPOS
AfModeEnumRW auto focus mode: see ToupcamAFMode NA YesAFMODE
AfStatusEnumRO auto focus status: see ToupcamAFStaus NA NAAFSTATUS
EEPROMSizeIntRO Query EEPROM capacity. This interface returns the capacity in HRESULT and does not write piValue; a negative result indicates failure. NANAEEPROM_SIZE
EEPROMCfgEnumRO Query whether configuration storage in EEPROM is supported: returns S_OK if supported or E_NOTIMPL otherwise. This query does not write piValue. NANA
LensStateEnumWO Load/Save lens state to EEPROM:
0: load
1: save
LENSSTATE
UserSetIntRW User settings: put_Int saves the selected settings; get_Int loads them. Before get_Int, initialize *piValue with the settings number and stop the camera. Here get_Int performs a load operation rather than reading a current value. NoUSER_SET
PresetEnumRW get_Int returns the number of presets; put_Int loads a preset by index. Toupcam_get_Enum returns preset names and indices. NAModel dependent
PresetLoadStrWO Load a preset by name. NAModel dependent
PresetSaveStrWO Save a preset using the supplied name. NAModel dependent
PresetDeleteIntWO Delete the preset at the specified index. NAModel dependent
PresetOverwriteIntWO Overwrite the preset at the specified index with the current settings. NAModel dependent
PresetRenameNStrWO Rename preset N to strValue, for example PresetRename0. NAModel dependent
PresetImportStrWO Import presets from the file specified by strValue. NAModel dependent
PresetExportStrWO Export presets to the file specified by strValue. NAModel dependent
ImportCfgStrWO Load configuration from the file specified by strValue. NAModel dependent
LoadCfgStrWO Alias of ImportCfg; load configuration from the specified file. NAModel dependent
ExportCfgStrWO Export the current configuration to the file specified by strValue. NAModel dependent
DumpCfgEnumRW 0: when camera is stopped, do not dump configuration automatically
1: when camera is stopped, dump configuration automatically
-1: explicitly dump configuration once
1 YesDUMP_CFG
FactoryIntWO restore the factory settings Always 0 NoFACTORY
DeviceResetIntWO reset usb device, simulate a replug NA NADEVICE_RESET
ResetSensorIntWO reset sensor NA YesRESET_SENSOR
OpenErrorCodeIntRO get the open camera error code NA NAOPEN_ERRORCODE
FrameGrabber:<name>Int / StrRW GenTL frame grabber property. Replace <name> with a property name exposed by the frame grabber. Names, types and access restrictions depend on the frame grabber NAModel dependent

Acquisition Control (AcquisitionControl)

Frame rate, exposure, triggering, acquisition modes and buffer queues.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
AcquisitionFrameRateIntRW Precise framerate: in 0.1fps, such as 115 means 11.5fps
use TOUPCAM_OPTION_MAX_PRECISE_FRAMERATE, TOUPCAM_OPTION_MIN_PRECISE_FRAMERATE to get the range. if the set value is out of range, E_INVALIDARG will be returned
90% of the maximum YesPRECISE_FRAMERATE
MaxFramerateIntRO get the precise frame maximum value in 0.1fps, such as 115 means 11.5fps
the maximum value depends the bandwidth/resolution/bitdepth/ROI
The return value is E_UNEXPECTED if camera is NOT running, E_NOTIMPL means not supported
NA NAMAX_PRECISE_FRAMERATE
MinFramerateIntRO get the precise frame minimum value in 0.1fps, such as 15 means 1.5fps
the minimum value depends the bandwidth/resolution/bitdepth/ROI
The return value is E_UNEXPECTED if camera is NOT running, E_NOTIMPL means not supported
NA NAMIN_PRECISE_FRAMERATE
FramerateIntRW limit the frame rate.
frame rate control is disabled automatically in trigger mode.
0
(means no limit)
No
(The return value is E_UNEXPECTED when set this option while camera is running)
FRAMERATE
FrameIntervalIntRW Frame interval in microseconds FRAMEINTERVAL
BandwidthIntRW bandwidth, range:[1-100]%
After setting the bandwidth, get the accurate precise rate range, and then set the precise frame rate
100 YesBANDWIDTH
SpeedIntRW For cameras that support precise frame-rate control, using that control is recommended. Speed remains available for compatibility. With MaxSpeed set to 9 (10 levels total), the levels map to the maximum frame rates at Bandwidth settings in [10, 100]%. For example, Speed 8 is equivalent to the maximum precise frame rate at a Bandwidth setting of 90%.
Corresponding function: Toupcam_get/put_Speed
NA Yes
ReadoutModeEnumRW Readout mode:
0: IWR (Integrate While Read)
1: ITR (Integrate Then Read)
The working modes of the detector readout circuit can be divided into two types: ITR and IWR. Using the IWR readout mode can greatly increase the frame rate. In the ITR mode, the integration of the (n+1)th frame starts after all the data of the nth frame are read out, while in the IWR mode, the data of the nth frame is read out at the same time when the (n+1)th frame is integrated
NA YESREADOUT_MODE
OperationModeEnumRW TDI Operation Mode:
1: area
2: TDI
Model Specific YesOPERATIONMODE
TDITriggerModeEnumRW TDI Trigger Mode:
1: normal
2: both
Model Specific YesTDITRIGGERMODE
TDIStageIntRW TDI Trigger Stage: sensor scan stage Model Specific YesTDISTAGE
RealTimeEnumRW Sets real-time mode:
0: non-real-time operation (frame capture stops when the frame-buffer queue is full)
1: real-time operation (all older frames are discarded when a new frame arrives)
2: soft real-time operation (the DDR buffer is unchanged). The default is 0 and normally does not need to be changed.
Corresponding function: Toupcam_get/put_RealTime
0 Yes
NoFrameTimeoutIntRW Timeout for grabbing no frame. Trigger an event when no frame is acquired within the set time, see TOUPCAM_EVENT_NOFRAMETIMEOUT
0: disable
positive value (>=TOUPCAM_NOFRAME_TIMEOUT_MIN) => timeout milliseconds
0 YesNOFRAME_TIMEOUT
DdrDepthEnumRW the number of the frames that DDR can cache:
1: DDR cache only one frame
0: Auto:
=> one for video mode when auto exposure is enabled
=> full capacity for others

-1: DDR can cache frames to full capacity
0 YesDDR_DEPTH
CallbackThreadEnumRW dedicated thread for callback:
0: disable
1: enable
Enable No
(The return value is E_UNEXPECTED when set this option while camera is running)
CALLBACK_THREAD
FrontDequeLengthIntRW frontend (raw) frame deque length, range: [2, 1024]
All the memory will be pre-allocated when the camera starts, so, please attention to memory usage
4 USB: Yes
GigE: Not supported with gigepdrv; supported with others
CL&CXP: depends on the frame grabber
FRONTEND_DEQUE_LENGTH
BackDequeLengthIntRW backend (pipelined) frame deque length (Only available in pull mode), range: [2, 1024]
All the memory will be pre-allocated when the camera starts, so, please attention to memory usage
3 YesBACKEND_DEQUE_LENGTH
ReloadIntRW Reload the last frame in the trigger mode
get return value S_OK means supporting this feature, E_NOTIMPL means not supported
NA YesRELOAD
HZEnumRW Sets the power frequency for anti-flicker operation. The anti-flicker function can remove side-effects that caused by the power-frequency of illumination used during imaging, including the flicker-bar exhibited by rolling shutter sensor, and blinking issue for global shutter sensor. Exposure time will be limited only to multiples of 10ms for 50HZ, and multiples of (1000/120) ms for 60HZ:
0: 60 Hz AC
1: 50 Hz AC
2: DC.
Corresponding function: Toupcam_get/put_HZ
NA Yes
ExposureAutoEnumRW Sets the auto exposure mode:
0: Off
1: Continuous
2: Once. When enabled, the device adjusts exposure time and analog gain so that the selected region approaches the exposure target.
Corresponding function: Toupcam_get/put_AutoExpoEnable
NA Yes
ExposureAutoOnceIntWO Runs auto exposure once and stops.
Corresponding function: Toupcam_put_AutoExpoEnable(mode=2)
NA Yes
ExposureTimeIntRW Writable when auto exposure is off; controls how long the photosensitive cells are exposed to light, in microseconds. Range returned by Toupcam_get_ExpTimeRange. NA Yes
ActualExposureTimeIntRO Actual exposure time in microseconds; it may differ from ExposureTime. Corresponds to Toupcam_get_RealExpoTime. NANA
TriggerModeEnumRW 0: video mode
1: software or simulated trigger mode
2: external trigger mode
3: external + software trigger
0 YesTRIGGER
TriggerCancelModeEnumRW Trigger cancel mode:
0: no frame
1: output frame
0 YesTRIGGER_CANCEL_MODE
ExposurePreDelayIntRW exposure signal pre-delay, microsecond 0 YesEXPOSURE_PRE_DELAY
ExposurePostDelayIntRW exposure signal post-delay, microsecond 0 YesEXPOSURE_POST_DELAY
LinePreDelayIntRW specified line signal pre-delay, microsecond 0 YesLINE_PRE_DELAY
LinePostDelayIntRW specified line signal post-delay, microsecond 0 YesLINE_POST_DELAY
TimedTriggerNumIntRW Timed trigger number 0 (Disable) YesTIMED_TRIGGER_NUM
TimedTriggerSelectorIntWO Select the trigger entry accessed by TimedTriggerHigh and TimedTriggerLow without a suffix; the index must be nonnegative. 0Yes
TimedTriggerLowIntRW Timed trigger: lower 32 bits of 64-bit integer, nanosecond since epoch (00:00:00 UTC on Thursday, 1 January 1970, see https://en.wikipedia.org/wiki/Unix_time) 0 YesTIMED_TRIGGER_LOW
TimedTriggerLowNIntRW Low 32 bits of the nanosecond timestamp for timed trigger N. NAModel dependent
TimedTriggerHighIntRW Timed trigger: high 32 bits. The lower 32 bits must be set first, followed by the higher 32 bits 0 YesTIMED_TRIGGER_HIGH
TimedTriggerHighNIntRW High 32 bits of timed trigger N, where N is nonnegative. Set the corresponding low 32 bits first. NAModel dependent
TriggerSourceEnumRW Selects the internal signal or physical input used as the trigger source:
0: Opto-isolated Input
1: GPIO0
2: GPIO1
3: Counter Divider
4: PWM
5: Software.
NA Yes
TriggerSourceNEnumRW The TriggerSource property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as TriggerSource. NAModel dependent
BurstCounterIntRW Sets the number of frames output for each trigger signal in burst mode. Range: [1, 65535]. NA Yes
BurstCounterNIntRW The BurstCounter property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as BurstCounter. NAModel dependent
SequencerModeEnumRW sequencer trigger: on/off 0 YesSEQUENCER_ONOFF
SequencerNumberIntRW sequencer trigger: number, range = [1, 255] NA YesSEQUENCER_NUMBER
SequencerSelectorIntWO Select the group accessed by SequencerExposureTime and SequencerGain without a suffix, range [1, 255]. NAYes
SequencerExposureTimeIntRW sequencer trigger: exposure time
iOption = TOUPCAM_OPTION_SEQUENCER_EXPOTIME | index
iValue = exposure time (no 50/60 HZ constraint)
For example, to set the exposure time of the third group to 50ms, call
Toupcam_put_Option(h, TOUPCAM_OPTION_SEQUENCER_EXPOTIME | 3, 50000)
NA YesSEQUENCER_EXPOTIME
SequencerExposureTimeNIntRW Exposure time for sequencer group N in microseconds; N=0 reads the current exposure time and other groups are [1, 255]. NAModel dependent
SequencerGainIntRW sequencer trigger: exposure gain
iOption = TOUPCAM_OPTION_SEQUENCER_EXPOGAIN | index
iValue = gain
NA YesSEQUENCER_EXPOGAIN
SequencerGainNIntRW Analog gain for sequencer group N, where 100 means 100%; the index range depends on the sequencer configuration. NAModel dependent
SoftwareTriggerIntWO Generates an internal trigger. TriggerSource must be set to Software, or the trigger mode must be set to Software Trigger.
Corresponding function: Toupcam_Trigger
NA Yes
StrobeDelayModeEnumRW Selects the delay mode in trigger mode:
0: delays the exposure time while keeping the output unchanged
1: delays only the output.
NA Yes
StrobeDelayModeNEnumRW The StrobeDelayMode property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as StrobeDelayMode. NAModel dependent
StrobeDelayTimeIntRW Controls the delay time for the selected delay mode in trigger mode, in microseconds. Range: [0, 5000000]. NA Yes
StrobeDelayTimeNIntRW The StrobeDelayTime property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as StrobeDelayTime. NAModel dependent
PauseEnumRW Pause or resume the video stream:
0: continue
1: pause.
Corresponding function: Toupcam_Pause
0 Yes
FlushModeEnumRW Sets how the camera's internal frame buffers are cleared:
1: hard flush (discard frames in the camera DDR buffer)
2: soft flush (discard frames in the SDK buffer)
3: both hard and soft flush.
3 Yes
FlushEnumWO 1: hard flush, discard frames cached by camera DDR (if any)
2: soft flush, discard frames cached by toupcam.dll (if any)
3: both
Toupcam_Flush means 'both'
return the number of soft flushed frames if successful, HRESULT if failed
NA NAFLUSH

Analog Control (AnalogControl)

Gain, black level, sensor analog settings and operating modes.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
GainIntRW Controls the amplification applied to the video signal. In this implementation, gain is expressed as a percentage; for example, 200 represents 200% gain.
Corresponding function: Toupcam_get/put_ExpoAGain
100 Yes
ActualGainIntRO Actual analog gain, where 100 means 100%. Corresponds to Toupcam_get_RealExpoGain. NANA
DigitalGainIntRW Digital gain; its unit and range depend on the camera model. DIGITAL_GAIN
ConversionGainEnumRW Conversion Gain:
0: LCG
1: HCG
2: HDR (for camera with flag TOUPCAM_FLAG_CGHDR)
2: MCG (for camera with flag TOUPCAM_FLAG_GHOPTO)
Model Specific YesCG
CGEnumRO Alias of ConversionGain in get_Int:
0: LCG
1: HCG
2: MCG or HDR depending on the model. Use ConversionGain to set it.
NANA
GainModeEnumRW Sets the camera gain mode:
0: High Sensitivity
1: High Full Well
2: Balance
3: HDR.
NA No
BlackLevelIntRW The black level refers to the baseline signal value output by an image sensor under no-light (completely dark) conditions.
In digital imaging systems, a fixed voltage offset is intentionally added to the signal to ensure that dark-region signals remain above zero, thereby preventing the loss of faint shadow details during A/D conversion.
(a) Prevent clipping: The sensor circuit's intrinsic noise may occasionally produce negative values. Without an offset, these negative values would be forcibly clipped to zero, resulting in the loss of shadow details.
(b) Preserve linearity: Raising the black level helps ensure that the sensor maintains consistent linear output behavior across the entire dynamic range.
Always return E_NOTIMPL for camera that don't support black level.
0 YesBLACKLEVEL
BlacklevelAutoAdjustEnumRW Black level automatic adjustment function:
0: off
1: on
This setting turn on/off black level auto adjust function by OB(Optical Black) level. In case of long exposure and so on, OB level is offset by leak or any other reason. Because of it, if the adjustment becomes a problem, this setting is introduced for one of the solution.
Model Specific YesBLACKLEVEL_AUTOADJUST
ZeroOffsetEnumRW Sensor output offset to zero:
0: disable
1: enable; default: 0
0ZERO_OFFSET
CDSIntRW Correlated Double Sampling: 0~100
see here
0 YesCDS
CdsGainEnumRW Correlated double sampling gain setting. Model specificModel dependent
LowNoiseEnumRW low noise mode (Higher signal noise ratio, lower frame rate):
0: disable
1: enable
Model Specific YesLOW_NOISE
LowPowerIntRW Controls low-power mode: 0 disables it, 1 enables it, and a value greater than 1 enables it when the exposure time exceeds the specified value. NA Yes
LowPowerConsumptionIntRW Low Power Consumption:
0: disable, 1: enable
> 1 : enable if exposure time is greater than the set value
Model Specific YesLOW_POWERCONSUMPTION
LowPowerExpoTimeIntRW Low Power Consumption: Enable if exposure time is greater than the set value Model Specific YesLOW_POWER_EXPOTIME
GlobalResetEnumRW global reset mode 0 YesGLOBAL_RESET_MODE
LaneIntRW Number of channels for camera output data Model Specific YesLANE
AntiBloomingIntRW Blooming occurs when the charge in a pixel exceeds the saturation level and the charge starts to fill adjacent pixels.
Some sensors are designed with structures built into them to limit blooming - anti-blooming structures.
Anti-blooming structures bleed off any excess charge before they can overflow the pixel and thereby stop blooming.
However, anti-blooming structures can reduce the effective quantum efficiency and introduce non linearity into the sensor.
Therefore, anti-blooming sensors are not recommended for applications requiring very low light or high accuracy measurements.
Model Specific YesANTI_BLOOMING
AntiBloomingMaxIntRO anti-blooming NA NAANTI_BLOOMING_MAX
OverClockIntRW overclock 0 YesOVERCLOCK
OverclockMaxIntRO maximum overclock NA NAOVERCLOCK_MAX
AntiShutterEnumRW anti shutter effect:
1: enable
0: disable
disable (0) YesANTI_SHUTTER_EFFECT
HighFullwellEnumRW high fullwell capacity:
0: disable
1: enable
Model Specific YesHIGH_FULLWELL
ModeEnumRW High-resolution cameras support two sampling modes: Bin (neighborhood averaging) and Skip (subsampling). Bin provides better image quality at a lower frame rate, while Skip provides a higher frame rate with lower image quality.
Corresponding function: Toupcam_get/put_Mode
NA Yes
VoltageBiasIntRW Voltage bias Model Specific YESVOLTAGEBIAS
VoltageBiasRangeIntRO Voltage bias range:
min (low 16bits)
max (high 16bits)
NA NAVOLTAGEBIAS_RANGE

Image Processing Control (ImageProcessingControl)

White balance, black balance, color, tone mapping, denoising, sharpening and image transformations.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
ISPEnumRW Enable hardware ISP:
0: auto (disable in RAW mode, otherwise enable)
1: enable
-1: disable
0(Auto) No
(The return value is E_UNEXPECTED when set this option while camera is running)
ISP
MultiThreadEnumRW multithread image processing 1 No
(The return value is E_UNEXPECTED when set this option while camera is running)
MULTITHREAD
ThreadPriorityEnumRW set the priority of the internal thread which grab data from the usb device.
Win:
0: THREAD_PRIORITY_NORMAL;
1: THREAD_PRIORITY_ABOVE_NORMAL;
2: THREAD_PRIORITY_HIGHEST;
3: THREAD_PRIORITY_TIME_CRITICAL;
Please refer to SetThreadPriority
Linux & macOS:
similar to Win
1 YesTHREAD_PRIORITY
WhiteBalanceOnceIntWO Runs automatic white balance once in temperature and tint mode.
Corresponding function: Toupcam_AwbOnce
NA Yes
WhiteBalanceTemperatureIntRW Sets the white balance color temperature. Range: [2000, 15000]; default: 6503.
Corresponding function: Toupcam_get/put_TempTint
6503 Yes
TempIntRW White balance color temperature, range [1000, 25000], default 6503. Available in Temp/Tint white balance mode. 6503Yes
WhiteBalanceTintIntRW Sets the white balance tint. Range: [200, 2500]; default: 1000.
Corresponding function: Toupcam_get/put_TempTint
1000 Yes
TintIntRW White balance tint, range [100, 2500], default 1000. Available in Temp/Tint white balance mode. 1000Yes
WhiteBalanceRedIntRW White balance red channel gain, available in RGB Gain white balance mode; query the corresponding Min/Max/Def names for limits and default. 0Yes
WhiteBalanceGreenIntRW White balance green channel gain, available in RGB Gain white balance mode; query the corresponding Min/Max/Def names for limits and default. 0Yes
WhiteBalanceBlueIntRW White balance blue channel gain, available in RGB Gain white balance mode; query the corresponding Min/Max/Def names for limits and default. 0Yes
WbGainEnumRW 0: turn off the builtin white balance gain
1: turn on the builtin white balance gain
1 YesWBGAIN
AwbContinuousIntRW Auto White Balance: continuous mode
0: disable
n>0: every n millisecond(s)
n<0: every -n frame
0 (Disable) YesAWB_CONTINUOUS
AWBWidthIntRW Sets the width in pixels of the auto white balance ROI. The minimum width is 4 pixels. WidthMax / 5 Yes
AWBHeightIntRW Sets the height in pixels of the auto white balance ROI. The minimum height is 4 pixels. HeightMax / 5 Yes
AWBOffsetXIntRW Sets the horizontal offset in pixels of the auto white balance ROI relative to the original resolution. WidthMax × 2 / 5 Yes
AWBOffsetYIntRW Sets the vertical offset in pixels of the auto white balance ROI relative to the original resolution. HeightMax × 2 / 5 Yes
BlackBalanceOnceIntWO Runs automatic black balance once.
Corresponding function: Toupcam_AbbOnce
NA Yes
BlackBalanceRIntRW Sets the black-balance subtraction value for the red channel. Range: [0, 2^bitdepth-1], such as 0~255 for 8 bits and 0~65535 for 16 bits; default: 0.
Corresponding function: Toupcam_get/put_BlackBalance
0 Yes
BlackBalanceGIntRW Sets the black-balance subtraction value for the green channel. Range: [0, 2^bitdepth-1], such as 0~255 for 8 bits and 0~65535 for 16 bits; default: 0.
Corresponding function: Toupcam_get/put_BlackBalance
0 Yes
BlackBalanceBIntRW Sets the black-balance subtraction value for the blue channel. Range: [0, 2^bitdepth-1], such as 0~255 for 8 bits and 0~65535 for 16 bits; default: 0.
Corresponding function: Toupcam_get/put_BlackBalance
0 Yes
ABBWidthIntRW Sets the width in pixels of the auto black balance ROI. The minimum width is 4 pixels. WidthMax / 5 Yes
ABBHeightIntRW Sets the height in pixels of the auto black balance ROI. The minimum height is 4 pixels. HeightMax / 5 Yes
ABBOffsetXIntRW Sets the horizontal offset in pixels of the auto black balance ROI relative to the original resolution. WidthMax × 2 / 5 Yes
ABBOffsetYIntRW Sets the vertical offset in pixels of the auto black balance ROI relative to the original resolution. HeightMax × 2 / 5 Yes
LevelRangeAutoIntWO Automatically adjusts the histogram left and right limits to stretch the image.
Corresponding function: Toupcam_LevelRangeAuto
NA Yes
LevelRangeLowRIntRW Sets the red-channel histogram left limit used by software image stretching. Range: [0, 255]; it cannot exceed the red right limit. 0 Yes
LevelRangeHighRIntRW Sets the red-channel histogram right limit used by software image stretching. Range: [0, 255]; it cannot be below the red left limit. 255 Yes
LevelRangeLowGIntRW Sets the green-channel histogram left limit used by software image stretching. Range: [0, 255]; it cannot exceed the green right limit. 0 Yes
LevelRangeHighGIntRW Sets the green-channel histogram right limit used by software image stretching. Range: [0, 255]; it cannot be below the green left limit. 255 Yes
LevelRangeLowBIntRW Sets the blue-channel histogram left limit used by software image stretching. Range: [0, 255]; it cannot exceed the blue right limit. 0 Yes
LevelRangeHighBIntRW Sets the blue-channel histogram right limit used by software image stretching. Range: [0, 255]; it cannot be below the blue left limit. 255 Yes
LevelRangeLowGrayIntRW Sets the grayscale histogram left limit used by software image stretching. Range: [0, 255]; it cannot exceed the grayscale right limit. 0 Yes
LevelRangeHighGrayIntRW Sets the grayscale histogram right limit used by software image stretching. Range: [0, 255]; it cannot be below the grayscale left limit. 255 Yes
HueIntRW A color information component in the image signal that characterizes hue and saturation attributes. Range: [-180, 180]; default: 0.
Corresponding function: Toupcam_get/put_Hue
0 Yes
SaturationIntRW Purity or vividness of a color. Range: [0, 255]; default: 128.
Corresponding function: Toupcam_get/put_Saturation
128 Yes
BrightnessIntRW Photometric component of the image signal that characterizes the brightness level. Range: [-255, 255]; default: 0.
Corresponding function: Toupcam_get/put_Brightness
0 Yes
ContrastIntRW Degree of brightness difference between the brightest and darkest areas of the image. Range: [-255, 255]; default: 0.
Corresponding function: Toupcam_get/put_Contrast
0 Yes
GammaIntRW Controls gamma correction of pixel intensity, typically to compensate for nonlinear display response. In percent. Range: [20, 180]; default: 100.
Corresponding function: Toupcam_get/put_Gamma
100 Yes
ChromeEnumRW Color mode or monochrome mode:
0: color mode
1: monochromatic mode.
Corresponding function: Toupcam_get/put_Chrome
NA Yes
ToneMappingEnumRW Builtin tone mapping:
0: turn off
1: turn on polynomial
2: turn on logarithmic
Enabling tone mapping significantly compromises linearity
2 YesCURVE
LinearEnumRW Builtin linear tone mapping:
0: turn off
1: turn on
1 YesLINEAR
ColorMatixEnumRW 0: turn off the builtin color matrix
1: turn on the builtin color matrix
1 YesCOLORMATIX
DemosaicEnumRW Demosaic mothod for both video and still image: (Please refrence https://en.wikipedia.org/wiki/Demosaicing)
0: BILINEAR
1: VNG(Variable Number of Gradients)
2: PPG(Patterned Pixel Grouping)
3: AHD(Adaptive Homogeneity Directed)
4: EA(Edge Aware)
In terms of CPU usage, EA is the lowest, followed by BILINEAR, and the others are higher.
Always return E_NOTIMPL for monochromatic camera.
0 YesDEMOSAIC
DemosaicVideoEnumRW Demosaic mothod for video 0 YesDEMOSAIC_VIDEO
DemosaicStillEnumRW Demosaic mothod for still image 0 YesDEMOSAIC_STILL
HdrKBIntRW HDR synthesize
K (high 16 bits): [1, 25500]
B (low 16 bits): [0, 65535]
0xffffffff: set to default
Model Specific YesHDR_KB
HdrKIntRO HDR synthesis coefficient K, the high 16 bits of HdrKB, range [1, 25500]. Set it using the packed HdrKB value. NANA
HdrBIntRO HDR synthesis offset B, the low 16 bits of HdrKB, range [0, 65535]. Set it using the packed HdrKB value. NANA
HdrThresholdIntRW HDR synthesize
threshold: [1, 4094]
0xffffffff: set to default
Model Specific YesHDR_THRESHOLD
RotateEnumRW rotate clockwise: 0, 90, 180, 270 0 YesROTATE
UpsideDownEnumRW Upside down:
1: yes
0: no
Please distinguish it from Toupcam_put_VFlip, which requires the CPU to perform data moving work on each frame of data
Win: 1, inverted by default on Windows
Linux/MacOS/Android: 0, not inverted by default
No
(The return value is E_UNEXPECTED when set this option while camera is running)
UPSIDE_DOWN
VFlipEnumRW Vertical flip of the image:
0: no flip
1: flip.
Corresponding function: Toupcam_get/put_VFlip
NA Yes
ReverseYEnumRW Vertical flip:
0: disabled
1: enabled; corresponds to VFlip.
0Yes
HFlipEnumRW Horizontal flip of the image:
0: no flip
1: flip.
Corresponding function: Toupcam_get/put_HFlip
NA Yes
ReverseXEnumRW Horizontal flip:
0: disabled
1: enabled; corresponds to HFlip.
0Yes
NegativeEnumRW Displays the current video bit-inverted:
0: off
1: on.
Corresponding function: Toupcam_get/put_Negative
NA Yes
UsmSelectEnumRW Sharpening processing selection:
0: automatic
1: camera hardware
2: software; availability depends on camera support.
Model specificModel dependent
SharpenStrengthIntRW Sets the sharpening strength. Range: [0, 500]; 0 disables sharpening. Model Specific Yes
SharpenRadiusIntRW Sets the sharpening radius. Range: [1, 10]. 2 Yes
SharpenThresholdIntRW Sets the sharpening threshold. Range: [0, 255]. 0 Yes
IntRW Sharpening, (threshold << 24) | (radius << 16) | strength)
strength: [0, 500], default: 0 (disable)
radius: [1, 10]
threshold: [0, 255]
strength: Model Specific
radius: 2
threshold: 0
YesSHARPENING
DenoiseIntRW Denoise
strength range: [0, 100], 0 means disable
Model Specific YesDENOISE
DynamicDefectDeadIntRW Sets the dead-pixel coefficient t1 for dynamic defect correction. Values in [0, 100] represent [0.0, 1.0]; 0 disables the correction. Read and write t1 directly by strName; corresponds to the high 16 bits of TOUPCAM_OPTION_DYNAMIC_DEFECT. See TOUPCAM_DYNAMIC_DEFECT_T1_(MIN/MAX/DEF). 0 (Not enabled) Yes
DynamicDefectHotIntRW Sets the hot-pixel coefficient t2 for dynamic defect correction. Values in [0, 100] represent [0.0, 1.0]; 0 disables the correction. Read and write t2 directly by strName; corresponds to the low 16 bits of TOUPCAM_OPTION_DYNAMIC_DEFECT. See TOUPCAM_DYNAMIC_DEFECT_T2_(MIN/MAX/DEF). 0 (Not enabled) Yes
IntRW Dynamic Defect Pixel Correction
dead pixel ratio, t1: (high 16 bits): [0, 100], means: [0.0, 1.0]
hot pixel ratio, t2: (low 16 bits): [0, 100], means: [0.0, 1.0]
See:
TOUPCAM_DYNAMIC_DEFECT_T1_(MIN/MAX/DEF), TOUPCAM_DYNAMIC_DEFECT_T2_(MIN/MAX/DEF)
disable
(t1=0, t2=0)
YesDYNAMIC_DEFECT
PseudoColorEnableEnumRW Pseudo:
-1: Custom: use startcolor & endcolor to generate the colormap
0: Disable
1: Spot
2: Spring
3: Summer
4: Autumn
5: Winter
6: Bone
7: Jet
8: Rainbow
9: DeepGreen
10: Ocean
11: Cool
12: HSV
13: Pink
14: Hot
15: Parula
16: Magma
17: Inferno
18: Plasma
19: Viridis
20: Cividis
21: Twilight
22: TwilightShifted
23: Turbo
24: Red
25: Green
26: Blue
27: Spectrum
0 YesPSEUDO_COLOR_ENABLE
PseudoColorStartIntRW Pseudo: start color, BGR format NA YesPSEUDO_COLOR_START
PseudoColorEndIntRW Pseudo: end color, BGR format NA YesPSEUDO_COLOR_END
HistogramEnumRW 0: only one
1: continue mode
YesHISTOGRAM

Correction Control (CorrectionControl)

Flat field, dark field, fixed pattern noise and defect pixel correction.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
DFCStatusIntRO Status of dark-field correction:
(val & 0xff): 0: disable, 1: enable, 2: inited
((val & 0xff00) >> 8): sequence
((val & 0xff0000) >> 16): number of averages
0 NA
IntRW Dark Field Correction:
set:
0: disable
1: enable
-1: reset
(0xff000000 | n): set the average number to n, [1, 255]
get:
(val & 0xff): 0: disable, 1: enable, 2: inited
((val & 0xff00) >> 8): sequence
((val & 0xff0000) >> 16): average number
0 YesDFC
DFCEnableEnumRW Controls dark-field correction: 0 disables it, 1 enables it, and -1 resets it. Reading returns 0 or 1 to indicate whether it is enabled. 0 Yes
DFCNumberIntRW Number of frames to capture for dark-field correction. 5 Yes
DFCInitIntWO Initialize dark-field correction. Sets the number of shots that take part in the average and performs one correction. The count range and the default value can be queried by strName through Toupcam_get_Int with DFCInitMin / DFCInitMax / DFCInitDef; GenTL cameras use the configured shot number. 5 Yes
DFCImportStrWO Import dark-field correction data.
Corresponding function: Toupcam_DfcImport
NA Yes
DFCExportStrWO Export dark-field correction data.
Corresponding function: Toupcam_DfcExport
NA Yes
DFCFileStrWO Dark field correction data file path for a GenTL camera. NAModel dependent
FFCStatusIntRO Status of flat-field correction:
(val & 0xff): 0: disable, 1: enable, 2: inited
((val & 0xff00) >> 8): sequence
((val & 0xff0000) >> 16): number of averages
0 NA
IntRW Flat Field Correction:
set:
0: disable
1: enable
-1: reset
(0xff000000 | n): set the average number to n, [1, 255]
get:
(val & 0xff): 0: disable, 1: enable, 2: inited
((val & 0xff00) >> 8): sequence
((val & 0xff0000) >> 16): average number
0 YesFFC
FFCEnableEnumRW Controls flat-field correction: 0 disables it, 1 enables it, and -1 resets it. Reading returns 0 or 1 to indicate whether it is enabled. 0 Yes
FFCNumberIntRW Number of frames to capture for flat-field correction. 5 Yes
FFCInitIntWO Initialize flat-field correction. Sets the number of shots that take part in the average and performs one correction. The count range and the default value can be queried by strName through Toupcam_get_Int with FFCInitMin / FFCInitMax / FFCInitDef; GenTL cameras use the configured shot number. 5 Yes
FFCImportStrWO Import flat-field correction data.
Corresponding function: Toupcam_FfcImport
NA Yes
FFCExportStrWO Export flat-field correction data.
Corresponding function: Toupcam_FfcExport
NA Yes
FFCFileStrWO Flat field correction data file path for a GenTL camera. NAModel dependent
FPNCStatusIntRO Status of fixed-pattern-noise correction:
(val & 0xff): 0: disable, 1: enable, 2: inited
((val & 0xff00) >> 8): sequence
((val & 0xff0000) >> 16): number of averages
0 NA
IntRW Fixed Pattern Noise Correction:
set:
0: disable
1: enable
-1: reset
(0xff000000 | n): set the average number to n, [1, 255]
get:
(val & 0xff): 0: disable, 1: enable, 2: inited
((val & 0xff00) >> 8): sequence
((val & 0xff0000) >> 16): average number
0 YesFPNC
FPNCEnableEnumRW Controls fixed-pattern-noise correction: 0 disables it, 1 enables it, and -1 resets it. Reading returns 0 or 1 to indicate whether it is enabled. 0 Yes
FPNCNumberIntRW Number of frames to capture for fixed-pattern-noise correction. 5 Yes
FPNCInitIntWO Initialize fixed-pattern-noise correction. Sets the number of shots that take part in the average and performs one correction. The count range and the default value can be queried by strName through Toupcam_get_Int with FPNCInitMin / FPNCInitMax / FPNCInitDef; GenTL cameras use the configured shot number. 5 Yes
FPNCImportStrWO Import fixed-pattern-noise correction data.
Corresponding function: Toupcam_FpncImport
NA Yes
FPNCExportStrWO Export fixed-pattern-noise correction data.
Corresponding function: Toupcam_FpncExport
NA Yes
DefectPixelEnumRW Defect Pixel Correction
0: disable
1: enable
enable (1) YesDEFECT_PIXEL
FPNCFileStrWO Fixed pattern noise correction data file path for a GenTL camera. NAModel dependent
FpncHwIntWO Perform camera hardware fixed pattern noise correction. Parameters depend on the camera; returns E_NOTIMPL when unsupported. NAModel dependent
DefectHwEnumRW Hardware defect pixel correction:
0: disabled
1: enabled. Requires camera support.
Model specificModel dependent

I/O Control (IOControl)

I/O lines, counters, PWM, UART and exposure signals.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
LineSelectorEnumRW Selects the physical I/O line to configure:
0: Opto-isolated Input
1: Opto-isolated Output
2: GPIO0
3: GPIO1. Other line-control features apply to the selected line.
NA Yes
SupportedModeEnumRO Reports the modes supported by the I/O:
1: input
2: output
3: both input and output.
NA NA
SupportedModeNEnumRO The SupportedMode property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as SupportedMode. NANA
LineModeEnumRW Controls whether the selected physical line is used as an input or an output. Only GPIO0 and GPIO1 support mode selection:
0: input
1: output.
NA Yes
LineModeNEnumRW The LineMode property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as LineMode. NAModel dependent
LineFormatEnumRO Electrical format of the selected physical input or output line:
0: not connected
1: Tri-state
2: TTL level
3: LVDS level
4: RS422 level
5: Opto-coupled.
NA NA
LineFormatNEnumRW The LineFormat property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as LineFormat. NAModel dependent
LineInverterEnumRW Controls inversion of the signal on the selected input or output line:
0: no inversion
1: inversion; only output lines support it.
NA Yes
LineInverterNEnumRW The LineInverter property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as LineInverter. NAModel dependent
LineSourceEnumRW Selects the internal acquisition or I/O signal driven on the selected output line:
0: Frame Trigger Wait
1: Exposure Active
2: Strobe
3: User Output
4: Counter Active
5: Timer Active. LineMode must be set to Output.
NA Yes
LineSourceNEnumRW The LineSource property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as LineSource. NAModel dependent
OutputPauseEnumWO Controls output pause: 0 continues output and 1 pauses output. NA Yes
OutputPauseNEnumWO The OutputPause property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as OutputPause. NAModel dependent
InputActivationEnumRW Sets the input-signal trigger condition:
0: rising edge
1: falling edge
2: high level
3: low level.
NA Yes
InputActivationNEnumRW The InputActivation property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as InputActivation. NAModel dependent
DebouncerTimeIntRW Sets the trigger-signal debounce time in microseconds to filter contact bounce. Range: [0, 20000]. NA Yes
DebouncerTimeNIntRW The DebouncerTime property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as DebouncerTime. NAModel dependent
InputStateEnumRO Reports the line input state:
0: low level
1: high level.
NA NA
InputStateNEnumRO The InputState property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as InputState. NANA
TriggerDelayIntRW Specifies the delay, in microseconds, applied after trigger reception before the trigger is activated. Range: [0, 5000000]. NA Yes
TriggerDelayNIntRW The TriggerDelay property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as TriggerDelay. NAModel dependent
CounterSourceEnumRW Sets the counter trigger source:
0: opto-isolated input
1: GPIO0
2: GPIO1.
NA Yes
CounterSourceNEnumRW The CounterSource property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as CounterSource. NAModel dependent
CounterValueIntRW Sets the counter divider used to divide the frequency of the external input trigger signal. Range: [1, 65535]. NA Yes
CounterValueNIntRW The CounterValue property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as CounterValue. NAModel dependent
OutputCounterValueIntRW Output counter value, range [0, 65535]. Without a suffix, uses the line selected by LineSelector; OutputCounterValueN selects line N. NAModel dependent
OutputCounterValueNIntRW The OutputCounterValue property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as OutputCounterValue. NAModel dependent
CounterResetIntWO Performs a software reset of the selected counter and starts it. The counter begins counting immediately unless a counter trigger is active. NA Yes
CounterResetNIntWO The CounterReset property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as CounterReset. NAModel dependent
PWMSourceEnumRW Sets the PWM (pulse-mode) trigger source:
0: opto-isolated input
1: GPIO0
2: GPIO1.
NA Yes
PWMSourceNEnumRW The PWMSource property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as PWMSource. NAModel dependent
PWMFreqIntRW Sets the PWM pulse frequency. Range: [0, 0xFFFFFFFF]. NA Yes
PWMFreqNIntRW The PWMFreq property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as PWMFreq. NAModel dependent
PWMDutyRatioIntRW Sets the PWM duty ratio, the percentage of a cycle for which the signal is high. Range: [0, 100]; default: 50. 50 Yes
PWMDutyRatioNIntRW The PWMDutyRatio property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as PWMDutyRatio. NAModel dependent
StrobeDurationIntRW Sets the strobe pulse width in microseconds, which determines how long the strobe signal remains high. Range: [0, 5000000]. NA Yes
StrobeDurationNIntRW The StrobeDuration property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as StrobeDuration. NAModel dependent
UserOutputValueIntRW Sets all user-output register bits as a bit field: bit 0 controls the opto-isolated output, bit 1 controls GPIO0, and bit 2 controls GPIO1. NA Yes
UserOutputValueNIntRW The UserOutputValue property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as UserOutputValue. NAModel dependent
UserPulseHighIntRW Sets the user-pulse high-level duration in microseconds. Range: [0, 0xFFFFFFFF]. NA Yes
UserPulseHighNIntRW The UserPulseHigh property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as UserPulseHigh. NAModel dependent
UserPulseLowIntRW Sets the user-pulse low-level duration in microseconds. Range: [0, 0xFFFFFFFF]. NA Yes
UserPulseLowNIntRW The UserPulseLow property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as UserPulseLow. NAModel dependent
UserPulseNumberIntRW Sets the number of user pulses. Range: [0, 0xFFFFFFFF]; default: 0. 0 Yes
UserPulseNumberNIntRW The UserPulseNumber property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as UserPulseNumber. NAModel dependent
UARTEnableEnumRW Controls the serial port: 0 disables it and 1 enables it. 0 Yes
UARTEnableNEnumRW The UARTEnable property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as UARTEnable. NAModel dependent
UARTBaudrateEnumRW Sets the serial-port baud rate:
0: 9600
1: 19200
2: 38400
3: 57600
4: 115200.
NA Yes
UARTBaudrateNEnumRW The UARTBaudrate property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as UARTBaudrate. NAModel dependent
UARTLineModeEnumRW Sets the serial-line mode by configuring GPIO0 and GPIO1 as TX or RX:
0: TX(GPIO_0)/RX(GPIO_1)
1: TX(GPIO_1)/RX(GPIO_0).
NA Yes
UARTLineModeNEnumRW The UARTLineMode property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as UARTLineMode. NAModel dependent
ExpoActiveModeEnumRW Sets the exposure-active signal mode:
0: a specified line
1: common exposure time.
NA Yes
ExpoActiveModeNEnumRW The ExpoActiveMode property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as ExpoActiveMode. NAModel dependent
ExpoEvtActiveModeEnumRW Sets the exposure-event-active signal mode:
0: a specified line
1: common exposure time.
NA Yes
ExpoEvtActiveModeNEnumRW The ExpoEvtActiveMode property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as ExpoEvtActiveMode. NAModel dependent
ExpoStartLineIntRW When specified-line exposure-active mode is selected, sets the line at which the exposure-active signal becomes active. Range: [0, 16384]; default: 0. 0 Yes
ExpoStartLineNIntRW The ExpoStartLine property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as ExpoStartLine. NAModel dependent
ExpoEndLineIntRW When specified-line exposure-active mode is selected, sets the line at which the exposure-active signal becomes inactive. Range: [0, 16384]; default: 0; the value cannot be less than the start line. 0 Yes
ExpoEndLineNIntRW The ExpoEndLine property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as ExpoEndLine. NAModel dependent
ExternalTriggerNumberIntRO Count of raw external trigger signals. NA NA
ExternalTriggerNumberNIntRO The ExternalTriggerNumber property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as ExternalTriggerNumber. NANA
DebouncerTriggerNumberIntRO Count of external trigger signals after debouncing. NA NA
DebouncerTriggerNumberNIntRO The DebouncerTriggerNumber property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as DebouncerTriggerNumber. NANA
EffectiveTriggerNumberIntRO Count of external trigger signals judged as valid. NA NA
EffectiveTriggerNumberNIntRO The EffectiveTriggerNumber property of I/O line N. Without a suffix, uses LineSelector; values have the same meaning as EffectiveTriggerNumber. NANA

Auto Exposure Control (AutoExposureControl)

Auto exposure region, target, limits, policy and convergence status.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
AEWidthIntRW Width of the auto exposure rectangle. WidthMax / 5 Yes
AEHeightIntRW Height of the auto exposure rectangle. HeightMax / 5 Yes
AEOffsetXIntRW Horizontal offset of the auto exposure rectangle. WidthMax × 2 / 5 Yes
AEOffsetYIntRW Vertical offset of the auto exposure rectangle. HeightMax × 2 / 5 Yes
AETargetIntRW If auto exposure is enabled, the software will automatically set the exposure time and analog gain to make the average brightness of the target rectangle as close as possible to the exposure target.
Corresponding function: Toupcam_get/put_AutoExpoTarget
120 Yes
AEPolicyEnumRW Auto Exposure Policy:
0: Exposure Only
1: Exposure Preferred
2: Gain Only
3: Gain Preferred
1 YesAUTOEXP_POLICY
AETimeMaxIntRW Maximum exposure time allowed for auto exposure. NA Yes
AETimeMinIntRW Minimum exposure time allowed for auto exposure. NA Yes
AEGainMaxIntRW Maximum gain allowed when setting auto exposure. NA Yes
AEGainMinIntRW Minimum gain allowed when setting auto exposure. NA Yes
AEThresholdIntRW threshold of auto exposure, range: [2, 15] 5 YesAUTOEXP_THRESHOLD
AEThldTriggerIntRW It refers to the maximum deviation tolerance boundary value that allows the existing difference between the current brightness and the target brightness without triggering parameter readjustment after auto exposure has converged. Range: [2, 64]; default: 5. 5 YesAUTOEXP_THLD_TRIGGER
AEPeakIntRW Peak mode of brightness calculation method: Calculate the average brightness of specified percentage top brightest pixels in interest area. Enable this option when the background is dark and the target is overexposed in average mode. Frame rate may be affected when this option is enabled due to higher CPU consumption
1~99: average brightness of specified percentage top brightest pixels in ROI, default: 1
0 or 100: average brightness of whole pixels in ROI, means "disabled"
0(Disabled) YesAUTOEXPOSURE_PERCENT
AEDampTimeIntRW Auto exposure damping coefficient: time (thousandths)
The larger the damping coefficient, the smoother and slower the exposure time changes
0 YesAUTOEXP_EXPOTIME_DAMP
AEDampGainIntRW Auto exposure damping coefficient: gain (thousandths)
The larger the damping coefficient, the smoother and slower the gain changes
0 YesAUTOEXP_GAIN_DAMP
AETriggerEnumRW auto exposure on trigger mode:
1: Enable
0: Disable
0 YesAUTOEXPO_TRIGGER
AEOverPolicyIntRW Auto exposure overexposure policy: when overexposed,
0: directly reduce the exposure time/gain to the minimum value; or
1: reduce exposure time/gain according to the ratio between current and target brightness; or
n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1

The advantage of policy 0 is that the convergence speed is faster, but there is black screen.
Policy 1 avoids the black screen, but the convergence speed is slower.
0 YesOVEREXP_POLICY
AEConvEnumRO Auto exposure convergence status:
1: converged
0: not converged
-1: pending.
NANA
AutoExpoConvEnumRO get auto exposure convergence status:
1: YES
0: NO
-1: PENDING
NAAUTOEXPO_CONV

Frame Information and Statistics (FrameInfo)

Frame queue statistics, received packet counts and sensor timing information.

Option Name (strName)Value TypeRead/WriteDescriptionDefault Can be changed when camera is running?
(Before Toupcam_StartXXXX or after Toupcam_Stop)
Option(Legacy Interface)
(TOUPCAM_OPTION_XXXX)
DropFrameIntRO get the number of frames that have been grabbed from the USB but dropped by the software NA NANUMBER_DROP_FRAME
FrontDequeCurrentIntRO get the current number in frontend deque NA NAFRONTEND_DEQUE_CURRENT
BackDequeCurrentIntRO get the current number in backend deque NA NABACKEND_DEQUE_CURRENT
FrontFullIntRO get the number of frontend deque full NA NAFRONTEND_FULL
BackFullIntRO get the number of backend deque full NA NABACKEND_FULL
PacketNumberIntRO get the received packet number NA NAPACKET_NUMBER
PacketNumIntRO Number of received USB packets; returns E_NOTIMPL for non-USB devices. NANA
LineLengthIntRW Line length in pixel clock NA YesLINE_LENGTH
LineTimeIntRO Line-time of sensor in nanosecond NA NALINE_TIME
ReadTimeIntRO Sensor readout time. Returns E_NOTIMPL when unsupported; the unit is defined by the camera model. NANAREAD_TIME
AllExpoTimeIntRO Sensor total exposure time. Returns E_NOTIMPL when unsupported; the unit is defined by the camera model. NANAALL_EXPO_TIME
CameraPeriodIntRO Camera acquisition period. Returns E_NOTIMPL when unsupported; the unit is defined by the camera model. NANACAMERA_PERIOD

Important:

It is forbidden to call Toupcam_put_Option with TOUPCAM_OPTION_TRIGGER, TOUPCAM_OPTION_BITDEPTH, TOUPCAM_OPTION_PIXEL_FORMAT, TOUPCAM_OPTION_BINNING, TOUPCAM_OPTION_ROTATE in the callback context of PTOUPCAM_EVENT_CALLBACK and PTOUPCAM_DATA_CALLBACK_V4/V3, the return value is E_WRONG_THREAD.


5. .NET (C# & VB.NET)


Toupcam does support .NET development environment (C# and VB.NET).

toupcam.cs use P/Invoke to call into toupcam.dll. Copy toupcam.cs to your C# project, please reference samples.

Please pay attation to that the object of the C# class Toupcam. Toupcam must be obtained by static mothod Open or OpenByIndex, it cannot be obtained by obj = new Toupcam (The constructor is private on purpose).

Most properties and methods of the Toupcam class P/Invoke into the corresponding Toupcam_xxxx functions of toupcam.dll/so. So, the descriptions of the Toupcam_xxxx function are also applicable for the corresponding C# properties or methods. For example, the C# Snap method call the function Toupcam_Snap, the descriptions of the Toupcam_Snap function is applicable for C# Snap method:

[DllImport("toupcam.dll", ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
private static extern int Toupcam_Snap(SafeHToupcamHandle h, uint nResolutionIndex);

public bool Snap(uint nResolutionIndex)
{
    if (_handle == null || _handle.IsInvalid || _handle.IsClosed)
        return false;
    return (Toupcam_Snap(_handle, nResolutionIndex) >= 0);
}

VB.NET is similar with C#, not otherwise specified.


6. Python


Toupcam does support Python (version 3.0 or above), please import toupcam to use toupcam.py and reference the sample code simplest.py, qt5.py, qt6.py.

Please pay attation to that the object of the python class toupcam.Toupcam must be obtained by classmethod Open or OpenByIndex, it cannot be obtained by obj = toupcam.Toupcam()

Most methods of the Toupcam class use ctypes to call into the corresponding Toupcam_xxxx functions of toupcam.dll/so/dylib. So, the descriptions of the Toupcam_xxxx function are also applicable for the corresponding python methods.

Please reference __errcheck in toupcam.py, the original HRESULT return code is mapped to HRESULTException exception (in win32 it's inherited from OSError).

Please make sure the toupcam dll/so/dylib library file is in the same directory with toupcam.py.


7. Java


Toupcam does support Java, toupcam.java use JNA to call into toupcam.dll/so/dylib. Copy toupcam.java to your java project, please reference the sample code simplest.java (Console), javafx.java, swing.java.

Please pay attation to that the object of the java class toupcam must be obtained by static method Open or OpenByIndex, it cannot be obtained by obj = new toupcam()(The constructor is private on purpose).

Most methods of the toupcam class use JNA to call into the corresponding Toupcam_xxxx functions of toupcam.dll/so/dylib. So, the descriptions of the Toupcam_xxxx function are also applicable for the corresponding java methods.

Please reference errcheck in toupcam.java, the original HRESULT return code is mapped to HRESULTException exception.

Remark: (1) Download jna-*.jar from github; (2) Make sure toupcam.dll/so/dylib is placed in the correct directory.


8. GigE Camera


a. Enable Jumbo Frames on the network interface card (NIC). Using smaller packet sizes will result in lower performance.

Enable Jumbo Frameson Windows:
(1) start "Device Manager", then expand Network adapters. snapshot
(2) Right click the network interface card and select "Properties"
(3) Select the Advanced tab. Next, select "Jumbo Packet" in the Property box, and then select "9014 Bytes" (Different network card models may have slightly different value) for Value to the right. Click OK to save the change. snapshot
(4) Run the following command to view the network card MTU: snapshot
netsh interface ipv4 show subinterface

b. GigE Performance Driver

This driver is optional: not recommended for 1.0G cameras; recommended for 10G cameras.
If you decide to install, please use the command line (Administrator mode), cd to the directory where the .inf file is located, and execute the following statement to install (install.cmd). If there is an old version, need to uninstall the old version first, and then install the new version:
Install:   netcfg.exe -v -l gigepdrv.inf -c s -i gigepdrv
Uninstall: netcfg.exe -u gigepdrv

c. Firewall and NIC protocols

(1) Recommend to disable the firewall for the NIC used by the network camera. Run in PowerShell (Administrator mode):
Disable firewall (NIC name "xx"):  Set-NetFirewallProfile -Name Private,Public,Domain -DisabledInterfaceAliases "xx"
Restore all NIC: Set-NetFirewallProfile -Name Private,Public,Domain -DisabledInterfaceAliases @()
(2) Recommend to remove or disable irrelevant NIC protocols and drivers (such as the Npcap Packet Driver, QoS, LLDP, etc). In the most streamlined configuration, only the "Gige Performance Driver" and "TCP/IPv4" should remain enabled.

d. The automatic camera discovery process uses broadcast packets with the address 255.255.255.255. Please ensure that your system's security policies do not block network broadcasts.


9. Samples


Name Platform Language Dependency UI Description
demosimplest Win32
Linux
macOS
Android
C++  console simplest sample, about 70 lines of code. snapshot.
imageptrsimplest simplest sample for ImagePtr mode, about 50 lines of code
gigesimplest simplest sample for GigE camera, about 75 lines of code
demowait Instead of using the callback function, use the Toupcam_WaitImageV4 to get the image, about 60 lines of code
demomulti Open all the enumerated cameras (possibly multiple) and pull image, about 90 lines of code
demostill simplest sample to demo snap still image, about 120 lines of code
demosofttrigger simplest sample to demo soft trigger, about 80 lines of code
demotriggersync simplest sample to demo soft trigger synchronously (TriggerSync), about 80 lines of code
democfg simplest sample to demo configuration (see here), about 80 lines of code
demoexternaltrigger simplest sample to demo external trigger, about 130 lines of code
demotriggerout simplest sample to demo output signal, about 150 lines of code
demoraw raw data, snap still image and save raw data to *.raw files, about 140 lines of code. snapshot.
demostillraw snap still raw image and save to *.raw files, about 140 lines of code
demoqt
imageptrqt
Win32
Linux
macOS
QtGUI Qt sample, snapshot.
The use of ImagePtr mode is what distinguishes the two examples.
Enumerate device, open device, video preview, (still) image capture, preview resolution, image save to file, etc. This sample use Pull Mode, StartPullModeWithCallback.
demotwoqt Qt sample, snapshot.
Use two cameras simultaneously
demolinecam Qt sample.
line scan camera
democpp
imageptrcpp
Win32 ATL/WTL snapshot.
The use of ImagePtr mode is what distinguishes the two examples.
demonstrates to enumerate device (Respone to device plugin/unplug notifications), initialize support GigE, open device, video preview, image capture, preview resolution, trigger, image saving multi-format (.bmp, .jpg, .png, etc), wmv format video recording, trigger mode, IO control, read write EEPROM/FLASH, etc. This sample use Pull Mode. To keep the code clean, this sample uses the WTL library which can be downloaded from http://sourceforge.net/projects/wtl
democallback snapshot. use Pull Mode, StartPullModeWithCallback
demopush snapshot. use Push Mode, StartPushModeV4
demomono demonstrates to use mono camera with 8 or 16 bits
democns snapshot. Consistency test: The image is evenly divided into m*n zones, and each zone takes a small area in the center to calculate the average value, connect the average value into a line, and check the fluctuation range of the line up and down
triggertest snapshot. Soft trigger test, use a background thread to save the image file to disk (SSD is recommended, otherwise, when the disk speed is insufficient, the storage speed will not be able to keep up, more and more images will be stored in the deque, and the memory consumption will also increase).
demomfc
imageptrmfc
MFC snapshot.
The use of ImagePtr mode is what distinguishes the two examples.
use MFC as the GUI library. It demonstrates to open device, video preview, image capture, set the preview resolution, multi-format image saving (.bmp, .jpg, .png, etc). This sample use Pull Mode
demod3d11 Similar to demomfc, but uses D3D11 to display video
autotest snapshot. auto test tool used to automatically test, such as open/close the camera, change the resolution, snap, ROI, bitdepth, etc
demowpf .NETC#WPF WPF sample, snapshot.
Enum camera, open camera, preview video, captuare (still) image, save image to file, auto exposure, white balance, calculate fps (frame per second), etc. This sample use Pull Mode, StartPullModeWithCallback
demowinformcs
imageptrwinform
WinForm winform sample, snapshot.
The use of ImagePtr mode is what distinguishes the two examples.
Enum camera, open camera, preview video, captuare (still) image, save image to file, auto exposure, white balance, calculate fps (frame per second), etc. This sample use Pull Mode, StartPullModeWithCallback
demopushcs winform sample, use Push Mode
demotwocs winform sample, snapshot.
Use two cameras simultaneously. This sample use Pull Mode, StartPullModeWithCallback
demowinformvbVB.NET winform sample, snapshot.
Enum camera, open camera, preview video, captuare (still) image, save image to file, auto exposure, white balance, calculate fps (frame per second), etc. This sample use Pull Mode, StartPullModeWithCallback
demouwp WinRTC#   UWP (Universal Windows Platform) simple demo, snapshot.
Before build and run this demo, please pay attention to the value of vid in file Package.appxmanifest
demoandroid AndroidJava
C++
Android sample
demojava simplest
imageptrsimplest
Win32
Linux
macOS
Java jna console simplest java sample. IntelliJ project
The use of ImagePtr mode is what distinguishes the two examples
javafxGUI javafx sample. IntelliJ project
swingswing sample. IntelliJ project
demopython simplest
imageptrsimplest
Pythonconsole simplest python sample
The use of ImagePtr mode is what distinguishes the two examples
gigesimplestsimplest python sample to support GigE camera
qt5
qt6
PyQtGUI PyQt sample, snapshot.
demodshow DirectShow C++MFC DirectShow sample
amcap Microsoft sample demonstrates various tasks related to video capture, see https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/Win7Samples/multimedia/directshow/capture/amcap
LVDemo1 LabView     Labview program which works with one camera, snapshot.
LVDemo2 Labview program which opens two cameras and control them respectively
LVDemo3 Labview sample, snapshot.
open camera, preview video, captuare (still) image, set the preview resolution, auto exposure, bitdepth, color adjustment, white (black) balance, digital binning, flat (dark) field corrction, etc.
demoopencv4 Win32
Linux
macOS
C++ OpenCV opencv sample
imagepro liveedf   C++Qt EDF (Extended Depth of Field), Qt sample, snapshot.
C#WinForm EDF (Extended Depth of Field), C# sample, snapshot.
livestack C++Qt Qt sample, snapshot.
C#WinForm C# sample, snapshot.
livestitch C++Qt Stitch, Qt sample
C#WinForm Stitch, C# sample

10. Changelog


v60: Add ImagePtr mode. Please see here

v59: Add RAW=-1 mode. Please see here

v58: Open the camera by sn, name (GigE: ip, mac)

v57: Add Toupcam_PullImageV4, ToupcamFrameInfoV4, GPS

v56: Performance improvements: reduced frame data copy in RAW mode

v55: Add Support to HDR Pixel Format

v54: Add support to GigE. Please see here

v53: Add ToupcamFrameInfoV3, Toupcam_PullImageV3, Toupcam_StartPushModeV4

v52: Android Java side transfer file descriptor to Toupcam_Open to open camera. Please see here

v51: Add support auto exposure "once" mode. Please see here

v50: SIMD optimize in Windows(x86/x64), Linux(x64) and Android(x64)
       frontend and backend deque length: TOUPCAM_OPTION_FRONTEND_DEQUE_LENGTH, TOUPCAM_OPTION_BACKEND_DEQUE_LENGTH

v49: Add support to save & load configuration. Please see here

v48: hardware event. Please see here, here and here

v47: hardware level range. Please see here and here

v46: Add support denose. Please see here

v45: Add sequencer trigger, UART, mix trigger (external and software trigger both are enabled)

v44: Extend the realtime mode, Please see here
       Add TOUPCAM_OPTION_CALLBACK_THREAD and TOUPCAM_OPTION_FRAME_DEQUE_LENGTH

v43: Reload the last frame in the trigger mode. Please see TOUPCAM_OPTION_RELOAD

v42: Precise frame rate and bandwidth. Please see here and TOUPCAM_FLAG_PRECISE_FRAMERATE

v41: no packet timeout. Please see here

v40: Auto test tool, see samples\autotest

v39: Update C#/VB.NET/Java/Python

v38: Add support to byte order, change BGR/RGB. Please see here

v37: Add Android support
       Add Toupcam_StartPushModeV3 (Toupcam_StartPushModeV2 and Toupcam_StartPushMode are obsoleted)

v36: Add Java support. Please see here

v35: Add Python support. Please see here

v34: Auto Focus and Focus Motor

v33: extend TOUPCAM_OPTION_AGAIN to TOUPCAM_OPTION_AUTOEXP_POLICY, support more options. Please see here

v32: Addd support to Windows 10 on ARM and ARM64, both desktop and WinRT

v31: Add Toupcam_deBayerV2, support RGB48 and RGB64

v30: Add TOUPCAM_FLAG_CGHDR

v29: Add ToupcamFrameInfoV2, a group of functions (PullImageV2 and StartPushModeV2), some cameras support frame sequence number and timestamp. Please see here

v28: Add Toupcam_read_Pipe, Toupcam_write_Pipe, Toupcam_feed_Pipe

v27: Add Toupcam_SnapN, support to snap multiple images, please see here and democpp

v26: Add support to restore factory settings, TOUPCAM_OPTION_FACTORY

v25: Add sharpening, TOUPCAM_OPTION_SHARPENING

v24: Add support to Exposure time with the 50/60 HZ constraint

v23: Add support to Linux armhf, armel and arm64
       Add FFC and DFC, please see here and here

v22: Add TOUPCAM_OPTION_DDR_DEPTH, please see here

v21: Add Toupcam_IoControl

v20: Add Toupcam_EnumV2, ToupcamModelV2, ToupcamDeviceV2; (Toupcam_Enum, ToupcamModel and ToupcamDevice are obsoleted)
       Add Pixel Format, see TOUPCAM_OPTION_PIXEL_FORMAT; (TOUPCAM_OPTION_PIXEL_FORMAT is the super set of TOUPCAM_OPTION_BITDEPTH)
       Add Flat Field Correction

v19: Add Black Balance: please see here

v18: Add Toupcam_get_Revision

v17: Add TOUPCAM_OPTION_ROTATE

v16: Add TOUPCAM_FLAG_DDR, use very large capacity DDR (Double Data Rate SDRAM) for frame buffer

v15: Add TOUPCAM_OPTION_BINNING

v14: Add support to WinRT / UWP (Universal Windows Platform) / Windows Store App

v13: support row pitch, please see Toupcam_PullImageWithRowPitch and Toupcam_PullStillImageWithRowPitch

v12: support RGB32, 8 bits Grey, 16 bits Grey, please see here

v11: black level: please see here

v10: demosaic method: please see here

v9: change the histogram data type from double to float

v8: support simulated trigger, please see here

v7: support RGB48 when bitdepth > 8, please see here

v6: support trigger mode, please see here

v5: White Balance: Temp/Tint Mode vs RGB Gain Mode, please see here

v4: ROI (Region Of Interest) supported: please see here

v3: more bitdepth supported: 10bits, 12bits, 14bits, 16bits

v2: support RAW format, please see here and here; support Linux and macOS

v1: initial release